fix: stop installer treating skills-CLI-managed skill dirs as legacy#183
Closed
citypaul wants to merge 1 commit into
Closed
fix: stop installer treating skills-CLI-managed skill dirs as legacy#183citypaul wants to merge 1 commit into
citypaul wants to merge 1 commit into
Conversation
Since skills CLI ~1.5, npx skills add copies each skill into ~/.claude/skills/<name> as a regular directory tracked in ~/.agents/.skill-lock.json, instead of symlinking through the universal ~/.agents/skills/ cache. install-claude.sh still assumed symlink-or-legacy, so every run moved all CLI-managed skills aside as pre-skills.sh leftovers and then warned that the fresh copies won't be visible to non-Claude agents — an endless move-and-reinstall cycle that loses skills if an install step fails after the move. Teach migrate_legacy_skill_dirs and verify_skills_installed to consult the skills CLI lock file: symlinks and lock-tracked directories are CLI-managed and left alone; only unmanaged strays are migrated or flagged. Add test/install-claude-skill-layout.sh covering the three layouts (old-CLI symlink, new-CLI lock-tracked copy, genuine leftover). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Folded into #184 (cherry-picked verbatim) so the installer fix and the skills quality sweep land together. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
install-claude.shstill assumed the old skills CLI layout (symlinks into the universal~/.agents/skills/cache). Since skills CLI ~1.5,npx skills addcopies each skill into~/.claude/skills/<name>as a regular directory, tracked in~/.agents/.skill-lock.json.The bug
With the current CLI, every installer run:
migrate_legacy_skill_dirs), then reinstalled them from scratch, and--skills-only— which triggers the move again.An endless move-and-reinstall cycle; if any install step fails after the move, skills silently vanish from
~/.claude/skills/. This is also why a newly merged skill (e.g.event-sourcingfrom #181) can look like the installer "wasn't updated" — verified empirically with sandboxedHOMEinstalls that discovery itself is fine (all 29 skills + resources land), but the post-install verification and next-run migration mishandle them.The fix
Both
migrate_legacy_skill_dirsandverify_skills_installednow consult the skills CLI lock file via a newskill_is_lock_managedhelper (node JSON parse, grep fallback):Testing
test/install-claude-skill-layout.sh(registered intest/run.sh): stubbed-npx installer run against a fakeHOMEcontaining all three layouts; written RED first against the old behaviour, GREEN after the fix../test/run.sh— all pass.Changeset
Includes
.changeset/fix-installer-skill-lock-awareness.md(patch).🤖 Generated with Claude Code