Imported from mingo023/hunkr.nvim (
skills/hunkr/SKILL.md). Install upstream withnpx skills add mingo023/hunkr.nvim --skill hunkr. Copyright stays with the author.
hunkr review loop
You are the other half of a review conversation. The reviewer comments on lines in Neovim; you fix the code and reply on the same thread; they read your reply in the editor and comment again. Keep the loop tight — this is a conversation, not a report.
The review file
hunkr always passes an absolute path, under /tmp/hunkr/. Shape:
{
"version": 1,
"repo": "/Users/me/project",
"base": "HEAD",
"nvim": {
"servername": "/var/folders/.../nvim.15994.0",
"notify": "nvim --server <servername> --remote-expr \"v:lua.require('hunkr').reload()\""
},
"threads": [
{
"id": "t1",
"path": "lua/hunkr/ui.lua",
"side": "new",
"line": 112,
"anchor": " if vim.v.virtnum ~= 0 then",
"status": "open",
"messages": [{ "author": "me", "text": "this breaks on wrapped lines" }]
}
]
}
side: "new"→lineis in the working tree file.side: "old"→lineis ingit show <base>:<path>; the reviewer is pointing at deleted code.baseis what the review is diffed against —"HEAD"for uncommitted work, or a branch like"main", in which case the old side isgit merge-base main HEAD.anchoris the exact text of that line when the comment was written. Use it to confirm you are looking at the right place — iflineandanchordisagree, trustanchor.- Optional
end_line/end_anchor: the comment covers the whole rangeline..end_line, not a single line. Absent means one line. status:openneeds your attention,answeredis waiting on the reviewer,resolvedis done.
What to do
- Read the review file at the given path.
- For every thread with
status: "open", read the code atpath:line(or the rangeline..end_linewhen present), take the last message inmessagesas the instruction, and act on it. If the comment is a question rather than a change request, answer it without touching the code. - Reply on the thread: append
{"author": "claude", "text": "..."}tomessagesand set"status": "answered". Keep replies to one or two sentences — say what you changed, or why you didn't. Push back if the request is wrong; this is a dialogue. - Re-anchor every thread you disturbed. You know exactly which lines you added and
removed, so recompute
lineand refreshanchor— plusend_line/end_anchorwhere present — for everyside: "new"thread in a file you edited, including threads you did not answer. This is the step that keeps the reviewer's comments pinned to the right code; skipping it silently misplaces them. - Notify Neovim by running the command in
nvim.notifyverbatim. It repaints the review with your replies. Ignore its output.
Write the review file back with the same 2-space-indented JSON shape. Never drop or
reorder threads, never edit a "me" message, never delete resolved threads.
Then stop
Do not start a new task, do not summarize the session, do not ask what's next. The
reviewer will comment again in Neovim and send you another /hunkr. Reply in the
conversation with one line per thread you touched, nothing more.