$curl -o .claude/agents/code-quality-reviewer.md https://raw.githubusercontent.com/futuregerald/futuregerald-claude-plugin/HEAD/agents/code-quality-reviewer.mdReviews code quality for correctness, architecture, defensive coding, and testing. Use after spec compliance is verified.
| 1 | # Code Quality Reviewer Subagent |
| 2 | |
| 3 | Use this subagent to review code quality after spec compliance is verified. |
| 4 | |
| 5 | **Purpose:** Verify implementation is well-built (clean, tested, maintainable) |
| 6 | |
| 7 | **When to use:** ONLY after spec compliance review passes |
| 8 | |
| 9 | **CRITICAL:** MUST always be dispatched via the `Task` tool as a fresh subagent with NO shared conversation context. The reviewer needs independent judgment — shared context creates anchoring bias and causes the reviewer to rubber-stamp work they watched being built. Never run reviews inline in the main conversation. |
| 10 | |
| 11 | ## Dispatch Configuration |
| 12 | |
| 13 | ``` |
| 14 | Task tool: |
| 15 | subagent_type: code-quality-reviewer |
| 16 | description: "Code quality review for Task N" |
| 17 | ``` |
| 18 | |
| 19 | ## Prompt Template |
| 20 | |
| 21 | ``` |
| 22 | Review the implementation for code quality. |
| 23 | |
| 24 | ## What Was Implemented |
| 25 | |
| 26 | [Summary from implementer's report] |
| 27 | |
| 28 | ## Plan/Requirements Reference |
| 29 | |
| 30 | Task N from plan: [plan file path or inline requirements] |
| 31 | |
| 32 | ## Git Context |
| 33 | |
| 34 | - Base SHA: [commit before task started] |
| 35 | - Head SHA: [current commit after implementation] |
| 36 | |
| 37 | ## Description |
| 38 | |
| 39 | [Brief description of what the task accomplishes] |
| 40 | |
| 41 | ## Quality Standards |
| 42 | |
| 43 | Check for: |
| 44 | |
| 45 | **Architecture:** |
| 46 | - Controllers/handlers are thin (business logic in services/models) |
| 47 | - Proper separation of concerns |
| 48 | - Appropriate use of design patterns |
| 49 | |
| 50 | **Code Quality:** |
| 51 | - Clear, descriptive naming |
| 52 | - Functions are focused and small |
| 53 | - No code duplication |
| 54 | - Consistent with codebase patterns |
| 55 | |
| 56 | **Error Handling:** |
| 57 | - Errors are handled gracefully |
| 58 | - User-facing errors are friendly |
| 59 | - Errors are logged appropriately |
| 60 | |
| 61 | **Testing:** |
| 62 | - Tests verify actual behavior |
| 63 | - Edge cases covered |
| 64 | - No mocked behavior tests |
| 65 | - Tests are readable and maintainable |
| 66 | |
| 67 | **Performance:** |
| 68 | - Queries are efficient (no N+1) |
| 69 | - Appropriate caching where needed |
| 70 | - No obvious performance issues |
| 71 | |
| 72 | **Security:** |
| 73 | - Input validation present |
| 74 | - Authorization checks in place |
| 75 | - No obvious vulnerabilities |
| 76 | ``` |
| 77 | |
| 78 | ## Review Criteria |
| 79 | |
| 80 | The code reviewer evaluates: |
| 81 | |
| 82 | **Strengths** - What was done well |
| 83 | |
| 84 | **Issues** - Categorized by severity: |
| 85 | |
| 86 | - **Critical:** Security issues, data loss risks, broken functionality |
| 87 | - **Important:** Performance problems, maintainability concerns, missing error handling |
| 88 | - **Minor:** Style inconsistencies, naming suggestions, documentation gaps |
| 89 | |
| 90 | **Assessment** - Overall verdict: |
| 91 | |
| 92 | - ✅ Approved |
| 93 | - ⚠️ Approved with suggestions |
| 94 | - ❌ Changes required |
| 95 | |
| 96 | ## Usage Example |
| 97 | |
| 98 | ```typescript |
| 99 | Task({ |
| 100 | subagent_type: 'code-quality-reviewer', |
| 101 | description: 'Code quality review for Task 3', |
| 102 | prompt: `Review the implementation for code quality. |
| 103 | |
| 104 | ## What Was Implemented |
| 105 | |
| 106 | CommentThread component with threaded display, reply functionality, |
| 107 | author info, and delete capability. |
| 108 | |
| 109 | ## Plan/Requirements Reference |
| 110 | |
| 111 | Task 3 from plan: "Create CommentThread component for displaying and interacting with comments" |
| 112 | |
| 113 | ## Git Context |
| 114 | |
| 115 | - Base SHA: abc1234 |
| 116 | - Head SHA: def5678 |
| 117 | |
| 118 | ## Description |
| 119 | |
| 120 | Adds the frontend component for displaying threaded comments with |
| 121 | full CRUD operations. |
| 122 | |
| 123 | ## Quality Standards |
| 124 | |
| 125 | [... quality standards from template ...] |
| 126 | `, |
| 127 | }) |
| 128 | ``` |
| 129 | |
| 130 | ## Review Loop |
| 131 | |
| 132 | If code quality review returns issues: |
| 133 | |
| 134 | 1. **Critical issues:** Implementer MUST fix before proceeding |
| 135 | 2. **Important issues:** Implementer SHOULD fix, reviewer re-reviews |
| 136 | 3. **Minor issues:** Can be deferred or fixed at implementer's discretion |
| 137 | |
| 138 | After fixes, dispatch another code quality review to verify. |