review
Code review with semantic diffs, expert routing, and auto-TaskCreate. Triggers on: code review, review changes, check code, review PR, security audit.
What this skill does
# Review Skill - AI Code Review
Perform comprehensive code reviews on staged changes, specific files, or pull requests. Routes to expert agents based on file types and automatically creates tasks for critical issues.
## Architecture
```
review [target] [--focus] [--depth]
│
├─→ Step 1: Determine Scope
│ ├─ No args → git diff --cached (staged)
│ ├─ --all → git diff HEAD (all uncommitted)
│ ├─ File path → specific file diff
│ └─ --pr N → gh pr diff N
│
├─→ Step 2: Analyze Changes (parallel)
│ ├─ delta for syntax-highlighted diff
│ ├─ difft for semantic diff (structural)
│ ├─ Categorize: logic, style, test, docs, config
│ └─ Identify touched modules/components
│
├─→ Step 3: Load Project Standards
│ ├─ AGENTS.md, CLAUDE.md conventions
│ ├─ .eslintrc, .prettierrc, pyproject.toml
│ ├─ Detect test framework
│ └─ Check CI config for existing linting
│
├─→ Step 4: Route to Expert Reviewers
│ ├─ TypeScript → typescript-expert
│ ├─ React/JSX → react-expert
│ ├─ Python → python-expert
│ ├─ Go → go-expert
│ ├─ Rust → rust-expert
│ ├─ Vue → vue-expert
│ ├─ SQL/migrations → postgres-expert
│ ├─ Claude extensions → claude-architect
│ ├─ Multi-domain → parallel expert dispatch
│ └─ All experts preload: security-ops + testing-ops context
│
├─→ Step 5: Generate Review
│ ├─ Severity: CRITICAL / WARNING / SUGGESTION / PRAISE
│ ├─ Line-specific comments (file:line refs)
│ ├─ Suggested fixes as diff blocks
│ └─ Overall verdict: Ready to commit? Y/N
│
└─→ Step 6: Integration
├─ Auto-create tasks (TaskCreate) for CRITICAL issues
├─ Link to /save for tracking
└─ Suggest follow-up: /testgen, /explain
```
## Execution Steps
### Step 1: Determine Scope
```bash
# Default: staged changes
git diff --cached --name-only
# Check if anything is staged
STAGED=$(git diff --cached --name-only | wc -l)
if [ "$STAGED" -eq 0 ]; then
echo "No staged changes. Use --all for uncommitted or specify a file."
git status --short
fi
```
**For PR review:**
```bash
gh pr diff $PR_NUMBER --patch
```
**For specific file:**
```bash
git diff HEAD -- "$FILE"
```
**For baseline comparison (--base):**
```bash
git diff $BASE_BRANCH...HEAD
```
### Step 2: Analyze Changes
Run semantic diff analysis (parallel where possible):
**With difft (semantic):**
```bash
command -v difft >/dev/null 2>&1 && git difftool --tool=difftastic --no-prompt HEAD~1 || git diff HEAD~1
```
**With delta (syntax highlighting):**
```bash
command -v delta >/dev/null 2>&1 && git diff --cached | delta || git diff --cached
```
**Categorize changes:**
```bash
git diff --cached --name-only | while read file; do
case "$file" in
*.test.* | *.spec.*) echo "TEST: $file" ;;
*.md | docs/*) echo "DOCS: $file" ;;
*.json | *.yaml | *.toml) echo "CONFIG: $file" ;;
*) echo "CODE: $file" ;;
esac
done
```
**Get diff statistics:**
```bash
git diff --cached --stat
```
### Step 3: Load Project Standards
```bash
# Claude Code conventions
cat AGENTS.md 2>/dev/null | head -50
cat CLAUDE.md 2>/dev/null | head -50
# Linting configs
cat .eslintrc* 2>/dev/null | head -30
cat .prettierrc* 2>/dev/null
cat pyproject.toml 2>/dev/null | head -30
# Test framework detection
cat package.json 2>/dev/null | jq '.devDependencies | keys | map(select(test("jest|vitest|mocha|cypress|playwright")))' 2>/dev/null
```
**Check CI for existing linting:**
```bash
cat .github/workflows/*.yml 2>/dev/null | grep -E "eslint|prettier|pylint|ruff" | head -10
```
### Step 4: Route to Expert Reviewers
| File Pattern | Primary Expert | Secondary Expert |
|--------------|----------------|------------------|
| `*.ts` | typescript-expert | - |
| `*.tsx` | react-expert | typescript-expert |
| `*.vue` | vue-expert | typescript-expert |
| `*.py` | python-expert | sql-expert (if ORM) |
| `*.go` | go-expert | - |
| `*.rs` | rust-expert | - |
| `*.sql`, `migrations/*` | postgres-expert | - |
| `agents/*.md`, `skills/*`, `commands/*` | claude-architect | - |
| `*.test.*`, `*.spec.*` | cypress-expert | (framework expert) |
| `*.cy.ts`, `cypress/*` | cypress-expert | typescript-expert |
| `*.spec.ts` (Playwright) | typescript-expert | - |
| `playwright/*`, `e2e/*` | typescript-expert | - |
| `wrangler.toml`, `workers/*` | wrangler-expert | cloudflare-expert |
| `*.sh`, `*.bash` | bash-expert | - |
**Invoke via Task tool:**
```
Task tool with subagent_type: "[detected]-expert"
model: "sonnet"
Prompt includes:
- Skill preloading (domain knowledge):
"First, read these files for review context:
- Read: skills/security-ops/references/owasp-detailed.md
- Read: skills/testing-ops/SKILL.md"
- Diff content
- Project conventions from AGENTS.md
- Linting config summaries
- Requested focus area
- Request for structured review output
```
**Language-specific preloads** (append to the preloading section above):
| Expert | Additional Preload | Why |
|--------|-------------------|-----|
| python-expert | `skills/python-pytest-ops/SKILL.md` | Python test patterns for coverage review |
| go-expert | `skills/go-ops/SKILL.md` | Go idioms, concurrency gotchas |
| rust-expert | `skills/rust-ops/SKILL.md` | Ownership patterns, unsafe review |
| typescript-expert | `skills/typescript-ops/SKILL.md` | Type safety patterns |
### Step 5: Generate Review
The expert produces a structured review:
```markdown
# Code Review: [scope description]
## Summary
| Metric | Value |
|--------|-------|
| Files reviewed | N |
| Lines changed | +X / -Y |
| Issues found | N (X critical, Y warnings) |
## Verdict
**Ready to commit?** Yes / No
[1-2 sentence summary of overall quality]
---
## Critical Issues
### `src/auth/login.ts:42`
**Issue:** SQL injection vulnerability in user input handling
**Risk:** Attacker can execute arbitrary SQL queries
**Fix:**
```diff
- const query = `SELECT * FROM users WHERE id = ${userId}`;
+ const query = `SELECT * FROM users WHERE id = $1`;
+ const result = await db.query(query, [userId]);
```
---
## Warnings
### `src/components/Form.tsx:89`
**Issue:** Missing dependency in useEffect
**Suggestion:** Add `userId` to dependency array
```diff
- useEffect(() => { fetchUser(userId) }, []);
+ useEffect(() => { fetchUser(userId) }, [userId]);
```
---
## Suggestions
[Style improvements, optional enhancements]
---
## Praise
[Good patterns worth noting]
---
## Files Reviewed
| File | Changes | Issues |
|------|---------|--------|
| `src/auth/login.ts` | +42/-8 | 1 critical |
```
### Step 6: Integration
**Auto-create tasks for CRITICAL issues:**
```
TaskCreate:
subject: "Fix: SQL injection in login.ts:42"
description: "SQL injection vulnerability found in user input handling."
activeForm: "Fixing SQL injection in login.ts:42"
```
**Link with dependencies for related issues:**
```
TaskCreate: #1 "Fix SQL injection in login.ts"
TaskCreate: #2 "Fix SQL injection in register.ts"
TaskUpdate: taskId: "2", addBlockedBy: ["1"]
```
**After fixing issues:**
```
TaskUpdate:
taskId: "1"
status: "completed"
```
---
## Severity System
| Level | Icon | Meaning | Action | Auto-Task? |
|-------|------|---------|--------|------------|
| CRITICAL | :red_circle: | Security bug, data loss risk, crashes | Must fix before merge | Yes |
| WARNING | :yellow_circle: | Logic issues, performance problems | Should address | No |
| SUGGESTION | :blue_circle: | Style, minor improvements | Optional | No |
| PRAISE | :star: | Good patterns worth noting | Recognition | No |
---
## Focus Modes
| Mode | What It Checks |
|------|----------------|
| `--security` | OWASP top 10, secrets in code, injection, auth issues |
| `--perf` | N+1 queries, unnecessary re-renders, complexity, memory |
| `--types` | Type safety, `any` usage, generics, nullRelated in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.