mit einem Klick
diffity-review
// Review current diff and leave comments using diffity agent commands
// Review current diff and leave comments using diffity agent commands
Create a guided code tour that walks through the codebase to answer a question or explain a feature. Opens in the browser with step-by-step navigation and highlighted code.
Create a guided code tour that walks through the codebase to answer a question or explain a feature. Opens in the browser with step-by-step navigation and highlighted code.
Start a project-driven learning journey for any technical topic — programming languages, tools, frameworks, or concepts. Teaches through real projects, Diffity tours, and interactive conversation, adapting to the learner's pace.
Start a project-driven learning journey for any technical topic — programming languages, tools, frameworks, or concepts. Teaches through real projects, Diffity tours, and interactive conversation, adapting to the learner's pace.
Review current diff and leave comments using diffity agent commands
Read open review comments and resolve them by making code fixes
| name | diffity-review |
| description | Review current diff and leave comments using diffity agent commands |
| user-invocable | true |
You are reviewing a diff and leaving inline comments using the {{binary}} agent CLI.
ref (optional): Git ref to review (e.g. main..feature, HEAD~3). Defaults to working tree changes. When both ref and focus are provided, use both (e.g. /diffity-review main..feature security).focus (optional): Focus the review on a specific area. One of: security, performance, naming, errors, types, logic. If omitted, review everything.{{binary}} agent diff
{{binary}} agent list [--status open|resolved|dismissed] [--json]
{{binary}} agent comment --file <path> --line <n> [--end-line <n>] [--side new|old] --body "<text>"
{{binary}} agent general-comment --body "<text>"
{{binary}} agent resolve <id> [--summary "<text>"]
{{binary}} agent dismiss <id> [--reason "<text>"]
{{binary}} agent reply <id> --body "<text>"
--file, --line, --body are required for comment--end-line defaults to --line (single-line comment)--side defaults to newgeneral-comment creates a diff-level comment not tied to any file or line<id> accepts full UUID or 8-char prefix{{binary}} is available: run which {{binary}}. If not found, {{install_hint}}.The review needs a running session whose ref matches the requested ref. A ref mismatch causes "file not in current diff" errors when adding comments.
{{binary}} list --json to get all running instances. Parse the JSON output and find the entry whose repoRoot matches the current repo.ref field against the requested ref:
"work" for working-tree sessions and the user-provided ref string (e.g. "main", "HEAD~3") for named refs.{{binary}} <ref> --no-open --new (or {{binary}} --no-open --new if no ref). The --new flag kills the old session and starts a fresh one. Use Bash tool with run_in_background: true. Wait 2 seconds, then verify with {{binary}} list --json and note the port."work" → restart with {{binary}} --no-open --new (the running session is for a named ref, but we need working-tree).{{binary}} <ref> --no-open (or {{binary}} --no-open if no ref)run_in_background: true{{binary}} list --json and note the port.{{binary}} agent diff
This outputs the full unified diff for the current session. Line numbers are in the @@ hunk headers.Gauge the diff size and plan your approach. Every file gets a thorough review regardless of diff size — the difference is how you organize the work:
No matter the size, read and review every changed file. Do not skip or spot-check files.
Summarize the change first. Before looking for problems, build a mental model of the diff:
git log --oneline <args>) and any linked issues or PR descriptions for context.Understanding intent helps you distinguish intentional behavior from real bugs.
For each changed file (adjusted by size strategy above), read the entire file (not just the diff hunks) to understand the full context.
Cross-reference callers and dependents. For any changed function signature, renamed export, modified return type, or altered behavior: grep for usages across the codebase. A function that looks correct in isolation can break every caller. Check:
Analyze the code changes using the techniques below. If a focus argument was provided, concentrate on that area. Otherwise, apply all analysis passes and the signal threshold.
The diff tells you what changed; the surrounding code tells you whether the change is correct. Apply these analysis passes:
Data flow analysis — Trace values through the changed code. Where does each variable come from? Where does it go? Check:
if (x)) that the diff accidentally moved outside of?State and lifecycle analysis — For stateful code (React state, database transactions, streams, event listeners):
Contract analysis — Check the changed code against the contracts it must satisfy:
Boundary analysis — For code at system boundaries (user input, network, file I/O, IPC):
Edge case analysis — Only for cases that will happen in practice, not theoretical ones:
After analyzing the code for correctness, check whether the change is complete — not just correct, but finished:
Test coverage:
[suggestion].Missing pieces:
Only flag missing pieces that are clearly needed for this change to work correctly. Don't flag aspirational improvements.
Flag real problems that would affect correctness, security, or reliability:
[suggestion], not [must-fix], unless the project's CLAUDE.md requires tests)Skip style concerns, linter-catchable issues, and pre-existing problems in unchanged code. Focus on the diff, not the whole file.
For each finding, verify it's real before posting:
If a repeated pattern appears across files, comment on the first occurrence and mention the pattern in the general summary instead of duplicating comments.
Order comments by severity. Post all [must-fix] comments first, then [suggestion], then [question]. Within each severity, follow file order. This ensures the most important issues are seen first if the author skims.
Categorize each finding with a severity prefix in the comment body:
[must-fix] — Bugs, security issues, data loss risks. Code that will break or produce wrong results.[suggestion] — Concrete improvements with a clear reason. Not style preferences — real improvements. This includes missing tests, incomplete changes, and better approaches.[question] — Something unclear that needs clarification from the author.For each finding, leave an inline comment using:
{{binary}} agent comment --file <path> --line <n> [--end-line <n>] [--side new] --body "<comment>"
--side new (default) for comments on added/modified code--side old for comments on removed code--end-line when the issue spans multiple linesAfter leaving all inline comments, decide whether a general comment is needed:
{{binary}} agent general-comment --body "<overall review summary>"
Open the browser now that comments are ready:
{{binary}} open <ref>
Pass the ref argument if one was provided (e.g. {{binary}} open HEAD~3). Omit it to open the default view.
Tell the user the review is ready and they can check the browser. Example:
Review complete — check your browser.
Found: 2 must-fix, 1 suggestion
When you're ready, run {{slash}}resolve to fix them.