feat(cli): help agents keep Hunk skills in sync#190
Conversation
Greptile SummaryThis PR adds The implementation is clean and well-tested. All three delivery paths (source layout via Confidence Score: 5/5Safe to merge — all remaining findings are P2 style suggestions. The feature is well-scoped and thoroughly tested across source, npm, and compiled binary layouts. The skill path resolution, version-change notice, and prebuilt smoke tests all look correct. The only finding is a minor inconsistency in the CJS wrapper's lack of an existence guard, which won't cause real-world failures because the skill file is verified to be present in the package via check-prebuilt-pack. bin/hunk.cjs — minor existence-check inconsistency in the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["hunk skill path"] --> B{via bin/hunk.cjs?}
B -- Yes --> C["bundledSkillPath()\npath.join(__dirname, '..', 'skills/hunk-review/SKILL.md')"]
C --> D["stdout.write + exit(0)"]
B -- No --> E["parseCli → parseSkillCommand"]
E --> F["renderHunkReviewSkillPath()"]
F --> G["resolveBundledHunkReviewSkillPath()"]
G --> H{searchRoots}
H --> I["import.meta.dir\n(source / npm bundle)"]
H --> J["process.execPath\n(compiled binary)"]
I --> K["findRelativePathFromAncestors\nwalk up ancestors"]
J --> K
K --> L{found?}
L -- Yes --> M["return path → help output"]
L -- No --> N["throw 'Could not locate...'"]
subgraph Version Change Notice
O["resolveStartupUpdateNotice"] --> P{HUNK_DISABLE_UPDATE_NOTICE=1?}
P -- Yes --> Q["return null"]
P -- No --> R["resolveStartupSkillRefreshNotice"]
R --> S{version changed?}
S -- No / first run --> T["fetch npm dist-tags → update notice or null"]
S -- Yes --> U["return skill:VERSION notice\nskip npm fetch"]
end
Reviews (1): Last reviewed commit: "feat(cli): help agents keep Hunk skills ..." | Re-trigger Greptile |
Summary
hunk skill pathso agents can resolve the bundled Hunk review skill from source and installed packageshunk skill pathTesting
bun run typecheckbun test src/core/cli.test.ts src/core/updateNotice.test.ts src/core/paths.test.ts test/cli/entrypoint.test.tsbun run build:prebuilt:npmbun run check:prebuilt-packbun run smoke:prebuilt-installThis PR description was generated by Pi using OpenAI o3