local-review
Overview
Run a disciplined local code review on git changes with no GitHub side effects. Use this skill when the user wants a /review-style assessment of local diffs.
Scope
- In scope: local diff review (
working, staged, or branch compare), risk analysis, and action-focused findings.
- Out of scope: posting PR reviews to GitHub. Use the
gh CLI or the harness's own PR-review command.
Workflow
- Select review target.
- Working tree changes:
--mode working (default)
- Staged changes only:
--mode staged
- Branch changes against a base:
--mode branch --base <ref> [--head <ref>]
- Deep review: add
--deep to raise the default diff budget from 4000 to 8000
lines, or pass --max-diff-lines <n> explicitly.
- Collect deterministic context. Resolve
scripts/collect_review_context.sh
relative to this skill directory, not the repository being reviewed. Do not look
for the script in the target repo unless that repo deliberately vendors a copy.
bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode working
or
bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode staged
or
bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode branch --base origin/main
If branch mode cannot resolve the default origin/main but local main exists,
the helper falls back to main and prints a base note in the review target.
- Analyze for:
- correctness and regressions
- security and data integrity
- performance and scalability
- maintainability and readability
- API or contract compatibility
- test coverage gaps
- Produce response in the exact output contract below.
Output Contract
Always present sections in this order:
- Findings
- Findings must come first.
- Order by severity:
CRITICAL, HIGH, MEDIUM, LOW.
- Include file and line when available.
- Use this structure for each finding:
Severity: <level>
Location: <path:line>
Issue: <concise problem statement>
Risk: <why this matters>
Recommended fix: <specific fix>
Tests: <missing or required tests>
- Open Questions / Assumptions
- List unknowns that affect confidence.
- Change Summary
- Keep short. This is secondary to findings.
- Residual Risks / Testing Gaps
- Explicitly call out what was not verified.
If there are no meaningful findings, state that explicitly and still include residual risks and test gaps.
Review Depth
- Quick review: small changes and low-risk files.
- Deep review: large diff, sensitive areas (auth, migrations, payments, infra), or user request.
- Trigger deep review automatically when diff is very large (for example, over 20 files or over 500 changed lines). If the context says the diff was truncated, rerun with
--deep or a higher --max-diff-lines, then read high-risk touched files directly as needed.
Commands
# Default: review working tree changes
bash <local-review-skill-dir>/scripts/collect_review_context.sh
# Review only staged changes
bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode staged
# Review branch changes vs base
bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode branch --base origin/main
# Deep review with a larger default diff budget
bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode branch --base origin/main --deep
Command Wrapper
If the harness supports command files, use commands/review.md as the canonical /review wrapper for this skill.
Boundaries
- Do not post reviews to GitHub or call the GitHub API
- Do not modify source code; this skill is read-only analysis
- Do not review files outside the git diff scope
Verification
- All findings reference specific files and line numbers from the diff
- Severity ratings are justified by stated risk
- Residual risks section is present even when no findings exist
Notes
- Prefer precise, evidence-backed findings over broad advice.
- Do not make GitHub review API calls in this skill.
Sibling skills
One of three review skills (diff / PR / multi-agent).
verify-before-complete — orthogonal gate. Run before claiming a diff is "done"; this skill produces the findings, that one enforces the completion claim.
error-handling-review — deliberately-invoked specialist lens for silent failures, swallowed errors, and unjustified fallbacks. Reach for it when this general pass flags error handling worth a deeper look.
type-design-review — deliberately-invoked specialist lens rating a new or changed type's invariants and encapsulation. Reach for it when this pass surfaces a new type worth assessing.
1---2name: local-review3description: Perform local code reviews on workspace changes without posting to GitHub. Use for requests like /review, review this diff, audit staged changes, or check branch changes. Produces findings-first reports with severity, file line references, risks, and test gaps.4---56# local-review78## Overview910Run a disciplined local code review on git changes with no GitHub side effects. Use this skill when the user wants a `/review`-style assessment of local diffs.1112## Scope1314- In scope: local diff review (`working`, `staged`, or `branch` compare), risk analysis, and action-focused findings.15- Out of scope: posting PR reviews to GitHub. Use the `gh` CLI or the harness's own PR-review command.1617## Workflow18191. Select review target.20- Working tree changes: `--mode working` (default)21- Staged changes only: `--mode staged`22- Branch changes against a base: `--mode branch --base <ref> [--head <ref>]`23- Deep review: add `--deep` to raise the default diff budget from 4000 to 800024 lines, or pass `--max-diff-lines <n>` explicitly.25262. Collect deterministic context. Resolve `scripts/collect_review_context.sh`27relative to this skill directory, not the repository being reviewed. Do not look28for the script in the target repo unless that repo deliberately vendors a copy.2930```bash31bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode working32```3334or3536```bash37bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode staged38```3940or4142```bash43bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode branch --base origin/main44```4546If branch mode cannot resolve the default `origin/main` but local `main` exists,47the helper falls back to `main` and prints a base note in the review target.48493. Analyze for:50- correctness and regressions51- security and data integrity52- performance and scalability53- maintainability and readability54- API or contract compatibility55- test coverage gaps56574. Produce response in the exact output contract below.5859## Output Contract6061Always present sections in this order:62631. Findings64- Findings must come first.65- Order by severity: `CRITICAL`, `HIGH`, `MEDIUM`, `LOW`.66- Include file and line when available.67- Use this structure for each finding:68 - `Severity: <level>`69 - `Location: <path:line>`70 - `Issue: <concise problem statement>`71 - `Risk: <why this matters>`72 - `Recommended fix: <specific fix>`73 - `Tests: <missing or required tests>`74752. Open Questions / Assumptions76- List unknowns that affect confidence.77783. Change Summary79- Keep short. This is secondary to findings.80814. Residual Risks / Testing Gaps82- Explicitly call out what was not verified.8384If there are no meaningful findings, state that explicitly and still include residual risks and test gaps.8586## Review Depth8788- Quick review: small changes and low-risk files.89- Deep review: large diff, sensitive areas (auth, migrations, payments, infra), or user request.90- Trigger deep review automatically when diff is very large (for example, over 20 files or over 500 changed lines). If the context says the diff was truncated, rerun with `--deep` or a higher `--max-diff-lines`, then read high-risk touched files directly as needed.9192## Commands9394```bash95# Default: review working tree changes96bash <local-review-skill-dir>/scripts/collect_review_context.sh9798# Review only staged changes99bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode staged100101# Review branch changes vs base102bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode branch --base origin/main103104# Deep review with a larger default diff budget105bash <local-review-skill-dir>/scripts/collect_review_context.sh --mode branch --base origin/main --deep106```107108## Command Wrapper109110If the harness supports command files, use `commands/review.md` as the canonical `/review` wrapper for this skill.111112## Boundaries113114- Do not post reviews to GitHub or call the GitHub API115- Do not modify source code; this skill is read-only analysis116- Do not review files outside the git diff scope117118## Verification119120- All findings reference specific files and line numbers from the diff121- Severity ratings are justified by stated risk122- Residual risks section is present even when no findings exist123124## Notes125126- Prefer precise, evidence-backed findings over broad advice.127- Do not make GitHub review API calls in this skill.128129## Sibling skills130131One of three review skills (diff / PR / multi-agent).132133- `verify-before-complete` — orthogonal gate. Run before claiming a diff is "done"; this skill produces the findings, that one enforces the completion claim.134- `error-handling-review` — deliberately-invoked specialist lens for silent failures, swallowed errors, and unjustified fallbacks. Reach for it when this general pass flags error handling worth a deeper look.135- `type-design-review` — deliberately-invoked specialist lens rating a new or changed type's invariants and encapsulation. Reach for it when this pass surfaces a new type worth assessing.