Commit Graph
1330 Commits
Author SHA1 Message Date
Willie 2cb830f736 feat(check): add remote update detection for tracked agents
Add RepoURL field to AgentCheckResult. Add EnrichAgentResultsWithRemote()
that batches remote HEAD hash checks via ParallelCheckURLs and marks
agents as 'update_available' when remote has newer commits than the
installed version.
2026-04-07 18:05:40 +08:00
Willie abd2328b9a feat(ui): add KindBadge to CollectPage and BatchUninstallPage
CollectPage: show kind badge next to local skill names in scan results.
BatchUninstallPage: show kind badge next to each skill in uninstall list.
2026-04-07 18:05:40 +08:00
Willie 2f4021fc6a feat: add kind badge to list TUI and remaining frontend pages
list_tui_item: show [A] badge prefix for agents in terminal list view.
list.go: add Kind field to skillEntry and skillJSON structs.

SyncPage: add kind badge to diff items using DiffTarget.items.kind.
AuditPage: add kind badge to audit result cards.
UpdatePage: add kind badge to update result items.
SkillPickerModal: add kind badge in skill picker.
client.ts: add kind to DiffTarget items and AuditResult types.
2026-04-07 18:05:40 +08:00
Willie c176d89405 feat(api): add kind field to sync, audit, check, update, and install handlers
handler_sync: add Kind field to diff stream item struct.
handler_audit: add Kind field to audit stream result.
handler_check: add Kind field to check stream result.
handler_update: add Kind field to update stream result.
handler_install: add Kind field to install request for agent support.
2026-04-07 18:05:40 +08:00
Willie e29a42d2d1 feat(cli): add kind arg to update command and kind field to diff output
update: add parseKindArg() for 'skillshare update agents' syntax.

diff: add Kind field to diffJSONItem struct for agent-aware diff output.
2026-04-07 18:05:40 +08:00
Willie 5dc981a5cb feat(audit): wire agent-only audit filtering via kind arg
When 'skillshare audit agents' is used, override sourcePath to agents
source directory so auditInstalled() scans agent .md files.
2026-04-07 18:05:40 +08:00
Willie 57cfab7133 feat(cli): add kind filter to check and uninstall commands
check: add parseKindArg() for 'skillshare check agents'. When agents
kind selected, runs CheckAgents() on agents source dir and displays
per-agent status (up_to_date/drifted/local/error). Supports --json.

uninstall: add --kind flag to parseUninstallArgs and parseKindFlag()
in cmdUninstall dispatch. Kind stored in uninstallOptions for
agent-specific uninstall routing.
2026-04-07 18:05:40 +08:00
Willie 6659898cc2 feat: add kind badge to SkillDetailPage and kind arg to audit command
SkillDetailPage: import KindBadge, show kind badge (S/A) next to skill
name in the detail header.

audit: add parseKindArg() for 'skillshare audit agents' syntax. Kind
filter parsing ready, actual agent-only filtering to be wired.
2026-04-07 18:05:40 +08:00
Willie 4c43506df3 feat: agent detail endpoint, project reconcile, and TrashPage badge
handler_skills: skill detail endpoint falls back to agents source when
skill not found. Returns agent .md file content and kind='agent'.

project_reconcile: add ReconcileProjectAgents() to scan agents source,
update registry with kind='agent' entries, and batch-update
.skillshare/.gitignore for agent files and metadata.

TrashPage: add KindBadge next to trashed item names with 'skill'
fallback for old trash items without kind field.
2026-04-07 18:05:40 +08:00
Willie 017dc22f3e feat: add --kind agent to enable/disable and agent path to TargetsPage
enable.go: support --kind agent flag to route enable/disable operations
to .agentignore instead of .skillignore. Works in both global and project
modes. Oplog entries now include kind field.

TargetsPage.tsx: show agent path below skill path when target has
agentPath. Display agent linked count alongside skill counts.
2026-04-07 18:05:40 +08:00
Willie 9a053a35b6 feat(ui): add agent stat card, kind filter tabs, and kind fields to API handlers
DashboardPage: add Agents stat card with Bot icon and accent color,
linking to /skills?kind=agent.

SkillsPage: add Skills/Agents filter tabs alongside existing filters.
KindBadge displayed on each skill card. matchFilter supports kind-based
filtering with accurate filter counts.

handler_collect: add kind field to localSkillItem response.
handler_uninstall: add kind field to batch request and result structs.
2026-04-07 18:05:40 +08:00
Willie 47da532bbe feat(cli,api): add agent info to status, doctor, and trash handler
status: show agents source path and agent count alongside skills source.

doctor: add checkAgentsSource() health check verifying agents source
directory exists, is a directory, and reports agent count. Non-existent
dir is info (not error) since agents are optional.

handler_trash: add kind field to trashItemJSON for frontend badge.
2026-04-07 18:05:40 +08:00
Willie 5536cac794 feat(ui): add agent kind types to API client and KindBadge component
Update TypeScript types to match backend agent support:
- Skill: add kind field ('skill' | 'agent')
- Overview: add agentCount field
- Target: add agentPath, agentLinkedCount, agentExpectedCount
- AuditFinding: add optional kind field
- TrashedSkill: add optional kind field

Update listSkills() to accept optional kind filter param (?kind=agent).

Add KindBadge component rendering [S] (info) or [A] (accent) badges
using the existing Badge component.
2026-04-07 18:05:40 +08:00
Willie 6f2932c650 feat(api): add agent support to overview, skills, and targets endpoints
Add agentsSource() helper to Server for mode-aware agent directory
resolution (global: EffectiveAgentsSource, project: .skillshare/agents).

handler_overview: add agentCount field counting .md files in agents dir.

handler_skills: add kind field ("skill"/"agent") to skillItem response.
Support ?kind= query param filter. List agents from agents source dir
alongside skills, with metadata enrichment from per-agent meta files.

handler_targets: add agentPath, agentLinkedCount, agentExpectedCount
fields to targetItem for frontend agent path display.
2026-04-07 18:05:40 +08:00
Willie 12f8c52a11 feat: add .agentignore support and agent file validation
Add ReadAgentIgnoreMatcher() in skillignore package to read .agentignore
and .agentignore.local files using the same gitignore-style pattern
format as .skillignore.

Integrate .agentignore filtering into AgentKind.Discover() with both
directory-level CanSkipDir() and file-level Match() checks.

Add agent validation in internal/validate/:
- AgentFile(): extension check, filename restrictions (no spaces/special
  chars), file size warning (>100KB), existence and type checks
- AgentName(): name format validation (alphanumeric + hyphens/underscores)

9 new tests across resource and validate packages.
2026-04-07 18:05:40 +08:00
Willie e2101ab5e9 feat(cli): add resource kind filter parsing for CLI commands
Add kind_filter.go with two parsing strategies:
- parseKindArg(): positional syntax (list agents, sync skills)
- parseKindFlag(): flag syntax (uninstall --kind agent tutor)

resourceKindFilter type with IncludesSkills()/IncludesAgents() helpers
for handler-level routing. Supports singular and plural forms
(skill/skills, agent/agents).

16 test cases covering both parsers and filter logic.
2026-04-07 18:05:40 +08:00
Willie 949fd444e0 feat(check,trash): add agent drift detection and agent trash support
Add CheckAgents() in internal/check/ that scans agents source directory,
reads per-agent metadata (<name>.skillshare-meta.json), and compares
file hashes to detect drift. Statuses: up_to_date, drifted, local, error.

Add agent trash functions in internal/trash/:
- AgentTrashDir() / ProjectAgentTrashDir() for agent-specific trash paths
- MoveAgentToTrash() moves agent .md file + metadata to timestamped
  trash subdirectory with rename-or-copy-then-delete fallback

6 unit tests for agent check covering empty dir, local agent, hash
match, drift detection, nonexistent dir, and non-md filtering.
2026-04-07 18:05:40 +08:00
Willie ba1b03f5f9 feat(install): add agent discovery, install flow, and --kind/--agent flags
Extend DiscoveryResult with Agents field and auto-detection rules:
- agents/ convention directory scanned for .md files
- pure agent repo fallback (no SKILL.md, no agents/ dir, root .md files)
- conventional excludes (README/LICENSE/CHANGELOG/SKILL.md)

Add InstallAgentFromDiscovery() for single-file agent install with
per-agent metadata (<name>.skillshare-meta.json with kind: agent).

Add Kind field to SkillMeta and InstallOptions. New CLI flags:
- --kind <skill|agent>: explicit resource kind selection
- --agent/-a <names>: select specific agents (implies --kind agent)

Add AgentInfo struct, DiscoveryResult helper methods (HasAgents,
HasSkills, IsMixed), and InstallOptions helpers (IsAgentMode,
HasAgentFilter).
2026-04-07 18:05:40 +08:00
Willie 9a4fbdc18f feat(sync): add agent sync engine with merge, symlink, and copy modes
Add SyncAgents() dispatcher supporting all three sync modes:
- merge: per-file symlinks with local file preservation
- symlink: whole directory symlink to agent source
- copy: file copy with content-diff detection

Add CheckAgentCollisions() to detect agents that flatten to the same
filename from different subdirectories.

Add PruneOrphanAgentLinks() for merge mode and PruneOrphanAgentCopies()
for copy mode to clean up stale agent files in targets.

Add CollectAgents() to copy non-symlinked .md files from target back
to agent source directory.

18 tests covering all modes, collision detection, pruning, and collect.
2026-04-07 18:05:40 +08:00
Willie ea055de8e5 refactor(registry): rename SkillEntry to ResourceEntry and add unified registry load/save
Rename SkillEntry to ResourceEntry with type alias for backward compat.
All 56 call sites continue to compile without changes.

Add LoadUnifiedRegistry() to merge separate skills and agents registry
files for global mode (skills/registry.yaml + agents/registry.yaml).
Agent entries automatically get Kind="agent" during merge.

Add SaveSplitByKind() to split a unified registry back by kind for
persisting to the correct source directory. Skips writing agents
registry file when no agent entries exist.
2026-04-07 18:05:40 +08:00
Willie c049ccdae0 feat(config): add agents_source field and create agents directory on init
Add AgentsSource field to Config struct with EffectiveAgentsSource()
method that defaults to ~/.config/skillshare/agents when not set.

Global init now creates agents source directory alongside skills source.
Project init creates .skillshare/agents/ alongside .skillshare/skills/.
projectRuntime gains agentsSourcePath field for project-mode agent ops.

Update config.schema.json with agents_source property definition.
2026-04-07 18:05:40 +08:00
Willie 5160ed5ffe feat(resource): add ResourceKind interface, SkillKind/AgentKind implementations, and reserved name validation
Create internal/resource/ package with:
- kind.go: ResourceKind interface (Discover, ResolveName, FlatName,
  CreateLink, feature gates) + DiscoveredResource struct
- skill.go: SkillKind — directory-based discovery via SKILL.md,
  frontmatter name resolution, nested separator flatten (a/b → a__b)
- agent.go: AgentKind — single-file .md discovery with conventional
  excludes (README/LICENSE/CHANGELOG/SKILL.md), filename-based naming
  with frontmatter override, directory-strip flatten (dir/f.md → f.md)

Add "agents" to reservedSkillNames in validate.SkillName() to prevent
skill names conflicting with the agents source directory.

16 unit tests covering discovery, nested paths, name resolution,
flat name computation, feature gates, and edge cases.
2026-04-07 18:05:39 +08:00
Willie 7a010a9ae0 chore: release v0.18.9 2026-04-07 17:36:07 +08:00
Willie 637814a996 style: gofmt 2026-04-07 17:35:06 +08:00
Willie 9ff006988a fix(sync): canonicalize paths for relative symlinks, atomic reformat
Two correctness improvements from Codex review:

1. EvalSymlinks before relative-link decisions: shouldUseRelative and
   createLink now resolve symlinked ancestors via EvalSymlinks so that
   a project opened through a symlinked workspace, or a target dir that
   traverses a symlink, produces correct relative paths (or falls back
   to absolute when paths diverge from the project root).

2. Atomic reformat via reformatLink: instead of remove→create (which
   loses the link on createLink failure), reformat now creates a temp
   link and renames it over the original. On Unix this is atomic; on
   Windows it falls back to remove→create when rename fails.

Tests added for symlinked project root, divergent target symlink,
and reformatLink atomic swap.
v0.18.9
2026-04-07 17:26:37 +08:00
Willie adec63727b fix(sync): prevent infinite reformat loop on Windows junction fallback
On Windows without Developer Mode, createLink falls back to an NTFS
junction (always absolute). linkNeedsReformat would then return true
on every sync, causing a remove→recreate loop.

Add build-tagged canCreateRelativeLink(): returns true on Unix, and
on Windows probes once with sync.Once by creating a test relative
symlink in a temp dir. linkNeedsReformat skips reformat when the
platform cannot create relative links.

Also use filepath.Clean instead of filepath.Abs in resolveReadlink
(input is already absolute, avoids unnecessary os.Getwd).

Addresses PR #122 review feedback.
2026-04-07 17:26:37 +08:00
Willie de0291c37c fix(sync): handle root projectRoot prefix, use abs paths for Windows Rel
- shouldUseRelative: avoid double separator when projectRoot is /
- symlink_windows.go: use pre-resolved absTarget/absSource for Rel
- extras.go: check os.Remove error on wrong symlink replacement
2026-04-07 17:26:37 +08:00
Willie 3316c9073e fix(sync): resolve relative readlink against link parent, check os.Remove errors
filepath.Abs(dest) on a relative readlink result resolves against CWD,
not the symlink's parent directory. This broke the 'already correct'
check when comparing relative symlinks to absolute source paths.

Add resolveReadlink() helper that joins relative targets with
filepath.Dir(linkPath) before calling filepath.Abs.

Also check os.Remove errors in all reformat paths instead of ignoring
them silently.

Addresses PR #122 review feedback.
2026-04-07 17:26:37 +08:00
Willie 7d4e6cad42 docs: add v0.18.9 changelog and document relative symlinks in project mode 2026-04-07 17:26:37 +08:00
Willie e51fe60254 fix(sync): upgrade existing absolute symlinks to relative in project mode
sync previously skipped symlinks that pointed to the correct source,
even if their format (absolute vs relative) didn't match the expected
mode. This meant existing absolute symlinks in project mode were never
converted to relative on subsequent syncs.

Add linkNeedsReformat(dest, wantRelative) helper that checks whether
the raw readlink result has the wrong format. All four 'already
correct' skip points now check format and recreate when mismatched:

- SyncTargetMergeWithSkills (skills merge mode)
- SyncTarget (skills symlink mode)
- syncExtraSymlinkMode (extras directory symlink)
- syncOneExtraFile (extras per-file merge)

Global mode is unaffected: shouldUseRelative returns false, so
linkNeedsReformat never triggers on absolute links.

Also fix macOS /var → /private/var path mismatch in
TestSyncProject_RelativeSymlinks by EvalSymlinks on expected path.
2026-04-07 17:26:37 +08:00
Willie 741564b8b9 fix(status): use shared version parser for skill version check
status command used a legacy local parser that only looked for a
top-level version: key in SKILL.md frontmatter, always returning empty
since version now lives under metadata.version.

Replace local readSkillVersion() and fetchRemoteSkillVersion() with
the shared versioncheck.ReadLocalSkillVersion() and
FetchRemoteSkillVersion() from internal/version, matching what doctor
and upgrade already use.

Remove now-unused skillshareSkillURL constant from init.go.

Closes #121
2026-04-07 17:26:37 +08:00
Willie fe244e8289 refactor(sync): simplify shouldUseRelative and hoist extras computation
- Use utils.PathHasPrefix/PathsEqual for Windows case-insensitivity
- Eliminate redundant filepath.Clean call
- Hoist shouldUseRelative in syncExtraPerFile (compute once, pass bool)
- Add invariant comment in SyncTargetMergeWithSkills
2026-04-07 17:26:37 +08:00
Willie 39eea955b1 test: verify relative symlinks in project mode, absolute in global mode
Ref: #120
2026-04-07 17:26:37 +08:00
Willie bbf2e4343e feat(sync): unify extras symlinks through createLink
Replace direct os.Symlink calls in extras.go with createLink, gaining:
- Relative symlink support in project mode
- Windows junction fallback for extras (previously missing)

Thread projectRoot through SyncExtra, CollectExtraFiles, and all callers.

Ref: #120
2026-04-07 17:26:37 +08:00
Willie 465db305ca feat(sync): pass projectRoot from project-mode callers
Project-mode sync now passes the project root directory through to
createLink, enabling relative symlinks for all paths under the project.
Server handlers use s.projectRoot for project-mode dashboards.

Ref: #120
2026-04-07 17:26:37 +08:00
Willie 3c8c56002d feat(sync): wire projectRoot through merge and symlink sync paths
SyncTargetMerge, SyncTargetMergeWithSkills, CreateSymlink, and SyncTarget
now accept projectRoot. When non-empty, createLink uses relative symlinks
for paths under the project root.

All existing callers pass empty string (global mode, no behavior change).

Ref: #120
2026-04-07 17:26:37 +08:00
Willie 1d62b15713 feat(sync): add relative parameter to createLink
Unix: computes filepath.Rel from link dir to source, falls back to
absolute on error.
Windows: tries os.Symlink with relative path first (Developer Mode),
falls back to mklink /J with absolute paths.

All existing call sites pass false (no behavior change yet).

Ref: #120
2026-04-07 17:26:37 +08:00
Willie c450078c69 feat(sync): add shouldUseRelative helper for project-mode relative symlinks
Determines whether both source and target paths are under the project
root, in which case relative symlinks are portable and can be committed
to git.

Ref: #120
2026-04-07 17:26:37 +08:00
Willie e82d18cfa4 fix: sync must not prune registry entries for installed skills
Sync's registry prune logic removed entries for installed skills whose
files were missing from disk. This was wrong: the registry is the
authoritative record of installations managed by install/uninstall.

Remove PruneStaleSkills calls from sync (CLI global, CLI project, and
web UI handler). Reconcile (called during install) still uses prune
with full metadata context, which is correct.

Fixes: running 'sync' after 'install' would clear registry.yaml when
the installed skill's source files were not yet on disk.
v0.18.8
2026-04-06 17:28:10 +08:00
Willie 9ddff32f42 docs(blog): update legacy target config format to current style
Migrate flat targets format (targets.claude.path) to nested skills
sub-key format (targets.claude.skills.path) for consistency across
all blog posts.
2026-04-05 20:51:04 +08:00
Willie 17da67aaff fix(blog): correct image path and remove outdated posts
Fix Docusaurus build error: /static/img/ → /img/ for markdown images.
Remove e2e-testing-for-ai-agents and e2e-tests-now-powered-by-mdproof
blog posts.
2026-04-05 20:31:46 +08:00
Willie 9a02d82554 docs(blog): add multi-account Claude Code setup guide
Covers setting up multiple Claude Code accounts via CLAUDE_CONFIG_DIR
aliases, syncing skills across accounts with skillshare targets, and
syncing rules/hooks/agents with the extras feature. Includes web UI
section and full config example.
2026-04-05 20:26:47 +08:00
Willie 162f5e3695 refactor(skills): split /changelog and create /release skill
Extract RELEASE_NOTES generation, version bump, and announcement
drafting from /changelog into a new /release skill that orchestrates
the full end-to-end release workflow.

/changelog now focuses solely on CHANGELOG.md + website sync (7 steps).
/release handles: validate → changelog → release notes → version bump
→ commit & tag → draft announcements → present & confirm (7 phases).
2026-04-05 20:08:41 +08:00
Willie 96b357bc20 fix(ui): prevent modal close when selecting text in input fields
Switch DialogShell backdrop detection from onClick to onMouseDown.

The click event's target resolves to the nearest common ancestor of
mousedown/mouseup positions, so dragging a text selection from an
input onto the backdrop would fire onClose. mousedown's target is
always the element directly pressed, so only an intentional press on
the backdrop itself triggers close.
2026-04-05 20:08:41 +08:00
Willie eceb487658 chore: remove badge from README
Removed mention of Awesome Codex CLI from README.
2026-04-05 18:03:05 +08:00
Willie 5d9b3c5f4b feat(ui): optimistic batch target update with inline spinner and interaction lock
- Add onMutate to batchMutation for instant UI updates (mirrors
  server matchesFolder logic, skips disabled/tracked-repo skills)
- Show inline Spinner next to the folder badge during batch ops,
  derived from batchMutation.variables (no manual state sync)
- Block context menu and target selection while batch is pending
  to prevent conflicting mutations
- Extract normalizeTargets result into variables to avoid redundant
  calls in skill row rendering
v0.18.7
2026-04-04 17:05:22 +08:00
Willie 8e4a8b18eb fix(ui): normalize wildcard targets and scope folder summary to direct skills
- Add normalizeTargets helper: treats ['*'], null, and [] as All
- Folder target summary now reflects direct skills only, not the
  entire subtree — child folders have their own visible badges
- Skill badges in grouped view also use normalizeTargets so '*'
  displays as 'All' instead of a literal asterisk
- Mixed display: shows 'Mixed' when some skills are All and others
  have specific targets (with tooltip showing the breakdown)
2026-04-04 17:05:22 +08:00
Willie 97fe0ebb11 fix(ui): show error toast when batch target edit hits only tracked-repo skills
When all skills in a folder are tracked-repo members (read-only), the
batch target mutation now shows an error toast instead of a misleading
'0 skills now available in X' success message.
2026-04-04 17:05:22 +08:00
Willie 343e29cfe5 fix(ui,server): harden target management, toggle, and tracked-repo UX
- Enable frontmatter parsing in DiscoverSourceSkillsAll so /api/skills
  returns saved targets (fixes target display reverting to All)
- Skip tracked-repo skills in batch/single target handlers to prevent
  dirty git state; reject with 400 for single-skill endpoint
- Add RefreshMetaHashes to recompute audit hashes after SKILL.md edits;
  batch handler refreshes outside the write lock
- Show 'Uninstall Repo' with confirm dialog for tracked-repo members
  instead of the always-failing individual uninstall action
- Return 409 Conflict when enabling a skill disabled by glob pattern
  in .skillignore/.skillignore.local instead of false success
- Preserve IsInRepo flag for root-skillignore-disabled skills so they
  remain visible in the Tracked tab after disable
- Update changelog and website changelog for v0.18.7
2026-04-04 17:05:22 +08:00
Willie ce76f58393 fix(doctor): read metadata.version + harden frontmatter delimiter parsing
- doctor: replace inline frontmatter parser with version.ReadLocalSkillVersion
  which correctly reads nested metadata.version (fixes #119)
- frontmatter_write: use TrimRight instead of TrimSpace for --- delimiter
  so indented --- inside YAML block scalars is not mistaken for end marker
- Update changelog and website changelog for v0.18.7
2026-04-04 17:05:22 +08:00