You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/hunk-review/SKILL.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
2
name: hunk-review
3
-
description: Use when the task involves Hunk or Hunk MCP review sessions. Helps Pi briefly explain what Hunk is, prefer live Hunk MCP inspection over shell parsing, inspect current review focus, navigate hunks, and leave inline review comments.
3
+
description: Use when the task involves Hunk review sessions. Helps Pi briefly explain what Hunk is, prefer live Hunk session CLI inspection over shell parsing, inspect current review focus, navigate hunks, and leave inline review comments.
4
4
compatibility: Requires Hunk from this repo or the published hunkdiff package. Works best with a real TTY for interactive review.
5
5
---
6
6
7
7
# Hunk Review
8
8
9
9
Use this skill when working with Hunk itself or when the user wants a code-review workflow centered on Hunk.
10
10
11
-
When this skill activates, start by briefly explaining what Hunk is in plain language before jumping into MCP details.
11
+
When this skill activates, start by briefly explaining what Hunk is in plain language before jumping into session-control details.
12
12
13
13
## What Hunk is
14
14
@@ -21,42 +21,42 @@ Keep these product rules in mind:
21
21
-`[` and `]` navigate hunks across the full review stream
22
22
- agent notes belong beside the code they explain
23
23
24
-
## Default rule: prefer live MCP review
24
+
## Default rule: prefer live session CLI review
25
25
26
-
If a live Hunk session already exists, prefer Hunk's MCP tools over launching new shell commands or scraping terminal output.
26
+
If a live Hunk session already exists, prefer `hunk session ...` over launching new shell commands that scrape terminal output.
27
27
28
-
The MCP daemon is local-only and brokers commands to one or more live Hunk sessions.
28
+
The local Hunk daemon is loopback-only by default and brokers commands to one or more live Hunk sessions.
29
29
30
30
Important behavior:
31
31
- normal Hunk sessions auto-start and register with the daemon when MCP is enabled
32
-
-`hunk mcp serve` exists for manual startup or debugging
33
-
-`HUNK_MCP_DISABLE=1` disables MCP registration for a session
32
+
-`hunk mcp serve` exists for manual startup or debugging, but it is not the default review path
33
+
-`HUNK_MCP_DISABLE=1` disables daemon registration for a session
34
34
- one daemon can serve many Hunk sessions
35
35
36
-
## Recommended MCP review loop
36
+
## Recommended review loop
37
37
38
38
Use this flow by default:
39
-
1.`list_sessions`
40
-
2.`get_selected_context`
41
-
3.`navigate_to_hunk` only if the current focus is wrong
42
-
4.`comment`
39
+
1.`hunk session list`
40
+
2.`hunk session context`
41
+
3.`hunk session navigate` only if the current focus is wrong
42
+
4.`hunk session comment add`
43
43
44
-
Use `get_session` only when you need broader session metadata.
44
+
Use `hunk session get` only when you need broader session metadata.
45
45
46
46
Guidelines:
47
47
- if multiple sessions are live, pass `sessionId` explicitly
48
-
- prefer `get_selected_context` before navigating blindly
49
-
- use `navigate_to_hunk` for hunk-level movement; do not invent extra remote-control behavior
50
-
- use `comment` for concise inline review notes tied to real diff lines
51
-
- prefer `reveal: true` unless the user wants a quieter action
48
+
- prefer `hunk session context` before navigating blindly
49
+
- use `hunk session navigate` for hunk-level movement; do not invent extra remote-control behavior
50
+
- use `hunk session comment add` for concise inline review notes tied to real diff lines
51
+
- prefer visible, review-oriented actions over shell parsing of rendered terminal output
52
52
53
-
For concrete MCP tool behavior and examples, read [references/mcp-review.md](references/mcp-review.md).
53
+
For concrete review flow examples, read [references/mcp-review.md](references/mcp-review.md).
54
54
55
55
## Start Hunk only when needed
56
56
57
-
If no live Hunk session exists and the user wants an interactive review UI, launch Hunk itself with a minimal command and let it auto-start/register with the MCP daemon.
57
+
If no live Hunk session exists and the user wants an interactive review UI, launch Hunk itself with a minimal command and let it auto-start/register with the daemon.
58
58
59
-
After launching Hunk, go back to `list_sessions` rather than suggesting manual daemon management.
59
+
After launching Hunk, go back to `hunk session list` rather than suggesting manual daemon management.
60
60
61
61
Inside the Hunk repo, prefer the source entrypoint:
62
62
@@ -87,7 +87,7 @@ When using Hunk for agent changes:
87
87
Prefer a skill over a prompt dump:
88
88
- keep always-loaded context small
89
89
- load the full Hunk workflow only when the task is actually about review
90
-
- use Hunk's existing MCP tools rather than ad hoc shell parsing
90
+
- use Hunk's session CLI rather than a separate agent-facing MCP tool surface
Copy file name to clipboardExpand all lines: skills/hunk-review/references/commands.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Source repo vs installed CLI
4
4
5
-
Launching Hunk normally should auto-start/register the MCP daemon when MCP is enabled, so Pi usually does not need to run `hunk mcp serve` first.
5
+
Launching Hunk normally should auto-start/register the local session daemon when MCP is enabled, so Pi usually does not need to run `hunk mcp serve` first.
6
6
7
7
If Pi is operating inside the Hunk source repo, prefer the source entrypoint so review and validation target the current checkout:
Hunk MCP is a local-only loopback daemon that brokers commands to one or more live Hunk review sessions.
3
+
Hunk uses one local-only loopback daemon to broker commands to one or more live Hunk review sessions.
4
4
5
5
## Daemon model
6
6
@@ -11,34 +11,37 @@ Hunk MCP is a local-only loopback daemon that brokers commands to one or more li
11
11
hunk mcp serve
12
12
```
13
13
14
-
- Disable MCP registration for one Hunk session with:
14
+
- Disable daemon registration for one Hunk session with:
15
15
16
16
```bash
17
17
HUNK_MCP_DISABLE=1 hunk diff
18
18
```
19
19
20
-
## Current tool surface
20
+
## User and agent interface
21
21
22
-
The review-oriented MCP tools are:
23
-
-`list_sessions`
24
-
-`get_session`
25
-
-`get_selected_context`
26
-
-`navigate_to_hunk`
27
-
-`comment`
22
+
The review-oriented interface is `hunk session ...`:
23
+
-`hunk session list`
24
+
-`hunk session get`
25
+
-`hunk session context`
26
+
-`hunk session navigate`
27
+
-`hunk session comment add`
28
+
-`hunk session comment list`
29
+
-`hunk session comment rm`
30
+
-`hunk session comment clear --yes`
28
31
29
-
## Recommended agent flow
32
+
## Recommended review flow
30
33
31
34
### 1. Discover the target session
32
35
33
-
Call `list_sessions` first.
36
+
Run `hunk session list` first.
34
37
35
-
If no session exists but the user wants interactive review, launch Hunk (`hunk diff`, `hunk show`, or the source entrypoint in this repo), then come back and call `list_sessions` again.
38
+
If no session exists but the user wants interactive review, launch Hunk (`hunk diff`, `hunk show`, or the source entrypoint in this repo), then come back and run `hunk session list` again.
36
39
37
-
Use `sessionId`explicitly whenever more than one live session exists.
40
+
Use explicit `sessionId`or `--repo <path>` whenever more than one live session exists.
38
41
39
42
### 2. Inspect current focus
40
43
41
-
Call `get_selected_context` to see:
44
+
Run `hunk session context` to see:
42
45
- current file
43
46
- current hunk index
44
47
- selected hunk old/new ranges
@@ -49,30 +52,28 @@ This is the best way to respect what the human reviewer is already looking at.
49
52
50
53
### 3. Move only when needed
51
54
52
-
If the current focus is wrong, call `navigate_to_hunk` with either:
53
-
-`hunkIndex`, or
54
-
-`side` + `line`
55
+
If the current focus is wrong, run `hunk session navigate` with either:
56
+
-`--hunk <n>`, or
57
+
-`--old-line <n>` / `--new-line <n>`
55
58
56
59
Prefer hunk-level movement over adding broader remote-control actions.
57
60
58
61
### 4. Leave inline review notes
59
62
60
-
Call `comment` with:
61
-
-`sessionId`
62
-
-`filePath`
63
-
-`side`
64
-
-`line`
65
-
-`summary`
66
-
- optional `rationale`
67
-
- optional `author`
68
-
- usually `reveal: true`
63
+
Run `hunk session comment add` with:
64
+
-`<session-id>` or `--repo <path>`
65
+
-`--file`
66
+
-`--old-line` or `--new-line`
67
+
-`--summary`
68
+
- optional `--rationale`
69
+
- optional `--author`
69
70
70
71
Use concise review comments tied to actual diff lines.
71
72
72
73
## Practical guidance for Pi
73
74
74
-
- Prefer MCP tools over scraping terminal text when a live Hunk session already exists.
75
-
- Use `get_session` when you need broad session metadata; use `get_selected_context` for fast focus-aware checks.
75
+
- Prefer `hunk session ...` over scraping terminal text when a live Hunk session already exists.
76
+
- Use `hunk session get` when you need broad session metadata; use `hunk session context` for fast focus-aware checks.
76
77
- In multi-session setups, never assume the sole-session fallback is still safe after new windows open.
77
78
- Keep comments review-oriented rather than conversational.
78
79
- If the user wants silent inspection rather than visible interaction, avoid unnecessary navigation and only comment when asked.
0 commit comments