Interactive Code Review
Run a structured, interactive review session that presents changes in small, readable chunks and waits for the human to approve, reject, or chat before moving on.
Framework
Structured Walkthrough: author intent is surfaced first, then the reviewer probes for risks, gaps, and misunderstandings. Established software quality practice (IEEE 1028) for defect detection and shared understanding.
Workflow
Confirm target and intent.
- Ask for the diff source if unclear (branch range, file paths, or patch).
- Clarify what "good" looks like (correctness, style, performance, risk).
Gather material.
- For code:
git status -sb, git diff --stat, then git diff <base>...<head>.
- For documents: ask for the text, sections, or relevant excerpt.
Chunk the review.
- File-by-file, then hunk-by-hunk within each file.
- Target 40–120 lines per chunk. Split large hunks.
- Order: module boundaries (entry points, public interfaces) first, then internals, finally tests.
- For prose: split by headings or logical paragraphs.
Present each chunk with the standard template. Pause for explicit response.
Handle responses.
- Approve: mark approved, continue.
- Reject: explain issue, propose concrete edit, confirm before changing files.
- Chat: answer questions, show context. Re-prompt with same actions. Chat loops until user gives approve/reject/skip.
- Skip: mark for later, continue.
- Done: end review immediately, show summary.
- Jump [file]: skip to specific file.
Wrap up with summary.
- List approved, rejected, skipped chunks.
- Offer to apply edits or re-run on updated diffs.
Actions
| Action |
Aliases |
Effect |
| approve |
ok, lgtm, yes, y, +1 |
Mark approved, continue |
| reject |
no, fix, change, -1 |
Explain issue, propose edit |
| chat |
?, context, explain, why |
More context, re-prompt |
| skip |
later, defer |
Mark for later, continue |
| done |
stop, abort |
End review, show summary |
| jump [file] |
go [file] |
Skip to specific file |
Chunk Template
Review chunk [i/N]
File: <path>
Summary: <1–2 lines>
<diff snippet>
Action? (approve / reject / chat / skip / done)
Progress Indicator
After every 5 chunks or on request:
Progress: [====------] 4/10 | 2 approved | 1 rejected | 1 skipped
Reviewer Conduct
- Verify before asserting or applying edits.
- Ask clarifying questions when feedback or intent is unclear.
- Avoid performative agreement; focus on evidence and fixes.
- Keep tone neutral and concise; avoid rewriting unless requested.
Review Heuristics
- Flag correctness risks, security issues, breaking changes, and missing tests first.
- At module boundaries: verify the contract (inputs/outputs) is preserved.
- For legacy code: check if change increases or decreases testability.
- For text: flag unclear intent, inconsistencies, missing context.
- If rejecting, include: issue, why it matters, and a concrete fix.
Deep Review Mode
If user asks for full assessment (e.g., "production readiness"):
Strengths
[What's well done.]
Issues
Critical (Must Fix)
[Bugs, security, data loss risks]
Important (Should Fix)
[Design gaps, missing requirements, test gaps]
Minor (Nice to Have)
[Nitpicks, optimizations, docs]
Recommendations
[Concise improvements]
Assessment
Ready to merge? [Yes/No/With fixes] (X-Y% confident)
Key assumptions: [List 2-3 assumptions behind assessment]
Reasoning: [1-2 sentences]
Integration
- Before claiming review complete: run
hope:gate checklist
- If rejection reveals systemic issue: suggest
hope:trace for root cause
- For security-focused reviews: reference
soul/references/differential-review.md
Safety
- Do not stage, commit, or modify files unless user explicitly asks.
- Maximum: 20 files or 2000 lines of diff per session. Larger reviews: split by directory.
- Binary files: skip with note "Binary file, review manually"
- Merge conflicts: pause and ask user to resolve first
1---2name: interactive-code-review-23description: Human-in-the-loop code review with chunk-by-chunk approve/reject/chat loop (git add -p style). Use when reviewing PRs, diffs, patches, or documents interactively. Triggers on "review my PR", "walk through changes", "interactive review".4---56# Interactive Code Review78Run a structured, interactive review session that presents changes in small, readable chunks and waits for the human to approve, reject, or chat before moving on.910## Framework1112Structured Walkthrough: author intent is surfaced first, then the reviewer probes for risks, gaps, and misunderstandings. Established software quality practice (IEEE 1028) for defect detection and shared understanding.1314## Workflow15161. **Confirm target and intent.**17 - Ask for the diff source if unclear (branch range, file paths, or patch).18 - Clarify what "good" looks like (correctness, style, performance, risk).19202. **Gather material.**21 - For code: `git status -sb`, `git diff --stat`, then `git diff <base>...<head>`.22 - For documents: ask for the text, sections, or relevant excerpt.23243. **Chunk the review.**25 - File-by-file, then hunk-by-hunk within each file.26 - Target 40–120 lines per chunk. Split large hunks.27 - Order: module boundaries (entry points, public interfaces) first, then internals, finally tests.28 - For prose: split by headings or logical paragraphs.29304. **Present each chunk** with the standard template. Pause for explicit response.31325. **Handle responses.**33 - **Approve**: mark approved, continue.34 - **Reject**: explain issue, propose concrete edit, confirm before changing files.35 - **Chat**: answer questions, show context. Re-prompt with same actions. Chat loops until user gives approve/reject/skip.36 - **Skip**: mark for later, continue.37 - **Done**: end review immediately, show summary.38 - **Jump [file]**: skip to specific file.39406. **Wrap up with summary.**41 - List approved, rejected, skipped chunks.42 - Offer to apply edits or re-run on updated diffs.4344## Actions4546| Action | Aliases | Effect |47|--------|---------|--------|48| approve | ok, lgtm, yes, y, +1 | Mark approved, continue |49| reject | no, fix, change, -1 | Explain issue, propose edit |50| chat | ?, context, explain, why | More context, re-prompt |51| skip | later, defer | Mark for later, continue |52| done | stop, abort | End review, show summary |53| jump [file] | go [file] | Skip to specific file |5455## Chunk Template5657```58Review chunk [i/N]59File: <path>60Summary: <1–2 lines>6162<diff snippet>6364Action? (approve / reject / chat / skip / done)65```6667## Progress Indicator6869After every 5 chunks or on request:70```71Progress: [====------] 4/10 | 2 approved | 1 rejected | 1 skipped72```7374## Reviewer Conduct7576- Verify before asserting or applying edits.77- Ask clarifying questions when feedback or intent is unclear.78- Avoid performative agreement; focus on evidence and fixes.79- Keep tone neutral and concise; avoid rewriting unless requested.8081## Review Heuristics8283- Flag correctness risks, security issues, breaking changes, and missing tests first.84- At module boundaries: verify the contract (inputs/outputs) is preserved.85- For legacy code: check if change increases or decreases testability.86- For text: flag unclear intent, inconsistencies, missing context.87- If rejecting, include: issue, why it matters, and a concrete fix.8889## Deep Review Mode9091If user asks for full assessment (e.g., "production readiness"):9293### Strengths94[What's well done.]9596### Issues9798#### Critical (Must Fix)99[Bugs, security, data loss risks]100101#### Important (Should Fix)102[Design gaps, missing requirements, test gaps]103104#### Minor (Nice to Have)105[Nitpicks, optimizations, docs]106107### Recommendations108[Concise improvements]109110### Assessment111112**Ready to merge?** [Yes/No/With fixes] (X-Y% confident)113114**Key assumptions:** [List 2-3 assumptions behind assessment]115116**Reasoning:** [1-2 sentences]117118## Integration119120- Before claiming review complete: run `hope:gate` checklist121- If rejection reveals systemic issue: suggest `hope:trace` for root cause122- For security-focused reviews: reference `soul/references/differential-review.md`123124## Safety125126- Do not stage, commit, or modify files unless user explicitly asks.127- Maximum: 20 files or 2000 lines of diff per session. Larger reviews: split by directory.128- Binary files: skip with note "Binary file, review manually"129- Merge conflicts: pause and ask user to resolve first