docs(claude-code): teach the skill-management skills the Nix layout
~/.claude/skills is generated by home-manager: the directories are real but every leaf file is a read-only symlink into the store. The skills that author and install skills assumed it was an ordinary writable tree. - craft-skill: personal skills are authored in modules/claude-code/skills and applied by a rebuild, never edited under ~/.claude/skills; writing there succeeds silently and strands the skill outside the repo. - setup-skills, update-skills: copy out of the library with cp -rL and chmod -R u+w. A plain cp -r copies the symlinks, committing store paths into the project, and dereferenced files keep the store's read-only mode. - craft-skill also staged through `dot add`, a fish function this repo no longer carries; plain git add replaces it.
This commit was merged in pull request #1.
This commit is contained in:
@@ -10,6 +10,12 @@ the current project's `.claude/skills/`, tracked in
|
||||
Only ever adds — checking already-installed skills for updates is
|
||||
[`update-skills`](../update-skills/SKILL.md)'s job, not this one's.
|
||||
|
||||
The library is a tree of read-only symlinks into the Nix store, so every
|
||||
copy out of it must dereference (`cp -rL`) and then restore write
|
||||
permission (`chmod -R u+w`). A plain `cp -r` copies the symlinks
|
||||
themselves, putting store paths into the project that break on any other
|
||||
machine.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Read `.claude/skills-lock.yaml` in the current project, if it exists.
|
||||
@@ -35,7 +41,8 @@ Only ever adds — checking already-installed skills for updates is
|
||||
skill already lives there and isn't tracked — remove or rename it
|
||||
first if they want the library version).
|
||||
- Otherwise, copy `~/.claude/skills/library/<name>/` to
|
||||
`.claude/skills/<name>/` in the project, run
|
||||
`.claude/skills/<name>/` in the project with
|
||||
`cp -rL` followed by `chmod -R u+w`, run
|
||||
`~/.claude/skills/setup-skills/hash-dir.sh .claude/skills/<name>`,
|
||||
and append `{name, hash: <output>}` to `.claude/skills-lock.yaml`
|
||||
(create the file, an empty YAML list, if it doesn't exist yet).
|
||||
|
||||
Reference in New Issue
Block a user