docs: add a worktrees-pnpm skill - #67
Conversation
Worktrees get their own empty node_modules, and every worktree problem in this repo follows from that: lint-staged shells out to prettier and eslint from node_modules/.bin, so `git commit` fails; every pnpm script fails; openspec isn't on PATH here. A missing prettier already cost an agent an hour of workarounds. Note pnpm has no worktree subcommand — pnpm's docs use plain `git worktree`, and `worktree:new` is a script in pnpm's own repo, not a feature. So the rule is not "use a different command", it's that `git worktree add` isn't finished until `pnpm install` has run in it. enableGlobalVirtualStore (pnpm >= 10.12.1; we run 10.12.4) is what makes that install nearly instant, but it's documented as not working with ESM under hoisted dependencies and this repo is ESM. Recorded as an opt-in to evaluate separately rather than switched on blind. CLAUDE.md now points at the skill instead of carrying a second copy. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDv57zHq7abms3RReSQw6q
|
@claude /review |
|
Claude finished @thecodedrift's task in 1m 50s —— View job Review:
|
A git worktree gets its own empty
node_modules, and everything that goes wrong in a worktree here follows from that.lint-stagedshells out toprettierandeslintfromnode_modules/.bin, sogit commitfails at the worst possible moment — after the work is done. Everypnpmscript fails too, andopenspecisn't onPATHin this repo. A missingprettieralready cost an agent about an hour of dead-end workarounds.This adds a
worktrees-pnpmskill so the next person or agent gets the procedure instead of rediscovering the failure, and reduces theCLAUDE.mdsection to a pointer plus the two rules that do the most damage when missed.There is no
pnpm worktreecommand, which is the thing worth checking me on. pnpm's git worktrees page uses plaingit worktree add; thepnpm worktree:newit mentions is a helper script in pnpm's own repository, not a pnpm feature. So the rule isn't "use a different command" — it's thatgit worktree addis not finished untilpnpm installhas run inside the new worktree.What pnpm does contribute is
enableGlobalVirtualStore: true, which makes that install nearly instant by symlinking into one shared content-addressable store. It is deliberately not enabled here. pnpm documents it as not working with ESM when hoisted dependencies are used, since Node no longer honoursNODE_PATHin ESM — andpackages/cliis"type": "module". We set no hoisting config, so it's likely fine, but flipping a resolution-layer switch for the whole workspace deserves its own change with the full suite as the check. Version isn't the blocker: it needs pnpm ≥ 10.12.1 and we run 10.12.4. The skill records this as an opt-in to evaluate, so it's a decision rather than an oversight.The skill also absorbs the background-agent delegation rules, cleanup, recovery when the main checkout gets switched onto an agent's branch, and a short note that sequential branch work is usually cheaper with plain
git checkoutthan with a worktree..agents/skills/is this repo's internal agent tooling, alongsideiterate-prand theopenspec-*skills — not theskills/taskless/tree that ships to users. Nothing here reaches the published CLI, henceskip-changeset.