with one click
code-walkthrough
// Create a context-first code walkthrough review packet for a branch or PR, with architecture, decisions, diff evidence, validation, and targeted feedback.
// Create a context-first code walkthrough review packet for a branch or PR, with architecture, decisions, diff evidence, validation, and targeted feedback.
| name | code-walkthrough |
| description | Create a context-first code walkthrough review packet for a branch or PR, with architecture, decisions, diff evidence, validation, and targeted feedback. |
Create a code-focused review packet for a branch or pull request, then call review_packet. The goal is to help the user review the actual code with enough context to understand why the changes matter.
Keep orientation brief. The walkthrough is for code review, not prose review: every substantive claim should be backed by visible code evidence. Use narrative to explain significance, make concrete changed code the review surface, and reserve raw diff evidence for diff-evidence cards.
Start from the context provided by the command or user message:
branch feature/foo or PR #123review_packet target JSONIf target JSON is provided, use it as the target object when calling review_packet. If you determine the current head SHA, add it as headSha.
Collect enough context to explain the target, then inspect the changed code directly:
git rev-parse HEAD
git log --oneline origin/$BASE..HEAD
git diff --stat origin/$BASE...HEAD
git diff --name-status origin/$BASE...HEAD
git diff origin/$BASE...HEAD
When a PR metadata command is provided, run it read-only. For branch targets, PR metadata is optional; if no PR exists, proceed using git context.
If origin/$BASE is missing or stale, use the best available base ref and explain the fallback in the packet.
Read the relevant source and test files directly so line references and explanations are grounded in code, not just patch text. For each important changed area, identify the changed line range and context that the reviewer should inspect in the packet.
Create a structured packet using the ReviewPacketSchema fields directly:
{
target: {
// command-provided target JSON plus optional headSha
},
source: {
goal: "Context-first code walkthrough for <target>"
},
cards: [
// Review cards, ordered from context/architecture to evidence/risks.
]
}
Recommended card sequence:
Orientation (kind: "orientation")
Architecture / lay of the land (kind: "architecture")
body, source line anchors in references, exact quote snippets where useful, and ASCII diagrams in body when helpful; do not include references[].diff.Behavior walkthrough (kind: "walkthrough")
body, source line anchors in references, exact quote snippets where useful, and ASCII diagrams in body when helpful; do not include references[].diff.Decisions and trade-offs (kind: "decision")
body, source line anchors in references, and exact quote snippets where useful; do not include references[].diff.Primary code changes / Git Diffs (kind: "diff-evidence")
references[].diff belongs. Provide structured intent; the code resolves it into git diffs for the packet.whyRelevant.Validation (kind: "validation")
body, source line anchors in references, and exact quote snippets for test cases or command output where useful; do not include references[].diff.Risks (kind: "risk")
body, source line anchors in references, and exact quote snippets where useful; do not include references[].diff.Open questions (kind: "open-question")
body, source line anchors in references, and exact quote snippets where useful; do not include references[].diff.Use multiple cards per kind when that improves clarity, but keep the packet concise enough for an interactive walkthrough.
Every reference must include a repo-relative path and explain why the code evidence matters using whyRelevant. Use references[].diff only in diff-evidence / Git Diffs cards, with structured fields that describe the desired evidence:
base: base ref or commit for the comparison.head: optional head ref or commit; omit to compare the base against the checked-out review worktree.path: optional file path override; omit to use the reference path.lineStart and lineEnd: changed line range to focus.contextLines: surrounding unchanged lines to include.The review packet tool resolves references[].diff into git diffs for diff-evidence cards. Provide structured intent, not raw git commands or pasted diff output. In all other card kinds, do not include references[].diff; put explanations, summaries, and ASCII diagrams in the card body, use source line anchors in references, and reserve quote for exact static snippets, PR metadata, config text, or command output. Do not use quote for prose paraphrase or generated ASCII diagrams.
Good diff-evidence references include:
{
"path": "path/to/file.ts",
"lineStart": 42,
"lineEnd": 58,
"diff": {
"base": "origin/main",
"head": "HEAD",
"lineStart": 42,
"lineEnd": 58,
"contextLines": 4
},
"whyRelevant": "This is the command entrypoint that starts the new walkthrough behavior, so it anchors the runtime path described in this card."
}
Reference guidance:
diff-evidence cards for changed-code evidence.references[].diff; use prose in body, source/test file line references, and exact quote snippets where useful.After gathering context and building the packet, call review_packet with the structured packet object. Do not present a long standalone walkthrough first; the tool is the walkthrough entrypoint.
After review_packet returns:
needs_explanation or question, answer or identify the extra investigation needed.needs_code_change, describe the requested change and affected files, but do not edit code automatically.Do not post GitHub comments, update PR metadata, or mutate the PR unless the user explicitly starts a separate workflow.
[HINT] Download the complete skill directory including SKILL.md and all related files