Commit Graph
58 Commits
Author SHA1 Message Date
Willie 46b23cd2ad feat(targets): let a target keep its instructions with skills switched off
Some tools only need skillshare for AGENTS.md, MCP or agents, while their
skills folder is managed elsewhere or shared through another target.
Syncing skills into those folders duplicated what the tool already reads,
so a target can now turn skills off (`target <name> --no-skills`, the
dashboard switch) and sync, diff, status and doctor skip its skills.
Switching off warns about the other tools that read the same folder.

The target list also gains tools that were missing, with colored vendor
logos where their licenses allow it, and zencoder/replit default paths
follow their current documentation.

The dashboard's target pages get the matching UI: universal is pinned as
the shared folder when adding a target, the add dialog lists what will be
written, and the AGENTS.md tab shows where the file comes from in one card
with an in-place switch between shared files.
2026-09-29 04:51:24 +08:00
Willie 97499ebcc4 fix: recognise Windows junctions wherever links are detected
Since Go 1.23, os.Lstat reports NTFS junctions as irregular files instead
of symlinks (winsymlink, active for go 1.25 in go.mod). Every check that
looked only at os.ModeSymlink therefore missed the junctions skillshare
itself creates on Windows: linked skills could be treated as local folders,
backed up, copied through, or left behind on prune.

Detect links through utils.IsLinkMode, which also asks the OS about the
reparse tag of irregular entries, and count only real symlinks and
junctions as links so OneDrive placeholders and deduplicated files stay
regular files. restore.go also used os.Stat for its link check, which
follows the link and never matched.

Refs #299
2026-09-28 13:53:16 +08:00
Willie 45854c5b57 fix(sync): count manifest-managed hidden entries in target scans
Flat target naming turns a source skill under a dot directory
(e.g. .system/example) into a hidden target entry (.system__example).
Target scans skipped every hidden name, so diff, doctor, status and the
dashboard reported these synced skills as missing, and prune never
removed them after the source skill was deleted.

Hidden entries are now skipped only when the target manifest does not
record them as managed, so files like .skillshare-manifest.json or
.DS_Store are still ignored.

Refs #294
2026-09-25 22:26:51 +08:00
Willie 1fb23f1e59 feat(analyze): measure what each target actually loads
The analyze numbers were drifting from what tools really see. Symlink-mode
targets expose the whole source folder, so .skillignore'd skills still load
but were left out; merge/copy targets often hold skills the user dropped in
by hand that skillshare never counted; and chars/4 undercounted CJK text by
roughly four times.

Route the CLI, TUI, web handler and sync summary through one
sync.TargetSkills so the three copies of the filter logic cannot disagree
again. Disabled skills stay in the discovery with Disabled=true and are
priced for symlink targets; unmanaged folders in a target are reported as
Local. Token estimates now charge one token per wide rune.

The dashboard keeps the chosen target in the URL so target and project
pages can deep-link into the analysis, lists project targets after own
targets with their tool icon, and tags local/disabled rows. Select gives
single-select icons a key to silence a React warning.
2026-09-21 04:17:26 +08:00
Willie 449fe40d6f fix(targets): move goose and openhands to .agents/skills
Both tools now document ~/.agents/skills and <project>/.agents/skills as
their skills locations and keep the old directories only for backward
compatibility. Writing to the old path next to `universal` makes them read
every skill from two places.

Global configs pin absolute paths, so they are unaffected and keep their
overlap warning. Project configs store target names only, so an existing
project follows the new default on its next sync while the links it created
in .goose/skills or .openhands/skills would stay behind and show up as
duplicates. Project sync now removes those leftovers from also_scans
directories that no configured target writes to.

That directory belongs to another tool, so the cleanup runs the prune with
ManagedOnly: only symlinks into the source and manifest-tracked folders are
removed. The flat-name heuristic would otherwise delete hand-made folders
such as `_drafts`. Targets with an explicit path are skipped, and --dry-run
only previews.

Refs #135
2026-09-21 02:55:18 +08:00
Willie 3743a1ef3f fix(sync): honor file ignore patterns in copy mode
Apply config ignore patterns to copy-mode file traversal, checksum, mtime, CLI diff, and server sync/diff paths.

Add default ignores for .DS_Store, .git, and __pycache__ in global and project init configs.

Tests: go test ./... -count=1
2026-06-29 10:30:11 +08:00
Willie f173b1d456 test(sync): add integration tests for token summary and budget warnings
DiscoverSourceSkillsWithStats did not set collectContext=true, so
DescChars/BodyChars were always 0 when sync called buildAnalyzeEntries.
Add DiscoverSourceSkillsWithStatsAndContext that enables both ignore
stats and context collection in a single walk, and use it in sync.go
and sync_project.go.
2026-05-11 21:34:38 +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.
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 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 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 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 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 f01ec9ec12 fix(sync): summarize resolution warnings instead of printing each one
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.
2026-04-01 00:32:49 +08:00
Willie ccdafd3293 feat(sync): add target_naming config option (flat/standard)
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
2026-04-01 00:32:49 +08:00
Willie f51cc8106b feat(sync): add DiscoverSourceSkillsAll with Disabled field
New discovery function that includes .skillignore-d skills marked with
Disabled=true. Existing discovery functions are unchanged — Disabled
defaults to false for backward compatibility.
2026-03-29 04:59:23 +08:00
Willie 41dd81b7f2 refactor: migrate all callers to SkillsConfig() / EnsureSkills()
44 files across CLI commands, sync engine, and server handlers now use
SkillsConfig() for reads and EnsureSkills() for writes instead of
accessing flat TargetConfig fields directly.

Key changes:
- sync engine (SyncTargetMerge/Copy/Symlink): reads sc := target.SkillsConfig()
- target commands: filter add/remove and mode set use EnsureSkills()
- target TUI: mode picker, filter ops, detail panel all via SkillsConfig()
- server handlers: backup, restore, targets, sync, diff, collect, analyze
- init/init_project: new target creation uses Skills sub-key
- doctor, status, diff: target display reads from SkillsConfig()
- computeTargetDiff: accepts config.TargetConfig directly (was anon struct)
2026-03-29 04:59:23 +08:00
Willie d377e6bbf6 refactor(analyze): simplify lint engine and fix review findings
- Eliminate double YAML parse: extend calcContextFromContent to return
  name, remove parseFrontmatterName helper
- Pre-compute lint icons (lintIconError/lintIconWarning) to avoid
  lipgloss.NewStyle() allocation per render frame
- Use tc.Red/tc.Yellow for Quality section icons (consistency)
- Extract check type string constants (checkFieldEmpty, etc.)
- Panic on embedded rule load failure instead of silent nil return
- Rename "Targets: all" to "Restricted to" (only shown when set)
- Fix struct field alignment (gofmt)
2026-03-26 19:20:52 +08:00
Willie 57ce3f507f feat(analyze): wire lint into discovery and analyze data flow
Populate LintIssues during skill discovery (collectContext path) and
propagate them through analyzeSkillEntry so JSON output includes lint
findings per skill.
2026-03-26 19:20:52 +08:00
Willie 2811a19fcf feat(analyze): return description from calcContextFromContent for TUI 2026-03-26 19:20:52 +08:00
Willie 620141af2b feat(analyze): add context analysis command
Analyze context window usage per target, showing always-loaded
(description) vs on-demand (body) token costs.

- Single-pass discovery with frontmatter-aware char/token counting
- Per-target filtering (include/exclude/symlink mode)
- Unified output when all targets have identical skills
- Verbose mode shows top 10 largest descriptions
- Project mode (-p) support
- JSON output (--json)
- Integration tests
2026-03-26 19:20:52 +08:00
Willie 8c0e97ac13 feat: add remove action (R key) to target list TUI
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.
2026-03-19 16:33:24 +08:00
Willie dc82b93d05 fix: address code review findings for auto-create target dirs
- 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
2026-03-19 04:16:36 +08:00
Willie 643e3c5c07 fix: auto-create missing target directories with notification (#87)
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
2026-03-19 03:57:08 +08:00
Willie 92603f5be6 feat: add config save validation and sync safety checks
Validate config semantics (source path, sync modes, target paths) at
save time (API + CLI) instead of failing at sync time with cryptic
errors. Sync no longer auto-creates missing target directories — fails
fast to catch typos like ~/.cusor/skills. Dry-run also validates paths.

- ValidateConfig / ValidateProjectConfig with warnings + errors
- handlePutConfig returns 400 for invalid configs, 200 + warnings
- handleSync pre-checks via ValidateConfig
- ensureRealTargetDir shared helper (replaces duplicated blocks)
- UI: warning toast on config save, warning banners on sync/preview
- Dashboard shows full absolute source path
2026-03-18 22:35:02 +08:00
Willie b2f5592cdb refactor(discovery): extract shared walk, add DiscoverSourceSkillsWithStats
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().
2026-03-18 00:19:30 +08:00
Willie 4214cb1038 feat(skillignore): upgrade to full gitignore-compatible syntax
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.
2026-03-18 00:19:30 +08:00
Willie 1c537797bb feat(discovery): add SkipDir optimization and root-level .skillignore
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
2026-03-18 00:19:30 +08:00
Willie 6e89577948 refactor(discovery): extract isSkillIgnored helper, unify tracked repo detection
- Extract duplicate .skillignore filtering block into isSkillIgnored()
- Use utils.IsTrackedRepoDir consistently in DiscoverSourceSkillsLite
- Fix unchecked os.WriteFile in skillignore test
2026-03-18 00:19:30 +08:00
Willie d925bf4e58 fix(discovery): respect .skillignore in source discovery (#83)
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.
2026-03-18 00:19:30 +08:00
Willie 767ad31ec3 fix(collect): skip .git directories when pulling nested skills to source
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.
2026-03-13 13:37:12 +08:00
Willie 7223ac52f4 fix(sync): preserve non-json dry-run output stream
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.
2026-03-06 02:15:36 +08:00
Willie 6b4a8782bd fix(cli): ensure --json mode outputs pure JSON to stdout
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
2026-03-06 02:15:36 +08:00
Willie 38f8f1c796 fix(symlink): resolve symlinked source/target dirs across all Walk callsites
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.
2026-03-02 10:05:57 +08:00
Willie c426a801d7 fix(sync): preserve external symlinks during sync (dotfiles manager support)
When source or target directories are symlinks managed by external tools
(e.g., dotfiles managers), sync would incorrectly delete them during
mode conversion. This change:

- Add resolveWalkRoot() so filepath.Walk follows symlinked source dirs
- Add isSymlinkToSource() with canonicalization to distinguish internal
  symlink-mode targets from external symlinks (alias-safe)
- Protect external target symlinks in both merge and copy mode
- Allow FindLocalSkills to scan through external symlinked targets
- Handle external symlinks in CheckStatusMerge as normal directories
2026-03-02 10:05:57 +08:00
Willie d1370c0f98 fix(sync): preserve external symlinks in merge/copy mode conversions
When a target directory is an external symlink (e.g., dotfiles manager
pointing ~/.claude/skills/ elsewhere), sync previously deleted it
unconditionally during symlink→merge/copy mode conversion. This also
affected DiscoverSourceSkills which failed to traverse symlinked source
directories because filepath.Walk uses Lstat on root.

Changes:
- Add resolveWalkRoot() helper; use in both Discover functions so
  filepath.Walk enters symlinked source directories
- Add isSymlinkToSource() to distinguish source-pointing symlinks
  (symlink mode residue, safe to remove) from external symlinks
- Pass explicit sourcePath to SyncTargetMergeWithSkills and
  SyncTargetCopyWithSkills for reliable symlink origin detection
- Fix FindLocalSkills to use utils.ResolveLinkTarget (handles relative
  symlinks correctly) and follow external symlinks for scanning
- Fix CheckStatusMerge to follow external symlinks instead of returning
  StatusConflict
- Add 17 unit tests and 6 integration tests covering symlinked source,
  target, both, chained symlinks, idempotency, prune, and pull
2026-03-02 10:05:57 +08:00
Willie f29b4ac1b8 fix(sync): dereference directory symlinks in copy mode and update changelog
Copy mode now resolves directory symlinks to concrete directories,
preventing broken symlinks in targets that use file copying (e.g.,
Windsurf). DirChecksum follows symlinks for consistent hash comparison.
DirMaxMtime disables mtime fast-path for symlink-containing skills to
avoid stale cache hits. Cycle detection prevents infinite recursion.

Also updates CHANGELOG v0.16.3 with previously missing entries:
hub risk badge colors, batch failure output, repo-grouped cloning.
2026-02-27 05:39:49 +08:00
Willie 2f6dd42695 perf(sync): cache discovery + add progress UI for sync operations
DiscoverSourceSkills was called 1+2N times (N = number of targets),
each doing a full filepath.Walk + SKILL.md frontmatter parsing.
Now discovered once and passed to all targets via WithSkills variants.

Changes:
- Add SyncTargetMergeWithSkills, PruneOrphanLinksWithSkills (PruneOptions struct)
- Add SyncTargetCopyWithSkills with onProgress callback, PruneOrphanCopiesWithSkills
- Discovery spinner + per-target reporting + summary line in CLI
- Copy mode shows per-skill spinner progress during slow checksum+copy
- Collision report uses dim gray text to avoid confusion with sync results
- Server handlers (handleSync, handlePull) use single discovery pass
- Fix pre-existing TestLog_StatsOutput assertion ("Success rate" → "OK:")
2026-02-26 22:27:23 +08:00
Willie 7079a705f3 feat(sync): add DiscoverSourceSkillsLite and ParseFrontmatterFields
DiscoverSourceSkillsLite skips frontmatter parsing during directory
walk and collects tracked repos in a single pass — significantly
faster for large skill collections.

ParseFrontmatterFields extracts specific YAML fields from SKILL.md
without parsing the full document, used by the TUI detail panel.
2026-02-25 19:39:28 +08:00
Willie a05d3448f2 fix(sync): match targets by shared path and track local dirs in prune
MatchesTargetName now falls back to path comparison when name-based
matching fails, so targets sharing the same project_path (e.g. codex
and universal both using .agents/skills) correctly match in
FilterSkillsByTarget.

PruneOrphanLinks records user-created directories in LocalDirs instead
of emitting misleading "unknown directory" warnings, and syncMergeMode
counts them toward the local skill total.
2026-02-25 07:02:54 +08:00
Willie 3721d69b54 fix: prune orphaned real directories in merge mode via manifest (#45)
- Extend .skillshare-manifest.json tracking from copy mode to merge mode.
- Update PruneOrphanLinks to prioritize manifest records over naming patterns.
- Ensure SyncTargetMerge writes to manifest for all linked/updated skills.
- Add integration tests for uninstall + sync orphan directory cleanup.
- Maintain backward compatibility for targets without existing manifests.
2026-02-24 01:47:38 +08:00
Willie 3b721ee3e2 feat(sync): add copy mode for AI CLIs that can't follow symlinks
Add a third sync mode (`copy`) that copies skills as real files instead
of symlinks, with a `.skillshare-manifest.json` tracking managed skills
and SHA256 checksums for incremental updates.

- Manifest-based tracking: skip unchanged, update modified, --force all
- Pruning: remove managed copies no longer in source
- Mode conversion: bidirectional merge↔copy and symlink↔copy
- Full command support: sync, status, doctor, diff, target, collect
- Server API + Web UI: targets list, drift detection, filter editing
- include/exclude filters work in both merge and copy modes
- 12 integration tests covering all acceptance criteria
- Documentation updated across 13 pages

Closes #31
2026-02-21 06:07:35 +08:00
Willie 76e1f6e3a9 fix: prune broken external symlinks after data migration (#28)
After data migration (e.g. XDG path change), target symlinks still
point to old source path. PruneOrphanLinks treated these as "external"
and always preserved them, even with --force.

- Auto-remove broken external symlinks (target no longer exists)
- Pass force flag to PruneOrphanLinks; force removes valid external symlinks
- Use utils.PathHasPrefix for Windows case-insensitive path comparison
2026-02-16 15:23:03 +08:00
Willie a29e198725 feat: add target filter CLI, skill-level targets field, and Web UI support
- CLI: `target <name> --add-include/--add-exclude/--remove-include/--remove-exclude`
- SKILL.md `targets` frontmatter restricts sync to specified targets
- Cross-mode matching (e.g. "claude" matches "claude-code" project target)
- Web UI: inline filter editor on Targets page, target badges on Skills pages
- API: PATCH /api/targets/{name} for filter updates
- Fix drift detection in doctor/status/handler to account for skill-level targets
- `check` warns about unknown target names in skill-level targets field
- Docs: update skill-format, target command, configuration, creating-skills
2026-02-15 23:29:30 +08:00
Willie 43d12b11c1 feat: per-target collision detection with filter-aware reporting
Collision checks previously ran on all skills before target filters,
producing false positive warnings when users route same-named skills
to different targets via include/exclude. Now collision detection
runs per-target after filtering, downgrading to info when filters
correctly isolate duplicates.

- Add CheckNameCollisionsForTargets() to internal/sync
- Replace collision blocks in sync.go and sync_project.go
- Show human-readable filter summary per merge target
- Add unit tests (5 cases) and integration test
- Update docs with new two-tier collision output examples
2026-02-14 18:35:21 +08:00
Willie bd75ef8939 feat: support target include/exclude filters across sync, UI, and docs 2026-02-14 00:21:48 +08:00
Willie f2017a35aa feat: fix tracked repo discovery, improve naming, and unify project list
Sync discovery (DiscoverSourceSkills) was skipping all hidden directories
via utils.IsHidden(), causing skills inside .curated/ and .system/ (like
openai/skills) to be invisible after install. Now only .git is skipped,
matching the install-time discovery that was already fixed in 8ec5306.

Tracked repo naming now uses owner-repo format (e.g., _openai-skills
instead of _skills) via new Source.TrackName() method, preventing
collisions between repos that share the same basename.

Project-mode `list` command now uses recursive DiscoverSourceSkills()
instead of shallow os.ReadDir(), aligning with global list and web UI
behavior so tracked repo skills are visible everywhere.

Also includes CHANGELOG for v0.11.0, README updates, docs improvements,
and minor UI nav reorder.
2026-02-10 03:13:21 +08:00
Willie 6185849328 fix: handle Windows junctions in sync and diff 2026-02-08 15:14:16 +08:00
Willie 32014986ec fix(diff,sync): improve diff clarity and fix sync --force for merge mode
diff improvements:
- Use sync.DiscoverSourceSkills for proper tracked repo handling
- Remove "Diff:" prefix, show target name directly
- Clearer descriptions: "missing", "local copy (sync --force to replace)", "local only"
- Add action hints explaining what sync/pull commands will do

sync --force fix:
- Now properly replaces local copies with symlinks in merge mode
- Previously --force only worked for symlink mode conflicts

help improvements:
- Add GIT REMOTE section grouping push and pull --remote together
- Remove logo from status command (high-frequency operation)

docs: update sync.md with new diff output format and symbols table
2026-01-31 20:22:51 +08:00