plugins/git-workflow/skills/hunk-review/SKILL.md
This skill should be used when the user asks to "review code with hunk", "start a hunk review session", "add comments to a hunk diff", "annotate a diff with hunk", "use hunk for code review", or when the user mentions the `hunkdiff` CLI tool. Provides structured guidance for interacting with live Hunk diff review sessions via the daemon CLI.
npx skillsauth add talent-factory/claude-plugins hunk-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Adapted from modem-dev/hunk — MIT License
Hunk is an interactive terminal diff viewer designed for reviewing code changes, particularly
AI-generated ones. This skill controls live Hunk review sessions through the daemon CLI
(hunk session, hunk comment). Hunk itself runs as an interactive TUI — do not launch it
directly; interact with an already-running session instead.
Installation:
npm i -g hunkdiff
Prerequisite: A Hunk session must already be running (hunk diff, hunk show, or hunk difftool).
Follow this structured sequence for every review:
hunk session list
Returns all active sessions. Note the session ID or repository path — both can be used to target sessions in subsequent commands.
Most session commands accept either:
--repo <path> — match by repository root directory<session-id> — explicit session identifierhunk session review --json
Returns the full file and hunk structure as JSON without loading raw patch text. Use this to understand the shape of the diff before navigating.
Add --include-patch only when examining actual diff content is essential:
hunk session review --json --include-patch
Absolute navigation requires --file plus exactly one position target. Hunk indices are zero-based — the first hunk in a file is --hunk 0.
# Jump to a specific hunk index
hunk session navigate --file src/main.py --hunk 2
# Jump to a line in the new version
hunk session navigate --file src/main.py --new-line 42
# Jump to a line in the original version
hunk session navigate --file src/main.py --old-line 17
Relative navigation moves between already-annotated hunks:
hunk session navigate --next-comment
hunk session navigate --prev-comment
Always navigate before adding a comment — this ensures the user sees the relevant code in the Hunk UI at the time the annotation appears.
Swap the diff content of a running session:
hunk session reload --repo . -- <command>
Note: Reloading replaces the session's diff content. Any comments attached to the previous diff are not preserved — re-apply them after reload using hunk comment apply.
Always include -- before the nested command so its flags are not parsed by Hunk:
# Reload with the latest git diff
hunk session reload --repo . -- git diff HEAD
# Reload with a specific commit
hunk session reload --repo . -- git show abc1234
Single comment:
hunk comment add --file src/main.py --hunk 2 "Clarify the intent of this guard clause."
Batch comments (preferred for multiple annotations):
Pipe a JSON array to comment apply via stdin:
hunk comment apply --repo . <<'EOF'
[
{
"file": "src/auth.ts",
"hunk": 1,
"body": "This token is never invalidated on logout — potential session fixation risk."
},
{
"file": "src/auth.ts",
"hunk": 3,
"body": "Prefer `crypto.timingSafeEqual` to avoid timing attacks."
}
]
EOF
Avoid annotating every change. Focus on:
Navigate through the diff in the order a reviewer would read it — typically top to bottom within each file, critical files first — rather than strict alphabetical file order.
Prepare all comments for a file or section before calling comment apply.
Batching reduces CLI round-trips and produces a coherent annotation set.
Do not call --include-patch unless examining the actual diff text is necessary.
The JSON structure from hunk session review --json is sufficient for navigation
and batch-comment planning in most cases.
# Start Hunk (user runs this in a separate terminal)
hunk diff HEAD~1
# In this session: list and inspect
hunk session list
hunk session review --json
# Navigate and annotate
hunk session navigate --file src/api.py --hunk 0
hunk comment add --file src/api.py --hunk 0 "Missing input validation before DB write."
# Fetch PR diff and load into Hunk (user runs this)
gh pr diff 42 | hunk diff -
# Reload after new commits are pushed
hunk session reload --repo . -- gh pr diff 42
# Inspect structure
hunk session review --json | jq '.files[].name'
# Prepare comments, then apply all at once
hunk comment apply --repo . < review-comments.json
| Symptom | Likely Cause | Fix |
|---|---|---|
| no session found | No Hunk session running | Start Hunk in a separate terminal first |
| Navigation has no effect | Wrong --file path | Check exact path with hunk session review --json |
| -- missing error | Nested command flags parsed by Hunk | Add -- before the nested command |
| Comments not visible | Session was reloaded after commenting | Re-apply comments after reload |
documentation
Creates comprehensive handoff documentation before a /compact operation, enabling a new agent with fresh context to seamlessly continue the work. Activate when the user says "prepare a handoff", "document before compact", "context is getting too large", "I need to hand this off", "create a handoff document", "end of session notes", or "document the current state for tomorrow". Supports --output and --linear-issue options.
documentation
Collects completed tasks, GitHub activity, calendar meetings, wiki learnings, and Linear progress for the past week, then writes a structured retrospective to the Obsidian vault. Activate when the user runs "/weekly-review", asks "what did I accomplish this week", "weekly retrospective", "summarise my week", or "prepare weekly review". Works from any directory.
development
Produces a prioritised daily briefing by aggregating tasks from Obsidian TaskNotes, Google Calendar, Gmail, Linear, and GitHub, then writes the result to today's daily note in the Obsidian vault. Activate when the user runs "/today", asks "what's on my plate today", "give me my daily briefing", "what do I need to do today", or "morning briefing". Works from any directory without requiring Obsidian to be running.
tools
Provides a quick status snapshot of all GitHub repositories in a configured organisation — active, dormant, stalled — plus open pull requests and issues. Terminal output only, optimised for speed. Activate when the user runs "/project-pulse", asks "what is the status of my GitHub projects", "show me my repos", "which projects are active", "project overview", "GitHub pulse", or "what is happening in [org]". Works from any directory.