@su-record/vibe 2.7.16 → 2.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/.env.example +37 -37
  2. package/CLAUDE.md +153 -134
  3. package/LICENSE +21 -21
  4. package/README.md +449 -449
  5. package/agents/architect-low.md +41 -41
  6. package/agents/architect-medium.md +59 -59
  7. package/agents/architect.md +80 -80
  8. package/agents/build-error-resolver.md +115 -115
  9. package/agents/compounder.md +261 -261
  10. package/agents/diagrammer.md +178 -178
  11. package/agents/docs/api-documenter.md +99 -99
  12. package/agents/docs/changelog-writer.md +93 -93
  13. package/agents/e2e-tester.md +294 -294
  14. package/agents/explorer-low.md +42 -42
  15. package/agents/explorer-medium.md +59 -59
  16. package/agents/explorer.md +48 -48
  17. package/agents/implementer-low.md +43 -43
  18. package/agents/implementer-medium.md +52 -52
  19. package/agents/implementer.md +54 -54
  20. package/agents/junior-mentor.md +141 -141
  21. package/agents/planning/requirements-analyst.md +84 -84
  22. package/agents/planning/ux-advisor.md +83 -83
  23. package/agents/qa/acceptance-tester.md +86 -86
  24. package/agents/qa/edge-case-finder.md +93 -93
  25. package/agents/refactor-cleaner.md +143 -143
  26. package/agents/research/best-practices-agent.md +199 -199
  27. package/agents/research/codebase-patterns-agent.md +157 -157
  28. package/agents/research/framework-docs-agent.md +188 -188
  29. package/agents/research/security-advisory-agent.md +213 -213
  30. package/agents/review/architecture-reviewer.md +107 -107
  31. package/agents/review/complexity-reviewer.md +116 -116
  32. package/agents/review/data-integrity-reviewer.md +88 -88
  33. package/agents/review/git-history-reviewer.md +103 -103
  34. package/agents/review/performance-reviewer.md +86 -86
  35. package/agents/review/python-reviewer.md +150 -150
  36. package/agents/review/rails-reviewer.md +139 -139
  37. package/agents/review/react-reviewer.md +144 -144
  38. package/agents/review/security-reviewer.md +80 -80
  39. package/agents/review/simplicity-reviewer.md +140 -140
  40. package/agents/review/test-coverage-reviewer.md +116 -116
  41. package/agents/review/typescript-reviewer.md +127 -127
  42. package/agents/searcher.md +54 -54
  43. package/agents/simplifier.md +120 -120
  44. package/agents/tester.md +49 -49
  45. package/agents/ui/ui-a11y-auditor.md +93 -93
  46. package/agents/ui/ui-antipattern-detector.md +94 -94
  47. package/agents/ui/ui-dataviz-advisor.md +69 -69
  48. package/agents/ui/ui-design-system-gen.md +57 -57
  49. package/agents/ui/ui-industry-analyzer.md +49 -49
  50. package/agents/ui/ui-layout-architect.md +65 -65
  51. package/agents/ui/ui-stack-implementer.md +68 -68
  52. package/agents/ui/ux-compliance-reviewer.md +81 -81
  53. package/agents/ui-previewer.md +258 -258
  54. package/commands/vibe.analyze.md +379 -379
  55. package/commands/vibe.review.md +607 -607
  56. package/commands/vibe.run.md +2124 -2124
  57. package/commands/vibe.spec.md +1195 -1195
  58. package/commands/vibe.spec.review.md +569 -569
  59. package/commands/vibe.utils.md +413 -413
  60. package/commands/vibe.verify.md +484 -484
  61. package/dist/cli/collaborator.js +52 -52
  62. package/dist/cli/commands/evolution.js +12 -12
  63. package/dist/cli/commands/info.js +51 -51
  64. package/dist/cli/commands/init.js +5 -5
  65. package/dist/cli/commands/remove.js +14 -14
  66. package/dist/cli/commands/sentinel.js +27 -27
  67. package/dist/cli/commands/skills.js +5 -5
  68. package/dist/cli/commands/slack.js +10 -10
  69. package/dist/cli/commands/telegram.js +12 -12
  70. package/dist/cli/commands/upgrade.d.ts +3 -3
  71. package/dist/cli/commands/upgrade.d.ts.map +1 -1
  72. package/dist/cli/commands/upgrade.js +24 -3
  73. package/dist/cli/commands/upgrade.js.map +1 -1
  74. package/dist/cli/detect.js +32 -32
  75. package/dist/cli/index.js +51 -51
  76. package/dist/cli/llm/claude-commands.js +16 -16
  77. package/dist/cli/llm/config.js +18 -18
  78. package/dist/cli/llm/gemini-commands.js +16 -16
  79. package/dist/cli/llm/gpt-commands.js +19 -19
  80. package/dist/cli/llm/help.js +21 -21
  81. package/dist/cli/postinstall/cursor-agents.js +32 -32
  82. package/dist/cli/postinstall/cursor-rules.js +83 -83
  83. package/dist/cli/postinstall/cursor-skills.js +743 -743
  84. package/dist/cli/setup/Provisioner.js +42 -42
  85. package/dist/infra/lib/DeepInit.js +24 -24
  86. package/dist/infra/lib/IterationTracker.js +11 -11
  87. package/dist/infra/lib/PythonParser.js +108 -108
  88. package/dist/infra/lib/ReviewRace.js +96 -96
  89. package/dist/infra/lib/SkillFrontmatter.js +28 -28
  90. package/dist/infra/lib/SkillQualityGate.js +9 -9
  91. package/dist/infra/lib/SkillRepository.js +159 -159
  92. package/dist/infra/lib/UltraQA.js +99 -99
  93. package/dist/infra/lib/autonomy/AuditStore.js +41 -41
  94. package/dist/infra/lib/autonomy/ConfirmationStore.js +30 -30
  95. package/dist/infra/lib/autonomy/EventOutbox.js +38 -38
  96. package/dist/infra/lib/autonomy/PolicyEngine.js +18 -18
  97. package/dist/infra/lib/autonomy/SecuritySentinel.js +1 -1
  98. package/dist/infra/lib/autonomy/SuggestionStore.js +33 -33
  99. package/dist/infra/lib/embedding/VectorStore.js +22 -22
  100. package/dist/infra/lib/evolution/AgentAnalyzer.js +10 -10
  101. package/dist/infra/lib/evolution/DescriptionOptimizer.js +21 -21
  102. package/dist/infra/lib/evolution/GenerationRegistry.js +36 -36
  103. package/dist/infra/lib/evolution/InsightStore.js +90 -90
  104. package/dist/infra/lib/evolution/RollbackManager.js +5 -5
  105. package/dist/infra/lib/evolution/SkillBenchmark.js +23 -23
  106. package/dist/infra/lib/evolution/SkillEvalRunner.js +50 -50
  107. package/dist/infra/lib/evolution/SkillGapDetector.js +10 -10
  108. package/dist/infra/lib/evolution/UsageTracker.js +28 -28
  109. package/dist/infra/lib/gemini/orchestration.js +5 -5
  110. package/dist/infra/lib/gpt/orchestration.js +4 -4
  111. package/dist/infra/lib/memory/KnowledgeGraph.js +4 -4
  112. package/dist/infra/lib/memory/MemorySearch.js +57 -57
  113. package/dist/infra/lib/memory/MemoryStorage.js +181 -181
  114. package/dist/infra/lib/memory/ObservationStore.js +28 -28
  115. package/dist/infra/lib/memory/ReflectionStore.js +30 -30
  116. package/dist/infra/lib/memory/SessionRAGRetriever.js +7 -7
  117. package/dist/infra/lib/memory/SessionRAGStore.js +225 -225
  118. package/dist/infra/lib/memory/SessionSummarizer.js +9 -9
  119. package/dist/infra/lib/telemetry/SkillTelemetry.d.ts +52 -0
  120. package/dist/infra/lib/telemetry/SkillTelemetry.d.ts.map +1 -0
  121. package/dist/infra/lib/telemetry/SkillTelemetry.js +117 -0
  122. package/dist/infra/lib/telemetry/SkillTelemetry.js.map +1 -0
  123. package/dist/infra/lib/telemetry/SkillTelemetry.test.d.ts +2 -0
  124. package/dist/infra/lib/telemetry/SkillTelemetry.test.d.ts.map +1 -0
  125. package/dist/infra/lib/telemetry/SkillTelemetry.test.js +91 -0
  126. package/dist/infra/lib/telemetry/SkillTelemetry.test.js.map +1 -0
  127. package/dist/infra/orchestrator/AgentManager.js +12 -12
  128. package/dist/infra/orchestrator/AgentRegistry.js +65 -65
  129. package/dist/infra/orchestrator/MultiLlmResearch.js +8 -8
  130. package/dist/infra/orchestrator/SwarmOrchestrator.test.js +16 -16
  131. package/dist/infra/orchestrator/parallelResearch.js +24 -24
  132. package/dist/test-helpers/index.d.ts +36 -0
  133. package/dist/test-helpers/index.d.ts.map +1 -0
  134. package/dist/test-helpers/index.js +85 -0
  135. package/dist/test-helpers/index.js.map +1 -0
  136. package/dist/test-helpers/index.test.d.ts +2 -0
  137. package/dist/test-helpers/index.test.d.ts.map +1 -0
  138. package/dist/test-helpers/index.test.js +92 -0
  139. package/dist/test-helpers/index.test.js.map +1 -0
  140. package/dist/tools/convention/analyzeComplexity.test.js +115 -115
  141. package/dist/tools/convention/validateCodeQuality.test.js +104 -104
  142. package/dist/tools/memory/createMemoryTimeline.js +10 -10
  143. package/dist/tools/memory/getMemoryGraph.js +12 -12
  144. package/dist/tools/memory/getSessionContext.js +9 -9
  145. package/dist/tools/memory/linkMemories.js +14 -14
  146. package/dist/tools/memory/listMemories.js +4 -4
  147. package/dist/tools/memory/recallMemory.js +4 -4
  148. package/dist/tools/memory/saveMemory.js +4 -4
  149. package/dist/tools/memory/searchMemoriesAdvanced.js +23 -23
  150. package/dist/tools/semantic/analyzeDependencyGraph.js +12 -12
  151. package/dist/tools/semantic/astGrep.test.js +6 -6
  152. package/dist/tools/spec/prdParser.test.js +171 -171
  153. package/dist/tools/spec/specGenerator.js +169 -169
  154. package/dist/tools/spec/traceabilityMatrix.js +64 -64
  155. package/dist/tools/spec/traceabilityMatrix.test.js +28 -28
  156. package/hooks/gemini-hooks.json +73 -73
  157. package/hooks/hooks.json +137 -137
  158. package/hooks/scripts/code-check.js +77 -77
  159. package/hooks/scripts/context-save.js +212 -212
  160. package/hooks/scripts/hud-status.js +291 -291
  161. package/hooks/scripts/keyword-detector.js +214 -214
  162. package/hooks/scripts/llm-orchestrate.js +475 -475
  163. package/hooks/scripts/post-edit.js +32 -32
  164. package/hooks/scripts/pre-tool-guard.js +125 -125
  165. package/hooks/scripts/prompt-dispatcher.js +185 -185
  166. package/hooks/scripts/sentinel-guard.js +104 -104
  167. package/hooks/scripts/session-start.js +106 -106
  168. package/hooks/scripts/stop-notify.js +209 -209
  169. package/hooks/scripts/utils.js +100 -100
  170. package/languages/csharp-unity.md +515 -515
  171. package/languages/gdscript-godot.md +470 -470
  172. package/languages/ruby-rails.md +489 -489
  173. package/languages/typescript-angular.md +433 -433
  174. package/languages/typescript-astro.md +416 -416
  175. package/languages/typescript-electron.md +406 -406
  176. package/languages/typescript-nestjs.md +524 -524
  177. package/languages/typescript-svelte.md +407 -407
  178. package/languages/typescript-tauri.md +365 -365
  179. package/package.json +123 -121
  180. package/skills/agents-md/SKILL.md +120 -120
  181. package/skills/arch-guard/SKILL.md +180 -180
  182. package/skills/brand-assets/SKILL.md +146 -146
  183. package/skills/capability-loop/SKILL.md +167 -167
  184. package/skills/characterization-test/SKILL.md +206 -206
  185. package/skills/commerce-patterns/SKILL.md +63 -63
  186. package/skills/commit-push-pr/SKILL.md +75 -75
  187. package/skills/context7-usage/SKILL.md +105 -105
  188. package/skills/core-capabilities/SKILL.md +13 -13
  189. package/skills/e2e-commerce/SKILL.md +61 -61
  190. package/skills/exec-plan/SKILL.md +147 -147
  191. package/skills/frontend-design/SKILL.md +12 -12
  192. package/skills/git-worktree/SKILL.md +72 -72
  193. package/skills/handoff/SKILL.md +109 -109
  194. package/skills/parallel-research/SKILL.md +87 -87
  195. package/skills/priority-todos/SKILL.md +63 -63
  196. package/skills/seo-checklist/SKILL.md +57 -57
  197. package/skills/techdebt/SKILL.md +122 -122
  198. package/skills/tool-fallback/SKILL.md +103 -103
  199. package/skills/typescript-advanced-types/SKILL.md +66 -66
  200. package/skills/ui-ux-pro-max/SKILL.md +221 -221
  201. package/skills/vercel-react-best-practices/SKILL.md +59 -59
  202. package/skills/video-production/SKILL.md +51 -51
  203. package/vibe/config.json +29 -29
  204. package/vibe/constitution.md +227 -227
  205. package/vibe/rules/principles/communication-guide.md +98 -98
  206. package/vibe/rules/principles/development-philosophy.md +52 -52
  207. package/vibe/rules/principles/quick-start.md +102 -102
  208. package/vibe/rules/quality/bdd-contract-testing.md +393 -393
  209. package/vibe/rules/quality/checklist.md +276 -276
  210. package/vibe/rules/quality/performance.md +236 -236
  211. package/vibe/rules/quality/testing-strategy.md +440 -440
  212. package/vibe/rules/standards/anti-patterns.md +541 -541
  213. package/vibe/rules/standards/code-structure.md +291 -291
  214. package/vibe/rules/standards/complexity-metrics.md +313 -313
  215. package/vibe/rules/standards/git-workflow.md +237 -237
  216. package/vibe/rules/standards/naming-conventions.md +198 -198
  217. package/vibe/rules/standards/security.md +305 -305
  218. package/vibe/rules/writing/document-style.md +74 -74
  219. package/vibe/setup.sh +31 -31
  220. package/vibe/templates/constitution-template.md +252 -252
  221. package/vibe/templates/contract-backend-template.md +526 -526
  222. package/vibe/templates/contract-frontend-template.md +599 -599
  223. package/vibe/templates/feature-template.md +96 -96
  224. package/vibe/templates/spec-template.md +221 -221
  225. package/vibe/ui-ux-data/charts.csv +26 -26
  226. package/vibe/ui-ux-data/colors.csv +97 -97
  227. package/vibe/ui-ux-data/icons.csv +101 -101
  228. package/vibe/ui-ux-data/landing.csv +31 -31
  229. package/vibe/ui-ux-data/products.csv +96 -96
  230. package/vibe/ui-ux-data/react-performance.csv +45 -45
  231. package/vibe/ui-ux-data/stacks/astro.csv +54 -54
  232. package/vibe/ui-ux-data/stacks/flutter.csv +53 -53
  233. package/vibe/ui-ux-data/stacks/html-tailwind.csv +56 -56
  234. package/vibe/ui-ux-data/stacks/jetpack-compose.csv +53 -53
  235. package/vibe/ui-ux-data/stacks/nextjs.csv +53 -53
  236. package/vibe/ui-ux-data/stacks/nuxt-ui.csv +51 -51
  237. package/vibe/ui-ux-data/stacks/nuxtjs.csv +59 -59
  238. package/vibe/ui-ux-data/stacks/react-native.csv +52 -52
  239. package/vibe/ui-ux-data/stacks/react.csv +54 -54
  240. package/vibe/ui-ux-data/stacks/shadcn.csv +61 -61
  241. package/vibe/ui-ux-data/stacks/svelte.csv +54 -54
  242. package/vibe/ui-ux-data/stacks/swiftui.csv +51 -51
  243. package/vibe/ui-ux-data/stacks/vue.csv +50 -50
  244. package/vibe/ui-ux-data/styles.csv +68 -68
  245. package/vibe/ui-ux-data/typography.csv +57 -57
  246. package/vibe/ui-ux-data/ui-reasoning.csv +101 -101
  247. package/vibe/ui-ux-data/ux-guidelines.csv +99 -99
  248. package/vibe/ui-ux-data/version.json +31 -31
  249. package/vibe/ui-ux-data/web-interface.csv +31 -31
@@ -1,607 +1,607 @@
1
- ---
2
- description: Multi-agent parallel code review with priority-based findings
3
- argument-hint: "PR number, branch name, or file path"
4
- ---
5
-
6
- # /vibe.review
7
-
8
- **Parallel Agent Code Review** - 13+ specialists review simultaneously
9
-
10
- ## Usage
11
-
12
- ```
13
- /vibe.review # Review current branch
14
- /vibe.review PR#123 # Review specific PR
15
- /vibe.review feature/login # Review specific branch
16
- /vibe.review src/api/ # Review specific path
17
- /vibe.review --race # Multi-LLM race mode (GPT + Gemini)
18
- /vibe.review --race security # Race mode for specific review type
19
- ```
20
-
21
- > **⏱️ Timer**: Call `getCurrentTime` tool at the START. Record the result as `{start_time}`.
22
-
23
- ## Race Mode (v2.6.9)
24
-
25
- **Multi-LLM competitive review** - Same review task runs on GPT + Gemini in parallel, results are cross-validated.
26
-
27
- ### How It Works
28
-
29
- ```
30
- /vibe.review --race
31
-
32
- security-review:
33
- ├─ GPT Codex → [SQL injection, XSS]
34
- └─ Gemini → [SQL injection, CSRF]
35
-
36
- Cross-validation:
37
- - SQL injection (2/2) → 🔴 P1 (100% confidence)
38
- - XSS (1/2) → 🟡 P2 (50% confidence)
39
- - CSRF (1/2) → 🟡 P2 (50% confidence)
40
- ```
41
-
42
- ### Confidence-Based Priority
43
-
44
- | Confidence | Priority | Meaning |
45
- |------------|----------|---------|
46
- | 100% (2/2) | P1 | Both models agree - high confidence |
47
- | 50% (1/2) | P2 | One model found - needs verification |
48
-
49
- ### Race Mode Options
50
-
51
- ```
52
- /vibe.review --race # All review types
53
- /vibe.review --race security # Security only
54
- /vibe.review --race performance # Performance only
55
- /vibe.review --race architecture # Architecture only
56
- ```
57
-
58
- ### Race Mode Output
59
-
60
- ```
61
- ## SECURITY Review (Race Mode)
62
-
63
- **Duration**: 3420ms
64
- **Models**: GPT Codex, Gemini
65
-
66
- ### Model Results
67
-
68
- | Model | Issues Found | Duration | Status |
69
- |-------|--------------|----------|--------|
70
- | gpt | 3 | 1823ms | OK |
71
- | gemini | 2 | 2156ms | OK |
72
-
73
- ### Cross-Validated Issues
74
-
75
- **Summary**: 3 issues (P1: 1, P2: 2)
76
- **Consensus Rate**: 67%
77
-
78
- #### 🔴 P1 - SQL Injection in user query
79
-
80
- - **Confidence**: 100% (gpt, gemini)
81
- - **Severity**: critical
82
- - **Location**: `src/api/users.ts:42`
83
- - **Suggestion**: Use parameterized queries
84
-
85
- #### 🟡 P2 - XSS vulnerability in render
86
-
87
- - **Confidence**: 50% (gpt)
88
- - **Severity**: high
89
- - **Location**: `src/components/Comment.tsx:15`
90
- ```
91
-
92
- ### When to Use Race Mode
93
-
94
- | Scenario | Recommended |
95
- |----------|-------------|
96
- | Critical security review | ✅ `--race security` |
97
- | Pre-production audit | ✅ `--race` |
98
- | Quick iteration | ❌ Standard review |
99
- | API cost concerns | ❌ Standard review |
100
-
101
- ### Tool Invocation (Race Mode - GPT + Gemini in parallel via Bash)
102
-
103
- **🚨 Use --input file to avoid CLI argument length limits and Windows pipe issues.**
104
-
105
- 1. Save code to review into `[SCRATCHPAD]/review-code.txt` (using Write tool)
106
- 2. Write JSON input file `[SCRATCHPAD]/review-input.json` (using Write tool):
107
- - `{"prompt": "Review this code for [REVIEW_TYPE]. Return JSON: {issues: [{id, title, description, severity, suggestion}]}. Code: [CODE_CONTENT]"}`
108
- - Where `[CODE_CONTENT]` is the code text (properly JSON-escaped inside the prompt string)
109
- 3. Script path: `[LLM_SCRIPT]` = `{{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js`
110
- 4. Run GPT + Gemini in PARALLEL (two Bash tool calls at once):
111
-
112
- ```bash
113
- # GPT review (Bash tool call 1)
114
- node "[LLM_SCRIPT]" gpt orchestrate-json --input "[SCRATCHPAD]/review-input.json"
115
- ```
116
-
117
- ```bash
118
- # Gemini review (Bash tool call 2 - run in parallel)
119
- node "[LLM_SCRIPT]" gemini orchestrate-json --input "[SCRATCHPAD]/review-input.json"
120
- ```
121
-
122
- ## File Reading Policy (Mandatory)
123
-
124
- - **소스코드 파일**: 리뷰 대상 파일은 반드시 `Read` 도구로 전체 파일을 읽은 후 리뷰할 것 (Grep으로 훑어보기 금지)
125
- - **Grep 사용 제한**: 파일 위치 탐색(어떤 파일에 있는지 찾기)에만 사용. 파일 내용 파악 및 리뷰에는 반드시 Read 사용
126
- - **에이전트 spawn 시**: 프롬프트에 "대상 파일을 Read 도구로 전체 읽은 후 분석하라"를 반드시 포함할 것
127
- - **부분 읽기 금지**: Grep 결과의 주변 몇 줄만 보고 판단하지 말 것. 전체 맥락을 파악해야 정확한 리뷰 가능
128
-
129
- ## Priority System
130
-
131
- | Priority | Criteria | Action |
132
- |----------|----------|--------|
133
- | P1 | Security vulnerabilities, data loss, crashes | Block merge, fix immediately |
134
- | P2 | Performance issues, architecture violations, missing tests | Fix before merge |
135
- | P3 | Style, refactoring suggestions, documentation | Add to backlog |
136
-
137
- ## Convergence Rules (Over-Diagnosis Prevention)
138
-
139
- > **Principle**: Reviews must converge. A review that always finds more issues is broken, not thorough.
140
-
141
- ### Scope Limiting
142
-
143
- - **Review ONLY changed files** — based on `git diff --name-only`. Never scan the entire project
144
- - **If no git diff** (first review) — review only files in the target path
145
-
146
- ### Severity Filtering by Round
147
-
148
- | Round | What to Report |
149
- |-------|---------------|
150
- | 1st review | P1 + P2 + P3 (all) |
151
- | 2nd review (same code) | P1 + P2 only (skip P3) |
152
- | 3rd+ review | P1 only (report only new P1s) |
153
-
154
- ### Stop Conditions
155
-
156
- - **P1 = 0 means MERGE READY** — mergeable even with remaining P2/P3
157
- - **P1 = 0 after auto-fix means DONE** — record P2 auto-fix failures as TODO and stop
158
- - **Final P1 list unchanged after Review Debate → DONE** — no new findings = converged
159
-
160
- ### Anti-Patterns (FORBIDDEN)
161
-
162
- - "All items must be verified" → Only P1 is mandatory, P2/P3 are best-effort
163
- - "Found one more issue" (repeated) → Only report P1s not mentioned in previous review
164
- - Forcing code changes for P3 issues → P3 goes to TODO files only, never force code changes
165
- - Infinite retries on auto-fix failure → max 1 retry then move to TODO
166
-
167
- ## Process
168
-
169
- ### Phase 1: Tech Stack Detection
170
-
171
- Detect project tech stack FIRST before launching reviewers:
172
-
173
- ```
174
- Read package.json -> TypeScript, React, Node.js
175
- Read pyproject.toml -> Python, FastAPI, Django
176
- Read Gemfile -> Ruby, Rails
177
- Read pubspec.yaml -> Flutter, Dart
178
- Read go.mod -> Go
179
- Read CLAUDE.md -> Explicit tech stack declaration
180
- ```
181
-
182
- ### Phase 1.5: SPEC ↔ Code Alignment Check
183
-
184
- > When SPEC files exist, verify that code changes align with the SPEC
185
-
186
- ```
187
- 1. Search .claude/vibe/specs/ for related SPEC files (based on git diff filenames)
188
- 2. Compare SPEC REQ-* list against functionality in changed code
189
- 3. If functionality added that's not in SPEC → P2 finding: "Feature added without SPEC"
190
- 4. If implementation differs from SPEC → P1 finding: "SPEC ↔ code mismatch"
191
- 5. If no SPEC files exist → Skip (reviews work without SPEC too)
192
- ```
193
-
194
- ### Phase 2: Parallel Agent Review (STACK-AWARE) via Orchestrator
195
-
196
- **Execution via Orchestrator (12+ agents in parallel):**
197
- ```bash
198
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => o.review(['FILE_PATHS'], ['DETECTED_STACKS']).then(r => console.log(r.content[0].text)))"
199
- ```
200
-
201
- **Example:**
202
- ```bash
203
- # Review changed files with TypeScript + React stack
204
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => o.review(['src/api/users.ts', 'src/components/Login.tsx'], ['TypeScript', 'React']).then(r => console.log(r.content[0].text)))"
205
- ```
206
-
207
- **Core Reviewers (Always Run):**
208
- | Agent | Focus |
209
- |-------|-------|
210
- | security-reviewer | OWASP Top 10, vulnerabilities |
211
- | data-integrity-reviewer | Data validation, constraints |
212
- | performance-reviewer | N+1 queries, memory leaks |
213
- | architecture-reviewer | Layer violations, cycles |
214
- | complexity-reviewer | Cyclomatic complexity, length |
215
- | simplicity-reviewer | Over-abstraction, dead code |
216
- | git-history-reviewer | Churn files, risk patterns |
217
- | test-coverage-reviewer | Missing tests, edge cases |
218
-
219
- **Stack-Specific Reviewers (Conditional):**
220
- | Agent | Condition |
221
- |-------|-----------|
222
- | python-reviewer | .py files in diff |
223
- | typescript-reviewer | .ts/.tsx files OR tsconfig |
224
- | rails-reviewer | Gemfile has rails |
225
- | react-reviewer | package.json has react |
226
-
227
- ### Phase 2.5: UI/UX Review Agents (Auto-triggered)
228
-
229
- > **활성화 조건**: 변경된 파일 중 UI 파일 존재 (`.tsx`, `.jsx`, `.vue`, `.svelte`, `.html`, `.css`, `.scss`)
230
- > **비활성화**: `.claude/vibe/config.json`에 `"uiUxAnalysis": false` 설정
231
-
232
- **기존 12+ 리뷰 에이전트와 병렬 실행:**
233
-
234
- | Agent | Role | Output |
235
- |-------|------|--------|
236
- | ⑥ ux-compliance-reviewer | UX 가이드라인 준수 검증 | P1/P2/P3 findings |
237
- | ⑦ ui-a11y-auditor | WCAG 2.1 AA 접근성 감사 | P1/P2/P3 findings |
238
- | ⑧ ui-antipattern-detector | UI 안티패턴 + 디자인 시스템 일관성 | P1/P2/P3 findings |
239
-
240
- **실행 방법 — 기존 Phase 2 에이전트와 병렬 실행:**
241
-
242
- ```text
243
- # ⑥ UX 준수 검증 (Haiku)
244
- Task(subagent_type="ux-compliance-reviewer",
245
- prompt="Review UI files for UX guideline compliance: {changed_ui_files}. Use core_ui_search against ux-guidelines and web-interface domains.")
246
-
247
- # ⑦ 접근성 감사 (Haiku)
248
- Task(subagent_type="ui-a11y-auditor",
249
- prompt="Audit UI files for WCAG 2.1 AA compliance: {changed_ui_files}.")
250
-
251
- # ⑧ 안티패턴 검출 (Haiku)
252
- Task(subagent_type="ui-antipattern-detector",
253
- prompt="Detect UI anti-patterns in: {changed_ui_files}. Check against MASTER.md if exists at .claude/vibe/design-system/{project}/MASTER.md.")
254
- ```
255
-
256
- **findings 통합**: ⑥⑦⑧ findings를 기존 findings[]와 병합 → P1/P2/P3 통합 정렬
257
-
258
- **⑦ Critical finding 에스컬레이션**: ui-a11y-auditor의 P1 finding은 Review Debate Team(Phase 4.5)에 자동 포함
259
-
260
- ### Phase 3: Deep Analysis
261
-
262
- After agent results:
263
-
264
- 1. **System Context**: Component interactions, data flow, external dependencies
265
- 2. **Stakeholder Perspectives**: Developers, Ops, Security, Business
266
- 3. **Edge Cases**: Race conditions, resource exhaustion, network failures
267
- 4. **Multiple Angles**: Technical excellence, business value, risk management
268
-
269
- ### Phase 4: Findings Synthesis
270
-
271
- ```
272
- REVIEW FINDINGS
273
-
274
- P1 CRITICAL (Blocks Merge) - N issues
275
- 1. [SECURITY] SQL Injection in user query
276
- Location: src/api/users.py:42
277
- Fix: Use parameterized queries
278
-
279
- P2 IMPORTANT (Should Fix) - N issues
280
- 2. [PERF] N+1 query in user list
281
- 3. [ARCH] Circular dependency detected
282
-
283
- P3 NICE-TO-HAVE (Enhancement) - N issues
284
- 4. [STYLE] Consider extracting helper function
285
- ```
286
-
287
- ### Phase 4.5: Agent Teams — Review Debate
288
-
289
- > **Agent Teams**: 개별 리뷰어의 발견을 팀으로 토론하여 우선순위를 검증하고 오탐을 제거합니다.
290
- > 설정: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` + `teammateMode: in-process` (`~/.claude/settings.json` 전역 — postinstall 자동 설정)
291
-
292
- **팀 구성:**
293
-
294
- | 팀원 | 역할 |
295
- |------|------|
296
- | security-reviewer (리더) | P1/P2 이슈 종합, 보안 이슈 최종 판정, 합의 주도 |
297
- | architecture-reviewer | 구조적 영향 평가, 숨겨진 결합도 식별 |
298
- | performance-reviewer | 성능 영향 평가, 부하 시나리오 검증 |
299
- | simplicity-reviewer | 과잉 설계 지적, 더 단순한 대안 제시 |
300
-
301
- **실행 순서:**
302
-
303
- 1. `TeamCreate(team_name="review-debate-{feature}")` — 팀 + 공유 태스크 리스트 생성
304
- 2. 4개 팀원 병렬 생성 — 각각 `Task(team_name=..., name=..., subagent_type=...)` 으로 spawn
305
- 3. 팀원들이 공유 TaskList에서 이슈를 claim하고, SendMessage로 교차 검증
306
- 4. 리더(security-reviewer)가 팀 합의 결과 종합 → 검증된 P1/P2 목록 출력
307
- 5. 모든 팀원 shutdown_request → TeamDelete로 정리
308
-
309
- **팀원 spawn 패턴:**
310
-
311
- ```text
312
- TeamCreate(team_name="review-debate-{feature}", description="Review debate for {feature}")
313
-
314
- # 4개 병렬 spawn
315
- Task(team_name="review-debate-{feature}", name="security-reviewer", subagent_type="security-reviewer",
316
- mode="bypassPermissions",
317
- prompt="리뷰 토론 팀 리더. Phase 2에서 발견된 P1/P2 이슈를 팀과 함께 검증하세요.
318
- Phase 2 결과: {phase2_findings}
319
- 역할: 보안 이슈 최종 판정, 팀원 간 우선순위 충돌 해결, 최종 합의 요약 작성.
320
- TaskList를 확인하고 이슈를 claim하세요. 각 이슈에 대해 팀원에게 SendMessage로 검증을 요청하세요.
321
- 모든 이슈 검증 완료 후 최종 합의 결과를 작성하세요.")
322
-
323
- Task(team_name="review-debate-{feature}", name="architecture-reviewer", subagent_type="architecture-reviewer",
324
- mode="bypassPermissions",
325
- prompt="리뷰 토론 팀 아키텍처 담당. Phase 2 결과: {phase2_findings}
326
- 역할: 각 이슈의 구조적 영향 평가, 숨겨진 결합도/의존성 식별.
327
- 아키텍처 관점에서 우선순위 변경이 필요하면 security-reviewer에게 SendMessage로 알리세요.
328
- TaskList에서 아키텍처 관련 이슈를 claim하세요.")
329
-
330
- Task(team_name="review-debate-{feature}", name="performance-reviewer", subagent_type="performance-reviewer",
331
- mode="bypassPermissions",
332
- prompt="리뷰 토론 팀 성능 담당. Phase 2 결과: {phase2_findings}
333
- 역할: 성능 영향 평가, 부하 시 cascading failure 가능성 검증.
334
- 성능 관점에서 P2→P1 승격이 필요하면 security-reviewer에게 SendMessage로 알리세요.
335
- TaskList에서 성능 관련 이슈를 claim하세요.")
336
-
337
- Task(team_name="review-debate-{feature}", name="simplicity-reviewer", subagent_type="simplicity-reviewer",
338
- mode="bypassPermissions",
339
- prompt="리뷰 토론 팀 복잡도 담당. Phase 2 결과: {phase2_findings}
340
- 역할: 과잉 진단(오탐) 식별, 더 단순한 수정 방안 제시.
341
- 오탐이나 P1→P2 강등이 필요하면 security-reviewer에게 SendMessage로 알리세요.
342
- TaskList에서 복잡도/단순화 관련 이슈를 claim하세요.")
343
- ```
344
-
345
- **팀원 간 통신 예시:**
346
-
347
- ```text
348
- architecture-reviewer → security-reviewer: "Unbounded query는 부하 시 cascading failure 가능. P2→P1 승격 제안"
349
- simplicity-reviewer → security-reviewer: "CSRF on read-only endpoint는 side effect 없음. P1→P2 강등 제안"
350
- performance-reviewer → architecture-reviewer: "N+1 query가 현재 데이터 규모에서는 영향 없으나 확장 시 문제. 의견?"
351
- security-reviewer → broadcast: "최종 합의: SQL Injection P1 유지, Unbounded query P1 승격, CSRF P2 강등, Circular dep 오탐 제거"
352
- ```
353
-
354
- **토론 결과 예시:**
355
-
356
- ```
357
- 🤝 REVIEW DEBATE RESULTS
358
-
359
- Team Consensus (4 reviewers):
360
-
361
- ✅ Validated P1 (unanimous):
362
- 1. [SECURITY] SQL Injection — 4/4 agree critical
363
-
364
- ⬆️ Upgraded P2→P1 (debate result):
365
- 2. [PERF] Unbounded query — architecture-reviewer pointed out
366
- cascading failure risk under load → team agreed P1
367
-
368
- ⬇️ Downgraded P1→P2 (debate result):
369
- 3. [SECURITY] CSRF on read-only endpoint — simplicity-reviewer
370
- noted endpoint has no side effects → team agreed P2
371
-
372
- ❌ Removed (false positive):
373
- 4. [ARCH] "Circular dependency" — architecture-reviewer confirmed
374
- this is intentional bi-directional reference, not a cycle
375
-
376
- 🆕 New findings (team discussion):
377
- 5. [DATA] Race condition in concurrent updates — emerged from
378
- security + performance discussion
379
- ```
380
-
381
- ### Phase 5: Auto-Fix (P1/P2)
382
-
383
- **Auto-fixable issues are resolved immediately:**
384
-
385
- ```
386
- 🔧 AUTO-FIX Starting...
387
-
388
- P1 Critical:
389
- 1. [SECURITY] SQL Injection → Fixed with parameterized query ✅
390
- 2. [DATA] Missing transaction rollback → Added try-finally ✅
391
-
392
- P2 Important:
393
- 3. [PERF] N+1 query → Added select_related ✅
394
- 4. [ARCH] Circular dependency → Separated dependencies ✅
395
- 5. [TEST] Missing edge case → Added test ✅
396
-
397
- 🔍 Re-validating...
398
- ✅ Build successful
399
- ✅ Tests passed
400
-
401
- ✅ 5 issues auto-fixed!
402
- ```
403
-
404
- **Cases that cannot be auto-fixed:**
405
- - Requires large-scale architecture changes
406
- - Requires business logic decisions
407
- - Requires user confirmation
408
-
409
- → Manual handling instructions in Phase 6
410
-
411
- ### Phase 6: Todo File Creation (Items Requiring Manual Handling)
412
-
413
- Save **remaining** findings to `.claude/vibe/todos/`:
414
-
415
- ```
416
- {priority}-{category}-{short-desc}.md
417
-
418
- Examples:
419
- - P2-arch-large-refactor.md (Cannot be auto-fixed)
420
- - P3-style-extract-helper.md (Backlog)
421
- ```
422
-
423
- ## Output
424
-
425
- ```
426
- CODE REVIEW SUMMARY
427
- PR #123: Add user authentication
428
-
429
- Reviewers: 13 agents
430
- ⏱️ Started: {start_time}
431
- ⏱️ Completed: {getCurrentTime 결과}
432
-
433
- Score: 92/100 (Good) ← Score after auto-fix
434
-
435
- Issues Found:
436
- - P1 Critical: 2 → 0 (✅ Auto-fixed)
437
- - P2 Important: 5 → 1 (✅ 4 auto-fixed)
438
- - P3 Nice-to-have: 3 (Backlog)
439
-
440
- Auto-Fixed: 6 issues
441
- - [SECURITY] SQL Injection ✅
442
- - [DATA] Transaction rollback ✅
443
- - [PERF] N+1 query ✅
444
- - [ARCH] Circular dependency ✅
445
- - [PERF] Unnecessary loop ✅
446
- - [TEST] Missing edge case ✅
447
-
448
- Remaining (Manual handling required):
449
- - P2-arch-large-refactor.md (Architecture decision required)
450
- - P3-style-extract-helper.md (Backlog)
451
- - P3-docs-add-readme.md (Backlog)
452
-
453
- ✅ MERGE READY (P1/P2 resolved)
454
- ```
455
-
456
- ### Phase 7: Guide to Fix Workflow (Manual Handling Items)
457
-
458
- **Choose workflow when handling remaining issues:**
459
-
460
- ```
461
- ## Fix Workflow
462
-
463
- Choose a workflow to fix the discovered issues:
464
-
465
- | Task Scale | Recommended Approach |
466
- |------------|---------------------|
467
- | Simple fix (1-2 files) | Plan Mode |
468
- | Complex fix (3+ files, validation needed) | /vibe.spec |
469
-
470
- 1. `/vibe.spec "fix: issue-name"` - VIBE workflow (SPEC validation + re-review)
471
- 2. Plan Mode - Quick fix (for simple tasks)
472
-
473
- Which approach would you like to proceed with?
474
- ```
475
-
476
- - Wait for user's choice before proceeding
477
- - If user chooses VIBE → wait for `/vibe.spec` command
478
- - If user chooses Plan Mode → proceed with EnterPlanMode
479
-
480
- ## Core Tools (Code Analysis)
481
-
482
- ### Tool Invocation
483
-
484
- All tools are called via:
485
-
486
- ```bash
487
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.TOOL_NAME({...args}).then(r => console.log(r.content[0].text)))"
488
- ```
489
-
490
- ### Recommended Tools for Review
491
-
492
- | Tool | Purpose | When to Use |
493
- |------|---------|-------------|
494
- | `validateCodeQuality` | Code quality check | Overall code quality scan |
495
- | `analyzeComplexity` | Complexity metrics | Check function complexity |
496
- | `findSymbol` | Find definitions | Locate implementations |
497
- | `findReferences` | Find all usages | Track symbol usage |
498
- | `saveMemory` | Save findings | Store important review findings |
499
-
500
- ### Example Tool Usage in Review
501
-
502
- **1. Validate code quality before review:**
503
-
504
- ```bash
505
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.validateCodeQuality({targetPath: 'src/', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
506
- ```
507
-
508
- **2. Analyze complexity of changed files:**
509
-
510
- ```bash
511
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.analyzeComplexity({targetPath: 'src/api/users.ts', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
512
- ```
513
-
514
- **3. Save critical finding for reference:**
515
-
516
- ```bash
517
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.saveMemory({key: 'review-pr123-critical', value: 'SQL injection in users.py:42', category: 'review', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
518
- ```
519
-
520
- ---
521
-
522
- ## Quality Gate (Mandatory)
523
-
524
- ### Review Quality Checklist
525
-
526
- Before completing review, check P1-critical items. P2/P3 items are best-effort:
527
-
528
- | Category | Check Item | Weight |
529
- |----------|------------|--------|
530
- | **Security** | OWASP Top 10 vulnerabilities scanned | 20% |
531
- | **Security** | Authentication/authorization verified | 10% |
532
- | **Security** | Sensitive data exposure checked | 10% |
533
- | **Performance** | N+1 queries detected and flagged | 10% |
534
- | **Performance** | Memory leaks checked | 5% |
535
- | **Architecture** | Layer violations detected | 10% |
536
- | **Architecture** | Circular dependencies checked | 5% |
537
- | **Code Quality** | Complexity limits enforced | 10% |
538
- | **Code Quality** | Forbidden patterns detected | 10% |
539
- | **Testing** | Test coverage gaps identified | 5% |
540
- | **Documentation** | Public API documentation checked | 5% |
541
-
542
- ### Review Score Calculation
543
-
544
- ```
545
- Score = 100 - (P1 × 20) - (P2 × 5) - (P3 × 1)
546
-
547
- Grades:
548
- - 95-100: ✅ EXCELLENT - Merge ready
549
- - 90-94: ⚠️ GOOD - Minor fixes required before merge
550
- - 80-89: ⚠️ FAIR - Must fix P2 issues
551
- - 0-79: ❌ POOR - Block merge, fix P1/P2
552
- ```
553
-
554
- ### Merge Decision Matrix
555
-
556
- | P1 Count | P2 Count | Decision |
557
- |----------|----------|----------|
558
- | 0 | 0-2 | ✅ MERGE READY |
559
- | 0 | 3+ | ⚠️ FIX P2 FIRST |
560
- | 1+ | Any | ❌ BLOCKED |
561
-
562
- ### Auto-Fix Capability Matrix
563
-
564
- | Issue Type | Auto-Fixable | Method |
565
- |------------|--------------|--------|
566
- | SQL Injection | ✅ Yes | Parameterized query |
567
- | Missing transaction | ✅ Yes | Add try-finally |
568
- | N+1 query | ✅ Yes | Add eager loading |
569
- | Circular dependency | ⚠️ Partial | Suggest restructure |
570
- | Missing tests | ✅ Yes | Generate test skeleton |
571
- | Hardcoded secrets | ❌ No | Flag for manual review |
572
- | Architecture violation | ❌ No | Suggest refactoring plan |
573
-
574
- ### Forbidden Patterns (P1 Critical)
575
-
576
- | Pattern | Risk Level | Detection Method |
577
- |---------|------------|------------------|
578
- | Hardcoded credentials | Critical | Regex + entropy scan |
579
- | SQL string concatenation | Critical | AST analysis |
580
- | `eval()` or `exec()` | Critical | AST analysis |
581
- | Disabled CSRF protection | Critical | Config scan |
582
- | Debug mode in production | Critical | Config scan |
583
- | Unvalidated redirects | High | URL pattern scan |
584
-
585
- ### Review Output Requirements
586
-
587
- Every review MUST produce:
588
-
589
- 1. **Summary Statistics**
590
- - Total issues by priority (P1/P2/P3)
591
- - Auto-fixed count
592
- - Remaining manual fixes
593
-
594
- 2. **Detailed Findings**
595
- - File path and line number
596
- - Issue description
597
- - Recommended fix
598
- - Auto-fix status (applied/pending/manual)
599
-
600
- 3. **Quality Score**
601
- - Numerical score (0-100)
602
- - Grade (EXCELLENT/GOOD/FAIR/POOR)
603
- - Merge recommendation
604
-
605
- ---
606
-
607
- ARGUMENTS: $ARGUMENTS
1
+ ---
2
+ description: Multi-agent parallel code review with priority-based findings
3
+ argument-hint: "PR number, branch name, or file path"
4
+ ---
5
+
6
+ # /vibe.review
7
+
8
+ **Parallel Agent Code Review** - 13+ specialists review simultaneously
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /vibe.review # Review current branch
14
+ /vibe.review PR#123 # Review specific PR
15
+ /vibe.review feature/login # Review specific branch
16
+ /vibe.review src/api/ # Review specific path
17
+ /vibe.review --race # Multi-LLM race mode (GPT + Gemini)
18
+ /vibe.review --race security # Race mode for specific review type
19
+ ```
20
+
21
+ > **⏱️ Timer**: Call `getCurrentTime` tool at the START. Record the result as `{start_time}`.
22
+
23
+ ## Race Mode (v2.6.9)
24
+
25
+ **Multi-LLM competitive review** - Same review task runs on GPT + Gemini in parallel, results are cross-validated.
26
+
27
+ ### How It Works
28
+
29
+ ```
30
+ /vibe.review --race
31
+
32
+ security-review:
33
+ ├─ GPT Codex → [SQL injection, XSS]
34
+ └─ Gemini → [SQL injection, CSRF]
35
+
36
+ Cross-validation:
37
+ - SQL injection (2/2) → 🔴 P1 (100% confidence)
38
+ - XSS (1/2) → 🟡 P2 (50% confidence)
39
+ - CSRF (1/2) → 🟡 P2 (50% confidence)
40
+ ```
41
+
42
+ ### Confidence-Based Priority
43
+
44
+ | Confidence | Priority | Meaning |
45
+ |------------|----------|---------|
46
+ | 100% (2/2) | P1 | Both models agree - high confidence |
47
+ | 50% (1/2) | P2 | One model found - needs verification |
48
+
49
+ ### Race Mode Options
50
+
51
+ ```
52
+ /vibe.review --race # All review types
53
+ /vibe.review --race security # Security only
54
+ /vibe.review --race performance # Performance only
55
+ /vibe.review --race architecture # Architecture only
56
+ ```
57
+
58
+ ### Race Mode Output
59
+
60
+ ```
61
+ ## SECURITY Review (Race Mode)
62
+
63
+ **Duration**: 3420ms
64
+ **Models**: GPT Codex, Gemini
65
+
66
+ ### Model Results
67
+
68
+ | Model | Issues Found | Duration | Status |
69
+ |-------|--------------|----------|--------|
70
+ | gpt | 3 | 1823ms | OK |
71
+ | gemini | 2 | 2156ms | OK |
72
+
73
+ ### Cross-Validated Issues
74
+
75
+ **Summary**: 3 issues (P1: 1, P2: 2)
76
+ **Consensus Rate**: 67%
77
+
78
+ #### 🔴 P1 - SQL Injection in user query
79
+
80
+ - **Confidence**: 100% (gpt, gemini)
81
+ - **Severity**: critical
82
+ - **Location**: `src/api/users.ts:42`
83
+ - **Suggestion**: Use parameterized queries
84
+
85
+ #### 🟡 P2 - XSS vulnerability in render
86
+
87
+ - **Confidence**: 50% (gpt)
88
+ - **Severity**: high
89
+ - **Location**: `src/components/Comment.tsx:15`
90
+ ```
91
+
92
+ ### When to Use Race Mode
93
+
94
+ | Scenario | Recommended |
95
+ |----------|-------------|
96
+ | Critical security review | ✅ `--race security` |
97
+ | Pre-production audit | ✅ `--race` |
98
+ | Quick iteration | ❌ Standard review |
99
+ | API cost concerns | ❌ Standard review |
100
+
101
+ ### Tool Invocation (Race Mode - GPT + Gemini in parallel via Bash)
102
+
103
+ **🚨 Use --input file to avoid CLI argument length limits and Windows pipe issues.**
104
+
105
+ 1. Save code to review into `[SCRATCHPAD]/review-code.txt` (using Write tool)
106
+ 2. Write JSON input file `[SCRATCHPAD]/review-input.json` (using Write tool):
107
+ - `{"prompt": "Review this code for [REVIEW_TYPE]. Return JSON: {issues: [{id, title, description, severity, suggestion}]}. Code: [CODE_CONTENT]"}`
108
+ - Where `[CODE_CONTENT]` is the code text (properly JSON-escaped inside the prompt string)
109
+ 3. Script path: `[LLM_SCRIPT]` = `{{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js`
110
+ 4. Run GPT + Gemini in PARALLEL (two Bash tool calls at once):
111
+
112
+ ```bash
113
+ # GPT review (Bash tool call 1)
114
+ node "[LLM_SCRIPT]" gpt orchestrate-json --input "[SCRATCHPAD]/review-input.json"
115
+ ```
116
+
117
+ ```bash
118
+ # Gemini review (Bash tool call 2 - run in parallel)
119
+ node "[LLM_SCRIPT]" gemini orchestrate-json --input "[SCRATCHPAD]/review-input.json"
120
+ ```
121
+
122
+ ## File Reading Policy (Mandatory)
123
+
124
+ - **소스코드 파일**: 리뷰 대상 파일은 반드시 `Read` 도구로 전체 파일을 읽은 후 리뷰할 것 (Grep으로 훑어보기 금지)
125
+ - **Grep 사용 제한**: 파일 위치 탐색(어떤 파일에 있는지 찾기)에만 사용. 파일 내용 파악 및 리뷰에는 반드시 Read 사용
126
+ - **에이전트 spawn 시**: 프롬프트에 "대상 파일을 Read 도구로 전체 읽은 후 분석하라"를 반드시 포함할 것
127
+ - **부분 읽기 금지**: Grep 결과의 주변 몇 줄만 보고 판단하지 말 것. 전체 맥락을 파악해야 정확한 리뷰 가능
128
+
129
+ ## Priority System
130
+
131
+ | Priority | Criteria | Action |
132
+ |----------|----------|--------|
133
+ | P1 | Security vulnerabilities, data loss, crashes | Block merge, fix immediately |
134
+ | P2 | Performance issues, architecture violations, missing tests | Fix before merge |
135
+ | P3 | Style, refactoring suggestions, documentation | Add to backlog |
136
+
137
+ ## Convergence Rules (Over-Diagnosis Prevention)
138
+
139
+ > **Principle**: Reviews must converge. A review that always finds more issues is broken, not thorough.
140
+
141
+ ### Scope Limiting
142
+
143
+ - **Review ONLY changed files** — based on `git diff --name-only`. Never scan the entire project
144
+ - **If no git diff** (first review) — review only files in the target path
145
+
146
+ ### Severity Filtering by Round
147
+
148
+ | Round | What to Report |
149
+ |-------|---------------|
150
+ | 1st review | P1 + P2 + P3 (all) |
151
+ | 2nd review (same code) | P1 + P2 only (skip P3) |
152
+ | 3rd+ review | P1 only (report only new P1s) |
153
+
154
+ ### Stop Conditions
155
+
156
+ - **P1 = 0 means MERGE READY** — mergeable even with remaining P2/P3
157
+ - **P1 = 0 after auto-fix means DONE** — record P2 auto-fix failures as TODO and stop
158
+ - **Final P1 list unchanged after Review Debate → DONE** — no new findings = converged
159
+
160
+ ### Anti-Patterns (FORBIDDEN)
161
+
162
+ - "All items must be verified" → Only P1 is mandatory, P2/P3 are best-effort
163
+ - "Found one more issue" (repeated) → Only report P1s not mentioned in previous review
164
+ - Forcing code changes for P3 issues → P3 goes to TODO files only, never force code changes
165
+ - Infinite retries on auto-fix failure → max 1 retry then move to TODO
166
+
167
+ ## Process
168
+
169
+ ### Phase 1: Tech Stack Detection
170
+
171
+ Detect project tech stack FIRST before launching reviewers:
172
+
173
+ ```
174
+ Read package.json -> TypeScript, React, Node.js
175
+ Read pyproject.toml -> Python, FastAPI, Django
176
+ Read Gemfile -> Ruby, Rails
177
+ Read pubspec.yaml -> Flutter, Dart
178
+ Read go.mod -> Go
179
+ Read CLAUDE.md -> Explicit tech stack declaration
180
+ ```
181
+
182
+ ### Phase 1.5: SPEC ↔ Code Alignment Check
183
+
184
+ > When SPEC files exist, verify that code changes align with the SPEC
185
+
186
+ ```
187
+ 1. Search .claude/vibe/specs/ for related SPEC files (based on git diff filenames)
188
+ 2. Compare SPEC REQ-* list against functionality in changed code
189
+ 3. If functionality added that's not in SPEC → P2 finding: "Feature added without SPEC"
190
+ 4. If implementation differs from SPEC → P1 finding: "SPEC ↔ code mismatch"
191
+ 5. If no SPEC files exist → Skip (reviews work without SPEC too)
192
+ ```
193
+
194
+ ### Phase 2: Parallel Agent Review (STACK-AWARE) via Orchestrator
195
+
196
+ **Execution via Orchestrator (12+ agents in parallel):**
197
+ ```bash
198
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => o.review(['FILE_PATHS'], ['DETECTED_STACKS']).then(r => console.log(r.content[0].text)))"
199
+ ```
200
+
201
+ **Example:**
202
+ ```bash
203
+ # Review changed files with TypeScript + React stack
204
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => o.review(['src/api/users.ts', 'src/components/Login.tsx'], ['TypeScript', 'React']).then(r => console.log(r.content[0].text)))"
205
+ ```
206
+
207
+ **Core Reviewers (Always Run):**
208
+ | Agent | Focus |
209
+ |-------|-------|
210
+ | security-reviewer | OWASP Top 10, vulnerabilities |
211
+ | data-integrity-reviewer | Data validation, constraints |
212
+ | performance-reviewer | N+1 queries, memory leaks |
213
+ | architecture-reviewer | Layer violations, cycles |
214
+ | complexity-reviewer | Cyclomatic complexity, length |
215
+ | simplicity-reviewer | Over-abstraction, dead code |
216
+ | git-history-reviewer | Churn files, risk patterns |
217
+ | test-coverage-reviewer | Missing tests, edge cases |
218
+
219
+ **Stack-Specific Reviewers (Conditional):**
220
+ | Agent | Condition |
221
+ |-------|-----------|
222
+ | python-reviewer | .py files in diff |
223
+ | typescript-reviewer | .ts/.tsx files OR tsconfig |
224
+ | rails-reviewer | Gemfile has rails |
225
+ | react-reviewer | package.json has react |
226
+
227
+ ### Phase 2.5: UI/UX Review Agents (Auto-triggered)
228
+
229
+ > **활성화 조건**: 변경된 파일 중 UI 파일 존재 (`.tsx`, `.jsx`, `.vue`, `.svelte`, `.html`, `.css`, `.scss`)
230
+ > **비활성화**: `.claude/vibe/config.json`에 `"uiUxAnalysis": false` 설정
231
+
232
+ **기존 12+ 리뷰 에이전트와 병렬 실행:**
233
+
234
+ | Agent | Role | Output |
235
+ |-------|------|--------|
236
+ | ⑥ ux-compliance-reviewer | UX 가이드라인 준수 검증 | P1/P2/P3 findings |
237
+ | ⑦ ui-a11y-auditor | WCAG 2.1 AA 접근성 감사 | P1/P2/P3 findings |
238
+ | ⑧ ui-antipattern-detector | UI 안티패턴 + 디자인 시스템 일관성 | P1/P2/P3 findings |
239
+
240
+ **실행 방법 — 기존 Phase 2 에이전트와 병렬 실행:**
241
+
242
+ ```text
243
+ # ⑥ UX 준수 검증 (Haiku)
244
+ Task(subagent_type="ux-compliance-reviewer",
245
+ prompt="Review UI files for UX guideline compliance: {changed_ui_files}. Use core_ui_search against ux-guidelines and web-interface domains.")
246
+
247
+ # ⑦ 접근성 감사 (Haiku)
248
+ Task(subagent_type="ui-a11y-auditor",
249
+ prompt="Audit UI files for WCAG 2.1 AA compliance: {changed_ui_files}.")
250
+
251
+ # ⑧ 안티패턴 검출 (Haiku)
252
+ Task(subagent_type="ui-antipattern-detector",
253
+ prompt="Detect UI anti-patterns in: {changed_ui_files}. Check against MASTER.md if exists at .claude/vibe/design-system/{project}/MASTER.md.")
254
+ ```
255
+
256
+ **findings 통합**: ⑥⑦⑧ findings를 기존 findings[]와 병합 → P1/P2/P3 통합 정렬
257
+
258
+ **⑦ Critical finding 에스컬레이션**: ui-a11y-auditor의 P1 finding은 Review Debate Team(Phase 4.5)에 자동 포함
259
+
260
+ ### Phase 3: Deep Analysis
261
+
262
+ After agent results:
263
+
264
+ 1. **System Context**: Component interactions, data flow, external dependencies
265
+ 2. **Stakeholder Perspectives**: Developers, Ops, Security, Business
266
+ 3. **Edge Cases**: Race conditions, resource exhaustion, network failures
267
+ 4. **Multiple Angles**: Technical excellence, business value, risk management
268
+
269
+ ### Phase 4: Findings Synthesis
270
+
271
+ ```
272
+ REVIEW FINDINGS
273
+
274
+ P1 CRITICAL (Blocks Merge) - N issues
275
+ 1. [SECURITY] SQL Injection in user query
276
+ Location: src/api/users.py:42
277
+ Fix: Use parameterized queries
278
+
279
+ P2 IMPORTANT (Should Fix) - N issues
280
+ 2. [PERF] N+1 query in user list
281
+ 3. [ARCH] Circular dependency detected
282
+
283
+ P3 NICE-TO-HAVE (Enhancement) - N issues
284
+ 4. [STYLE] Consider extracting helper function
285
+ ```
286
+
287
+ ### Phase 4.5: Agent Teams — Review Debate
288
+
289
+ > **Agent Teams**: 개별 리뷰어의 발견을 팀으로 토론하여 우선순위를 검증하고 오탐을 제거합니다.
290
+ > 설정: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` + `teammateMode: in-process` (`~/.claude/settings.json` 전역 — postinstall 자동 설정)
291
+
292
+ **팀 구성:**
293
+
294
+ | 팀원 | 역할 |
295
+ |------|------|
296
+ | security-reviewer (리더) | P1/P2 이슈 종합, 보안 이슈 최종 판정, 합의 주도 |
297
+ | architecture-reviewer | 구조적 영향 평가, 숨겨진 결합도 식별 |
298
+ | performance-reviewer | 성능 영향 평가, 부하 시나리오 검증 |
299
+ | simplicity-reviewer | 과잉 설계 지적, 더 단순한 대안 제시 |
300
+
301
+ **실행 순서:**
302
+
303
+ 1. `TeamCreate(team_name="review-debate-{feature}")` — 팀 + 공유 태스크 리스트 생성
304
+ 2. 4개 팀원 병렬 생성 — 각각 `Task(team_name=..., name=..., subagent_type=...)` 으로 spawn
305
+ 3. 팀원들이 공유 TaskList에서 이슈를 claim하고, SendMessage로 교차 검증
306
+ 4. 리더(security-reviewer)가 팀 합의 결과 종합 → 검증된 P1/P2 목록 출력
307
+ 5. 모든 팀원 shutdown_request → TeamDelete로 정리
308
+
309
+ **팀원 spawn 패턴:**
310
+
311
+ ```text
312
+ TeamCreate(team_name="review-debate-{feature}", description="Review debate for {feature}")
313
+
314
+ # 4개 병렬 spawn
315
+ Task(team_name="review-debate-{feature}", name="security-reviewer", subagent_type="security-reviewer",
316
+ mode="bypassPermissions",
317
+ prompt="리뷰 토론 팀 리더. Phase 2에서 발견된 P1/P2 이슈를 팀과 함께 검증하세요.
318
+ Phase 2 결과: {phase2_findings}
319
+ 역할: 보안 이슈 최종 판정, 팀원 간 우선순위 충돌 해결, 최종 합의 요약 작성.
320
+ TaskList를 확인하고 이슈를 claim하세요. 각 이슈에 대해 팀원에게 SendMessage로 검증을 요청하세요.
321
+ 모든 이슈 검증 완료 후 최종 합의 결과를 작성하세요.")
322
+
323
+ Task(team_name="review-debate-{feature}", name="architecture-reviewer", subagent_type="architecture-reviewer",
324
+ mode="bypassPermissions",
325
+ prompt="리뷰 토론 팀 아키텍처 담당. Phase 2 결과: {phase2_findings}
326
+ 역할: 각 이슈의 구조적 영향 평가, 숨겨진 결합도/의존성 식별.
327
+ 아키텍처 관점에서 우선순위 변경이 필요하면 security-reviewer에게 SendMessage로 알리세요.
328
+ TaskList에서 아키텍처 관련 이슈를 claim하세요.")
329
+
330
+ Task(team_name="review-debate-{feature}", name="performance-reviewer", subagent_type="performance-reviewer",
331
+ mode="bypassPermissions",
332
+ prompt="리뷰 토론 팀 성능 담당. Phase 2 결과: {phase2_findings}
333
+ 역할: 성능 영향 평가, 부하 시 cascading failure 가능성 검증.
334
+ 성능 관점에서 P2→P1 승격이 필요하면 security-reviewer에게 SendMessage로 알리세요.
335
+ TaskList에서 성능 관련 이슈를 claim하세요.")
336
+
337
+ Task(team_name="review-debate-{feature}", name="simplicity-reviewer", subagent_type="simplicity-reviewer",
338
+ mode="bypassPermissions",
339
+ prompt="리뷰 토론 팀 복잡도 담당. Phase 2 결과: {phase2_findings}
340
+ 역할: 과잉 진단(오탐) 식별, 더 단순한 수정 방안 제시.
341
+ 오탐이나 P1→P2 강등이 필요하면 security-reviewer에게 SendMessage로 알리세요.
342
+ TaskList에서 복잡도/단순화 관련 이슈를 claim하세요.")
343
+ ```
344
+
345
+ **팀원 간 통신 예시:**
346
+
347
+ ```text
348
+ architecture-reviewer → security-reviewer: "Unbounded query는 부하 시 cascading failure 가능. P2→P1 승격 제안"
349
+ simplicity-reviewer → security-reviewer: "CSRF on read-only endpoint는 side effect 없음. P1→P2 강등 제안"
350
+ performance-reviewer → architecture-reviewer: "N+1 query가 현재 데이터 규모에서는 영향 없으나 확장 시 문제. 의견?"
351
+ security-reviewer → broadcast: "최종 합의: SQL Injection P1 유지, Unbounded query P1 승격, CSRF P2 강등, Circular dep 오탐 제거"
352
+ ```
353
+
354
+ **토론 결과 예시:**
355
+
356
+ ```
357
+ 🤝 REVIEW DEBATE RESULTS
358
+
359
+ Team Consensus (4 reviewers):
360
+
361
+ ✅ Validated P1 (unanimous):
362
+ 1. [SECURITY] SQL Injection — 4/4 agree critical
363
+
364
+ ⬆️ Upgraded P2→P1 (debate result):
365
+ 2. [PERF] Unbounded query — architecture-reviewer pointed out
366
+ cascading failure risk under load → team agreed P1
367
+
368
+ ⬇️ Downgraded P1→P2 (debate result):
369
+ 3. [SECURITY] CSRF on read-only endpoint — simplicity-reviewer
370
+ noted endpoint has no side effects → team agreed P2
371
+
372
+ ❌ Removed (false positive):
373
+ 4. [ARCH] "Circular dependency" — architecture-reviewer confirmed
374
+ this is intentional bi-directional reference, not a cycle
375
+
376
+ 🆕 New findings (team discussion):
377
+ 5. [DATA] Race condition in concurrent updates — emerged from
378
+ security + performance discussion
379
+ ```
380
+
381
+ ### Phase 5: Auto-Fix (P1/P2)
382
+
383
+ **Auto-fixable issues are resolved immediately:**
384
+
385
+ ```
386
+ 🔧 AUTO-FIX Starting...
387
+
388
+ P1 Critical:
389
+ 1. [SECURITY] SQL Injection → Fixed with parameterized query ✅
390
+ 2. [DATA] Missing transaction rollback → Added try-finally ✅
391
+
392
+ P2 Important:
393
+ 3. [PERF] N+1 query → Added select_related ✅
394
+ 4. [ARCH] Circular dependency → Separated dependencies ✅
395
+ 5. [TEST] Missing edge case → Added test ✅
396
+
397
+ 🔍 Re-validating...
398
+ ✅ Build successful
399
+ ✅ Tests passed
400
+
401
+ ✅ 5 issues auto-fixed!
402
+ ```
403
+
404
+ **Cases that cannot be auto-fixed:**
405
+ - Requires large-scale architecture changes
406
+ - Requires business logic decisions
407
+ - Requires user confirmation
408
+
409
+ → Manual handling instructions in Phase 6
410
+
411
+ ### Phase 6: Todo File Creation (Items Requiring Manual Handling)
412
+
413
+ Save **remaining** findings to `.claude/vibe/todos/`:
414
+
415
+ ```
416
+ {priority}-{category}-{short-desc}.md
417
+
418
+ Examples:
419
+ - P2-arch-large-refactor.md (Cannot be auto-fixed)
420
+ - P3-style-extract-helper.md (Backlog)
421
+ ```
422
+
423
+ ## Output
424
+
425
+ ```
426
+ CODE REVIEW SUMMARY
427
+ PR #123: Add user authentication
428
+
429
+ Reviewers: 13 agents
430
+ ⏱️ Started: {start_time}
431
+ ⏱️ Completed: {getCurrentTime 결과}
432
+
433
+ Score: 92/100 (Good) ← Score after auto-fix
434
+
435
+ Issues Found:
436
+ - P1 Critical: 2 → 0 (✅ Auto-fixed)
437
+ - P2 Important: 5 → 1 (✅ 4 auto-fixed)
438
+ - P3 Nice-to-have: 3 (Backlog)
439
+
440
+ Auto-Fixed: 6 issues
441
+ - [SECURITY] SQL Injection ✅
442
+ - [DATA] Transaction rollback ✅
443
+ - [PERF] N+1 query ✅
444
+ - [ARCH] Circular dependency ✅
445
+ - [PERF] Unnecessary loop ✅
446
+ - [TEST] Missing edge case ✅
447
+
448
+ Remaining (Manual handling required):
449
+ - P2-arch-large-refactor.md (Architecture decision required)
450
+ - P3-style-extract-helper.md (Backlog)
451
+ - P3-docs-add-readme.md (Backlog)
452
+
453
+ ✅ MERGE READY (P1/P2 resolved)
454
+ ```
455
+
456
+ ### Phase 7: Guide to Fix Workflow (Manual Handling Items)
457
+
458
+ **Choose workflow when handling remaining issues:**
459
+
460
+ ```
461
+ ## Fix Workflow
462
+
463
+ Choose a workflow to fix the discovered issues:
464
+
465
+ | Task Scale | Recommended Approach |
466
+ |------------|---------------------|
467
+ | Simple fix (1-2 files) | Plan Mode |
468
+ | Complex fix (3+ files, validation needed) | /vibe.spec |
469
+
470
+ 1. `/vibe.spec "fix: issue-name"` - VIBE workflow (SPEC validation + re-review)
471
+ 2. Plan Mode - Quick fix (for simple tasks)
472
+
473
+ Which approach would you like to proceed with?
474
+ ```
475
+
476
+ - Wait for user's choice before proceeding
477
+ - If user chooses VIBE → wait for `/vibe.spec` command
478
+ - If user chooses Plan Mode → proceed with EnterPlanMode
479
+
480
+ ## Core Tools (Code Analysis)
481
+
482
+ ### Tool Invocation
483
+
484
+ All tools are called via:
485
+
486
+ ```bash
487
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.TOOL_NAME({...args}).then(r => console.log(r.content[0].text)))"
488
+ ```
489
+
490
+ ### Recommended Tools for Review
491
+
492
+ | Tool | Purpose | When to Use |
493
+ |------|---------|-------------|
494
+ | `validateCodeQuality` | Code quality check | Overall code quality scan |
495
+ | `analyzeComplexity` | Complexity metrics | Check function complexity |
496
+ | `findSymbol` | Find definitions | Locate implementations |
497
+ | `findReferences` | Find all usages | Track symbol usage |
498
+ | `saveMemory` | Save findings | Store important review findings |
499
+
500
+ ### Example Tool Usage in Review
501
+
502
+ **1. Validate code quality before review:**
503
+
504
+ ```bash
505
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.validateCodeQuality({targetPath: 'src/', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
506
+ ```
507
+
508
+ **2. Analyze complexity of changed files:**
509
+
510
+ ```bash
511
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.analyzeComplexity({targetPath: 'src/api/users.ts', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
512
+ ```
513
+
514
+ **3. Save critical finding for reference:**
515
+
516
+ ```bash
517
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.saveMemory({key: 'review-pr123-critical', value: 'SQL injection in users.py:42', category: 'review', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
518
+ ```
519
+
520
+ ---
521
+
522
+ ## Quality Gate (Mandatory)
523
+
524
+ ### Review Quality Checklist
525
+
526
+ Before completing review, check P1-critical items. P2/P3 items are best-effort:
527
+
528
+ | Category | Check Item | Weight |
529
+ |----------|------------|--------|
530
+ | **Security** | OWASP Top 10 vulnerabilities scanned | 20% |
531
+ | **Security** | Authentication/authorization verified | 10% |
532
+ | **Security** | Sensitive data exposure checked | 10% |
533
+ | **Performance** | N+1 queries detected and flagged | 10% |
534
+ | **Performance** | Memory leaks checked | 5% |
535
+ | **Architecture** | Layer violations detected | 10% |
536
+ | **Architecture** | Circular dependencies checked | 5% |
537
+ | **Code Quality** | Complexity limits enforced | 10% |
538
+ | **Code Quality** | Forbidden patterns detected | 10% |
539
+ | **Testing** | Test coverage gaps identified | 5% |
540
+ | **Documentation** | Public API documentation checked | 5% |
541
+
542
+ ### Review Score Calculation
543
+
544
+ ```
545
+ Score = 100 - (P1 × 20) - (P2 × 5) - (P3 × 1)
546
+
547
+ Grades:
548
+ - 95-100: ✅ EXCELLENT - Merge ready
549
+ - 90-94: ⚠️ GOOD - Minor fixes required before merge
550
+ - 80-89: ⚠️ FAIR - Must fix P2 issues
551
+ - 0-79: ❌ POOR - Block merge, fix P1/P2
552
+ ```
553
+
554
+ ### Merge Decision Matrix
555
+
556
+ | P1 Count | P2 Count | Decision |
557
+ |----------|----------|----------|
558
+ | 0 | 0-2 | ✅ MERGE READY |
559
+ | 0 | 3+ | ⚠️ FIX P2 FIRST |
560
+ | 1+ | Any | ❌ BLOCKED |
561
+
562
+ ### Auto-Fix Capability Matrix
563
+
564
+ | Issue Type | Auto-Fixable | Method |
565
+ |------------|--------------|--------|
566
+ | SQL Injection | ✅ Yes | Parameterized query |
567
+ | Missing transaction | ✅ Yes | Add try-finally |
568
+ | N+1 query | ✅ Yes | Add eager loading |
569
+ | Circular dependency | ⚠️ Partial | Suggest restructure |
570
+ | Missing tests | ✅ Yes | Generate test skeleton |
571
+ | Hardcoded secrets | ❌ No | Flag for manual review |
572
+ | Architecture violation | ❌ No | Suggest refactoring plan |
573
+
574
+ ### Forbidden Patterns (P1 Critical)
575
+
576
+ | Pattern | Risk Level | Detection Method |
577
+ |---------|------------|------------------|
578
+ | Hardcoded credentials | Critical | Regex + entropy scan |
579
+ | SQL string concatenation | Critical | AST analysis |
580
+ | `eval()` or `exec()` | Critical | AST analysis |
581
+ | Disabled CSRF protection | Critical | Config scan |
582
+ | Debug mode in production | Critical | Config scan |
583
+ | Unvalidated redirects | High | URL pattern scan |
584
+
585
+ ### Review Output Requirements
586
+
587
+ Every review MUST produce:
588
+
589
+ 1. **Summary Statistics**
590
+ - Total issues by priority (P1/P2/P3)
591
+ - Auto-fixed count
592
+ - Remaining manual fixes
593
+
594
+ 2. **Detailed Findings**
595
+ - File path and line number
596
+ - Issue description
597
+ - Recommended fix
598
+ - Auto-fix status (applied/pending/manual)
599
+
600
+ 3. **Quality Score**
601
+ - Numerical score (0-100)
602
+ - Grade (EXCELLENT/GOOD/FAIR/POOR)
603
+ - Merge recommendation
604
+
605
+ ---
606
+
607
+ ARGUMENTS: $ARGUMENTS