Code Review
Review the requested change set against its intended behavior. Prioritize defects and release risk over style commentary.
Boundary
Review only the requested diff, patch, files, or comparison range, plus the surrounding code needed to validate behavior. Do not modify code unless the user explicitly asks for fixes.
Identify the language, framework, and relevant versions before reviewing framework-dependent behavior. Apply framework-specific review guidance whenever the change runs inside a framework. If that guidance or the required version context is unavailable, limit the review to demonstrated language-neutral defects and do not approve framework-dependent behavior.
Use other specialist guidance when the main question is narrower, such as algorithmic complexity, test quality, infrastructure, or privacy.
Required Context
Establish:
- the exact review scope and comparison base
- the requested behavior, acceptance criteria, or issue being solved
- the language, framework, runtime, and relevant versions
- repository guidance and relevant architectural constraints
- checks already run and any known failures
If the scope is empty or ambiguous, say so instead of reviewing an assumed change set.
Workflow
- Read the entire change set before forming conclusions.
- Trace each changed behavior through callers, consumers, data boundaries, and failure paths.
- Assess change risk from the actual semantic change. Trace changed contracts through static and dynamic dependents, side effects, criticality, and relevant cross-cutting failure modes. For each material risk, name the triggering changed path, plausible failure and consequence, evidence strength, and mitigation or verification. Risk without a concrete defect belongs in residual risk, not Findings. Treat missing evidence as residual risk, not proof of safety.
- Compare the implementation with the stated requirement and existing repository patterns.
- Check for correctness failures, regressions, unsafe defaults, authorization gaps, data loss, concurrency hazards, compatibility breaks, and incomplete migrations.
- Challenge new abstractions, configuration, dependencies, and indirection that are not required by the change.
- Inspect tests for observable behavior, important branches, failure handling, and regression protection.
- Run the narrowest relevant repository checks when execution is available. Distinguish checks actually run from checks merely recommended.
- Keep only findings supported by a concrete code path and user-visible or operational consequence.
Finding Standard
Each finding must include:
- severity: critical, high, medium, or low
- file and line reference
- the incorrect or risky behavior
- the conditions that trigger it
- why it matters
- the smallest safe correction
Do not report optional refactors, personal style preferences, or speculative concerns as defects.
Release Verdict
When asked for a quality gate, return exactly one verdict:
APPROVED: no unresolved material defect and required verification passed
NEEDS CHANGES: one or more actionable defects must be corrected
BLOCKED: missing scope, evidence, environment, or prerequisite prevents a responsible decision
Passing tests do not prove correctness. Conversely, do not block release on unrelated cleanup or optional polish.
Output
- Findings, ordered by severity and confidence
- Verdict, when requested
- Open questions or assumptions
- Checks run and their results
- Residual risk
If there are no findings, say so directly and identify any verification that was not possible.
1---2name: code-review3description: Review a concrete change set for correctness, regressions, security, data risk, unnecessary complexity, and missing tests, then give evidence-backed findings or a release verdict. Use when reviewing a diff, pull request, patch, staged changes, or deciding whether code is ready to merge or ship.4---56# Code Review78Review the requested change set against its intended behavior. Prioritize defects and release risk over style commentary.910## Boundary1112Review only the requested diff, patch, files, or comparison range, plus the surrounding code needed to validate behavior. Do not modify code unless the user explicitly asks for fixes.1314Identify the language, framework, and relevant versions before reviewing framework-dependent behavior. Apply framework-specific review guidance whenever the change runs inside a framework. If that guidance or the required version context is unavailable, limit the review to demonstrated language-neutral defects and do not approve framework-dependent behavior.1516Use other specialist guidance when the main question is narrower, such as algorithmic complexity, test quality, infrastructure, or privacy.1718## Required Context1920Establish:2122- the exact review scope and comparison base23- the requested behavior, acceptance criteria, or issue being solved24- the language, framework, runtime, and relevant versions25- repository guidance and relevant architectural constraints26- checks already run and any known failures2728If the scope is empty or ambiguous, say so instead of reviewing an assumed change set.2930## Workflow31321. Read the entire change set before forming conclusions.332. Trace each changed behavior through callers, consumers, data boundaries, and failure paths.343. Assess change risk from the actual semantic change. Trace changed contracts through static and dynamic dependents, side effects, criticality, and relevant cross-cutting failure modes. For each material risk, name the triggering changed path, plausible failure and consequence, evidence strength, and mitigation or verification. Risk without a concrete defect belongs in residual risk, not Findings. Treat missing evidence as residual risk, not proof of safety.354. Compare the implementation with the stated requirement and existing repository patterns.365. Check for correctness failures, regressions, unsafe defaults, authorization gaps, data loss, concurrency hazards, compatibility breaks, and incomplete migrations.376. Challenge new abstractions, configuration, dependencies, and indirection that are not required by the change.387. Inspect tests for observable behavior, important branches, failure handling, and regression protection.398. Run the narrowest relevant repository checks when execution is available. Distinguish checks actually run from checks merely recommended.409. Keep only findings supported by a concrete code path and user-visible or operational consequence.4142## Finding Standard4344Each finding must include:4546- severity: critical, high, medium, or low47- file and line reference48- the incorrect or risky behavior49- the conditions that trigger it50- why it matters51- the smallest safe correction5253Do not report optional refactors, personal style preferences, or speculative concerns as defects.5455## Release Verdict5657When asked for a quality gate, return exactly one verdict:5859- `APPROVED`: no unresolved material defect and required verification passed60- `NEEDS CHANGES`: one or more actionable defects must be corrected61- `BLOCKED`: missing scope, evidence, environment, or prerequisite prevents a responsible decision6263Passing tests do not prove correctness. Conversely, do not block release on unrelated cleanup or optional polish.6465## Output66671. **Findings**, ordered by severity and confidence682. **Verdict**, when requested693. **Open questions or assumptions**704. **Checks run** and their results715. **Residual risk**7273If there are no findings, say so directly and identify any verification that was not possible.