Perform senior-level code and pull request reviews with explicit checks for architecture and design fit, security and performance risks, code quality, and functional correctness. Use when asked to review a PR, commit diff, patch, or code snippet and provide a structured decision with actionable findings.
Resources
1Install
npx skillscat add data219/opencode-docker/code-review-master Install via the SkillsCat registry.
Code Review Master
Goal
Deliver a practical, risk-based review that helps decide merge readiness.
Missing Context Protocol
If review context is incomplete, ask at most these 3 questions first:
- What exact requirement or ticket should this change satisfy?
- Which commit range, files, or PR scope should be reviewed?
- Are there constraints that change review criteria (security, latency, compatibility, rollout risk)?
If answers are unavailable, continue with explicit assumptions and lower confidence for affected findings.
Review Modes
- Use
Quick Reviewfor low-risk changes (docs, comments, non-behavioral refactors, test-only updates). - Use
Deep Risk Reviewfor auth/authz, state changes, DB/schema, contracts, concurrency, security-sensitive code, and hot-path performance changes. - Default to
Deep Risk Reviewwhen uncertainty exists.
Quick Review Entry Gate
Allow Quick Review only if all conditions are true:
- No auth/authz change.
- No state-changing behavior change.
- No DB/schema or API/contract change.
- No concurrency or retry/timeout behavior change.
- No hot-path performance impact.
If any condition is unknown or false, use Deep Risk Review.
Review Workflow
- Select review mode (
Quick RevieworDeep Risk Review) based on risk triggers. - Read the change intent first: PR description, issue context, acceptance criteria.
- Identify impact scope: touched modules, interfaces, database or API contracts, and user-facing behavior.
- Review high-risk paths before style details: auth, input handling, data writes, concurrency, and error paths.
- Review line-by-line for correctness, maintainability, and integration side effects.
- Assess test quality: coverage of happy path, failure path, and edge cases.
- Re-verify claimed fixes for security, bugfix, and hotfix paths with explicit evidence (repro before/after or equivalent incident evidence + targeted regression).
- Produce a decision plus prioritized findings with clear fixes.
Review Focus Areas
Scope rule:
- In
Quick Review, prioritize sections directly affected by change scope. Release SafetyandOperational Readinessare mandatory inDeep Risk Reviewand whenever release-risk triggers are present.
Architecture & Design
- Check alignment with established project patterns.
- Check modularity and separation of concerns.
- Check for design-pattern misuse or avoidable coupling.
- Check complexity level (avoid over- and under-engineering).
Security & Performance
- Check for security vulnerabilities and data exposure risks.
- Check no secrets are exposed in code, logs, configs, or build artifacts.
- Check explicit app-layer authz for state-changing endpoints and handlers.
- Check dependency vulnerability delta and block on unresolved critical vulnerabilities (or high, if project policy requires).
- Check for performance regressions and optimization opportunities.
- For performance findings, require evidence (baseline, measurement method, workload profile, before/after result).
- Check resource handling (memory, file handles, connections, retries, timeouts).
- Check error boundaries and edge-case handling.
Code Quality
- Check readability and maintainability.
- Check naming, comments, and documentation quality.
- Check test coverage depth and test reliability.
- Check compliance with project coding standards.
Functionality
- Check requirement fulfillment and behavior parity.
- Check for logical bugs and regression risks.
- Check edge-case behavior and fallback paths.
- Check integration with existing systems and contracts.
Release Safety
- Check rollout and rollback strategy for risky changes (especially schema, contract, and data changes).
- Check rollback capability has validation evidence (test, drill, or explicit forward-fix fallback plan with abort criteria).
- Check critical paths avoid SPOF by redundancy/failover or documented degradation mode with owner.
- Check blast radius and failure containment are documented.
- Check ownership and abort criteria for release-risk changes.
Operational Readiness
- Check metrics, logs, and alerts are sufficient for incident diagnosis.
- Check dashboard/runbook updates and on-call ownership where behavior changes.
- Check SLO/SLA impact is assessed when latency, error rate, or throughput may change.
Severity Rules
- Treat security flaws, data loss, broken behavior, and contract breaks as critical.
- Treat risky design debt and likely regressions as major.
- Treat readability or minor optimization notes as suggestions.
- Require concrete evidence and reproduction paths for risky claims.
Evidence Gates
- Do not
Approvebugfix/hotfix changes without repro evidence (before fix or equivalent incident proof) and a targeted regression test. - Allow
Hypothesis-levelperformance concerns without measurements only if clearly marked non-blocking and coupled to a concrete follow-up measurement request. - Do not classify performance findings as blocking without measurement evidence on relevant paths, unless strong analytical evidence indicates material regression and a pre-release measurement follow-up is mandatory.
- Do not close security findings without re-verification evidence.
- Do not
Approverelease-risk changes without rollback validation evidence, SPOF/failover/degradation evidence, and minimum operability evidence (metrics, logs, alerts, owner).
Risk Acceptance Minimum
If a security or major risk is temporarily accepted, require all fields:
OwnerDue dateCompensating controlsDetection and monitoring evidenceRe-verification dateRisk acceptance approverApproval timestamp
Full Decision Record means a risk acceptance record with all mandatory fields above, plus explicit Risk scope and Rationale.
Assessment Mapping
- Set
Overall AssessmenttoRequest Changeswhen at least one open critical or major issue exists. - Set
Overall AssessmenttoRequest Changeswhen evidence is incomplete for risky paths (security, state changes, contracts, DB/schema, concurrency, performance-critical paths), unless aFull Decision Recordis present. - Set
Overall AssessmenttoRequest Changeswhen release-risk evidence is incomplete (rollback validation, failure containment/SPOF strategy, operability baseline). - Set
Overall AssessmenttoRequest Changeswhen anEmergency Exception Recordis active; allowApproveonly after missing evidence is delivered and re-verified. - Set
Overall AssessmenttoCommentswhen only minor suggestions exist and evidence is sufficient for the reviewed risk level. - For
Insufficient Evidencedue missing reviewer access/context in clearly low-risk, non-behavioral scope, useCommentsand include mandatoryData Needed to Confirm. - Set
Overall AssessmenttoApproveonly when no critical/major blockers remain and testing confidence is acceptable.
Output Format
Return exactly these sections:
- Overall Assessment:
Approve,Request Changes, orComments - Key Strengths: What is done well
- Must-Fix Issues (Critical + Major): Must-fix problems
- Suggestions: Nice-to-have improvements
- Specific Feedback: Line-by-line comments when useful
In Specific Feedback, always include:
Review Mode Justificationwith each Quick Review gate criterion and evidence (unknown => Deep Risk Review).Operational Risk Notes(dependencies, blast radius, rollback evidence, on-call owner, abort criteria) when release-risk triggers exist.
For each item in Must-Fix Issues (Critical + Major), include:
SeverityEvidence(prefer file and line)ImpactFix suggestionConfidence(0.0-1.0)
For deferred security or major risks, include a mandatory Risk Acceptance Record in Suggestions with:
OwnerDue dateCompensating controlsDetection and monitoring evidenceRe-verification dateRisk acceptance approverApproval timestampRisk scopeRationale
If there are no must-fix issues:
- Keep Must-Fix Issues (Critical + Major) present and set to
None. - Include
Residual RisksandTesting Gapsin Suggestions.
For Comments caused by low-risk missing context, include mandatory Data Needed to Confirm in Suggestions.
Always include Unverified Scope in Suggestions, regardless of severity distribution.
Emergency Exception Flow
Use only for incident/hotfix time pressure when required evidence cannot be produced immediately.
Emergency Exception Recordis aFull Decision RecordplusEmergency context.- Require explicit
Emergency Exception Recordwith: OwnerDue dateCompensating controlsDetection and monitoring evidenceRe-verification dateRisk acceptance approverApproval timestampRisk scopeRationaleEmergency context- Time-limit exceptions and require post-release evidence completion; otherwise escalate to
Request Changes. - Emergency exception never permits
Approveuntil missing evidence is delivered and re-verified.
Output Quality Bar
- Reference files and lines when available.
- Explain impact briefly (
risk,user effect,operational effect). - Suggest a fix for every critical issue.
- Keep comments actionable and non-redundant.
- Explicitly state assumptions when certainty is limited.