with one click
reviewdeck
// Split a large PR diff into reviewable sub-patches for easier code review.
// Split a large PR diff into reviewable sub-patches for easier code review.
| name | reviewdeck |
| description | Split a large PR diff into reviewable sub-patches for easier code review. |
| compatibility | Requires Node.js 18+ and npx (or the reviewdeck CLI installed globally). |
| metadata | {"author":"yanzhen","version":"0.5"} |
You help a code reviewer turn a large PR diff into an ordered review deck, then hand it off for human review.
Default posture:
split. Continue into render unless the user explicitly says they only want split output.npx, use npx reviewdeck@^0.5.0 ....Use the cheapest path that already matches the user's situation:
.diff, use it directly.gh pr diff 123 > pr.diff
main, run:git diff main...HEAD > pr.diff
Other common fallbacks:
# Specific PR in another repo
gh pr diff 123 --repo owner/repo > pr.diff
# Between two commits
git diff <commit-a> <commit-b> > pr.diff
# Staged changes
git diff --cached > pr.diff
npx reviewdeck@^0.5.0 index pr.diff
This prints a numbered list of changed lines. Those indices are the units you group in the split metadata.
Before generating split metadata, decide whether the user has already expressed a preferred review flow.
deps-first (recommended): order groups so earlier groups introduce context and dependencies needed by later groups.tests/docs-first: review tests or docs that define expected behavior before the implementation that satisfies them.deps-first.Use tests/docs-first only when tests or docs materially explain the expected behavior. If the tests are trivial or only mirror the implementation, stay with deps-first.
If you need more detail about the patterns or how to choose between them, read references/split.md.
Output a single JSON object:
{
"groups": [
{
"description": "Add version selection plumbing so later upgrade flows have a stable input",
"changes": ["0-2", 5, 6]
}
]
}
Default rules:
deps-first, put prerequisite changes before changes that rely on them when possible.tests/docs-first, put behavior-defining tests or docs before the implementation they explain when that improves reviewability.description should help a reviewer navigate the sequence, not just restate filenames or labels."0-23" over enumerating many individual indices to save tokens.draftComments is optional. Add it only for concrete reviewer-worthy concerns you can already support from the diff.change that belongs to the same group.If you need heavier guidance for grouping, description writing, or draft comment quality, then read references/split.md.
echo '<meta JSON>' | npx reviewdeck@^0.5.0 split pr.diff -
Or write files:
echo '<meta JSON>' | npx reviewdeck@^0.5.0 split pr.diff - -o output/
This validates the metadata, generates sub-patches, and verifies that they compose back to the original diff.
If split fails, read the error, fix the metadata JSON, and retry.
After split succeeds, the default next step is live review:
npx reviewdeck@^0.5.0 render output/
Or from stdin:
echo '<meta JSON>' | npx reviewdeck@^0.5.0 split pr.diff - | npx reviewdeck@^0.5.0 render -
The server opens a browser, blocks until submission, and prints a review submission JSON object to stdout.
Default behavior:
render and wait for submission when the user wants PR review help.comments as the final human-approved payload.draftComments as provenance for which agent drafts were accepted, rejected, or left pending.After render completes:
comments, ask whether the user wants them submitted back to the source review system.comments, not raw draftComments.comments, say so clearly and stop.