Commit Graph
6 Commits
Author SHA1 Message Date
Willie efcc3e6f61 fix(update): honour installed branch in batch update and web UI check/update
Skills installed from a non-default branch record that branch in metadata,
but the grouped update path (update --all) cloned the remote default branch,
so the skills were either downgraded or reported as removed upstream and
pruned. The web UI update and check handlers had the same gap, comparing
against the remote HEAD instead of the installed branch.

Group batch updates and web UI checks by URL+branch, pass the branch through
to the clone, and resolve remote tree hashes for that branch as well.

Refs #268
2026-09-02 13:08:40 +08:00
Colin Mason 325c9bb5f8 fix(update): resolve dot-dir subdirs in batch
Batch update looks up each skill's subdir in the discovery map, but
discovery deliberately skips target dot-dirs (.claude, .codex, ...) to
avoid counting target-synced copies as source skills. A skill installed
from such a subdir therefore never appears in the map and is falsely
reported as stale (deleted upstream), steering users toward --prune on a
healthy skill. Fall back to a direct SKILL.md stat in the cloned repo --
mirroring the single-skill update path -- before declaring the path
missing.

Fixes #261
2026-08-06 10:57:32 +08:00
Willie 51d2e3a6c5 perf(update): speed up grouped updates and unstick progress bar
Optimize grouped repo updates by skipping reinstall when installed metadata already matches remote state (commit match, or subdir tree-hash match when HEAD moved).

Emit per-skill grouped progress events so the batch progress bar advances continuously instead of appearing stuck at 0%.

When skipping by tree-hash match, best-effort refresh meta.Version to latest commit to keep status/version output current.

Add unit tests covering commit/tree-hash skip behavior and metadata version refresh.
2026-02-28 03:44:02 +08:00
Willie b4a4969ff6 perf(update): skip unchanged skills in grouped repo updates
When update --all processes many skills from the same repo, avoid reinstall/copy when installed metadata already matches the fetched repo state.

For root skills, skip when meta.Version matches repo commit. For subdir skills, require both meta.Version and meta.TreeHash to match. Added unit tests for match/mismatch cases.
2026-02-28 03:44:02 +08:00
Willie 41fe18b3be fix(update): normalize empty Subdir to "." for root-level skill repos
Root-level skills (SKILL.md at repo root) have meta.Subdir="" but
discoverSkills() returns Path=".". The mismatch caused lookup failure
in batch update, falsely reporting these skills as stale/deleted.
2026-02-28 03:44:02 +08:00
Willie 3012061649 fix(update): use caller-provided dest paths in batch update to prevent path duplication
UpdateSkillsFromRepo was using filepath.Join(sourceDir, meta.Subdir) to
derive the local destination, but meta.Subdir is the repo-internal path
(e.g. "skills/foo") which may differ from the local install path ("foo/").
This created leaked copies at sourceDir/skills/foo/ alongside the correct
sourceDir/foo/, doubling the skill count on subsequent scans.

Change skillTargets from []string to map[string]string where key is the
repo subdir (for discovery lookup) and value is the local absolute path
(provided by the caller who already knows where the skill is installed).
2026-02-25 07:02:54 +08:00