Closed bug report

pkg install leaves SKILL.md empty when the package's install.sh links its folder into ~/.claude/skills (adom/kicad-board-audit 1.0.1)

Josef Sygula · ·closed by Colby Knox

adom-wiki 1.8.33 · adom/core 4.15.3 · adom/kicad-board-audit 1.0.1 · ah 1.0.772 · Hydrogen local workspace (WSL2, Ubuntu 24.04.4) on Windows 11

What I did

adom-wiki pkg install adom/kicad-board-audit

What I expected

The skill in ~/.claude/skills/kicad-board-audit/ with the files from the tarball.

What happened

The install reports success and adom-wiki pkg verify adom/kicad-board-audit passes, but three files are empty: in the package folder, in ~/.claude/skills and in the ~/.codex/skills mirror.

File In the tarball After install
SKILL.md 6706 bytes 0 bytes
docs/HERO.md 640 bytes 0 bytes
assets/kicad_netlist.py 3565 bytes 0 bytes
README.md, package.json, install.sh, uninstall.sh 2028, 1571, 245, 84 bytes unchanged

The output:

installed: ~/.claude/skills/kicad-board-audit -> /home/adom/project/adom_modules/adom/kicad-board-audit
1 package(s) installed. (run: adom-wiki pkg list)
hint [SKILLS_DELIVERED]: adom/kicad-board-audit installed 1 skill(s) to ~/.claude/skills: kicad-board-audit
hint [SKILLS_ADOPTED]: 1 skill(s) were already in place byte-identical (the package's install script put them there); recorded as delivered so upgrades and uninstall manage them: kicad-board-audit
hint [SKILLS_MIRRORED_CODEX]: 1 skill(s) mirrored to ~/.codex/skills (Codex reads the same SKILL.md format; the ~/.claude tree stays canonical)

The skill then loads with no instructions, and its netlist script is empty. It happened on the first install and again on a clean pkg uninstall and pkg install.

Cause, as far as I can tell

  1. The package's install.sh links the skill folder to the package folder: ln -sfn "$PWD" "$HOME/.claude/skills/kicad-board-audit".
  2. Skill delivery then copies the skill's files (SKILL.md, docs/, assets/) from the package folder to ~/.claude/skills/kicad-board-audit/. Through the link, source and destination are the same file, so opening the destination for writing empties the source before it is read.
  3. SKILLS_ADOPTED then finds the files "byte-identical". They are: each is one empty file compared with itself.

The files that keep their content are the ones outside SKILL.md, docs/ and assets/, which fits.

Without the script the install is correct: after adom-wiki pkg install --ignore-scripts adom/kicad-board-audit, the three files have 6706, 640 and 3565 bytes in all three places, and ~/.claude/skills/kicad-board-audit is a real folder.

Suggested fix

  • In skill delivery, skip the copy when source and destination resolve to the same file (canonical path, or device and inode), or write to a temporary file and rename it.
  • adom/kicad-board-audit 1.0.1 can drop install.sh and uninstall.sh, since the CLI delivers the skill itself.
  • I have not looked for other packages whose install script links their folder into ~/.claude/skills; they would presumably lose their files the same way. A publish lint could catch that.

I filed this here because the files are emptied by the CLI. The package that triggers it, adom/kicad-board-audit, has no issue for it.

1 Reply

Colby Knox marked this in progress ·
Colby Knox ·

Thanks for the exact diagnosis. It was right on every point.

CLI: fixed in adom-wiki 1.8.34 (now latest).

  • A skill folder that is a symlink is removed (the link, never what it points at) and delivered as a real folder. A new hint, SKILL_LINK_REPLACED, says so.
  • A copy onto the same file is skipped, so no link can empty a file again.
  • Reproduced in a scratch home with kicad-board-audit 1.0.1: 1.8.33 leaves 0-byte files behind a link; 1.8.34 leaves 6706 / 640 / 3565 bytes in a real folder.

The package: adom/kicad-board-audit 1.0.3. A skill package still has to ship install.sh, so it keeps one. It now only removes the link 1.0.1 left behind, which matters because CLIs before 1.8.34 wrote through that link again on every update. With the released 1.8.33, updating a machine broken by 1.0.1 to 1.0.3 restores all three files with no other step. A plain adom-wiki pkg install adom/kicad-board-audit picks it up.

pkg verify passing was expected but misleading: it checks the published tarball, not the installed files. The wiki thread has a handoff for a publish lint that flags install scripts linking into ~/.claude/skills.

Colby Knox closed this ·

Log in to reply.