review
npx machina-cli add skill tslateman/duet/review --openclawStructured Code Review
Overview
Code review that captures context, not just correctness. Grounded in Bacchelli & Bird's research on modern code review, which found that code review's primary value is knowledge transfer — not defect detection. Beyond finding bugs, document the why — concerns raised, alternatives considered, risks accepted. This creates organizational memory for future maintainers.
Use this for PRs, local changes, or architecture review — any code where you want to preserve the reasoning, not just the verdict.
Review Workflow
1. Understand the Change
Before commenting, understand intent:
- What problem does this solve?
- What was the previous state?
- What constraints shaped the solution?
Read the PR description, linked issues, and recent commits.
If context is missing, ask before reviewing.
2. Evaluate on Multiple Dimensions
Correctness — Does it work?
- Logic errors, edge cases, error handling
- Does it match stated requirements?
Design — Is this the right approach?
- Does it fit existing patterns in the codebase?
- Are there simpler alternatives?
- Will this scale if assumptions change?
Maintainability — Can others work with this?
- Is the code readable without comments?
- Are names clear and consistent?
- Is complexity justified?
Risk — What could go wrong?
- Performance implications
- Security considerations
- Breaking changes, backwards compatibility
- Operational concerns (monitoring, debugging)
3. Document Your Review
Structure feedback for the record:
## Summary
[1-2 sentence assessment: approve, request changes, or needs discussion]
## What This Changes
[Brief description of the change and its purpose]
## Feedback
### Must Address
- [Blocking issue] — [Why it matters]
### Should Consider
- [Non-blocking suggestion] — [Trade-off or alternative]
### Observations
- [Pattern noticed, question raised, or context captured]
## Concerns for the Record
[Risks accepted, alternatives rejected, assumptions made—future maintainers need this]
## Alternatives Considered
[Other approaches discussed and why they were rejected]
4. Calibrate Feedback
Blocking issues (Must Address):
- Bugs that will cause failures
- Security vulnerabilities
- Breaking changes without migration
- Violations of hard requirements
Suggestions (Should Consider):
- Better approaches that aren't urgent
- Style preferences beyond project standards
- Optimizations without clear need
Observations (For the Record):
- "This assumes X remains true"
- "If Y changes, this will need rework"
- "We chose this over Z because..."
Review Patterns
PR Review (with GitHub CLI)
# View PR details
gh pr view [number]
# View PR diff
gh pr diff [number]
# View PR comments
gh api repos/{owner}/{repo}/pulls/{number}/comments
# Add review comment
gh pr review [number] --comment --body "..."
# Approve or request changes
gh pr review [number] --approve
gh pr review [number] --request-changes --body "..."
Local Code Review
For code not yet in a PR:
- Read the changed files
- Check git diff for what's new
- Understand context from surrounding code
- Apply the review dimensions above
Architecture Review
For larger changes:
- Map the change across files
- Trace data flow and control flow
- Identify coupling and dependencies
- Consider failure modes
- Document assumptions explicitly
Anti-Patterns
Rubber stamping — Approving without understanding. If you don't have time, say so.
Style nitpicking — Bikeshedding on preferences not in project standards. Automate style with linters.
Drive-by criticism — Pointing out problems without suggesting solutions or understanding constraints.
Scope creep — Requesting changes unrelated to the PR's purpose. File separate issues.
Assumption silence — Noticing risks but not documenting them. Future you will wish you had.
The "For the Record" Principle
The most valuable reviews capture what won't be obvious later:
- "We discussed using X but chose Y because of constraint Z"
- "This is a temporary solution until the Q2 migration"
- "Performance is acceptable for current load but watch metric M"
- "This duplicates code in file F; intentional to avoid coupling"
When warnings are ignored, the review becomes evidence. When they're heeded, it becomes context. Either way, document it.
Output Quality
A good review:
- Distinguishes blocking issues from suggestions
- Explains why, not just what
- Captures context that isn't in the code
- Helps the author improve, not just comply
- Creates value for future readers
See Also
/naming— Code review surfaces naming problems; naming review deepens code review/adr— Reviews that capture architectural decisions belong in ADRs/prose— Write review comments clearly using Strunk's rulesskills/FRAMEWORKS.md— Full framework indexRECIPE.md— Agent recipe for parallel decomposition (3 workers)
Overview
Captures the rationale behind changes, not just the diff. It documents concerns raised, alternatives rejected, and risks accepted to preserve organizational memory for future maintainers. Use for PRs, local changes, or architecture reviews where the decision context matters.
How This Skill Works
Reviewer steps through understanding the change, evaluating it across correctness, design, maintainability, and risk, then documents the review using a structured template: Summary, What This Changes, Feedback (Must Address, Should Consider, Observations), Concerns for the Record, and Alternatives Considered. It supports PR, local, and architecture reviews to preserve reasoning for future maintainers.
When to Use It
- PR reviews where the reasoning behind decisions matters more than the diff
- Local changes that future maintainers will need to justify
- Architecture reviews with long-term impact and data/flow considerations
- Changes involving security, risk, or compliance concerns
- Knowledge transfer tasks or handoffs for critical components
Quick Start
- Step 1: Understand the change and gather context from PR descriptions, issues, and commits
- Step 2: Evaluate correctness, design, maintainability, and risk
- Step 3: Document the review using the structured template and share across PR, local, or architecture contexts
Best Practices
- Start by understanding intent and context (read description, issues, commits)
- Evaluate Correctness, Design, Maintainability, and Risk across the change
- Structure feedback for the record using Summary, What This Changes, and categorized feedback
- Capture concerns for the record, trade-offs, and rejected alternatives
- Apply appropriate review patterns (PR, Local, Architecture) to preserve context
Example Use Cases
- PR introduces a caching layer with documented trade-offs and rationale
- Local refactor changes API surface with justification and migration notes
- Architecture decision maps data flow and dependencies for a module rewrite
- Security-focused change notes threat model and mitigations within the review
- Legacy code cleanup includes compatibility notes and migration strategy