Repository navigation
fix(patchy): the Patchy skill survives a Node version change - #673
Conversation
GPT 6.1 Sol review (xhigh), round 1
Rulings on the flagged points:
Completeness: the required mirrors are covered—CLI help/output, README, ADR-0004, glossary, skill distribution, Repo standards: no additional Effect or simplicity findings; no rendered HTML/CSS changes. Tests: focused and would catch the original prefix-deletion bug, reference copying, and retired-file pruning. Swap/rollback failure coverage is missing. Tests were reviewed statically, not run. Public hygiene: clean diff and PR body; only generic documented home/tmp paths. NOT READY — failed rollback can delete the last good skill copy. |
11b4956 to
f1f43de
Compare
GPT 6.1 Sol review (xhigh), round 2No blocker, should-fix, or nit findings in the full diff at
NOT READY — code review is clean, but latest-head CI is still running. |
patchy setup now copies the bundled skill to ~/.patchy/skills/patchy and links both agent paths to that copy, so removing the Node version (and npm prefix) that installed the CLI no longer takes the skill with it. Each setup swaps a fresh copy in whole; setup --remove removes the copy too. The skill says to reinstall from the named instance, else the saved apiUrl. Co-Authored-By: Claude Opus 5.5 <[email protected]>
If swapping in the new copy fails and the old one cannot be moved back, setup now leaves its staging folder in place and names where the old copy is kept, instead of deleting it. The README now describes the window a killed run leaves and how rerunning setup recovers, and contributors are told to rerun patchy setup after rebuilding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
f1f43de to
32d5950
Compare
… Patchy is smoother (#679) Release 12's What's new entry, written from `b58b899`, ahead of deploying it. `patchy` and `CURRENT_RELEASE` move to `0.12.0`, so CLIs and patch repos installed before this deploy are told to upgrade. | Change | PRs | | --- | --- | | Fixed: Links within a page jump to their section | #677 | | Improved: Set up Patchy however you ask | #672, #674 | | Improved: Claude Code can know Patchy is your company's own | #676 | | Fixed: Your agent remembers Patchy after a Node.js update | #673 | | Fixed: Sign-in codes say how many minutes they have left | #675 | | Behind the scenes: uploaded pages and logos are checked within strict limits | #678 | Made by Claude Opus 5.5 via Claude Code in T3 Code Co-authored-by: Claude Opus 5.5 <[email protected]>
What changed
The installer runs
npm install --global, andpatchy setuplinked~/.agents/skills/patchyand~/.claude/skills/patchyinto the bundled skill inside that npm prefix. Under a per-version Node manager (mise, nvm, fnm, asdf) that prefix belongs to one Node version. Switch away andpatchyleavesPATH. Remove that version and both skill links dangle, so the agent forgets Patchy exists and nothing tells it to reinstall.The fix:
patchy setupcopies the whole bundled skill directory, references included, to~/.patchy/skills/patchyand links both agent paths to that copy. The path comes from the home directory, neverPATCHY_STATE_DIR.~/.patchy/skills/, then swaps it in with two renames. Files the release no longer ships are dropped, and a run that fails mid-copy leaves the old copy whole. If the second rename fails (Windows can briefly lock freshly written files), the old copy is moved back. If that also fails, setup keeps the staging folder and its error says where the old copy is kept. A run killed between the two renames leaves no copy and dangling links until setup or the install line runs again; the README says so.skill_conflict, and so is a file or link at the copy's path. A real directory at the copy's path counts as setup's own, because~/.patchyis Patchy's directory. That avoids a marker file.setup --removeremoves the links first, then the copy, and warns about anything it leaves in place.SKILL.md. Whenpatchyis missing (for example after a Node version change), reinstall from the intended instance: the one the person named, otherwise theapiUrlin the state directory'sconfig.json. Ask where to publish only when neither exists.setup --jsonkeeps its shape.skillnow names the copy'sSKILL.md, which is also what the installer prints asSkill:.Older CLIs: an older CLI's
patchy setupsees links to~/.patchy/skills/patchyas foreign and refuses withskill_conflict. Its message already says to move them aside and rerun. There is no compatibility shim, per the issue.Closes #668
How it was verified
pnpm testpasses locallyAdded or updated tests covering this change
Setup.test.ts:renamethat refuses the copy's path), the old copy is kept and the error names where--removetakes the copy and owned links and leaves foreign entriescli.test.ts,install.test.tsandscripts/packed-cli-e2e.mjsnow expect the copy as the link target andskillpath. The installer test also deletes the npm prefix after installing and checks that the skill still reads through~/.claude/skills/patchy.Round 1 fixes (keep the backup when the rollback fails, README crash window, contributors rerun setup after rebuilding):
pnpm checkand the touched suites pass. The full verify below ran on the first commit; the fixes only touchSetup.ts, its test and docs.flock /tmp/patchy-heavy-suite.lock pnpm verifyon the first commit: format, lint, typecheck, synth, test, postgres-concurrency, cli-smoke (including the/llms.txtfront-door install on a clean HOME), tier2-smoke and browser all pass.Windows is reasoned, not tested (CI is Linux-only, and the installer tests skip Windows). Junction targets are the absolute copy path. A junction is "current" by its resolved target or by
realpath.rename,cpandrmwork on directories there.Hit every surface
setup --jsonkeeps its shape; onlyskill's value moved. The/llms.txtsentence inFrontDoor.tsnow says the installer copies the skill to~/.patchy/skills/patchyand links that copy.patchy setupbehaviour changed, so thepackages/patchy/README.mdsetup section, installer paragraph and contributor build note, ADR-0004's setup row and paragraph, the globalSKILL.md, and theskills-lock.jsonhash were all updated. The--removeflag's help text and the command description were updated too. Exit codes are unchanged.scripts/devdoes not run setup.Setupentry inpackages/patchy/GLOSSARY.mdanddocs/SKILL_DISTRIBUTION.md.docs/product.mddoes not describe the link target. ADR-0004 was updated, not contradicted.setup --removeremoves the new copy as well as the links.Release impact
Upgrading runs the new setup, which replaces the old links into the npm prefix. The one case that needs action is running an older release's setup after this one, which refuses with
skill_conflictand says how to proceed.Made by Claude Opus 5.5 via Claude Code in T3 Code