From 8518f955acb8687fd3284bbf2d6ed6dcc4a3f01a Mon Sep 17 00:00:00 2001 From: "Fredrik Liljegren (Claude Code Claude Opus 5)" Date: Fri, 21 Aug 2026 13:52:26 +0200 Subject: [PATCH] fix(scripts): make the dev skills sync opt-in A build wrote diffity-dev-* into ~/.claude/skills every time, which is how it came to delete unrelated skills in the first place. The dev variants drive the diffity-dev binary from a local checkout, which most builds do not want, and installing them alongside the plain skills gives an agent two candidates with identical descriptions. DIFFITY_SYNC_DEV_SKILLS=1 opts back in. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs --- README.md | 1 + bin/diffity | 1 + scripts/build-skills.ts | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 120000 bin/diffity diff --git a/README.md b/README.md index 05fdaaf..040f2a6 100644 --- a/README.md +++ b/README.md @@ -244,6 +244,7 @@ diffity list --json # machine-readable output | `DIFFITY_HOST` | Hostname used in the printed URL (default: `localhost`). | | `DIFFITY_BIND` | Interface the server listens on (default: `127.0.0.1`). | | `DIFFITY_DATA_DIR` | Where review notes are kept (default: `~/.diffity/`). | +| `DIFFITY_SYNC_DEV_SKILLS` | Set to `1` to have a build install the `diffity-dev-*` skills into `~/.claude/skills`. | Useful when running diffity inside a VM or container and opening it from another machine: diff --git a/bin/diffity b/bin/diffity new file mode 120000 index 0000000..67c6055 --- /dev/null +++ b/bin/diffity @@ -0,0 +1 @@ +../lib/node_modules/diffity/dist/index.js \ No newline at end of file diff --git a/scripts/build-skills.ts b/scripts/build-skills.ts index 141ec07..7bbf104 100644 --- a/scripts/build-skills.ts +++ b/scripts/build-skills.ts @@ -30,8 +30,10 @@ writeFile( ); console.log(`Skills hash: ${skillsHash}`); -if (process.env.DIFFITY_SKIP_DEV_SKILLS || !homeDir) { - console.log('Skipped dev skills sync'); +// Opt-in: a build should not write into the user's home directory unless asked. The dev skills +// exist to drive the `diffity-dev` binary from this checkout, which is not what most builds want. +if (!process.env.DIFFITY_SYNC_DEV_SKILLS || !homeDir) { + console.log('Skipped dev skills sync (set DIFFITY_SYNC_DEV_SKILLS=1 to install them)'); } else { cleanManagedSkills(globalClaudeSkillsDir, DEV_SKILL_PREFIX); for (const skill of skills) {