Skip to content

fix: stop installer treating skills-CLI-managed skill dirs as legacy#183

Closed
citypaul wants to merge 1 commit into
mainfrom
fix/installer-skill-lock-awareness
Closed

fix: stop installer treating skills-CLI-managed skill dirs as legacy#183
citypaul wants to merge 1 commit into
mainfrom
fix/installer-skill-lock-awareness

Conversation

@citypaul

@citypaul citypaul commented Jul 1, 2026

Copy link
Copy Markdown
Owner

What

install-claude.sh still assumed the old skills CLI layout (symlinks into the universal ~/.agents/skills/ cache). 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.

The bug

With the current CLI, every installer run:

  1. moved all CLI-managed skills aside as "pre-skills.sh legacy" directories (migrate_legacy_skill_dirs), then reinstalled them from scratch, and
  2. warned afterwards that every freshly copied skill "won't be visible to non-Claude agents", telling the user to re-run --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-sourcing from #181) can look like the installer "wasn't updated" — verified empirically with sandboxed HOME installs 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_dirs and verify_skills_installed now consult the skills CLI lock file via a new skill_is_lock_managed helper (node JSON parse, grep fallback):

  • symlinks (old-CLI layout) → CLI-managed, left alone
  • regular dirs tracked in the lock file (new-CLI layout) → CLI-managed, left alone
  • unmanaged regular dirs (genuine pre-skills.sh leftovers) → migrated aside / warned, as before

Testing

  • New test/install-claude-skill-layout.sh (registered in test/run.sh): stubbed-npx installer run against a fake HOME containing 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

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>
@citypaul

citypaul commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Folded into #184 (cherry-picked verbatim) so the installer fix and the skills quality sweep land together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant