code-review
Analyzes code changes for bugs, security vulnerabilities, performance problems, and architectural improvements. Generates structured markdown reports with evidence-based findings tied to specific file:line references, and creates Beads tasks for tracking. Adapts review depth based on scope — from quick pre-commit checks to thorough branch reviews. Use proactively when reviewing code before commits, after implementing features, before PRs, when checking code quality, or when the user mentions "review", "check changes", "code review", "PR review", "review branch", or any code quality assessment.
Best use case
code-review is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Analyzes code changes for bugs, security vulnerabilities, performance problems, and architectural improvements. Generates structured markdown reports with evidence-based findings tied to specific file:line references, and creates Beads tasks for tracking. Adapts review depth based on scope — from quick pre-commit checks to thorough branch reviews. Use proactively when reviewing code before commits, after implementing features, before PRs, when checking code quality, or when the user mentions "review", "check changes", "code review", "PR review", "review branch", or any code quality assessment.
Teams using code-review should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/code-review/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How code-review Compares
| Feature / Agent | code-review | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Analyzes code changes for bugs, security vulnerabilities, performance problems, and architectural improvements. Generates structured markdown reports with evidence-based findings tied to specific file:line references, and creates Beads tasks for tracking. Adapts review depth based on scope — from quick pre-commit checks to thorough branch reviews. Use proactively when reviewing code before commits, after implementing features, before PRs, when checking code quality, or when the user mentions "review", "check changes", "code review", "PR review", "review branch", or any code quality assessment.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# Code Review
Review code directly in the main context. Read the code, analyze git history, write the report, create Beads tasks.
The goal is **risk reduction, not perfect code**. "Heartbleed was 2 lines" — size doesn't determine risk. Focus on findings that matter: real bugs, security gaps, and meaningful improvements. If the code is clean, say so.
## Workflow
```
Scope → Git History → Read & Analyze → Quality Gates → Report → Beads Tasks → Summary
```
## Step 1: Determine Scope
| User says | Scope | Command |
| ----------------------- | ----------------- | -------------------------------------------------------- |
| "review my changes" | Staged + unstaged | `git diff --name-only` + `git diff --cached --name-only` |
| "review before commit" | Staged only | `git diff --cached --name-only` |
| "review the branch" | Branch vs base | `git diff --name-only develop...HEAD` |
| "review PR #N" | PR diff | `gh pr diff N --name-only` |
| "review src/foo/" | Specific path | Read files in path |
| "review recent changes" | Last N commits | `git diff --name-only HEAD~N` |
If ambiguous, ask. Skip non-reviewable: `*.lock`, `*.min.js`, `*.map`, generated `database.types.ts`.
**Adapt depth to scale:**
- **1-5 files**: Exhaustive line-by-line analysis
- **6-20 files**: Focus on risky areas (auth, data handling, new patterns)
- **20+ files**: Surgical — prioritize security-critical paths, new APIs, schema changes
## Step 2: Analyze Git History
Do not skip this. Surface analysis misses regressions that history reveals.
```bash
# What changed and why
git log --oneline -10 -- <changed-files>
# Was validation/auth logic removed?
git log -p --all -S 'functionName' -- <file>
```
Look for:
- **Removed safety checks** — validation, auth, error handling deleted without replacement
- **Reverted patterns** — code going back to a previously fixed approach
- **Blast radius** — if a shared utility changed, who else uses it?
## Step 3: Read & Analyze
Read each changed file or diff. Separate findings into **Issues** (broken/dangerous) and **Improvements** (works but could be better).
### Issues — things that need fixing
| Priority | When | Examples |
| ------------- | ----------------------------------- | ----------------------------------------------------------- |
| Critical (P0) | Security vulnerability or data loss | Exposed secrets, SQL injection, missing auth, RLS gaps |
| High (P1) | Will cause bugs in production | Stale closures, unhandled crashes, wrong types via `as any` |
| Medium (P2) | Should fix but won't break things | Empty catch blocks, missing input validation |
| Low (P3) | Cleanup | Dead code, leftover console.log |
### Improvements — things that could be better
| Priority | When | Examples |
| -------- | -------------------------------------- | -------------------------------------------------------------------- |
| High | Significant impact on maintenance/perf | N+1 queries, monolithic 500+ line components, missing code-splitting |
| Medium | Moderate benefit | DRY violations, missing memoization, inconsistent patterns |
| Low | Minor polish | Naming, minor readability tweaks |
### What makes a good finding
**Good finding** (specific, evidence-based, actionable):
```
FlashcardViewer.tsx:237 — `onCardFlip` defined as plain function inside render body,
creating new reference every render. This defeats React.memo on FlashcardCard (line 22).
Fix: wrap in useCallback([handleFlip]).
```
**Bad finding** (vague, no evidence):
```
Consider improving performance of the component.
```
Frame uncertain points as questions: "Is the 80px swipe threshold intentional? On small screens this may be hard to trigger."
### Escalation flags
Flag for senior review (don't just note — explicitly call out):
- Database schema changes or migrations
- API contract modifications (new/changed endpoints)
- Authentication or authorization logic
- New external dependencies
- Changes to shared utilities used by multiple packages
## Step 4: Quality Gates
```bash
pnpm type-check
pnpm build
```
If either fails, it's a Critical finding. Include pass/fail in report.
## Step 5: Generate Report
Write to: `docs/reports/code-reviews/{YYYY-MM}/CR-{YYYY-MM-DD}-{topic}.md`
Use this structure, but adapt — a 2-file i18n review doesn't need the same sections as a 20-file refactor:
```markdown
# Code Review: {Topic}
**Date**: {YYYY-MM-DD}
**Scope**: {what was reviewed}
**Files**: {count} | **Changes**: +{added} / -{removed}
## Summary
| | Critical | High | Medium | Low |
| ------------ | -------- | ---- | ------ | --- |
| Issues | {n} | {n} | {n} | {n} |
| Improvements | — | {n} | {n} | {n} |
**Verdict**: {PASS | NEEDS WORK}
## Issues
### {Priority}
#### {n}. {Title}
- **File**: `{path}:{line}`
- **Problem**: {what's wrong}
- **Impact**: {why it matters — be specific}
- **Fix**: {concrete code or action}
## Improvements
### {Priority}
{same format, "Current" / "Recommended" for code}
## Positive Patterns
{Note 2-3 things done well — balanced feedback}
## Escalation
{Items requiring senior review, if any}
## Validation
- Type Check: {PASS/FAIL}
- Build: {PASS/FAIL}
```
Every finding must have: file:line, evidence of the problem, and a concrete fix. No generic advice.
## Step 6: Create Beads Tasks
```bash
# Issues
bd create "BUG: {title}" -t bug -p {0-3} -d "{file}:{line} — {description}. Fix: {fix}"
# Improvements
bd create "IMPROVE: {title}" -t chore -p {2-4} -d "{file}:{line} — {description}"
# Label all
bd update {id} --add-label code-review
```
## Step 7: Present Summary
```
## Code Review Complete
**Report**: `{path}`
**Verdict**: {PASS / NEEDS WORK}
| Priority | Issues | Improvements |
|---|---|---|
| Critical | {n} | — |
| High | {n} | {n} |
| Medium | {n} | {n} |
| Low | {n} | {n} |
**Beads tasks created**: {total} ({list IDs})
**Next**: {actionable guidance based on verdict}
```
## Project Conventions
These are specific to this codebase — the things you wouldn't know without being told:
- **Types**: Import from `@megacampus/shared-types`, never duplicate
- **Supabase**: Two admin clients by design (Node.js + Next.js runtimes)
- **Quality**: `pnpm type-check && pnpm build` must pass before merge
- **Monorepo**: `packages/web` (Next.js), `packages/course-gen-platform` (backend), `packages/shared-*`
- **i18n**: `next-intl` with ICU MessageFormat plurals, locales in `packages/web/messages/{en,ru}/`
- **Styling**: Tailwind + shadcn/ui, `cn()` utility for conditional classes
- **State**: No global state management — React hooks + context
- **Don't flag**: Two Supabase admin clients (intentional), generated `database.types.ts` (auto-generated)Related Skills
Beads Issue Tracking Skill
> **Attribution**: [Beads](https://github.com/steveyegge/beads) by [Steve Yegge](https://github.com/steveyegge)
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
validate-report-file
Validate that worker-generated reports have all required sections and proper formatting. Use in quality gates, for report completeness checking, or when debugging missing report sections.
validate-plan-file
Validate that orchestrator plan files conform to expected JSON schema. Use before workers read plan files or after orchestrators create them to ensure proper structure and required fields.
ux-researcher-designer
UX research and design toolkit for Senior UX Designer/Researcher including data-driven persona generation, journey mapping, usability testing frameworks, and research synthesis. Use for user research, persona creation, journey mapping, and design validation.
ui-design-system
UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
setup-knip
Install and configure Knip for dead code detection. Use before running dead-code-hunter or dependency-auditor to ensure Knip is available. Handles installation, configuration creation, and validation.
senior-prompt-engineer
World-class prompt engineering skill for LLM optimization, prompt patterns, structured outputs, and AI product development. Expertise in Claude, GPT-4, prompt design patterns, few-shot learning, chain-of-thought, and AI evaluation. Includes RAG optimization, agent design, and LLM system architecture. Use when building AI products, optimizing LLM performance, designing agentic systems, or implementing advanced prompting techniques.
senior-devops
Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup, infrastructure as code, deployment automation, and monitoring. Use when setting up pipelines, deploying applications, managing infrastructure, implementing monitoring, or optimizing deployment processes.
senior-architect
Comprehensive software architecture skill for designing scalable, maintainable systems using ReactJS, NextJS, NodeJS, Express, React Native, Swift, Kotlin, Flutter, Postgres, GraphQL, Go, Python. Includes architecture diagram generation, system design patterns, tech stack decision frameworks, and dependency analysis. Use when designing system architecture, making technical decisions, creating architecture diagrams, evaluating trade-offs, or defining integration patterns.