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.
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.
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.
- 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
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.
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.
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
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
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
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
- 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
With 25000+ skipped skills (standard naming + name collisions),
the CLI sync output was flooded with per-skill warning lines.
Now prints a concise summary:
12345 skill(s) skipped (naming validation)
456 name collision(s) excluded
Applied to both merge and copy sync modes.
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
New discovery function that includes .skillignore-d skills marked with
Disabled=true. Existing discovery functions are unchanged — Disabled
defaults to false for backward compatibility.
Update registry.yaml path references from ~/.config/skillshare/
to ~/.config/skillshare/skills/ in schema description, quick
reference docs, and migration guide. Fix whitespace alignment
in lint.go constants and remove blank line in skill.go imports.
- Surface YAML parse errors from calcContextFromContent as a new
"malformed-frontmatter" lint issue instead of silently ignoring them
- Fix help text to say "Top 10" (was "Top 5") matching actual constant
- Shorten TUI list title to target name only; move skill count to
stats line so the header no longer wraps on narrow terminals
- Truncate long skill names in TUI to keep token counts visible
- Change "All Skills" icon block to green (matches Skills summary card)
Populate LintIssues during skill discovery (collectContext path) and
propagate them through analyzeSkillEntry so JSON output includes lint
findings per skill.
When flatten=true, SyncExtra maps subdirectory files to target root
using filepath.Base(). First file wins on collision, subsequent are
skipped with warnings. Includes config validation, sync-time guard,
CheckSyncStatus collision handling, and CollectExtraFiles support.
Ref: #97
Press R on a selected target to show a confirmation overlay.
Confirming exits the TUI and dispatches the full target remove
flow (backup + unlink + config update), matching the existing
exit-with-action pattern used by the skill list TUI.
Supports both global and project modes.
- 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
Unify ~160 lines of duplicated walk logic from DiscoverSourceSkills and
DiscoverSourceSkillsLite into a single discoverSourceSkillsInternal
function controlled by discoverOptions (parseFrontmatter, collectIgnored,
collectTracked).
Add DiscoverSourceSkillsWithStats which returns IgnoreStats populated
with root/repo .skillignore file paths, active patterns, and ignored
skill relPaths. When collectIgnored is true, CanSkipDir is bypassed so
the file-level Match check can record every ignored SKILL.md path.
Add Patterns() method to skillignore.Matcher to expose the original
pattern strings stored during Compile().
Replace the naive string matcher (~40 lines) with a proper gitignore
implementation (~200 lines, no external deps) supporting **, ?, [abc],
!negation, /anchored, pattern/ (dir-only), and \#/\! escapes.
New Matcher API (Compile, ReadMatcher, Match, CanSkipDir, HasRules)
replaces the old Match/ReadPatterns functions (kept as deprecated
wrappers). Call sites in sync.go and install_discovery.go updated.
Also fixes isDir=true for install discovery (skill paths are dirs).
100% test coverage on skillignore package (~150 table-driven cases).
Added 7 sync discovery tests and 5 install integration tests covering
**, !negation, pattern/, [Tt] char class, and combined patterns.
Skip entire ignored directory trees during walk instead of filtering
at SKILL.md level. Support root-level .skillignore at source root
for globally muting skills or excluding patterns.
Root patterns checked first (can skip entire tracked repos), then
repo-level patterns. Both layers use filepath.SkipDir for performance.
Ref: #83
- Extract duplicate .skillignore filtering block into isSkillIgnored()
- Use utils.IsTrackedRepoDir consistently in DiscoverSourceSkillsLite
- Fix unchecked os.WriteFile in skillignore test
DiscoverSourceSkills and DiscoverSourceSkillsLite now load .skillignore
from tracked repos and skip matching paths during walk. This prevents
false warnings in doctor/status/list for vendored SKILL.md files
(e.g. .venv/ inside a tracked repo).
Extract shared skillignore package from internal/install so both
install-time and source discovery use the same filtering logic.
copyDirectoryWithState did not skip .git/ dirs, causing collect to fail
on git-cloned repos (e.g. obra/superpowers) — filepath.Walk would abort
on .git pack files, leaving only empty directories in source.
Add copyDirectorySkipGit() variant and use it in PullSkill. Existing
copyDirectory (used by copy-mode sync) is unchanged.
Add ability to change sync mode of an extra's target across all three
interfaces: CLI (`extras mode`/shorthand `extras <name> --mode`),
TUI (`M` key with mode picker overlay), and Web UI (inline Select
dropdown per target with PATCH /api/extras/{name}/mode endpoint).
Fix sync behavior so symlinks from a previous mode are auto-replaced
without --force, while regular files still require explicit --force.
Consolidate sync mode list into config.ExtraSyncModes single source
of truth. Fix Select component missing disabled prop and add viewport
collision detection with useLayoutEffect.
Includes 8 integration tests covering mode command happy path, error
cases, shorthand syntax, and mode-switch sync behavior.
- Move checkExtrasSyncStatus to sync.CheckSyncStatus (shared)
- Add sync.EffectiveMode helper to replace inline mode defaults
- Add config.ValidateExtraMode to centralize mode validation
- Fix sync --all --json outputting two separate JSON objects
by merging extras into the skills JSON output
- Fix swallowed JSON decode error in handleExtrasSync
- Remove dead symlink check in CollectExtraFiles (filepath.Walk
follows symlinks so the check was unreachable)
- Fix integration test extras paths to use extras/<name>/ layout
Keep sync dry-run diagnostics on stdout by default to avoid non-JSON behavior regressions. Introduce sync.DiagOutput so JSON mode can silence diagnostics via io.Discard at command entry and restore after execution. Update search JSON integration assertion to match fully silent progress behavior.
Address code review feedback from PR #67:
- Move all dry-run diagnostic messages (internal/sync) from stdout to
stderr so they don't pollute JSON output
- Suppress UI output (spinners, headers, warnings) in uninstall --json
mode by adding jsonOutput guards across all phases
- Return nil after writeJSONError to prevent dual output (JSON + plain
text error) in install and sync commands
- Handle json.MarshalIndent error in writeJSONError with stderr fallback
- Merge duplicated discovery logic (JSON vs non-JSON branches) in sync,
sync_project, diff, and collect using nullable spinner pattern
- Remove checkRepoDirty alias in status.go, call isRepoDirty directly
- Remove extractJSON test workaround — tests now assert stdout is valid
JSON directly, enforcing the clean-stdout contract
- Add contentEqual() byte comparison for copy-mode idempotency check:
re-running sync extras no longer marks identical copies as conflicts
- Restore mode default in CLI handler so display shows "(merge)"
instead of "()" for targets with no explicit mode
- Fix bug: pass `rest` (not `args`) to cmdSyncExtras in --all path
- Return error from cmdSyncExtras when totalErrors > 0
- Remove empty if-block dead code in syncOneExtraFile
- Remove redundant mode default (SyncExtra already defaults to merge)
- Consolidate capitalize/capitalizeFirst into single Unicode-safe helper
- Remove trivial copyExtraFile wrapper, call copyFile directly
- Warn when --all is used in project mode (extras are global only)
- Cache os.UserHomeDir() at package level for shortenPath
- Use source file set instead of per-file os.Stat in pruneExtraOrphans
filepath.Walk/WalkDir silently skip symlinked root directories because
os.Lstat sees the root as a non-directory symlink and never enters it.
This affected update, uninstall, reconcile, and server handlers when
the source directory was a symlink (common with dotfiles managers).
Extract ResolveSymlink() from sync.go into internal/utils/path.go and
apply it at every filepath.Walk/WalkDir callsite on source/target dirs.
Also add containment guards to resolveGroupSkills (uninstall) and
resolveGroupUpdatable (update) to reject group directories that are
symlinks pointing outside the source tree.