with one click
review
// Comprehensive code review of the current branch against base. Read-only analysis with P0-P3 severity-rated findings and actionable feedback. Use before merging or to check code quality.
// Comprehensive code review of the current branch against base. Read-only analysis with P0-P3 severity-rated findings and actionable feedback. Use before merging or to check code quality.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | review |
| description | Comprehensive code review of the current branch against base. Read-only analysis with P0-P3 severity-rated findings and actionable feedback. Use before merging or to check code quality. |
| category | process |
| triggers | ["review code","check quality","before merge","code review"] |
Purpose: Code review of the current branch against the base branch Mode: Read-only — do NOT modify files, run tests, or make commits Usage:
/review [scope flags]
/security-review/validate/implement or /refactor/debug| Flag | Description |
|---|---|
--files=<paths> | Review specific files instead of full branch diff |
--pr=<number> | Review a specific PR by number |
| Level | Label | Confidence Required | When to Use |
|---|---|---|---|
| P0 | Critical | HIGH — confirmed in code | Security vulnerability, data loss, correctness bug |
| P1 | High | HIGH — likely real | Logic error, race condition, performance regression |
| P2 | Medium | MEDIUM — possible | Code smell, maintainability concern |
| P3 | Low | Any | Style, naming, minor suggestion |
Confidence determines whether to report:
git branch --show-current
MAIN_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main")
gh pr view --json number,title,body,baseRefName,url 2>/dev/null
git diff $MAIN_BRANCH...HEAD --stat
git diff $MAIN_BRANCH...HEAD
For each changed file, read the full file for context. Use references/review-checklist.md for a comprehensive domain-organized checklist (correctness, security, performance, testing, maintainability, TypeScript/React/API-specific checks).
Load review checklists based on file types in the diff:
| File Type in Diff | Load Additional Checklists |
|---|---|
| .ts/.tsx (React) | typescript-guidelines, accessibility-review/references/wcag-checklist.md |
| API routes | rest-api-guidelines, security-review/references/security-checklists.md |
| Test files (.spec.ts) | vitest-guidelines, tdd/references/testing-anti-patterns.md |
| Database / ORM files | prisma-guidelines |
| Config / env files | env-config-guidelines |
| CI / Docker files | github-actions-guidelines, docker-node-guidelines |
Check:
Code Quality: No any types, proper typing, correct imports, no lint warnings
Testing: Test coverage for new code, meaningful descriptions, proper async handling
Security (structured check — do not skip):
eval(), new Function(), or dynamic code execution with external inputinnerHTML, dangerouslySetInnerHTML, or v-html with unsanitized datachild_process.exec() with user-controlled inputrejectUnauthorized: false)select or explicit field mapping)Before reporting a finding at P0 or P1, search for existing mitigations that may reduce severity or confidence:
select, pick) that limits writable fields?If a mitigation exists, adjust confidence accordingly (HIGH to MEDIUM) and note the mitigation in the finding. If no mitigation is found, report at the original severity with HIGH confidence. Do NOT skip the finding just because you are unsure — report it as "needs verification" at MEDIUM confidence if uncertain.
Performance: No obvious bottlenecks, efficient data fetching
General: No console.log in prod, error handling present, no dead code
Flag for explicit discussion even if no bug is found:
## Code Review: [Branch Name]
### Summary
[Brief overview of what the changes accomplish]
### P0 Critical
1. **[Issue]** — `file.ts:line` — Confidence: HIGH
- **Evidence:** [Why real, not theoretical]
- **Fix:** [Specific remediation]
_(None found — or list findings)_
### P1 High
1. **[Issue]** — `file.ts:line` — Confidence: HIGH/MEDIUM
- **Evidence:** [Why it matters]
- **Fix:** [Approach]
### P2 Medium
1. [Issue] — `file.ts:line` — [suggestion]
### P3 Low
1. [Suggestion] — `file.ts:line`
### Positive Notes
- [What was done well]
### Escalation Flags
- [Any flagged items, or "None"]
### Files Reviewed
| File | Status | Notes |
|------|--------|-------|
| path/to/file.ts | ✅/🟡/🔴 | Brief note |
### Areas Not Covered
[What couldn't be verified — runtime behavior, external API contracts, business logic]
### Residual Risks
[Risks remaining even after fixing all findings]
---
**Recommendation:** [Approve / Request Changes / Needs Discussion]
When providing feedback, use severity labels and the question approach (see references/review-feedback-patterns.md for label definitions, tone guidelines, and constructive feedback templates).
**What would you like to do?**
1. **Fix all** — Apply fixes for all P0-P2 findings
2. **Fix P0-P1 only** — Critical and high issues only
3. **Fix specific items** — Choose which (e.g., "P0.1, P1.2")
4. **No changes** — Keep as read-only review
GATE: User must select an action before proceeding.
The review phase (Steps 1-5) is strictly read-only. No file modifications, no test runs, no git operations beyond context gathering. If the user selects a fix option from the action menu, transition to write mode for the fix phase only:
| ID | Type | Prompt / Condition | Expected |
|---|---|---|---|
| REV-T1 | Positive | "Review my code before merging" | Skill triggers |
| REV-T2 | Positive | "Check code quality of this branch" | Skill triggers |
| REV-T3 | Positive | "Code review" | Skill triggers |
| REV-T4 | Negative | "Run the tests" | Does NOT trigger (→ /validate) |
| REV-T5 | Negative | "Fix the bug in auth" | Does NOT trigger (→ /debug) |
| REV-T6 | Negative | "Check for security vulnerabilities" | Does NOT trigger (→ /security-review) |
| REV-T7 | Boundary | "Review and then merge" | Triggers for review phase only |