[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E5DEA4H03VF8HTEYPS5R67":3,"skill-same:01M7E5DEA4H03VF8HTEYPS5R67":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M7E5DEA4H03VF8HTEYPS5R67","speckit-ext-code-review",null,"Multi-agent code review with security, architecture, and quality analysis","stefanwalther\u002Fghn","stefanwalther","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F669728?v=4","01M7E59BWN972ZZWN6SJ3RBZS8","Stefan Walther","01M7E59BX6XCFE72NWR5BN5M78",1,"MIT","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-code-review\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: speckit-ext-code-review\ndescription: Multi-agent code review with security, architecture, and quality analysis\ncompatibility: Requires spec-kit project structure with .specify\u002F directory\nmetadata:\n  author: github-spec-kit\n  source: ext:commands\u002Fspeckit.ext.code-review.md\n---\n\n## User Input\n\n```text\n$ARGUMENTS\n```\n\nYou **MUST** consider the user input before proceeding (if not empty).\n\n## Outline\n\nThis extension performs intelligent code review using specialized sub-agents running in parallel. Unlike the `validate` extension which runs automated checks (tests, linting), this extension analyzes code like a senior engineer would - looking for architecture issues, security vulnerabilities, and code smells.\n\n**Core Principle**: Multi-agent review with parallel execution and synthesized findings.\n\n### Execution Steps\n\n1. **Parse Arguments**\n\nParse `$ARGUMENTS` to extract:\n- Target spec directory (optional, auto-detect from branch if not provided)\n- Flags:\n  - `--quick`, `-q`: Fast mode (quality review only, skip security\u002Farchitecture)\n  - `--deep`, `-d`: Deep mode (include performance review)\n  - `--fix`: Attempt auto-fix for simple issues (naming, formatting)\n  - `--json`: Output as JSON (for CI integration)\n  - `--help`, `-h`: Display usage and exit\n\n**If `--help` specified**, display usage and exit:\n```\nUsage: \u002Fspeckit.ext.code-review [spec-directory] [options]\n\nOptions:\n  --quick, -q       Fast mode (quality only, skip security\u002Farch)\n  --deep, -d        Deep mode (include performance review)\n  --fix             Attempt auto-fix for simple issues\n  --json            Output as JSON (for CI integration)\n  --help, -h        Show this help\n\nExamples:\n  \u002Fspeckit.ext.code-review                    # Full review (auto-detect)\n  \u002Fspeckit.ext.code-review specs\u002F012-feature  # Review specific feature\n  \u002Fspeckit.ext.code-review --quick            # Fast quality-only review\n  \u002Fspeckit.ext.code-review --deep             # Include performance analysis\n```\n\n**Auto-detection**:\n```bash\n# Get current branch name\ngit rev-parse --abbrev-ref HEAD\n\n# Extract feature number (e.g., \"012\" from \"012-session-handover\")\n# Find matching spec directory in specs\u002F\n```\n\nSet flags:\n- `QUICK_MODE`: true if --quick specified\n- `DEEP_MODE`: true if --deep specified\n- `FIX_MODE`: true if --fix specified\n- `JSON_OUTPUT`: true if --json specified\n\n2. **Environment Check**\n\nVerify execution environment:\n\na. **Branch Check**:\n   - Use Bash: `git rev-parse --abbrev-ref HEAD`\n   - Warn if on main\u002Fmaster branch (review still runs but may be less useful)\n\nb. **Git Status Check**:\n   - Use Bash: `git status --porcelain`\n   - If uncommitted changes: Note count (review will include staged changes)\n\nc. **Find Spec Directory**:\n   - If provided in arguments: Use that\n   - Otherwise: Auto-detect from branch name\n   - If not found: Continue (non-spec feature is OK)\n\n**Output**:\n```\n=== Code Review ===\n\nBranch: 012-session-handover\nFeature: #012 (if detected)\nUncommitted changes: 3 files\nMode: Full review (or Quick\u002FDeep)\n\nGathering changed files...\n```\n\n3. **Gather Changed Files**\n\nAnalyze the diff to understand what needs review:\n\na. **Get Changed Files**:\n   ```bash\n   git diff main...HEAD --name-only\n   ```\n\nb. **Categorize Files by Type**:\n   - Use Glob to identify file types\n   - Group into categories:\n     - `security_relevant`: Files in auth\u002F, api\u002F, containing passwords, tokens, keys\n     - `architecture_relevant`: Files with classes, interfaces, services\n     - `quality_relevant`: All source code files (excluding tests, configs)\n     - `performance_relevant`: Database queries, API endpoints, loops\n\nc. **Calculate Review Scope**:\n   ```\n   Files to review: 15\n   - Security-relevant: 3 files\n   - Architecture-relevant: 8 files  \n   - Quality-relevant: 15 files\n   - Performance-relevant: 4 files (if --deep)\n   ```\n\n4. **Launch Parallel Review Agents**\n\nBased on the mode and file categorization, launch specialist agents in parallel using the Task tool.\n\n**CRITICAL**: Launch these as PARALLEL Task calls in a single tool call block.\n\n**Standard Mode** (default): Launch 3 agents in parallel:\n\n**Agent 1 - Security Reviewer** (skip if --quick):\n```\nUse Task tool with:\n- subagent_type: \"qa\"\n- description: \"Security code review\"\n- readonly: true\n- prompt: |\n    You are a senior security engineer performing code review.\n    \n    ## Your Focus Areas (Priority Order)\n    \n    CRITICAL:\n    - Hardcoded secrets, API keys, credentials, tokens\n    - SQL injection vulnerabilities\n    - XSS (Cross-Site Scripting) vulnerabilities\n    - Command injection risks\n    - Input validation and sanitization gaps\n    - Authentication\u002Fauthorization logic flaws\n    \n    IMPORTANT:\n    - Unsafe deserialization\n    - Path traversal vulnerabilities\n    - CSRF protection gaps\n    - Improper error handling (information leakage)\n    - Insecure direct object references\n    \n    ## Files to Review\n    {list of security_relevant files}\n    \n    ## Instructions\n    1. Read each file using the Read tool\n    2. Analyze for security vulnerabilities\n    3. For each finding, provide:\n       - Severity: CRITICAL, WARNING, or SUGGESTION\n       - File and line number\n       - Problem description\n       - Suggested fix with code example\n       - Rationale\n    \n    ## Output Format\n    Return findings as a structured list:\n    \n    ### Finding 1\n    - **Severity**: CRITICAL\n    - **File**: src\u002Fapi\u002Fauth.ts:42\n    - **Problem**: Hardcoded API key in source code\n    - **Fix**: Move to environment variable\n    - **Code**:\n      ```typescript\n      \u002F\u002F Bad\n      const API_KEY = \"sk_live_abc123\";\n      \u002F\u002F Good  \n      const API_KEY = process.env.API_KEY;\n      ```\n    \n    If no security issues found, explicitly state: \"No security issues found.\"\n```\n\n**Agent 2 - Architecture Reviewer** (skip if --quick):\n```\nUse Task tool with:\n- subagent_type: \"architect\"\n- description: \"Architecture code review\"\n- readonly: true\n- prompt: |\n    You are a senior software architect performing code review.\n    \n    ## Your Focus Areas\n    \n    DESIGN PRINCIPLES:\n    - SOLID principle violations (especially SRP and DIP)\n    - High coupling between modules\n    - Low cohesion within modules\n    - Missing or inappropriate abstractions\n    - Over-engineering (unnecessary complexity)\n    \n    STRUCTURAL ISSUES:\n    - Circular dependencies\n    - God classes or god functions\n    - Inappropriate layering violations\n    - API contract inconsistencies\n    - Schema misalignment\n    \n    PATTERNS:\n    - Anti-patterns (singletons where inappropriate, etc.)\n    - Missing patterns where beneficial\n    - Inconsistent patterns across codebase\n    \n    ## Files to Review\n    {list of architecture_relevant files}\n    \n    ## Instructions\n    1. Read each file using the Read tool\n    2. Analyze for architectural issues\n    3. For each finding, provide:\n       - Severity: CRITICAL, WARNING, or SUGGESTION\n       - Files affected\n       - Problem description\n       - Suggested refactoring approach\n       - Impact assessment\n    \n    ## Output Format\n    Return findings as a structured list:\n    \n    ### Finding 1\n    - **Severity**: WARNING\n    - **Files**: services\u002Fauth.ts, services\u002Fuser.ts\n    - **Problem**: Circular dependency detected\n    - **Fix**: Extract shared interface to common module\n    - **Impact**: Improves testability and maintainability\n    \n    If no architectural issues found, explicitly state: \"No architectural issues found.\"\n```\n\n**Agent 3 - Code Quality Reviewer** (always runs):\n```\nUse Task tool with:\n- subagent_type: \"qa\"\n- description: \"Code quality review\"\n- readonly: true\n- prompt: |\n    You are a senior developer performing code quality review.\n    \n    ## Your Focus Areas\n    \n    NAMING & CLARITY:\n    - Poor or unclear variable\u002Ffunction names\n    - Misleading names\n    - Inconsistent naming conventions\n    \n    COMPLEXITY:\n    - High cyclomatic complexity (deeply nested conditionals)\n    - Long functions (>50 lines)\n    - Long parameter lists (>4 parameters)\n    - Complex boolean expressions\n    \n    CODE SMELLS:\n    - Code duplication (DRY violations)\n    - Dead code, unused variables\n    - Magic numbers, hardcoded strings\n    - Feature envy, data clumps\n    \n    ERROR HANDLING:\n    - Missing error handling\n    - Empty catch blocks\n    - Overly broad exception handling\n    - Silent failures\n    \n    ## Files to Review\n    {list of quality_relevant files}\n    \n    ## Instructions\n    1. Read each file using the Read tool\n    2. Analyze for code quality issues\n    3. For each finding, provide:\n       - Severity: CRITICAL, WARNING, or SUGGESTION\n       - File and line number\n       - Problem description\n       - Suggested improvement with code example\n    \n    ## Output Format\n    Return findings as a structured list:\n    \n    ### Finding 1\n    - **Severity**: SUGGESTION\n    - **File**: src\u002Futils\u002Fhelper.ts:8\n    - **Problem**: Poor variable naming\n    - **Current**: `const x = getData()`\n    - **Suggested**: `const userData = fetchUserProfile()`\n    \n    If no quality issues found, explicitly state: \"No code quality issues found.\"\n```\n\n**Agent 4 - Performance Reviewer** (only if --deep):\n```\nUse Task tool with:\n- subagent_type: \"qa\"\n- description: \"Performance code review\"\n- readonly: true\n- prompt: |\n    You are a performance engineer performing code review.\n    \n    ## Your Focus Areas\n    \n    DATABASE:\n    - N+1 query patterns\n    - Missing indexes (based on query patterns)\n    - Unbounded queries (missing LIMIT)\n    - Inefficient joins\n    \n    ALGORITHMS:\n    - O(n^2) or worse algorithms where O(n) possible\n    - Unnecessary iterations\n    - Inefficient data structure choices\n    \n    RESOURCES:\n    - Memory leaks\n    - Unclosed resources (files, connections)\n    - Missing connection pooling\n    - Large objects held in memory\n    \n    ASYNC:\n    - Synchronous calls that could be async\n    - Missing parallelization opportunities\n    - Blocking operations in hot paths\n    \n    CACHING:\n    - Missing caching for expensive operations\n    - Cache invalidation issues\n    - Over-caching (stale data risks)\n    \n    ## Files to Review\n    {list of performance_relevant files}\n    \n    ## Instructions\n    1. Read each file using the Read tool\n    2. Analyze for performance issues\n    3. For each finding, provide:\n       - Severity: CRITICAL, WARNING, or SUGGESTION\n       - File and line number\n       - Problem description\n       - Performance impact estimate\n       - Suggested optimization\n    \n    ## Output Format\n    Return findings as a structured list:\n    \n    ### Finding 1\n    - **Severity**: WARNING\n    - **File**: src\u002Fapi\u002Fusers.ts:55\n    - **Problem**: N+1 query pattern detected\n    - **Impact**: O(n) database calls instead of O(1)\n    - **Fix**: Use eager loading or batch query\n    \n    If no performance issues found, explicitly state: \"No performance issues found.\"\n```\n\n**Wait for all agents to complete** before proceeding.\n\n5. **Synthesize Results**\n\nAfter all agents complete, aggregate their findings:\n\na. **Collect All Findings**:\n   - Gather results from each agent\n   - Parse into structured format\n\nb. **Deduplicate**:\n   - If multiple agents flagged the same issue, merge them\n   - Keep the most detailed description\n   - Note which reviewers agreed\n\nc. **Rank by Severity**:\n   - CRITICAL: Must fix before PR (security vulns, major bugs)\n   - WARNING: Strongly recommended to fix (code smells, minor issues)\n   - SUGGESTION: Optional improvements (naming, style)\n\nd. **Calculate Summary**:\n   ```\n   Total findings: 8\n   - Critical: 2\n   - Warnings: 3\n   - Suggestions: 3\n   ```\n\n6. **Generate REVIEW.md**\n\nWrite the review report to the spec directory (or current directory if no spec):\n\n```markdown\n# Code Review Report\n\nFeature: #012 Session Handover\nBranch: 012-session-handover\nDate: {current date}\nReviewers: security, architecture, quality{, performance if --deep}\n\n---\n\n## Summary\n\nStatus: {READY | NEEDS ATTENTION | CRITICAL ISSUES}\n\n| Severity | Count |\n|----------|-------|\n| Critical | 2 |\n| Warning | 3 |\n| Suggestion | 3 |\n\n---\n\n## Critical Issues\n\n{For each critical finding, format as:}\n\n### [CATEGORY] Brief description\n**File**: `path\u002Fto\u002Ffile.ts:42`\n**Reviewer**: security\n**Problem**: Detailed explanation\n**Fix**: How to resolve\n```code\n\u002F\u002F Example fix\n```\n\n---\n\n## Warnings\n\n{Similar format for warnings}\n\n---\n\n## Suggestions\n\n{Similar format for suggestions}\n\n---\n\n## Next Steps\n\n1. {If critical issues}: Address critical issues before creating PR\n2. {If warnings}: Consider fixing warnings (recommended)\n3. {If only suggestions}: Ready for PR - suggestions are optional\n\nRun `\u002Fspeckit.ext.code-review` again after making fixes.\n```\n\n7. **Handle --fix Mode** (if specified)\n\nFor simple auto-fixable issues:\n\na. **Identify Fixable Issues**:\n   - Naming improvements (with user confirmation)\n   - Unused imports removal\n   - Simple formatting fixes\n\nb. **Apply Fixes**:\n   - Use StrReplace tool for each fix\n   - Track what was fixed\n\nc. **Report**:\n   ```\n   Auto-fixed 3 issues:\n   - Removed 2 unused imports\n   - Fixed 1 naming issue\n   \n   Remaining issues require manual attention.\n   ```\n\n8. **Present Summary**\n\nDisplay final summary to user:\n\n```\n=== Code Review Complete ===\n\nFeature: #012 Session Handover\nDuration: {time}\n\nResults:\n{If CRITICAL issues}:\n  Status: CRITICAL ISSUES FOUND\n  \n  2 critical issues must be fixed before PR:\n  - [SECURITY] Hardcoded API key (src\u002Fapi\u002Fclient.ts:42)\n  - [ARCHITECTURE] Circular dependency (services\u002F)\n  \n  3 warnings should be reviewed\n  3 suggestions for improvement\n  \n  Review report: specs\u002F012-session-handover\u002FREVIEW.md\n  \n  Next: Fix critical issues, then run \u002Fspeckit.ext.code-review again\n\n{If only WARNINGS}:\n  Status: NEEDS ATTENTION\n  \n  0 critical issues\n  3 warnings should be reviewed\n  3 suggestions for improvement\n  \n  Review report: specs\u002F012-session-handover\u002FREVIEW.md\n  \n  Next: \u002Fspeckit.ext.pr (or fix warnings first)\n\n{If CLEAN}:\n  Status: READY FOR PR\n  \n  No critical issues\n  No warnings\n  3 optional suggestions\n  \n  Review report: specs\u002F012-session-handover\u002FREVIEW.md\n  \n  Next: \u002Fspeckit.ext.pr\n```\n\n**If --json flag**: Output structured JSON instead of formatted text.\n\n## Usage Examples\n\n```bash\n# Full code review (auto-detect feature)\n\u002Fspeckit.ext.code-review\n\n# Review specific feature\n\u002Fspeckit.ext.code-review specs\u002F012-session-handover\n\n# Quick review (quality only - faster)\n\u002Fspeckit.ext.code-review --quick\n\n# Deep review (include performance analysis)\n\u002Fspeckit.ext.code-review --deep\n\n# Auto-fix simple issues\n\u002Fspeckit.ext.code-review --fix\n\n# CI integration (JSON output)\n\u002Fspeckit.ext.code-review --json\n\n# Combined flags\n\u002Fspeckit.ext.code-review --deep --fix\n```\n\n## Agent Responsibilities\n\n| Agent | Type | Focus | Speed |\n|-------|------|-------|-------|\n| Security | qa | Vulnerabilities, auth, secrets | Medium |\n| Architecture | architect | Design, coupling, patterns | Medium |\n| Code Quality | qa | Naming, complexity, smells | Fast |\n| Performance | qa | N+1, memory, caching | Slow (--deep only) |\n\n## Differentiation from \u002Fspeckit.ext.validate\n\n| Aspect | validate | code-review |\n|--------|----------|-------------|\n| **Type** | Automated checks | Intelligent analysis |\n| **Speed** | Fast (30s-5min) | Slower (2-5min) |\n| **Output** | Pass\u002Ffail verdict | Detailed findings |\n| **Focus** | Tests pass, linting clean | Design quality, security |\n| **Examples** | \"All tests passing\" | \"This violates SRP\" |\n\n**Recommended flow**: Run `validate` first (fast, automated), then `code-review` (thorough, intelligent).\n\n## Notes\n\n- **Multi-agent**: Uses Task tool to run specialists in parallel\n- **Routing**: Only invokes agents relevant to changed file types\n- **Deduplication**: Merges overlapping findings from different reviewers\n- **REVIEW.md**: Persisted report for reference and PR documentation\n- **Non-blocking**: Warnings and suggestions don't block PR creation\n- **Re-runnable**: Run multiple times as issues are fixed","## User Input\n\n```text\n$ARGUMENTS\n```\n\nYou **MUST** consider the user input before proceeding (if not empty).\n\n## Outline\n\nThis extension performs intelligent code review using specialized sub-agents running in parallel. Unlike the `validate` extension which runs automated checks (tests, linting), this extension analyzes code like a senior engineer would - looking for architecture issues, security vulnerabilities, and code smells.\n\n**Core Principle**: Multi-agent review with parallel execution and synthesized findings.\n\n### Execution Steps\n\n1. **Parse Arguments**\n\nParse `$ARGUMENTS` to extract:\n- Target spec directory (optional, auto-detect from branch if not provided)\n- Flags:\n  - `--quick`, `-q`: Fast mode (quality review only, skip security\u002Farchitecture)\n  - `--deep`, `-d`: Deep mode (include performance review)\n  - `--fix`: Attempt auto-fix for simple issues (naming, formatting)\n  - `--json`: Output as JSON (for CI integration)\n  - `--help`, `-h`: Display usage and exit\n\n**If `--help` specified**, display usage and exit:\n```\nUsage: \u002Fspeckit.ext.code-review [spec-directory] [options]\n\nOptions:\n  --quick, -q       Fast mode (quality only, skip security\u002Farch)\n  --deep, -d        Deep mode (include performance review)\n  --fix             Attempt auto-fix for simple issues\n  --json            Output as JSON (for CI integration)\n  --help, -h        Show this help\n\nExamples:\n  \u002Fspeckit.ext.code-review                    # Full review (auto-detect)\n  \u002Fspeckit.ext.code-review specs\u002F012-feature  # Review specific feature\n  \u002Fspeckit.ext.code-review --quick            # Fast quality-only review\n  \u002Fspeckit.ext.code-review --deep             # Include performance analysis\n```\n\n**Auto-detection**:\n```bash\n# Get current branch name\ngit rev-parse --abbrev-ref HEAD\n\n# Extract feature number (e.g., \"012\" from \"012-session-handover\")\n# Find matching spec directory in specs\u002F\n```\n\nSet flags:\n- `QUICK_MODE`: true if --quick specified\n- `DEEP_MODE`: true if --deep specified\n- `FIX_MODE`: true if --fix specified\n- `JSON_OUTPUT`: true if --json specified\n\n2. **Environment Check**\n\nVerify execution environment:\n\na. **Branch Check**:\n   - Use Bash: `git rev-parse --abbrev-ref HEAD`\n   - Warn if on main\u002Fmaster branch (review still runs but may be less useful)\n\nb. **Git Status Check**:\n   - Use Bash: `git status --porcelain`\n   - If uncommitted changes: Note count (review will include staged changes)\n\nc. **Find Spec Directory**:\n   - If provided in arguments: Use that\n   - Otherwise: Auto-detect from branch name\n   - If not found: Continue (non-spec feature is OK)\n\n**Output**:\n```\n=== Code Review ===\n\nBranch: 012-session-handover\nFeature: #012 (if detected)\nUncommitted changes: 3 files\nMode: Full review (or Quick\u002FDeep)\n\nGathering changed files...\n```\n\n3. **Gather Changed Files**\n\nAnalyze the diff to understand what needs review:\n\na. **Get Changed Files**:\n   ```bash\n   git diff main...HEAD --name-only\n   ```\n\nb. **Categorize Files by Type**:\n   - Use Glob to identify file types\n   - Group into categories:\n     - `security_relevant`: Files in auth\u002F, api\u002F, containing passwords, tokens, keys\n     - `architecture_relevant`: Files with classes, interfaces, services\n     - `quality_relevant`: All source code files (excluding tests, configs)\n     - `performance_relevant`: Database queries, API endpoints, loops\n\nc. **Calculate Review Scope**:\n   ```\n   Files to review: 15\n   - Security-relevant: 3 files\n   - Architecture-relevant: 8 files  \n   - Quality-relevant: 15 files\n   - Performance-relevant: 4 files (if --deep)\n   ```\n\n4. **Launch Parallel Review Agents**\n\nBased on the mode and file categorization, launch specialist agents in parallel using the Task tool.\n\n**CRITICAL**: Launch these as PARALLEL Task calls in a single tool call block.\n\n**Standard Mode** (default): Launch 3 agents in parallel:\n\n**Agent 1 - Security Reviewer** (skip if --quick):\n```\nUse Task tool with:\n- subagent_type: \"qa\"\n- description: \"Security code review\"\n- readonly: true\n- prompt: |\n    You are a senior security engineer performing code review.\n    \n    ## Your Focus Areas (Priority Order)\n    \n    CRITICAL:\n    - Hardcoded secrets, API keys, credentials, tokens\n    - SQL injection vulnerabilities\n    - XSS (Cross-Site Scripting) vulnerabilities\n    - Command injection risks\n    - Input validation and sanitization gaps\n    - Authentication\u002Fauthorization logic flaws\n    \n    IMPORTANT:\n    - Unsafe deserialization\n    - Path traversal vulnerabilities\n    - CSRF protection gaps\n    - Improper error handling (information leakage)\n    - Insecure direct object references\n    \n    ## Files to Review\n    {list of security_relevant files}\n    \n    ## Instructions\n    1. Read each file using the Read tool\n    2. Analyze for security vulnerabilities\n    3. For each finding, provide:\n       - Severity: CRITICAL, WARNING, or SUGGESTION\n       - File and line number\n       - Problem description\n       - Suggested fix with code example\n       - Rationale\n    \n    ## Output Format\n    Return findings as a structured list:\n    \n    ### Finding 1\n    - **Severity**: CRITICAL\n    - **File**: src\u002Fapi\u002Fauth.ts:42\n    - **Problem**: Hardcoded API key in source code\n    - **Fix**: Move to environment variable\n    - **Code**:\n      ```typescript\n      \u002F\u002F Bad\n      const API_KEY = \"sk_live_abc123\";\n      \u002F\u002F Good  \n      const API_KEY = process.env.API_KEY;\n      ```\n    \n    If no security issues found, explicitly state: \"No security issues found.\"\n```\n\n**Agent 2 - Architecture Reviewer** (skip if --quick):\n```\nUse Task tool with:\n- subagent_type: \"architect\"\n- description: \"Architecture code review\"\n- readonly: true\n- prompt: |\n    You are a senior software architect performing code review.\n    \n    ## Your Focus Areas\n    \n    DESIGN PRINCIPLES:\n    - SOLID principle violations (especially SRP and DIP)\n    - High coupling between modules\n    - Low cohesion within modules\n    - Missing or inappropriate abstractions\n    - Over-engineering (unnecessary complexity)\n    \n    STRUCTURAL ISSUES:\n    - Circular dependencies\n    - God classes or god functions\n    - Inappropriate layering violations\n    - API contract inconsistencies\n    - Schema misalignment\n    \n    PATTERNS:\n    - Anti-patterns (singletons where inappropriate, etc.)\n    - Missing patterns where beneficial\n    - Inconsistent patterns across codebase\n    \n    ## Files to Review\n    {list of architecture_relevant files}\n    \n    ## Instructions\n    1. Read each file using the Read tool\n    2. Analyze for architectural issues\n    3. For each finding, provide:\n       - Severity: CRITICAL, WARNING, or SUGGESTION\n       - Files affected\n       - Problem description\n       - Suggested refactoring approach\n       - Impact assessment\n    \n    ## Output Format\n    Return findings as a structured list:\n    \n    ### Finding 1\n    - **Severity**: WARNING\n    - **Files**: services\u002Fauth.ts, services\u002Fuser.ts\n    - **Problem**: Circular dependency detected\n    - **Fix**: Extract shared interface to common module\n    - **Impact**: Improves testability and maintainability\n    \n    If no architectural issues found, explicitly state: \"No architectural issues found.\"\n```\n\n**Agent 3 - Code Quality Reviewer** (always runs):\n```\nUse Task tool with:\n- subagent_type: \"qa\"\n- description: \"Code quality review\"\n- readonly: true\n- prompt: |\n    You are a senior developer performing code quality review.\n    \n    ## Your Focus Areas\n    \n    NAMING & CLARITY:\n    - Poor or unclear variable\u002Ffunction names\n    - Misleading names\n    - Inconsistent naming conventions\n    \n    COMPLEXITY:\n    - High cyclomatic complexity (deeply nested conditionals)\n    - Long functions (>50 lines)\n    - Long parameter lists (>4 parameters)\n    - Complex boolean expressions\n    \n    CODE SMELLS:\n    - Code duplication (DRY violations)\n    - Dead code, unused variables\n    - Magic numbers, hardcoded strings\n    - Feature envy, data clumps\n    \n    ERROR HANDLING:\n    - Missing error handling\n    - Empty catch blocks\n    - Overly broad exception handling\n    - Silent failures\n    \n    ## Files to Review\n    {list of quality_relevant files}\n    \n    ## Instructions\n    1. Read each file using the Read tool\n    2. Analyze for code quality issues\n    3. For each finding, provide:\n       - Severity: CRITICAL, WARNING, or SUGGESTION\n       - File and line number\n       - Problem description\n       - Suggested improvement with code example\n    \n    ## Output Format\n    Return findings as a structured list:\n    \n    ### Finding 1\n    - **Severity**: SUGGESTION\n    - **File**: src\u002Futils\u002Fhelper.ts:8\n    - **Problem**: Poor variable naming\n    - **Current**: `const x = getData()`\n    - **Suggested**: `const userData = fetchUserProfile()`\n    \n    If no quality issues found, explicitly state: \"No code quality issues found.\"\n```\n\n**Agent 4 - Performance Reviewer** (only if --deep):\n```\nUse Task tool with:\n- subagent_type: \"qa\"\n- description: \"Performance code review\"\n- readonly: true\n- prompt: |\n    You are a performance engineer performing code review.\n    \n    ## Your Focus Areas\n    \n    DATABASE:\n    - N+1 query patterns\n    - Missing indexes (based on query patterns)\n    - Unbounded queries (missing LIMIT)\n    - Inefficient joins\n    \n    ALGORITHMS:\n    - O(n^2) or worse algorithms where O(n) possible\n    - Unnecessary iterations\n    - Inefficient data structure choices\n    \n    RESOURCES:\n    - Memory leaks\n    - Unclosed resources (files, connections)\n    - Missing connection pooling\n    - Large objects held in memory\n    \n    ASYNC:\n    - Synchronous calls that could be async\n    - Missing parallelization opportunities\n    - Blocking operations in hot paths\n    \n    CACHING:\n    - Missing caching for expensive operations\n    - Cache invalidation issues\n    - Over-caching (stale data risks)\n    \n    ## Files to Review\n    {list of performance_relevant files}\n    \n    ## Instructions\n    1. Read each file using the Read tool\n    2. Analyze for performance issues\n    3. For each finding, provide:\n       - Severity: CRITICAL, WARNING, or SUGGESTION\n       - File and line number\n       - Problem description\n       - Performance impact estimate\n       - Suggested optimization\n    \n    ## Output Format\n    Return findings as a structured list:\n    \n    ### Finding 1\n    - **Severity**: WARNING\n    - **File**: src\u002Fapi\u002Fusers.ts:55\n    - **Problem**: N+1 query pattern detected\n    - **Impact**: O(n) database calls instead of O(1)\n    - **Fix**: Use eager loading or batch query\n    \n    If no performance issues found, explicitly state: \"No performance issues found.\"\n```\n\n**Wait for all agents to complete** before proceeding.\n\n5. **Synthesize Results**\n\nAfter all agents complete, aggregate their findings:\n\na. **Collect All Findings**:\n   - Gather results from each agent\n   - Parse into structured format\n\nb. **Deduplicate**:\n   - If multiple agents flagged the same issue, merge them\n   - Keep the most detailed description\n   - Note which reviewers agreed\n\nc. **Rank by Severity**:\n   - CRITICAL: Must fix before PR (security vulns, major bugs)\n   - WARNING: Strongly recommended to fix (code smells, minor issues)\n   - SUGGESTION: Optional improvements (naming, style)\n\nd. **Calculate Summary**:\n   ```\n   Total findings: 8\n   - Critical: 2\n   - Warnings: 3\n   - Suggestions: 3\n   ```\n\n6. **Generate REVIEW.md**\n\nWrite the review report to the spec directory (or current directory if no spec):\n\n```markdown\n# Code Review Report\n\nFeature: #012 Session Handover\nBranch: 012-session-handover\nDate: {current date}\nReviewers: security, architecture, quality{, performance if --deep}\n\n---\n\n## Summary\n\nStatus: {READY | NEEDS ATTENTION | CRITICAL ISSUES}\n\n| Severity | Count |\n|----------|-------|\n| Critical | 2 |\n| Warning | 3 |\n| Suggestion | 3 |\n\n---\n\n## Critical Issues\n\n{For each critical finding, format as:}\n\n### [CATEGORY] Brief description\n**File**: `path\u002Fto\u002Ffile.ts:42`\n**Reviewer**: security\n**Problem**: Detailed explanation\n**Fix**: How to resolve\n```code\n\u002F\u002F Example fix\n```\n\n---\n\n## Warnings\n\n{Similar format for warnings}\n\n---\n\n## Suggestions\n\n{Similar format for suggestions}\n\n---\n\n## Next Steps\n\n1. {If critical issues}: Address critical issues before creating PR\n2. {If warnings}: Consider fixing warnings (recommended)\n3. {If only suggestions}: Ready for PR - suggestions are optional\n\nRun `\u002Fspeckit.ext.code-review` again after making fixes.\n```\n\n7. **Handle --fix Mode** (if specified)\n\nFor simple auto-fixable issues:\n\na. **Identify Fixable Issues**:\n   - Naming improvements (with user confirmation)\n   - Unused imports removal\n   - Simple formatting fixes\n\nb. **Apply Fixes**:\n   - Use StrReplace tool for each fix\n   - Track what was fixed\n\nc. **Report**:\n   ```\n   Auto-fixed 3 issues:\n   - Removed 2 unused imports\n   - Fixed 1 naming issue\n   \n   Remaining issues require manual attention.\n   ```\n\n8. **Present Summary**\n\nDisplay final summary to user:\n\n```\n=== Code Review Complete ===\n\nFeature: #012 Session Handover\nDuration: {time}\n\nResults:\n{If CRITICAL issues}:\n  Status: CRITICAL ISSUES FOUND\n  \n  2 critical issues must be fixed before PR:\n  - [SECURITY] Hardcoded API key (src\u002Fapi\u002Fclient.ts:42)\n  - [ARCHITECTURE] Circular dependency (services\u002F)\n  \n  3 warnings should be reviewed\n  3 suggestions for improvement\n  \n  Review report: specs\u002F012-session-handover\u002FREVIEW.md\n  \n  Next: Fix critical issues, then run \u002Fspeckit.ext.code-review again\n\n{If only WARNINGS}:\n  Status: NEEDS ATTENTION\n  \n  0 critical issues\n  3 warnings should be reviewed\n  3 suggestions for improvement\n  \n  Review report: specs\u002F012-session-handover\u002FREVIEW.md\n  \n  Next: \u002Fspeckit.ext.pr (or fix warnings first)\n\n{If CLEAN}:\n  Status: READY FOR PR\n  \n  No critical issues\n  No warnings\n  3 optional suggestions\n  \n  Review report: specs\u002F012-session-handover\u002FREVIEW.md\n  \n  Next: \u002Fspeckit.ext.pr\n```\n\n**If --json flag**: Output structured JSON instead of formatted text.\n\n## Usage Examples\n\n```bash\n# Full code review (auto-detect feature)\n\u002Fspeckit.ext.code-review\n\n# Review specific feature\n\u002Fspeckit.ext.code-review specs\u002F012-session-handover\n\n# Quick review (quality only - faster)\n\u002Fspeckit.ext.code-review --quick\n\n# Deep review (include performance analysis)\n\u002Fspeckit.ext.code-review --deep\n\n# Auto-fix simple issues\n\u002Fspeckit.ext.code-review --fix\n\n# CI integration (JSON output)\n\u002Fspeckit.ext.code-review --json\n\n# Combined flags\n\u002Fspeckit.ext.code-review --deep --fix\n```\n\n## Agent Responsibilities\n\n| Agent | Type | Focus | Speed |\n|-------|------|-------|-------|\n| Security | qa | Vulnerabilities, auth, secrets | Medium |\n| Architecture | architect | Design, coupling, patterns | Medium |\n| Code Quality | qa | Naming, complexity, smells | Fast |\n| Performance | qa | N+1, memory, caching | Slow (--deep only) |\n\n## Differentiation from \u002Fspeckit.ext.validate\n\n| Aspect | validate | code-review |\n|--------|----------|-------------|\n| **Type** | Automated checks | Intelligent analysis |\n| **Speed** | Fast (30s-5min) | Slower (2-5min) |\n| **Output** | Pass\u002Ffail verdict | Detailed findings |\n| **Focus** | Tests pass, linting clean | Design quality, security |\n| **Examples** | \"All tests passing\" | \"This violates SRP\" |\n\n**Recommended flow**: Run `validate` first (fast, automated), then `code-review` (thorough, intelligent).\n\n## Notes\n\n- **Multi-agent**: Uses Task tool to run specialists in parallel\n- **Routing**: Only invokes agents relevant to changed file types\n- **Deduplication**: Merges overlapping findings from different reviewers\n- **REVIEW.md**: Persisted report for reference and PR documentation\n- **Non-blocking**: Warnings and suggestions don't block PR creation\n- **Re-runnable**: Run multiple times as issues are fixed",{"name":5,"metadata":24,"description":7,"compatibility":27},{"author":25,"source":26},"github-spec-kit","ext:commands\u002Fspeckit.ext.code-review.md","Requires spec-kit project structure with .specify\u002F directory","main","2045797696f3923d9e47519e2302e944260b2266",".specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-code-review",0,"https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn","https:\u002F\u002Fgithub.com\u002Fstefanwalther","2026-11-15 06:19:35",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add stefanwalther\u002Fghn --skill speckit-ext-code-review",{"tool":41,"command":42},"bunx","bunx skills add stefanwalther\u002Fghn --skill speckit-ext-code-review",{"tool":44,"command":45},"pnpm","pnpm dlx skills add stefanwalther\u002Fghn --skill speckit-ext-code-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-code-review\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7E5EJAJD6R57EE4YSMDJWMP","speckit-ext-validate","Pre-merge validation and quality gate for feature completion","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-validate\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7E5EFW37C0QJ0VZZG7SAWHD","speckit-ext-update-workspace","Update workspace documentation after feature completion","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-update-workspace\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7E5EBDFYZPMJ1HM484EH8K8","speckit-ext-session-handover","Mid-implementation context handover with proactive monitoring and continuation prompts","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-session-handover\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7E5E92Y08ME10QRAW8T0ES9","speckit-ext-scope-change","Document scope changes and ad-hoc additions during feature implementation","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-scope-change\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7E5E3DJ0B3B0FHF0YQAE2JV","speckit-ext-pr","Create a pull request for spec-kit features with agent-based workflow and spec-kit context awareness","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-pr\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7E5E1B26HH69228R8MD54H5","speckit-ext-post-merge","Spec-kit workflow command: speckit-ext-post-merge","https:\u002F\u002Fgithub.com\u002Fstefanwalther\u002Fghn\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fext\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-ext-post-merge\u002FSKILL.md",[],[]]