From 23deafb18fa19c42ff0f3e0c45fdb29c4e4e9be1 Mon Sep 17 00:00:00 2001 From: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com> Date: Thu, 22 Oct 2026 02:54:49 -0700 Subject: [PATCH] fix(skills): fall back to hunk skill path in pointer skills Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com> --- .agents/skills/hunk-extensions/SKILL.md | 6 ++++++ .agents/skills/hunk-review/SKILL.md | 6 ++++++ .changeset/skill-pointer-path-fallback.md | 5 +++++ scripts/generate/skillPointer.test.ts | 1 + scripts/generate/skillPointer.ts | 6 ++++++ website/src/content/docs/docs/agents/review-skill.md | 2 +- 6 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .changeset/skill-pointer-path-fallback.md diff --git a/.agents/skills/hunk-extensions/SKILL.md b/.agents/skills/hunk-extensions/SKILL.md index 43011d353..8b7116801 100644 --- a/.agents/skills/hunk-extensions/SKILL.md +++ b/.agents/skills/hunk-extensions/SKILL.md @@ -15,4 +15,10 @@ Before anything else, load them and follow them: hunk skill show hunk-extensions ``` +Hunk versions before 0.24 do not have `hunk skill show`. If it fails, print the bundled skill's path instead, then read that file and follow it: + +```bash +hunk skill path hunk-extensions +``` + If `hunk` is not on PATH, ask the user to install Hunk first: https://hunk.dev/docs/start/install/ diff --git a/.agents/skills/hunk-review/SKILL.md b/.agents/skills/hunk-review/SKILL.md index 05d067396..9a0227990 100644 --- a/.agents/skills/hunk-review/SKILL.md +++ b/.agents/skills/hunk-review/SKILL.md @@ -15,4 +15,10 @@ Before anything else, load them and follow them: hunk skill show hunk-review ``` +Hunk versions before 0.24 do not have `hunk skill show`. If it fails, print the bundled skill's path instead, then read that file and follow it: + +```bash +hunk skill path hunk-review +``` + If `hunk` is not on PATH, ask the user to install Hunk first: https://hunk.dev/docs/start/install/ diff --git a/.changeset/skill-pointer-path-fallback.md b/.changeset/skill-pointer-path-fallback.md new file mode 100644 index 000000000..1da932b0b --- /dev/null +++ b/.changeset/skill-pointer-path-fallback.md @@ -0,0 +1,5 @@ +--- +"hunkdiff": patch +--- + +Pointer skills installed with `npx skills add modem-dev/hunk` now fall back to `hunk skill path` when the installed Hunk predates `hunk skill show`. diff --git a/scripts/generate/skillPointer.test.ts b/scripts/generate/skillPointer.test.ts index f294ebd48..0709c4ac1 100644 --- a/scripts/generate/skillPointer.test.ts +++ b/scripts/generate/skillPointer.test.ts @@ -39,6 +39,7 @@ describe("skill pointers", () => { ); expect(stub).toContain(""); expect(stub).toContain("hunk skill show hunk-review"); + expect(stub).toContain("hunk skill path hunk-review"); expect(stub).not.toContain("Full instructions that must never be copied"); }); diff --git a/scripts/generate/skillPointer.ts b/scripts/generate/skillPointer.ts index db10206f2..de66aa449 100644 --- a/scripts/generate/skillPointer.ts +++ b/scripts/generate/skillPointer.ts @@ -55,6 +55,12 @@ export function renderAgentSkillStub(frontmatter: SkillFrontmatter) { `hunk skill show ${frontmatter.name}`, "```", "", + "Hunk versions before 0.24 do not have `hunk skill show`. If it fails, print the bundled skill's path instead, then read that file and follow it:", + "", + "```bash", + `hunk skill path ${frontmatter.name}`, + "```", + "", "If `hunk` is not on PATH, ask the user to install Hunk first: https://hunk.dev/docs/start/install/", "", ].join("\n"); diff --git a/website/src/content/docs/docs/agents/review-skill.md b/website/src/content/docs/docs/agents/review-skill.md index e81c4a44f..34b920df9 100644 --- a/website/src/content/docs/docs/agents/review-skill.md +++ b/website/src/content/docs/docs/agents/review-skill.md @@ -15,7 +15,7 @@ npx skills add modem-dev/hunk -g --skill hunk-review `-g` installs the skill for your user instead of one project. Add `-a ` (for example `-a claude-code`) to install it for a single agent. -The installed file is a pointer: it tells the agent to run `hunk skill show hunk-review` and follow the output. The instructions therefore come from the Hunk binary on your `PATH` and stay in step with it after every upgrade; you don't need to reinstall the skill. +The installed file is a pointer: it tells the agent to run `hunk skill show hunk-review` and follow the output. Hunk versions before 0.24 lack `hunk skill show`, so the pointer falls back to reading the file printed by `hunk skill path hunk-review`. The instructions therefore come from the Hunk binary on your `PATH` and stay in step with it after every upgrade; you don't need to reinstall the skill. ## Load it without the skills CLI