Code quality fixes from review:
- Extract RemoveByNames() to eliminate copy-paste in uninstall Phase 7
- Add MetadataKindSkill/MetadataKindAgent constants
- Remove dual-write shim (findSkillsRoot + writeMetaToCentralized)
- install_apply.go uses WriteMetaToStore with SourceDir (no sidecar)
- Move LoadMetadata out of walk loops (P0 efficiency fix)
- isGroupDir accepts store parameter to avoid redundant loads
- Add SourceDir to InstallOptions for --into group support
- Dual-write in WriteMeta: also writes to .metadata.json for backward compat
- Migration looks in parent dir for registry.yaml
- Group uninstall matches entries by Group field + full path
- Sync test uses MetadataStore instead of registry.yaml
- All integration tests pass (0 FAIL)
- CheckAgents uses recursive discovery via resource.AgentKind{}.Discover()
so nested agents (e.g. demo/code-reviewer.md) are found correctly
- Add --group/-G flag to update, check, and uninstall agents commands
with shared validateAgentGroups/matchesAnyGroup helpers
- Fix TUI project-mode dispatch: call cmdUpdateAgentsProject and
cmdUninstallAgents directly instead of passing 'agents' keyword to
handlers that don't understand it
- TUI confirmation overlay shows correct command with 'agents' keyword
and confirmKind field tracks skill vs agent
- TUI toggleDisabled (E key) writes to .agentignore for agents instead
of .skillignore
- Agent Discover now marks .agentignore matches as Disabled=true instead
of skipping them, so disabled agents appear in list with [disabled] tag
- Sync filters out disabled agents via resource.ActiveAgents()
- auditSkillByName uses scanPathTarget to support single-file agent audit
- Uninstall agents display uses RelPath (e.g. demo/tutor) instead of
frontmatter name (e.g. Python Tutor Expert)
When extras has an entry named 'agents' whose target paths overlap with
the resolved agent target paths from targets.yaml, the extras targets
are skipped with a warning — the agents sync system takes priority.
Detection uses dual conditions: extras name == 'agents' AND resolved
path overlap. Non-'agents' extras targeting agent paths are unaffected.
Agents source must exist with actual files; empty/missing source means
no overlap (extras sync normally).
Also fixes:
- CheckAgents now recurses into subdirectories via resource.AgentKind
- update agents resolves nested agent names via filepath.Base
- filterAgentCheckResults matches both full path and basename
Validates the full agent workflow: install mixed repo (skills + agents)
then sync all — verifying skills go to skills targets, agents go to
agent-capable targets, agents are excluded from targets without agents
path, and the skip warning mentions the target name.
Uses 'sync all' since plain 'sync' only syncs skills by design.
Both syncAgentsGlobal and syncAgentsProject now collect target names
where agentPath is empty and print a summary warning after the sync
summary line. This makes it visible to users which targets were
silently skipped, helping them configure agents paths if desired.
Mixed repos containing both skills/ and agents/ directories previously
only installed skills, silently ignoring agents. Now after every skill
install exit point, discovered agents are also installed to the agents
source directory.
- Add installDiscoveredAgents helper that installs agents post-skills
- Update 'Found' message to show agent count in mixed repos
- Call helper at all 4 skill install exit points in handleGitInstall
- Add integration test for mixed-repo install scenario
- TestList_Agents_KindFilter_NoTUI: verifies list agents/all/default
kind filtering works correctly in --no-tui mode
- TestTrash_MergedList_IncludesAgents: verifies uninstalled agents
appear in trash agents list --no-tui output
Add -p/--project support to 'backup agents' and 'restore agents' commands.
Project-mode backups are stored under .skillshare/backups/ (parallel to
.skillshare/trash/).
Backup engine changes:
- Add ProjectBackupDir(), CreateInDir(), ListInDir() to internal/backup
- Add RestoreLatestInDir(), FindBackupsForTargetInDir(),
GetBackupByTimestampInDir() to restore.go
- Existing global functions become thin wrappers (zero caller churn)
Command layer changes:
- Allow project mode through for kind=agents in cmdBackup/cmdRestore
- Auto-detect project mode when .skillshare/config.yaml exists
- Refactor backup_agents.go with resolveAgentBackupContext() to
resolve backup dir + agent targets per mode
Skills backup in project mode remains unsupported (error unchanged).
Remove all "not yet supported in project mode" errors. Every command
that supports agents in global mode now also supports project mode:
- status -p agents: shows project agent source + per-target status
- status -p all: shows both skills and agents
- check -p agents: checks agent status from .skillshare/agents/
- diff -p agents: computes agent diffs (missing/orphan per target)
- diff agents (global): also now fully implemented via diffGlobalAgents
- collect -p agents: collects local agents from project targets
- audit -p agents: scans .skillshare/agents/ for security patterns
New file: diff_agents.go — shared agent diff logic for both modes
(computeAgentDiff, diffProjectAgents, diffGlobalAgents).
11 new integration tests covering all 5 commands in project mode.
Total agent tests: 56.
7 new integration tests covering:
- trash agents empty / delete
- uninstall agents in project mode (fix: wire kind into project dispatch)
- check all (combined skill + agent)
- sync agents skips targets without agent path
- list all --json verifies kind field on every entry
- status agents --json with target details
Total agent tests: 45 (38 + 7).
7 integration tests covering:
- install --kind flag parsing and validation
- install -a flag parsing
- check agents with empty dir, local agent, and JSON output
- enable/disable --kind agent routing to .agentignore
- uninstall --kind agent flag parsing
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.
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.
Tracked repos have no .skillshare-meta.json, so reconcile could not
read branch from metadata. Now falls back to git rev-parse --abbrev-ref
HEAD for tracked repos, ensuring branch is written to registry.yaml
for cross-device rebuild.
Added gitCurrentBranch() helper in config package (cannot import
internal/git due to circular dependency).
Added registry assertion to TestInstallBranch_TrackedRepo.
TestSync_TargetNamingStandard_InvalidSkillWarnsAndSkips now checks
for summarized output 'skill(s) skipped (naming validation)' instead
of per-skill warning line.
- NewMetaFromSource: set meta.Branch from source.Branch
- installFromDiscoveryImpl: forward discovery.Source.Branch when building
per-skill Source struct for metadata
- installFromGitSubdir: pass source.Branch to sparseCloneSubdir (was
hardcoded empty string, causing subdir installs to ignore --branch)
- ReconcileGlobalSkills: sync meta.Branch to registry on both new and
existing entries
- toSkillEntryDTOs: include Branch field in DTO conversion
- updateRegularSkill / updateSkillFromMeta: restore source.Branch from
meta before reinstalling, so updates pull from the originally-specified
branch
Tests: TestInstallBranch_MetadataPersistence, TestInstallBranch_UpdatePreservesBranch
Source.Branch threads the branch parameter through discovery.
cloneRepo() passes --branch to git clone when set.
source.Branch is set from parsed.opts.Branch in cmdInstall.
Ref: #90
cloneTrackedRepo(), cloneRepoFull(), and sparseCloneSubdir() now accept
a branch parameter. When non-empty, --branch <name> is passed to
git clone. Fallback chain (partial → full) preserved.
Ref: #90
Add --branch / -b flag to install command:
- Flag parsing with value-required and non-empty validation
- Mutual exclusion: --branch rejected for non-git (local path) sources
- Help text added to printInstallHelp()
- Integration tests covering all three error paths
Add per-target target_naming setting that controls how skill directories
are named in sync targets. 'flat' (default) preserves the existing
flattened __ separator behavior. 'standard' uses the SKILL.md name field
directly, following the Agent Skills specification.
Standard mode:
- Validates SKILL.md names match directory basenames
- Detects and skips name collisions with warnings
- Auto-migrates managed entries when switching from flat to standard
- Preserves legacy entries when bare name is already occupied
Also includes:
- Per-target toggle via CLI (--target-naming), TUI (N key), and Web UI
- Collision output redesigned as deduplicated compact summary
- Config inheritance: global target_naming → per-target override
- JSON schema + UI validation for the new field
Closes#110
Support case-insensitive substring filter on skill relPath.
When --filter is set, JSON output includes filtered_summary with
always_loaded, on_demand, and total token counts for matched skills.
Ref: Discussion #99
Verify MigrateRegistryToSource behaviour end-to-end:
- old-only: registry.yaml is moved from config dir to source dir
- both-exist: old file is kept, new file unchanged, warning printed
- global mode fresh sandbox: registry.yaml never written to config dir
- Fix nil pointer panic when WindowSizeMsg arrives before data loaded
- Fix TestAnalyze_Verbose: create 12 skills to match analyzeTopN=10
- Unify left panel with shared renderPrefixRow (▌ prefix bar style)
- Right-align token counts in skill list rows
- Pre-compute colored dots to avoid per-render lipgloss allocations
- Add category tab bar at top for future analysis categories
- Improve target bar separator (│ → ·) and footer spacing
- Extract renderFooter to eliminate viewSplit/viewVertical duplication
- Add analyze command reference page and sidebar/index entries
- Remove early return in dry-run so linked/copied counts are populated
correctly (P1: UI preview no longer hides Sync Now button)
- Use local quietDryRun flag instead of mutating global DiagOutput
to suppress per-skill messages (P2: safe under parallel sync)
- Use "Will create" for dry-run, "Created" for actual sync (P3)
- Include dir_created in allUpToDate check so empty source + missing
dir still shows Sync Now in the preview modal
v0.17.5 blocked sync when target directories didn't exist, which
prevented first-time users on fresh CLI installs from syncing.
Sync now auto-creates missing directories and reports what it did
in CLI output, dry-run preview, and the Web UI. Init also creates
target directories when it detects an installed CLI tool.
Web UI: Sync Preview modal stays open after sync with a success
banner instead of immediately closing, so users can review results.
Closes#87
Verify that the new metadata.targets format works end-to-end
through the full sync pipeline: filtering, mixed format
coexistence, and metadata-over-toplevel priority.
Tests were failing because config validation now requires target paths
to exist before sync. Updated tests to create target directories
properly and adjusted expected error messages.
- TestExclude_GlobalSymlinkMode_Ignored: use CreateTarget instead of RemoveAll
- TestSync_SymlinkMode_CreatesSingleSymlink: same
- TestSync_SourceNotExist_ReturnsError: use CreateTarget, update error message
- TestLog_SyncPartialStatus: use read-only dir to trigger partial failure
Verify that sync command correctly reports ignored skills in text output,
includes ignored_count and ignored_skills in JSON output, and produces
no ignored output when .skillignore does not exist.
Surface .skillignore visibility in the status command so users can
see active patterns and how many skills are being ignored without
needing to run doctor.
Text output shows an indented line under Source when .skillignore
exists; JSON output adds a skillignore object inside source with
active flag, file paths, patterns, and ignored skill details.
Add checkInfo status constant for informational (non-pass/warn/error)
doctor checks. Info checks count toward total but are tracked separately
in the summary.
Add checkSkillignore to doctor: reports .skillignore state as either
info (no .skillignore found) or pass (active with pattern/ignored counts
and details). Switches discovery from DiscoverSourceSkills to
DiscoverSourceSkillsWithStats to collect .skillignore statistics in the
same walk.