---
name: review-code
description: Run a comprehensive multi-perspective code review on current changes. Activates the Review Council (security, quality, documentation, domain review) and runs automated security scanning. Use before creating a pull request or when you want a thorough review of your work.
---
# Code Review Workflow
Run a comprehensive, multi-perspective code review on the current branch changes. This skill activates the Review Council and integrates automated security scanning to catch issues before they reach a pull request.
> [!CAUTION]
> **Scope boundary**: This skill reviews code and commits fixes. It does **NOT** create pull requests, push to remote, or merge anything. When the review is complete, **stop** and suggest the user run `/submit-pr` next. Do not proceed to PR creation — that is `/submit-pr`'s job.
> [!WARNING]
> **Checkpoint protocol.** When this workflow reaches a `### CHECKPOINT`, you **must** actively prompt the user for a decision — do not simply present information and continue. Use your agent's interactive prompting mechanism (e.g., `AskUserQuestion` in Claude Code) to require an explicit response before proceeding. This prevents queued or in-flight messages from being misinterpreted as approval. If your agent lacks interactive prompting, output the checkpoint content and **stop all work** until the user explicitly responds.
## Step 1: Analyze Current Changes
Identify all changes on the current branch:
1. Run `git diff origin/main...HEAD` to see all changes relative to main
2. Run `git diff` and `git diff --cached` to catch any uncommitted work
3. Run `git status` to see modified, added, and deleted files
Categorize changed files by layer based on your project's directory structure:
- **Frontend**: UI components, pages, styles, client-side logic
- **Backend**: API routes, services, business logic, server-side code
- **Database**: Schema files, migrations, seed data
- **Configuration**: Config files, CI/CD, container definitions, environment files
- **Documentation**: Markdown files, docs directories
- **Tests**: Test files (`.test.*`, `.spec.*`)
Present a summary of changed files by category to the user.
## Step 2: Run Formatting and Lint Checks
Run your project's formatting and lint commands before the council review to catch mechanical issues early. Common examples:
```
# Adapt to your project's toolchain
format:check # Prettier, Black, gofmt, etc.
lint # ESLint, Ruff, golangci-lint, etc.
```
If formatting checks fail, fix them immediately by running the auto-formatter on the reported files and stage the changes. Do not include formatting issues in the council review — just fix them.
## Step 3: Run Automated Security Scanning
Perform static application security testing (SAST) on all changed files. Scan for:
SAST Scanning Checklist
- Are all database queries parameterized? (SQL/NoSQL injection)
- Are user inputs sanitized before rendering? (XSS — reflected, stored, DOM-based)
- Are state-changing endpoints protected against CSRF?
- Are there hardcoded secrets, API keys, passwords, or connection strings?
- Are authentication flows following secure patterns? (no auth bypass paths)
- Are error messages leaking internal details? (stack traces, DB structure)
- Are dependencies free of known CVEs?
- Are file uploads validated and restricted?
- Are authorization checks present on all protected endpoints?
If backend files are changed, also perform a hardening review:
- Is input validation comprehensive on all user-facing inputs?
- Are authentication and authorization checks present and correct?
- Are error responses safe? (no internal details leaked)
- Are secrets managed securely? (environment variables, vaults — not hardcoded)
- Are security headers configured? (CSP, HSTS, X-Frame-Options)
- Are rate limits configured on public endpoints?
Collect all findings with severity levels (Critical, High, Medium, Low, Info).
> **Claude Code optimization**: If the `/security-scanning:security-sast` and `/security-scanning:security-hardening` skills are available, use them for enhanced automated scanning. Otherwise, follow the manual checklists above.
## Step 4: Run Accessibility Audit (if frontend changes)
If any frontend files (UI components, CSS, HTML templates) are in the changeset, check WCAG compliance on modified components:
Accessibility Checklist
- Do text and interactive elements meet color contrast ratios? (4.5:1 for normal text, 3:1 for large text)
- Can all interactive elements be reached and operated via keyboard alone?
- Are ARIA attributes used correctly? (roles, labels, live regions)
- Is focus managed properly during dynamic content changes? (modals, route transitions)
- Is semantic HTML used? (`