Code Review Skill Purpose: Enforce automated code reviews as a mandatory guardrail before every commit and deployment. Choose between Claude, OpenAI Codex, Google Gemini, or multiple engines for comprehensive analysis. Sub-skills: - adr-gate.md — Pre-review ADR and spec enforcement --- Pre-Review: ADR Gate (Mandatory) Before any review engine runs, the ADR gate executes automatically: 1. Classify — trivial changes (typos, deps, tests-only) skip the gate 2. Discover — scan , , iCPG ReasonNodes, git history for linked ADRs and specs 3. Enforce — if no ADRs found for non-trivial changes: - Inter…

)\n\nif [ -n \"$STAGED_FILES\" ]; then\n # Invoke code review (requires claude CLI)\n claude --print \"/code-review $STAGED_FILES\" > /tmp/code-review-result.txt 2>&1\n\n # Check for critical/high issues\n if grep -q \"🔴\\|Critical\\|🟠\\|High\" /tmp/code-review-result.txt; then\n echo \"❌ Code review found critical/high issues:\"\n cat /tmp/code-review-result.txt\n echo \"\"\n echo \"Fix these issues before committing.\"\n exit 1\n fi\n\n echo \"✅ Code review passed\"\nfi\n\nexit 0\n```\n\n### Make Hook Executable\n\n```bash\nchmod +x .git/hooks/pre-commit\n```\n\n---\n\n## Codex CLI Setup (For Codex/Both Modes)\n\nIf you want to use Codex or Both modes, install the Codex CLI:\n\n```bash\n# Prerequisites: Node.js 22+\nnode --version # Must be 22+\n\n# Install Codex CLI\nnpm install -g @openai/codex\n\n# Authenticate (choose one):\n# Option 1: ChatGPT subscription (Plus, Pro, Team, Enterprise)\ncodex # Follow prompts to sign in\n\n# Option 2: API key\nexport OPENAI_API_KEY=sk-proj-...\n```\n\n### Verify Installation\n\n```bash\n# Check Codex is installed\ncodex --version\n\n# Test review\ncodex\n> /review\n```\n\nSee `codex-review.md` skill for full Codex documentation.\n\n---\n\n## Gemini CLI Setup (For Gemini/Multi-Engine Modes)\n\nIf you want to use Gemini or multi-engine modes, install the Gemini CLI:\n\n```bash\n# Prerequisites: Node.js 20+\nnode --version # Must be 20+\n\n# Install Gemini CLI\nnpm install -g @google/gemini-cli\n\n# Or via Homebrew (macOS)\nbrew install gemini-cli\n\n# Install Code Review extension\ngemini extensions install https://github.com/gemini-cli-extensions/code-review\n```\n\n### Authenticate\n\n```bash\n# Option 1: Google Account (recommended, 1000 req/day free)\ngemini # Follow browser login prompts\n\n# Option 2: API key (100 req/day free)\nexport GEMINI_API_KEY=\"your-key-from-aistudio.google.com\"\n```\n\n### Verify Installation\n\n```bash\n# Check Gemini is installed\ngemini --version\n\n# List extensions\ngemini extensions list\n\n# Test review\ngemini\n> /code-review\n```\n\nSee `gemini-review.md` skill for full Gemini documentation.\n\n---\n\n## CI/CD Integration\n\n### GitHub Actions - Claude Only\n\n```yaml\n# .github/workflows/code-review.yml\nname: Code Review\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n code-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Get changed files\n id: changed-files\n run: |\n echo \"files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | tr '\\n' ' ')\" >> $GITHUB_OUTPUT\n\n - name: Run Claude Code Review\n env:\n ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n run: |\n npx @anthropic-ai/claude-code --print \"/code-review ${{ steps.changed-files.outputs.files }}\" > review.md\n\n - name: Post Review Comment\n uses: actions/github-script@v7\n with:\n script: |\n const fs = require('fs');\n const review = fs.readFileSync('review.md', 'utf8');\n\n github.rest.issues.createComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n body: `## 🔍 Claude Code Review\\n\\n${review}`\n });\n\n - name: Check for Critical Issues\n run: |\n if grep -q \"Critical\\|🔴\" review.md; then\n echo \"❌ Critical issues found\"\n exit 1\n fi\n```\n\n### GitHub Actions - Codex Only\n\n```yaml\n# .github/workflows/codex-review.yml\nname: Codex Code Review\n\non:\n pull_request:\n\njobs:\n review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Codex Review\n uses: openai/codex-action@main\n with:\n openai_api_key: ${{ secrets.OPENAI_API_KEY }}\n model: gpt-5.2-codex\n safety_strategy: drop-sudo\n```\n\n### GitHub Actions - Both Engines\n\n```yaml\n# .github/workflows/dual-review.yml\nname: Dual Code Review\n\non:\n pull_request:\n\njobs:\n claude-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Claude Review\n env:\n ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n run: |\n npx @anthropic-ai/claude-code --print \"/code-review\" > claude-review.md\n\n - uses: actions/upload-artifact@v4\n with:\n name: claude-review\n path: claude-review.md\n\n codex-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - uses: actions/setup-node@v4\n with:\n node-version: '22'\n\n - name: Install Codex\n run: npm install -g @openai/codex\n\n - name: Codex Review\n env:\n OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}\n run: |\n codex exec --full-auto --sandbox read-only \\\n --output-last-message codex-review.md \\\n \"Review this code for bugs, security issues, and quality problems\"\n\n - uses: actions/upload-artifact@v4\n with:\n name: codex-review\n path: codex-review.md\n\n combine-reviews:\n needs: [claude-review, codex-review]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/download-artifact@v4\n\n - name: Combine Reviews\n run: |\n echo \"## 🔍 Dual Code Review Results\" > combined-review.md\n echo \"\" >> combined-review.md\n echo \"### Claude Findings\" >> combined-review.md\n cat claude-review/claude-review.md >> combined-review.md\n echo \"\" >> combined-review.md\n echo \"### Codex Findings\" >> combined-review.md\n cat codex-review/codex-review.md >> combined-review.md\n\n - name: Post Combined Review\n uses: actions/github-script@v7\n with:\n script: |\n const fs = require('fs');\n const review = fs.readFileSync('combined-review.md', 'utf8');\n github.rest.issues.createComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n body: review\n });\n```\n\n### GitHub Actions - Gemini Only\n\n```yaml\n# .github/workflows/gemini-review.yml\nname: Gemini Code Review\n\non:\n pull_request:\n types: [opened, synchronize]\n\njobs:\n review:\n runs-on: ubuntu-latest\n permissions:\n contents: read\n pull-requests: write\n\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Setup Node.js\n uses: actions/setup-node@v4\n with:\n node-version: '20'\n\n - name: Install Gemini CLI\n run: npm install -g @google/gemini-cli\n\n - name: Run Review\n env:\n GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}\n run: |\n # Get diff\n git diff origin/${{ github.base_ref }}...HEAD > diff.txt\n\n # Run Gemini review\n gemini -p \"Review this pull request diff for bugs, security issues, and code quality problems. Be specific about file names and line numbers.\n\n $(cat diff.txt)\" > review.md\n\n - name: Post Review Comment\n uses: actions/github-script@v7\n with:\n script: |\n const fs = require('fs');\n const review = fs.readFileSync('review.md', 'utf8');\n github.rest.issues.createComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n body: `## 🤖 Gemini Code Review\\n\\n${review}`\n });\n\n - name: Check for Critical Issues\n run: |\n if grep -qi \"critical\\|security vulnerability\\|injection\" review.md; then\n echo \"❌ Critical issues found\"\n exit 1\n fi\n```\n\n### GitHub Actions - All Three Engines\n\n```yaml\n# .github/workflows/triple-review.yml\nname: Triple Engine Code Review\n\non:\n pull_request:\n\njobs:\n claude-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Claude Review\n env:\n ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n run: |\n npx @anthropic-ai/claude-code --print \"/code-review\" > claude-review.md\n\n - uses: actions/upload-artifact@v4\n with:\n name: claude-review\n path: claude-review.md\n\n codex-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - uses: actions/setup-node@v4\n with:\n node-version: '22'\n\n - name: Install Codex\n run: npm install -g @openai/codex\n\n - name: Codex Review\n env:\n OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}\n run: |\n codex exec --full-auto --sandbox read-only \\\n --output-last-message codex-review.md \\\n \"Review this code for bugs, security issues, and quality problems\"\n\n - uses: actions/upload-artifact@v4\n with:\n name: codex-review\n path: codex-review.md\n\n gemini-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - uses: actions/setup-node@v4\n with:\n node-version: '20'\n\n - name: Install Gemini CLI\n run: npm install -g @google/gemini-cli\n\n - name: Gemini Review\n env:\n GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}\n run: |\n git diff origin/${{ github.base_ref }}...HEAD > diff.txt\n gemini -p \"Review this code diff for bugs, security, and quality issues:\n $(cat diff.txt)\" > gemini-review.md\n\n - uses: actions/upload-artifact@v4\n with:\n name: gemini-review\n path: gemini-review.md\n\n combine-reviews:\n needs: [claude-review, codex-review, gemini-review]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/download-artifact@v4\n\n - name: Combine Reviews\n run: |\n echo \"## 🔍 Triple Engine Code Review Results\" > combined-review.md\n echo \"\" >> combined-review.md\n echo \"### 🟣 Claude Findings\" >> combined-review.md\n cat claude-review/claude-review.md >> combined-review.md\n echo \"\" >> combined-review.md\n echo \"---\" >> combined-review.md\n echo \"### 🟢 Codex Findings\" >> combined-review.md\n cat codex-review/codex-review.md >> combined-review.md\n echo \"\" >> combined-review.md\n echo \"---\" >> combined-review.md\n echo \"### 🔵 Gemini Findings\" >> combined-review.md\n cat gemini-review/gemini-review.md >> combined-review.md\n\n - name: Post Combined Review\n uses: actions/github-script@v7\n with:\n script: |\n const fs = require('fs');\n const review = fs.readFileSync('combined-review.md', 'utf8');\n github.rest.issues.createComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n body: review\n });\n\n - name: Check Critical Issues\n run: |\n # Fail if any engine found critical issues\n if grep -qi \"critical\\|🔴\" combined-review.md; then\n echo \"❌ Critical issues found by at least one engine\"\n exit 1\n fi\n```\n\n---\n\n## Review Checklist\n\n### Before Every Commit\n\n- [ ] Run `/code-review` on staged changes\n- [ ] No critical (🔴) issues\n- [ ] No high (🟠) issues\n- [ ] Security concerns addressed\n- [ ] Performance issues considered\n\n### Before Every PR\n\n- [ ] Full code review of all changes\n- [ ] All critical/high issues resolved\n- [ ] Tests added for new functionality\n- [ ] Documentation updated if needed\n\n### Before Every Deployment\n\n- [ ] Final review of deployment diff\n- [ ] Security scan passed\n- [ ] No new vulnerabilities introduced\n- [ ] Rollback plan documented\n\n---\n\n## Common Review Findings\n\n### Security Issues (Always Fix)\n\n| Issue | Example | Fix |\n|-------|---------|-----|\n| SQL Injection | `query = f\"SELECT * FROM users WHERE id = {id}\"` | Use parameterized queries |\n| XSS | `innerHTML = userInput` | Sanitize or use textContent |\n| Secrets in code | `apiKey = \"sk-xxx\"` | Use environment variables |\n| Missing auth | Unprotected endpoints | Add authentication middleware |\n| Insecure crypto | MD5/SHA1 for passwords | Use bcrypt/argon2 |\n\n### Performance Issues (Should Fix)\n\n| Issue | Example | Fix |\n|-------|---------|-----|\n| N+1 queries | Loop with individual queries | Use batch/eager loading |\n| Memory leak | Unclosed connections | Use connection pooling |\n| Missing index | Slow queries | Add database indexes |\n| Large payload | Fetching unused fields | Select only needed fields |\n| No pagination | Loading all records | Implement pagination |\n\n### Code Quality (Nice to Fix)\n\n| Issue | Example | Fix |\n|-------|---------|-----|\n| Long function | 100+ lines | Extract into smaller functions |\n| Deep nesting | 5+ levels | Early returns, extract methods |\n| Magic numbers | `if (status === 3)` | Use named constants |\n| Duplicate code | Copy-pasted blocks | Extract shared function |\n| Missing types | `any` everywhere | Add proper TypeScript types |\n\n---\n\n## Post-Review: Decision Extraction\n\nAfter review completes, extract architectural decisions automatically:\n\n1. If review flagged new architectural choices → prompt to create ADR in `docs/adr/`\n2. If review approved a new pattern → log to `_project_specs/session/decisions.md`\n3. If review found ADR drift → flag the ADR for update or supersede\n\n```markdown\n### Auto-Log Entry (decisions.md)\n- [YYYY-MM-DD] **[Review Finding]**: Brief description\n - Source: Code review of [PR/commit]\n - ADR: Created/Updated ADR-NNNN\n - Impact: What changed\n```\n\n---\n\n## Integration with TDD Workflow\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│ TDD + CODE REVIEW WORKFLOW │\n│ ───────────────────────────────────────────────────────────── │\n│ │\n│ 1. RED: Write failing tests │\n│ 2. GREEN: Write code to pass tests │\n│ 3. REFACTOR: Clean up code │\n│ 4. REVIEW: Run /code-review ← NEW STEP │\n│ 5. FIX: Address critical/high issues │\n│ 6. VALIDATE: Lint + TypeCheck + Coverage │\n│ 7. COMMIT: Only after review passes │\n│ │\n│ Review catches what tests miss: │\n│ - Security vulnerabilities │\n│ - Performance issues │\n│ - Architecture problems │\n│ - Code maintainability │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n---\n\n## Review Response Template\n\nWhen code review finds issues, respond with:\n\n```markdown\n## Code Review Results\n\n### 🔴 Critical Issues (Must Fix)\n1. **SQL Injection in userController.ts:45**\n - Issue: User input directly interpolated into query\n - Fix: Use parameterized query\n - Code: `db.query('SELECT * FROM users WHERE id = $1', [userId])`\n\n### 🟠 High Issues (Should Fix)\n1. **Missing authentication on /api/admin endpoints**\n - Issue: Admin routes accessible without auth\n - Fix: Add auth middleware\n\n### 🟡 Medium Issues (Fix Soon)\n1. **N+1 query in getOrders function**\n - Consider eager loading or batch query\n\n### 🟢 Low Issues (Nice to Have)\n1. **Consider extracting validation logic to separate file**\n\n### ✅ Strengths\n- Good test coverage\n- Clear function names\n- Proper error handling\n\n### 📊 Summary\n- Critical: 1 | High: 1 | Medium: 1 | Low: 1\n- **Status: ❌ BLOCKED** - Fix critical/high issues before commit\n```\n\n---\n\n## Claude Instructions\n\n### When to Invoke Code Review\n\nClaude should automatically suggest or run code review:\n\n1. **After completing a feature** → \"Let me run a code review before we commit\"\n2. **Before creating a PR** → \"Running code review on all changes\"\n3. **When user says \"commit\"** → \"First, let me review the changes\"\n4. **After fixing bugs** → \"Reviewing the fix for any issues\"\n\n### Review Focus Areas\n\nPrioritize review based on change type:\n\n| Change Type | Focus Areas |\n|-------------|-------------|\n| Auth/Security code | Security, input validation, crypto |\n| Database code | SQL injection, N+1, transactions |\n| API endpoints | Auth, rate limiting, validation |\n| Frontend code | XSS, state management, performance |\n| Infrastructure | Secrets, permissions, logging |\n\n---\n\n## Quick Reference\n\n### Commands\n\n```bash\n# Basic review\n/code-review\n\n# Review specific files\n/code-review src/auth.ts src/users.ts\n\n# Review with focus\n/code-review --focus security\n\n# Review PR\n/code-review --pr 123\n```\n\n### Severity Actions\n\n```\n🔴 Critical → STOP. Fix now. No commit.\n🟠 High → STOP. Fix now. No commit.\n🟡 Medium → Note it. Fix soon. Can commit.\n🟢 Low → Optional. Nice to have.\nℹ️ Info → FYI only.\n```\n\n### Workflow\n\n```\nCode → Test → Review → Fix → Commit → Push → PR → Review → Merge → Deploy\n ↑ ↑ ↑\n /code-review /code-review /code-review\n```","attachment_filenames":["adr-gate.md"],"attachments":[{"filename":"adr-gate.md","content":"---\nname: adr-gate\ndescription: Pre-review gate that enforces ADR and spec linkage before code review proceeds\nwhen-to-use: Automatically before every /code-review invocation\nuser-invocable: false\neffort: low\n---\n\n# ADR Gate — Pre-Review Spec Enforcement\n\nEvery code review must have architectural context. This gate runs before review engines and ensures changes are linked to ADRs (Architecture Decision Records) and specs.\n\n---\n\n## Gate Protocol\n\nBefore any review engine runs, execute this sequence:\n\n```\nChanged files detected\n |\n v\n[1. Classify change scope]\n |\n v\n Trivial? ──YES──> Skip gate, proceed to review\n |\n NO\n v\n[2. Discover linked ADRs + specs]\n |\n v\n Found? ──YES──> Inject into review context\n |\n NO\n v\n[3. Reverse-engineer ADR draft]\n |\n v\n[4. Present draft to user OR auto-tag as \"proposed\"]\n |\n v\n[5. Proceed to review with ADR context]\n```\n\n---\n\n## Step 1: Classify Change Scope\n\nExempt trivial changes from ADR requirements:\n\n### Trivial (Skip Gate)\n- Typo fixes, comment edits, whitespace\n- Dependency version bumps (patch/minor)\n- Test-only changes that don't alter behavior\n- Config value changes (not structural)\n- Changelog/README updates\n\n### Detection\n```bash\n# If ALL changed files match trivial patterns, skip gate\nTRIVIAL_PATTERNS=\"CHANGELOG|README|\\.lock$|\\.md$|__snapshots__|\\.test\\.|\\.spec\\.\"\n```\n\n### Non-Trivial (Gate Applies)\n- New files or deleted files\n- Changes to API routes, models, schemas\n- Security-related files (auth, crypto, permissions)\n- Architecture changes (new services, new patterns)\n- Database migrations\n\n---\n\n## Step 2: Discover ADRs + Specs\n\nSearch in order — stop when context is sufficient:\n\n### 2a. Check `docs/adr/` directory\n```bash\n# List existing ADRs\nls docs/adr/*.md 2>/dev/null\n\n# Search ADR content for references to changed files/modules\ngrep -rl \"module_name\\|feature_name\" docs/adr/ 2>/dev/null\n```\n\n### 2b. Query iCPG (if indexed)\n```\nsearch_graph(name_pattern=\"*\", label=\"ReasonNode\")\n```\nMatch ReasonNodes to changed file paths. If iCPG is not available, skip — this step is optional.\n\n### 2c. Check `_project_specs/`\n```bash\n# Search specs for references to the changed area\ngrep -rl \"feature_name\\|module_name\" _project_specs/ 2>/dev/null\n```\n\n### 2d. Check git history for decision context\n```bash\n# Get commit messages that explain WHY for changed files\ngit log --oneline -10 -- \u003cchanged_files>\ngit log --grep=\"decision\\|chose\\|instead of\\|trade-off\" -5\n```\n\n### 2e. Check issue tracker references\n```bash\n# Look for ticket references in recent commits\ngit log --oneline -20 | grep -oE \"(#[0-9]+|[A-Z]+-[0-9]+)\"\n\n# Check PR description if in PR context\ngh pr view --json body -q .body 2>/dev/null\n```\n\n### Discovery Output\nProduce an ADR context block:\n\n```markdown\n## ADR Context for Review\n\n### Linked ADRs\n- ADR-0003: Use Zustand for state management (accepted)\n- ADR-0007: Atomic file writes for editor (accepted)\n\n### Linked Specs\n- _project_specs/phase-08-editor.md\n- GitHub Issue #25: In-browser file editor\n\n### Relevant Decisions (from git history)\n- \"Chose atomic write via temp+rename over direct write\" (commit abc123)\n\n### Coverage\n- 3/5 changed files have ADR linkage\n- 2 files have no documented decision context\n```\n\n---\n\n## Step 3: Reverse-Engineer ADR Draft\n\nWhen ADRs are missing for non-trivial changes, draft one:\n\n### Input Sources\n1. `git log --follow -5 \u003cfile>` — commit messages for intent\n2. `git diff` — what actually changed\n3. File content — module structure, imports, patterns\n4. PR description (if available)\n\n### Draft Template\n```markdown\n# NNNN - [Auto-generated title from change description]\n\n**Status:** proposed\n**Date:** [today]\n**Spec:** [discovered spec or \"none — needs linking\"]\n**Deciders:** [git author]\n\n## Context\n[Extracted from commit messages and PR description]\n\n## Decision\n[Inferred from the code changes — what pattern/library/approach was chosen]\n\n## Consequences\n[Inferred trade-offs from the implementation]\n\n## Alternatives Considered\n[If git history shows rejected approaches, include them]\n```\n\n---\n\n## Step 4: Present or Auto-Tag\n\n### Interactive Mode (default when user is present)\nPresent the draft ADR:\n```\nNo ADR found for changes to src/services/editor.ts.\nHere's a draft based on git history and code:\n\n # 0008 - Atomic file writes for editor API\n Status: proposed\n Decision: Use temp file + os.rename for atomic saves\n Context: Editor needs crash-safe writes...\n\nAccept this ADR? [Y/edit/skip]\n```\n\n### Unattended Mode (CI/CD, headless)\n- Write ADR draft as `docs/adr/NNNN-draft-TITLE.md` with `Status: proposed`\n- Log warning: \"ADR auto-generated as proposed — needs human review\"\n- Do NOT mark as \"accepted\" — only humans accept ADRs\n- Review proceeds with the proposed ADR as context\n\n### Configuration\nSet in project CLAUDE.md or `.claude/settings.json`:\n```toml\n[adr-gate]\nmode = \"interactive\" # interactive | unattended | strict\n# interactive: ask user to confirm ADR drafts\n# unattended: auto-write as proposed, proceed\n# strict: block review until ADR exists (not auto-generated)\n```\n\n---\n\n## Step 5: Inject into Review Context\n\nPrepend this block to the review prompt sent to any engine:\n\n```markdown\n## Architectural Context (ADR Gate)\n\n### Active ADRs for This Change\n[List of relevant ADRs with status and summary]\n\n### Linked Specifications\n[List of specs/tickets with key requirements]\n\n### Review Against ADRs\nIn addition to standard review categories, verify:\n1. Does this change conform to the linked ADRs?\n2. Does it introduce decisions not captured in any ADR?\n3. Should any existing ADR be updated or superseded?\n4. Are there spec requirements not addressed by this change?\n```\n\n---\n\n## New Review Dimension: ADR Compliance\n\nAdded to the standard review categories:\n\n| Category | What It Checks |\n|----------|----------------|\n| **ADR Compliance** | Change conforms to documented decisions, no undocumented architectural shifts |\n\n### Severity for ADR Issues\n| Finding | Severity |\n|---------|----------|\n| Change contradicts accepted ADR | Critical |\n| Architectural decision not in any ADR | High |\n| ADR exists but is outdated/stale | Medium |\n| Minor drift from ADR intent | Low |\n\n---\n\n## Post-Review: Decision Extraction\n\nAfter review completes, extract new decisions:\n\n1. If review flagged architectural choices → prompt to create ADR\n2. If review approved a new pattern → log to `_project_specs/session/decisions.md`\n3. If review found ADR drift → flag ADR for update\n\n### Auto-Log Format (decisions.md)\n```markdown\n- [YYYY-MM-DD] **[Review Finding]**: Brief description\n - Source: Code review of [PR/commit]\n - ADR: Created/Updated ADR-NNNN\n - Impact: [What changed]\n```\n\n---\n\n## ADR Numbering\n\nADRs use sequential 4-digit numbers: `0001`, `0002`, etc.\n\n### Auto-Number Logic\n```bash\n# Find next ADR number\nLAST=$(ls docs/adr/*.md 2>/dev/null | sort -t- -k1 -n | tail -1 | grep -oE '[0-9]{4}' | head -1)\nNEXT=$(printf \"%04d\" $((${LAST:-0} + 1)))\n```\n\n---\n\n## Project Init Integration\n\nWhen a project is initialized via claude-bootstrap:\n1. Create `docs/adr/` directory\n2. Write `docs/adr/0001-project-init.md` with tech stack decisions\n3. Add `docs/adr/` to the file structure documentation\n4. Register ADR pattern in session decisions.md\n\n---\n\n## Quick Reference\n\n```\n/code-review → ADR gate runs automatically before review\ndocs/adr/NNNN-*.md → ADR storage location\n_project_specs/ → Spec storage (phases, roadmap)\ndecisions.md → Session decision log (auto-appended)\n\nADR statuses: proposed → accepted → deprecated/superseded\nGate modes: interactive | unattended | strict\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":7731,"content_sha256":"927efd7e2337d3e43ebef24ad9427004e770448ecbd27067a654c866bb67e6b2"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Code Review Skill","type":"text"}]},{"type":"paragraph","content":[{"text":"Purpose:","type":"text","marks":[{"type":"strong"}]},{"text":" Enforce automated code reviews as a mandatory guardrail before every commit and deployment. Choose between Claude, OpenAI Codex, Google Gemini, or multiple engines for comprehensive analysis.","type":"text"}]},{"type":"paragraph","content":[{"text":"Sub-skills:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"adr-gate.md","type":"text","marks":[{"type":"link","attrs":{"href":"./adr-gate.md","title":null}}]},{"text":" — Pre-review ADR and spec enforcement","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Pre-Review: ADR Gate (Mandatory)","type":"text"}]},{"type":"paragraph","content":[{"text":"Before any review engine runs, the ADR gate executes automatically:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Classify","type":"text","marks":[{"type":"strong"}]},{"text":" — trivial changes (typos, deps, tests-only) skip the gate","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Discover","type":"text","marks":[{"type":"strong"}]},{"text":" — scan ","type":"text"},{"text":"docs/adr/","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"_project_specs/","type":"text","marks":[{"type":"code_inline"}]},{"text":", iCPG ReasonNodes, git history for linked ADRs and specs","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Enforce","type":"text","marks":[{"type":"strong"}]},{"text":" — if no ADRs found for non-trivial changes:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Interactive","type":"text","marks":[{"type":"strong"}]},{"text":" (default): draft ADR from git history, ask user to confirm","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Unattended","type":"text","marks":[{"type":"strong"}]},{"text":" (CI): write as ","type":"text"},{"text":"Status: proposed","type":"text","marks":[{"type":"code_inline"}]},{"text":", proceed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Strict","type":"text","marks":[{"type":"strong"}]},{"text":": block review until ADR exists","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Inject","type":"text","marks":[{"type":"strong"}]},{"text":" — feed discovered ADRs + specs into the review prompt as architectural context","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"ADR Compliance Review Dimension","type":"text"}]},{"type":"paragraph","content":[{"text":"Added to the standard 7 review categories:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Category","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"What It Checks","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ADR Compliance","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Change conforms to documented decisions, no undocumented architectural shifts","type":"text"}]}]}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Finding","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Severity","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Change contradicts accepted ADR","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Critical","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Architectural decision not in any ADR","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"High","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ADR exists but is outdated/stale","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Medium","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Minor drift from ADR intent","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Low","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"adr-gate.md","type":"text","marks":[{"type":"link","attrs":{"href":"./adr-gate.md","title":null}}]},{"text":" for full protocol, reverse-engineering rules, and configuration.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Review Engine Choice","type":"text"}]},{"type":"paragraph","content":[{"text":"When running ","type":"text"},{"text":"/code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":", users can choose their preferred review engine:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"┌─────────────────────────────────────────────────────────────────┐\n│ CODE REVIEW - Choose Your Engine │\n├─────────────────────────────────────────────────────────────────┤\n│ │\n│ ○ Claude (default) │\n│ Built-in, no extra setup, full conversation context │\n│ │\n│ ○ OpenAI Codex CLI │\n│ GPT-5.2-Codex specialized for code review, 88% detection │\n│ Requires: npm install -g @openai/codex │\n│ │\n│ ○ Google Gemini CLI │\n│ Gemini 2.5 Pro with 1M token context, free tier available │\n│ Requires: npm install -g @google/gemini-cli │\n│ │\n│ ○ Dual Engine (any two) │\n│ Run two engines, compare findings, catch more issues │\n│ │\n│ ○ All Three (maximum coverage) │\n│ Run Claude + Codex + Gemini for critical/security code │\n│ │\n└─────────────────────────────────────────────────────────────────┘","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Engine Comparison","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Aspect","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Claude","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Codex","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Gemini","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Multi-Engine","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Setup","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"None","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"npm + OpenAI API","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"npm + Google Account","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"All setups","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Speed","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fast","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fast","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fast","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"2-3x time","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Context","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Conversation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fresh per review","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"1M tokens","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"N/A","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Detection","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Good","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"88% (best)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"63.8% SWE-Bench","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Combined","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Free Tier","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"N/A","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Limited","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"1,000/day","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Varies","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Best for","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Quick reviews","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"High accuracy","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Large codebases","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Critical code","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Set Default Engine","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"toml"},"content":[{"text":"# ~/.claude/settings.toml or project CLAUDE.md\n[code-review]\ndefault_engine = \"claude\" # Options: claude, codex, gemini, dual, all","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Usage Examples","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Use default engine\n/code-review\n\n# Explicitly choose engine\n/code-review --engine claude\n/code-review --engine codex\n/code-review --engine gemini\n\n# Dual engine (pick any two)\n/code-review --engine claude,codex\n/code-review --engine claude,gemini\n/code-review --engine codex,gemini\n\n# All three engines\n/code-review --engine all\n\n# Quick shortcuts\n/code-review # Uses default\n/code-review --codex # Use Codex\n/code-review --gemini # Use Gemini\n/code-review --all # All three engines","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Multi-Engine Output","type":"text"}]},{"type":"paragraph","content":[{"text":"When using multiple engines, findings are compared and deduplicated:","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Dual Engine Example","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"┌─────────────────────────────────────────────────────────────────┐\n│ CODE REVIEW RESULTS - DUAL ENGINE (Claude + Codex) │\n├─────────────────────────────────────────────────────────────────┤\n│ │\n│ ✅ AGREED (Found by both): │\n│ 🔴 SQL injection in auth.ts:45 │\n│ 🟡 Missing error handling in api.ts:112 │\n│ │\n│ 🔷 CLAUDE ONLY: │\n│ 🟠 Potential race condition in worker.ts:89 │\n│ 🟢 Consider extracting helper function │\n│ │\n│ 🔶 CODEX ONLY: │\n│ 🟠 Memory leak - unclosed stream in upload.ts:34 │\n│ 🟡 N+1 query pattern in orders.ts:156 │\n│ │\n├─────────────────────────────────────────────────────────────────┤\n│ SUMMARY │\n│ Agreed: 2 | Claude only: 2 | Codex only: 2 │\n│ Critical: 1 | High: 2 | Medium: 2 | Low: 1 │\n│ Status: ❌ BLOCKED - Fix critical/high issues │\n└─────────────────────────────────────────────────────────────────┘","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Triple Engine Example (All Three)","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"┌─────────────────────────────────────────────────────────────────┐\n│ CODE REVIEW RESULTS - TRIPLE ENGINE │\n├─────────────────────────────────────────────────────────────────┤\n│ │\n│ ✅ UNANIMOUS (All 3 found): │\n│ 🔴 SQL injection in auth.ts:45 │\n│ │\n│ ✅ MAJORITY (2 of 3 found): │\n│ 🟠 Memory leak - unclosed stream in upload.ts:34 (Codex+Gemini)│\n│ 🟡 Missing error handling in api.ts:112 (Claude+Codex) │\n│ │\n│ 🔷 CLAUDE ONLY: │\n│ 🟠 Potential race condition in worker.ts:89 │\n│ │\n│ 🔶 CODEX ONLY: │\n│ 🟡 N+1 query pattern in orders.ts:156 │\n│ │\n│ 🟢 GEMINI ONLY: │\n│ 🟡 Consider using batch API for better performance │\n│ 🟢 Type could be more specific in types.ts:23 │\n│ │\n├─────────────────────────────────────────────────────────────────┤\n│ SUMMARY │\n│ Unanimous: 1 | Majority: 2 | Single: 5 │\n│ Critical: 1 | High: 2 | Medium: 3 | Low: 2 │\n│ Status: ❌ BLOCKED - Fix critical/high issues │\n└─────────────────────────────────────────────────────────────────┘","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"When to Use Each Mode","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Mode","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use When","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Single (Claude)","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Quick in-flow reviews, exploration","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Single (Codex)","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"CI/CD automation, high accuracy needed","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Single (Gemini)","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Large codebases (100+ files), free tier","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Dual","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Important PRs, pre-merge reviews","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Triple (All)","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Security-critical code, payment systems, auth","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Philosophy","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"┌─────────────────────────────────────────────────────────────────┐\n│ CODE REVIEW IS NON-NEGOTIABLE │\n│ ───────────────────────────────────────────────────────────── │\n│ │\n│ Every commit must pass code review. │\n│ Every PR must be reviewed before merge. │\n│ Every deployment must include review sign-off. │\n│ │\n│ AI catches what humans miss. Humans catch what AI misses. │\n│ Together: fewer bugs, cleaner code, better security. │\n├─────────────────────────────────────────────────────────────────┤\n│ INVOKE: /code-review │\n│ PLUGIN: code-review@claude-plugins-official │\n└─────────────────────────────────────────────────────────────────┘","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"When to Run Code Review","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Mandatory Review Points","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Trigger","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Action","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Command","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Before commit","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Review staged changes","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"/code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Before PR","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Review all changes vs base","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"/code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Before merge","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Final review of PR","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"/code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Before deploy","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Review deployment diff","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"/code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Automatic Integration","type":"text"}]},{"type":"paragraph","content":[{"text":"Run code review automatically before every commit:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"┌─────────────────────────────────────────────────────────────────┐\n│ COMMIT WORKFLOW │\n│ ───────────────────────────────────────────────────────────── │\n│ │\n│ 1. Write code │\n│ 2. Run tests (TDD - must pass) │\n│ 3. Run /code-review ← MANDATORY │\n│ 4. Address critical/high issues │\n│ 5. Commit │\n│ 6. Push │\n│ │\n│ Skip step 3? ❌ NO COMMIT ALLOWED │\n└─────────────────────────────────────────────────────────────────┘","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Using the Code Review Plugin","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Basic Usage","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Review current changes\n/code-review\n\n# Review specific files\n/code-review src/auth/*.ts\n\n# Review a PR\n/code-review --pr 123\n\n# Review with specific focus\n/code-review --focus security\n/code-review --focus performance\n/code-review --focus architecture","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Review Categories","type":"text"}]},{"type":"paragraph","content":[{"text":"The code review plugin analyzes:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Category","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"What It Checks","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Security","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Vulnerabilities, injection risks, auth issues, secrets","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Performance","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"N+1 queries, memory leaks, inefficient algorithms","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Architecture","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Design patterns, SOLID principles, coupling","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Code Quality","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Readability, complexity, duplication","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Best Practices","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Language idioms, framework conventions","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Testing","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Coverage gaps, test quality, edge cases","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Documentation","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Missing docs, outdated comments","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Severity Levels","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Level","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Action Required","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Can Commit?","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"🔴 ","type":"text"},{"text":"Critical","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Must fix immediately","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"❌ NO","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"🟠 ","type":"text"},{"text":"High","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Should fix before commit","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"❌ NO","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"🟡 ","type":"text"},{"text":"Medium","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fix soon, can commit","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ YES","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"🟢 ","type":"text"},{"text":"Low","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Nice to have","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ YES","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ℹ️ ","type":"text"},{"text":"Info","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Suggestions only","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ YES","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Pre-Commit Hook Integration","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Install Pre-Commit Hook","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"#!/bin/bash\n# .git/hooks/pre-commit\n\necho \"🔍 Running code review...\"\n\n# Run Claude code review on staged files\nSTAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\\.(ts|tsx|js|jsx|py|go|rs)

Code Review Skill Purpose: Enforce automated code reviews as a mandatory guardrail before every commit and deployment. Choose between Claude, OpenAI Codex, Google Gemini, or multiple engines for comprehensive analysis. Sub-skills: - adr-gate.md — Pre-review ADR and spec enforcement --- Pre-Review: ADR Gate (Mandatory) Before any review engine runs, the ADR gate executes automatically: 1. Classify — trivial changes (typos, deps, tests-only) skip the gate 2. Discover — scan , , iCPG ReasonNodes, git history for linked ADRs and specs 3. Enforce — if no ADRs found for non-trivial changes: - Inter…

)\n\nif [ -n \"$STAGED_FILES\" ]; then\n # Invoke code review (requires claude CLI)\n claude --print \"/code-review $STAGED_FILES\" > /tmp/code-review-result.txt 2>&1\n\n # Check for critical/high issues\n if grep -q \"🔴\\|Critical\\|🟠\\|High\" /tmp/code-review-result.txt; then\n echo \"❌ Code review found critical/high issues:\"\n cat /tmp/code-review-result.txt\n echo \"\"\n echo \"Fix these issues before committing.\"\n exit 1\n fi\n\n echo \"✅ Code review passed\"\nfi\n\nexit 0","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Make Hook Executable","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"chmod +x .git/hooks/pre-commit","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Codex CLI Setup (For Codex/Both Modes)","type":"text"}]},{"type":"paragraph","content":[{"text":"If you want to use Codex or Both modes, install the Codex CLI:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Prerequisites: Node.js 22+\nnode --version # Must be 22+\n\n# Install Codex CLI\nnpm install -g @openai/codex\n\n# Authenticate (choose one):\n# Option 1: ChatGPT subscription (Plus, Pro, Team, Enterprise)\ncodex # Follow prompts to sign in\n\n# Option 2: API key\nexport OPENAI_API_KEY=sk-proj-...","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Verify Installation","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Check Codex is installed\ncodex --version\n\n# Test review\ncodex\n> /review","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"codex-review.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" skill for full Codex documentation.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Gemini CLI Setup (For Gemini/Multi-Engine Modes)","type":"text"}]},{"type":"paragraph","content":[{"text":"If you want to use Gemini or multi-engine modes, install the Gemini CLI:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Prerequisites: Node.js 20+\nnode --version # Must be 20+\n\n# Install Gemini CLI\nnpm install -g @google/gemini-cli\n\n# Or via Homebrew (macOS)\nbrew install gemini-cli\n\n# Install Code Review extension\ngemini extensions install https://github.com/gemini-cli-extensions/code-review","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Authenticate","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Option 1: Google Account (recommended, 1000 req/day free)\ngemini # Follow browser login prompts\n\n# Option 2: API key (100 req/day free)\nexport GEMINI_API_KEY=\"your-key-from-aistudio.google.com\"","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Verify Installation","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Check Gemini is installed\ngemini --version\n\n# List extensions\ngemini extensions list\n\n# Test review\ngemini\n> /code-review","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"gemini-review.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" skill for full Gemini documentation.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"CI/CD Integration","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"GitHub Actions - Claude Only","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"yaml"},"content":[{"text":"# .github/workflows/code-review.yml\nname: Code Review\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n code-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Get changed files\n id: changed-files\n run: |\n echo \"files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | tr '\\n' ' ')\" >> $GITHUB_OUTPUT\n\n - name: Run Claude Code Review\n env:\n ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n run: |\n npx @anthropic-ai/claude-code --print \"/code-review ${{ steps.changed-files.outputs.files }}\" > review.md\n\n - name: Post Review Comment\n uses: actions/github-script@v7\n with:\n script: |\n const fs = require('fs');\n const review = fs.readFileSync('review.md', 'utf8');\n\n github.rest.issues.createComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n body: `## 🔍 Claude Code Review\\n\\n${review}`\n });\n\n - name: Check for Critical Issues\n run: |\n if grep -q \"Critical\\|🔴\" review.md; then\n echo \"❌ Critical issues found\"\n exit 1\n fi","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"GitHub Actions - Codex Only","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"yaml"},"content":[{"text":"# .github/workflows/codex-review.yml\nname: Codex Code Review\n\non:\n pull_request:\n\njobs:\n review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Codex Review\n uses: openai/codex-action@main\n with:\n openai_api_key: ${{ secrets.OPENAI_API_KEY }}\n model: gpt-5.2-codex\n safety_strategy: drop-sudo","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"GitHub Actions - Both Engines","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"yaml"},"content":[{"text":"# .github/workflows/dual-review.yml\nname: Dual Code Review\n\non:\n pull_request:\n\njobs:\n claude-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Claude Review\n env:\n ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n run: |\n npx @anthropic-ai/claude-code --print \"/code-review\" > claude-review.md\n\n - uses: actions/upload-artifact@v4\n with:\n name: claude-review\n path: claude-review.md\n\n codex-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - uses: actions/setup-node@v4\n with:\n node-version: '22'\n\n - name: Install Codex\n run: npm install -g @openai/codex\n\n - name: Codex Review\n env:\n OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}\n run: |\n codex exec --full-auto --sandbox read-only \\\n --output-last-message codex-review.md \\\n \"Review this code for bugs, security issues, and quality problems\"\n\n - uses: actions/upload-artifact@v4\n with:\n name: codex-review\n path: codex-review.md\n\n combine-reviews:\n needs: [claude-review, codex-review]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/download-artifact@v4\n\n - name: Combine Reviews\n run: |\n echo \"## 🔍 Dual Code Review Results\" > combined-review.md\n echo \"\" >> combined-review.md\n echo \"### Claude Findings\" >> combined-review.md\n cat claude-review/claude-review.md >> combined-review.md\n echo \"\" >> combined-review.md\n echo \"### Codex Findings\" >> combined-review.md\n cat codex-review/codex-review.md >> combined-review.md\n\n - name: Post Combined Review\n uses: actions/github-script@v7\n with:\n script: |\n const fs = require('fs');\n const review = fs.readFileSync('combined-review.md', 'utf8');\n github.rest.issues.createComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n body: review\n });","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"GitHub Actions - Gemini Only","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"yaml"},"content":[{"text":"# .github/workflows/gemini-review.yml\nname: Gemini Code Review\n\non:\n pull_request:\n types: [opened, synchronize]\n\njobs:\n review:\n runs-on: ubuntu-latest\n permissions:\n contents: read\n pull-requests: write\n\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Setup Node.js\n uses: actions/setup-node@v4\n with:\n node-version: '20'\n\n - name: Install Gemini CLI\n run: npm install -g @google/gemini-cli\n\n - name: Run Review\n env:\n GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}\n run: |\n # Get diff\n git diff origin/${{ github.base_ref }}...HEAD > diff.txt\n\n # Run Gemini review\n gemini -p \"Review this pull request diff for bugs, security issues, and code quality problems. Be specific about file names and line numbers.\n\n $(cat diff.txt)\" > review.md\n\n - name: Post Review Comment\n uses: actions/github-script@v7\n with:\n script: |\n const fs = require('fs');\n const review = fs.readFileSync('review.md', 'utf8');\n github.rest.issues.createComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n body: `## 🤖 Gemini Code Review\\n\\n${review}`\n });\n\n - name: Check for Critical Issues\n run: |\n if grep -qi \"critical\\|security vulnerability\\|injection\" review.md; then\n echo \"❌ Critical issues found\"\n exit 1\n fi","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"GitHub Actions - All Three Engines","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"yaml"},"content":[{"text":"# .github/workflows/triple-review.yml\nname: Triple Engine Code Review\n\non:\n pull_request:\n\njobs:\n claude-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Claude Review\n env:\n ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n run: |\n npx @anthropic-ai/claude-code --print \"/code-review\" > claude-review.md\n\n - uses: actions/upload-artifact@v4\n with:\n name: claude-review\n path: claude-review.md\n\n codex-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - uses: actions/setup-node@v4\n with:\n node-version: '22'\n\n - name: Install Codex\n run: npm install -g @openai/codex\n\n - name: Codex Review\n env:\n OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}\n run: |\n codex exec --full-auto --sandbox read-only \\\n --output-last-message codex-review.md \\\n \"Review this code for bugs, security issues, and quality problems\"\n\n - uses: actions/upload-artifact@v4\n with:\n name: codex-review\n path: codex-review.md\n\n gemini-review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - uses: actions/setup-node@v4\n with:\n node-version: '20'\n\n - name: Install Gemini CLI\n run: npm install -g @google/gemini-cli\n\n - name: Gemini Review\n env:\n GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}\n run: |\n git diff origin/${{ github.base_ref }}...HEAD > diff.txt\n gemini -p \"Review this code diff for bugs, security, and quality issues:\n $(cat diff.txt)\" > gemini-review.md\n\n - uses: actions/upload-artifact@v4\n with:\n name: gemini-review\n path: gemini-review.md\n\n combine-reviews:\n needs: [claude-review, codex-review, gemini-review]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/download-artifact@v4\n\n - name: Combine Reviews\n run: |\n echo \"## 🔍 Triple Engine Code Review Results\" > combined-review.md\n echo \"\" >> combined-review.md\n echo \"### 🟣 Claude Findings\" >> combined-review.md\n cat claude-review/claude-review.md >> combined-review.md\n echo \"\" >> combined-review.md\n echo \"---\" >> combined-review.md\n echo \"### 🟢 Codex Findings\" >> combined-review.md\n cat codex-review/codex-review.md >> combined-review.md\n echo \"\" >> combined-review.md\n echo \"---\" >> combined-review.md\n echo \"### 🔵 Gemini Findings\" >> combined-review.md\n cat gemini-review/gemini-review.md >> combined-review.md\n\n - name: Post Combined Review\n uses: actions/github-script@v7\n with:\n script: |\n const fs = require('fs');\n const review = fs.readFileSync('combined-review.md', 'utf8');\n github.rest.issues.createComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n body: review\n });\n\n - name: Check Critical Issues\n run: |\n # Fail if any engine found critical issues\n if grep -qi \"critical\\|🔴\" combined-review.md; then\n echo \"❌ Critical issues found by at least one engine\"\n exit 1\n fi","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Review Checklist","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Before Every Commit","type":"text"}]},{"type":"checkbox_list","attrs":{"id":null},"content":[{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Run ","type":"text"},{"text":"/code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" on staged changes","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"No critical (🔴) issues","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"No high (🟠) issues","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Security concerns addressed","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Performance issues considered","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Before Every PR","type":"text"}]},{"type":"checkbox_list","attrs":{"id":null},"content":[{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Full code review of all changes","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"All critical/high issues resolved","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Tests added for new functionality","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Documentation updated if needed","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Before Every Deployment","type":"text"}]},{"type":"checkbox_list","attrs":{"id":null},"content":[{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Final review of deployment diff","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Security scan passed","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"No new vulnerabilities introduced","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Rollback plan documented","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Common Review Findings","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Security Issues (Always Fix)","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Issue","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Example","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fix","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SQL Injection","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"query = f\"SELECT * FROM users WHERE id = {id}\"","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use parameterized queries","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"XSS","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"innerHTML = userInput","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Sanitize or use textContent","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Secrets in code","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"apiKey = \"sk-xxx\"","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use environment variables","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Missing auth","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Unprotected endpoints","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Add authentication middleware","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Insecure crypto","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"MD5/SHA1 for passwords","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use bcrypt/argon2","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Performance Issues (Should Fix)","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Issue","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Example","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fix","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"N+1 queries","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Loop with individual queries","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use batch/eager loading","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Memory leak","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Unclosed connections","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use connection pooling","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Missing index","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Slow queries","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Add database indexes","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Large payload","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fetching unused fields","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Select only needed fields","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"No pagination","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Loading all records","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Implement pagination","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Code Quality (Nice to Fix)","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Issue","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Example","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fix","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Long function","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"100+ lines","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Extract into smaller functions","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Deep nesting","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"5+ levels","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Early returns, extract methods","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Magic numbers","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"if (status === 3)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use named constants","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Duplicate code","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Copy-pasted blocks","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Extract shared function","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Missing types","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"any","type":"text","marks":[{"type":"code_inline"}]},{"text":" everywhere","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Add proper TypeScript types","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Post-Review: Decision Extraction","type":"text"}]},{"type":"paragraph","content":[{"text":"After review completes, extract architectural decisions automatically:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If review flagged new architectural choices → prompt to create ADR in ","type":"text"},{"text":"docs/adr/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If review approved a new pattern → log to ","type":"text"},{"text":"_project_specs/session/decisions.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If review found ADR drift → flag the ADR for update or supersede","type":"text"}]}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"### Auto-Log Entry (decisions.md)\n- [YYYY-MM-DD] **[Review Finding]**: Brief description\n - Source: Code review of [PR/commit]\n - ADR: Created/Updated ADR-NNNN\n - Impact: What changed","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Integration with TDD Workflow","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"┌─────────────────────────────────────────────────────────────────┐\n│ TDD + CODE REVIEW WORKFLOW │\n│ ───────────────────────────────────────────────────────────── │\n│ │\n│ 1. RED: Write failing tests │\n│ 2. GREEN: Write code to pass tests │\n│ 3. REFACTOR: Clean up code │\n│ 4. REVIEW: Run /code-review ← NEW STEP │\n│ 5. FIX: Address critical/high issues │\n│ 6. VALIDATE: Lint + TypeCheck + Coverage │\n│ 7. COMMIT: Only after review passes │\n│ │\n│ Review catches what tests miss: │\n│ - Security vulnerabilities │\n│ - Performance issues │\n│ - Architecture problems │\n│ - Code maintainability │\n└─────────────────────────────────────────────────────────────────┘","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Review Response Template","type":"text"}]},{"type":"paragraph","content":[{"text":"When code review finds issues, respond with:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"## Code Review Results\n\n### 🔴 Critical Issues (Must Fix)\n1. **SQL Injection in userController.ts:45**\n - Issue: User input directly interpolated into query\n - Fix: Use parameterized query\n - Code: `db.query('SELECT * FROM users WHERE id = $1', [userId])`\n\n### 🟠 High Issues (Should Fix)\n1. **Missing authentication on /api/admin endpoints**\n - Issue: Admin routes accessible without auth\n - Fix: Add auth middleware\n\n### 🟡 Medium Issues (Fix Soon)\n1. **N+1 query in getOrders function**\n - Consider eager loading or batch query\n\n### 🟢 Low Issues (Nice to Have)\n1. **Consider extracting validation logic to separate file**\n\n### ✅ Strengths\n- Good test coverage\n- Clear function names\n- Proper error handling\n\n### 📊 Summary\n- Critical: 1 | High: 1 | Medium: 1 | Low: 1\n- **Status: ❌ BLOCKED** - Fix critical/high issues before commit","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Claude Instructions","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"When to Invoke Code Review","type":"text"}]},{"type":"paragraph","content":[{"text":"Claude should automatically suggest or run code review:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"After completing a feature","type":"text","marks":[{"type":"strong"}]},{"text":" → \"Let me run a code review before we commit\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Before creating a PR","type":"text","marks":[{"type":"strong"}]},{"text":" → \"Running code review on all changes\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"When user says \"commit\"","type":"text","marks":[{"type":"strong"}]},{"text":" → \"First, let me review the changes\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"After fixing bugs","type":"text","marks":[{"type":"strong"}]},{"text":" → \"Reviewing the fix for any issues\"","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Review Focus Areas","type":"text"}]},{"type":"paragraph","content":[{"text":"Prioritize review based on change type:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Change Type","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Focus Areas","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Auth/Security code","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Security, input validation, crypto","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Database code","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SQL injection, N+1, transactions","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"API endpoints","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Auth, rate limiting, validation","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Frontend code","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"XSS, state management, performance","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Infrastructure","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Secrets, permissions, logging","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick Reference","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Commands","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Basic review\n/code-review\n\n# Review specific files\n/code-review src/auth.ts src/users.ts\n\n# Review with focus\n/code-review --focus security\n\n# Review PR\n/code-review --pr 123","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Severity Actions","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"🔴 Critical → STOP. Fix now. No commit.\n🟠 High → STOP. Fix now. No commit.\n🟡 Medium → Note it. Fix soon. Can commit.\n🟢 Low → Optional. Nice to have.\nℹ️ Info → FYI only.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Workflow","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"Code → Test → Review → Fix → Commit → Push → PR → Review → Merge → Deploy\n ↑ ↑ ↑\n /code-review /code-review /code-review","type":"text"}]}]},"metadata":{"date":"2026-11-02","name":"code-review","author":"@skillopedia","effort":"high","source":{"stars":711,"repo_name":"maggy","origin_url":"https://github.com/alinaqi/maggy/blob/HEAD/skills/code-review/SKILL.md","repo_owner":"alinaqi","body_sha256":"aa76e3145b6aa0cb54492352dfcb114e5e97457ffdd456c11309cba1dda35076","cluster_key":"d1786ab78130eef54e3f4c28f2c3175b0d38c328aed96994a40d8361591aa1f7","clean_bundle":{"format":"clean-skill-bundle-v1","source":"alinaqi/maggy/skills/code-review/SKILL.md","text_bytes":7731,"source_commit":"55aabe2493627e1de9cd09459d555181d66f3111","skills_sh_rank":10433,"attachment_count":1,"text_attachments":1,"attachment_storage":"skill_attachments","binary_attachments":0},"cluster_size":1,"skill_md_path":"skills/code-review/SKILL.md","import_metadata":{"date":"2026-11-02","author":"@skillopedia","version":"v1","category":"testing-qa","category_label":"Testing"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"testing-qa","import_tag":"skills-sh-top20k-2026-11","description":"Mandatory code reviews via /code-review before commits and deploys","when-to-use":"When user asks to review code, before commits, or when /code-review is invoked","allowed-tools":["Read","Glob","Grep","Bash"],"user-invocable":true}},"renderedAt":1793671725041}

Code Review Skill Purpose: Enforce automated code reviews as a mandatory guardrail before every commit and deployment. Choose between Claude, OpenAI Codex, Google Gemini, or multiple engines for comprehensive analysis. Sub-skills: - adr-gate.md — Pre-review ADR and spec enforcement --- Pre-Review: ADR Gate (Mandatory) Before any review engine runs, the ADR gate executes automatically: 1. Classify — trivial changes (typos, deps, tests-only) skip the gate 2. Discover — scan , , iCPG ReasonNodes, git history for linked ADRs and specs 3. Enforce — if no ADRs found for non-trivial changes: - Inter…