superkit-mcp-server 1.0.2 → 1.1.0

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 (116) hide show
  1. package/ARCHITECTURE.md +102 -102
  2. package/README.md +67 -63
  3. package/SUPERKIT.md +168 -168
  4. package/agents/code-archaeologist.md +106 -0
  5. package/agents/coder.md +90 -90
  6. package/agents/data-engineer.md +28 -28
  7. package/agents/devops-engineer.md +242 -0
  8. package/agents/git-manager.md +203 -203
  9. package/agents/orchestrator.md +4 -0
  10. package/agents/penetration-tester.md +188 -0
  11. package/agents/performance-optimizer.md +187 -0
  12. package/agents/planner.md +270 -270
  13. package/agents/qa-automation-engineer.md +103 -0
  14. package/agents/quant-developer.md +32 -28
  15. package/agents/reviewer.md +100 -100
  16. package/agents/scout.md +222 -222
  17. package/agents/tester.md +274 -274
  18. package/agents/ui-designer.md +208 -208
  19. package/build/index.js +53 -1
  20. package/build/tools/validators/__tests__/apiSchema.test.js +23 -23
  21. package/build/tools/validators/__tests__/convertRules.test.js +5 -5
  22. package/build/tools/validators/__tests__/frontendDesign.test.js +12 -12
  23. package/build/tools/validators/__tests__/geoChecker.test.js +19 -19
  24. package/build/tools/validators/__tests__/mobileAudit.test.js +12 -12
  25. package/build/tools/validators/__tests__/reactPerformanceChecker.test.js +17 -17
  26. package/build/tools/validators/__tests__/securityScan.test.js +6 -6
  27. package/build/tools/validators/__tests__/seoChecker.test.js +16 -16
  28. package/build/tools/validators/__tests__/typeCoverage.test.js +14 -14
  29. package/package.json +33 -33
  30. package/skills/meta/README.md +30 -30
  31. package/skills/meta/api-design/SKILL.md +134 -134
  32. package/skills/meta/code-review/SKILL.md +44 -37
  33. package/skills/meta/code-review/checklists/pre-merge.md +25 -25
  34. package/skills/meta/code-review/workflows/architecture-pass.md +26 -26
  35. package/skills/meta/code-review/workflows/performance-pass.md +27 -27
  36. package/skills/meta/code-review/workflows/security-pass.md +29 -29
  37. package/skills/meta/compound-docs/SKILL.md +133 -133
  38. package/skills/meta/debug/SKILL.md +40 -40
  39. package/skills/meta/debug/templates/bug-report.template.md +31 -31
  40. package/skills/meta/debug/workflows/reproduce-issue.md +20 -20
  41. package/skills/meta/docker/SKILL.md +126 -126
  42. package/skills/meta/examples/supabase/SKILL.md +46 -46
  43. package/skills/meta/examples/supabase/references/best-practices.md +319 -319
  44. package/skills/meta/examples/supabase/references/common-patterns.md +373 -373
  45. package/skills/meta/examples/supabase/templates/migration-template.sql +49 -49
  46. package/skills/meta/examples/supabase/templates/rls-policy-template.sql +77 -77
  47. package/skills/meta/examples/supabase/workflows/debugging.md +260 -260
  48. package/skills/meta/examples/supabase/workflows/migration-workflow.md +211 -211
  49. package/skills/meta/examples/supabase/workflows/rls-policies.md +244 -244
  50. package/skills/meta/examples/supabase/workflows/schema-design.md +321 -321
  51. package/skills/meta/file-todos/SKILL.md +88 -88
  52. package/skills/meta/mobile/SKILL.md +140 -140
  53. package/skills/meta/nextjs/SKILL.md +101 -101
  54. package/skills/meta/performance/SKILL.md +130 -130
  55. package/skills/meta/react-patterns/SKILL.md +83 -83
  56. package/skills/meta/security/SKILL.md +114 -114
  57. package/skills/meta/session-resume/SKILL.md +96 -96
  58. package/skills/meta/tailwind/SKILL.md +139 -139
  59. package/skills/meta/testing/SKILL.md +43 -43
  60. package/skills/meta/testing/references/vitest-patterns.md +45 -45
  61. package/skills/meta/testing/templates/component-test.template.tsx +37 -37
  62. package/skills/tech/alpha-vantage/SKILL.md +142 -0
  63. package/skills/tech/alpha-vantage/references/commodities.md +153 -0
  64. package/skills/tech/alpha-vantage/references/economic-indicators.md +158 -0
  65. package/skills/tech/alpha-vantage/references/forex-crypto.md +154 -0
  66. package/skills/tech/alpha-vantage/references/fundamentals.md +223 -0
  67. package/skills/tech/alpha-vantage/references/intelligence.md +138 -0
  68. package/skills/tech/alpha-vantage/references/options.md +93 -0
  69. package/skills/tech/alpha-vantage/references/technical-indicators.md +374 -0
  70. package/skills/tech/alpha-vantage/references/time-series.md +157 -0
  71. package/skills/tech/financial-modeling/SKILL.md +18 -0
  72. package/skills/tech/financial-modeling/skills/3-statements/SKILL.md +368 -0
  73. package/skills/tech/financial-modeling/skills/3-statements/references/formatting.md +118 -0
  74. package/skills/tech/financial-modeling/skills/3-statements/references/formulas.md +292 -0
  75. package/skills/tech/financial-modeling/skills/3-statements/references/sec-filings.md +125 -0
  76. package/skills/tech/financial-modeling/skills/dcf-model/SKILL.md +1211 -0
  77. package/skills/tech/financial-modeling/skills/dcf-model/TROUBLESHOOTING.md +40 -0
  78. package/skills/tech/financial-modeling/skills/dcf-model/requirements.txt +8 -0
  79. package/skills/tech/financial-modeling/skills/dcf-model/scripts/validate_dcf.py +292 -0
  80. package/skills/tech/financial-modeling/skills/lbo-model/SKILL.md +236 -0
  81. package/skills/tech/financial-modeling/skills/merger-model/SKILL.md +108 -0
  82. package/skills/tech/intelligent-routing/SKILL.md +5 -5
  83. package/workflows/README.md +191 -191
  84. package/workflows/adr.md +174 -174
  85. package/workflows/changelog.md +74 -74
  86. package/workflows/compound.md +323 -323
  87. package/workflows/compound_health.md +74 -74
  88. package/workflows/create-agent-skill.md +139 -139
  89. package/workflows/cycle.md +144 -144
  90. package/workflows/deploy-docs.md +84 -84
  91. package/workflows/development-rules.md +37 -37
  92. package/workflows/doc.md +95 -95
  93. package/workflows/documentation-management.md +29 -29
  94. package/workflows/explore.md +146 -146
  95. package/workflows/generate_command.md +106 -106
  96. package/workflows/heal-skill.md +97 -97
  97. package/workflows/housekeeping.md +229 -229
  98. package/workflows/kit-setup.md +102 -102
  99. package/workflows/map-codebase.md +78 -0
  100. package/workflows/orchestration-protocol.md +38 -38
  101. package/workflows/plan-compound.md +439 -433
  102. package/workflows/plan_review.md +269 -248
  103. package/workflows/primary-workflow.md +32 -32
  104. package/workflows/promote_pattern.md +86 -86
  105. package/workflows/release-docs.md +82 -82
  106. package/workflows/report-bug.md +135 -135
  107. package/workflows/reproduce-bug.md +118 -118
  108. package/workflows/resolve_pr.md +133 -133
  109. package/workflows/resolve_todo.md +128 -128
  110. package/workflows/review-compound.md +376 -359
  111. package/workflows/skill-review.md +127 -127
  112. package/workflows/specs.md +257 -257
  113. package/workflows/triage-sprint.md +102 -102
  114. package/workflows/triage.md +152 -152
  115. package/workflows/work.md +399 -399
  116. package/workflows/xcode-test.md +93 -93
@@ -1,359 +1,376 @@
1
- ---
2
- description: (Compound) Perform comprehensive multi-pass code review with security, performance, and architecture checks.
3
- ---
4
-
5
- # /review-compound - Comprehensive Code Review
6
-
7
- Perform exhaustive code reviews using multi-perspective analysis to catch issues before they ship.
8
-
9
- > **Sequential Review:** Unlike parallel agent systems, this review runs sequentially through each review perspective. Focus on depth over breadth.
10
- >
11
- > **Note:** This is the Compound version with multi-pass review. For quick review, use `/review`.
12
-
13
-
14
- ## When To Use
15
-
16
- - Before merging any PR
17
- - Self-review before pushing
18
- - After `/work` completion
19
- - When reviewing others' code
20
-
21
- ---
22
-
23
- ## Workflow
24
-
25
- ### Step -1: Resume Context (If New Session)
26
-
27
- > [!CAUTION]
28
- > **BLOCKING STEP.** If this is a NEW CONVERSATION, follow the session-resume skill first.
29
-
30
- ```bash
31
- cat skills/session-resume/SKILL.md
32
- ./scripts/log-skill.sh "session-resume" "workflow" "/review"
33
- ```
34
-
35
- ### Step 0: Load Code Review Skill (MANDATORY)
36
-
37
- > [!TIP]
38
- > Use the **code-review skill** for checklists, security guards, and reference patterns.
39
-
40
- ```bash
41
- # Data collection
42
- ./scripts/log-workflow.sh "/review" "$$"
43
-
44
- cat skills/code-review/SKILL.md
45
- ./scripts/log-skill.sh "code-review" "workflow" "/review"
46
- ```
47
-
48
- ### Step 1: Determine Review Target
49
-
50
- **Identify what to review:**
51
-
52
- | Input | Action |
53
- |-------|--------|
54
- | PR number | `gh pr view {number} --json title,body,files` |
55
- | GitHub URL | Extract PR number, fetch metadata |
56
- | Branch name | `git diff main...{branch}` |
57
- | Empty | Review current branch vs main |
58
-
59
- **Setup:**
60
- ```bash
61
- # If reviewing a PR, checkout the branch
62
- gh pr checkout {PR_NUMBER}
63
-
64
- # Or compare current branch
65
- git diff main --stat
66
- ```
67
-
68
- ### Step 2: Gather Context
69
-
70
- Before reviewing, understand:
71
-
72
- - [ ] **What changed:** Files modified, lines added/removed
73
- - [ ] **Why it changed:** PR description, linked issues
74
- - [ ] **What's affected:** Dependencies, downstream code
75
-
76
- **Prior Knowledge Check:**
77
- > Use search to find similar past issues or patterns.
78
-
79
- ```bash
80
- ./scripts/compound-search.sh "{change type or component keywords}"
81
- ```
82
-
83
- ```bash
84
- # View changed files
85
- git diff main --name-only
86
-
87
- # View detailed changes
88
- git diff main
89
- ```
90
-
91
- ### Step 3: Sequential Review Passes
92
-
93
- Run through each review perspective sequentially:
94
-
95
- ---
96
-
97
- #### Pass 1: 🔒 Security Review
98
-
99
- **Action:** Run the Security Pass workflow from the skill:
100
- ```bash
101
- cat skills/code-review/workflows/security-pass.md
102
- ```
103
-
104
- - [ ] Completed security checklist?
105
- - [ ] NO hardcoded secrets?
106
- - [ ] Auth guards verified?
107
-
108
- ```bash
109
- # Search for potential issues
110
- grep -rn "eval\|exec\|dangerouslySetInnerHTML" --include="*.ts" --include="*.js" src/
111
- grep -rn "password\|secret\|api_key" --include="*.ts" --include="*.js" src/
112
- ```
113
-
114
- ---
115
-
116
- #### Pass 2: ⚡ Performance Review
117
-
118
- Check for:
119
- - [ ] Unnecessary re-renders
120
- - [ ] N+1 queries
121
- - [ ] Large bundle sizes
122
-
123
- ```bash
124
- # Look for loop patterns with async calls
125
- grep -rn "forEach.*await\|map.*await" --include="*.ts" src/
126
- ```
127
-
128
- ---
129
-
130
- #### Pass 3: 🏛️ Architecture Review
131
-
132
- Check structural integrity:
133
-
134
- - [ ] **Single Responsibility:** Each function does one thing?
135
- - [ ] **Dependencies:** Proper layering? No circular deps?
136
- - [ ] **Naming:** Clear, consistent naming?
137
- - [ ] **Patterns:** Following project conventions?
138
- - [ ] **Tests:** Adequate test coverage?
139
-
140
- ---
141
-
142
- #### Pass 4: 💾 Data Integrity Review
143
-
144
- Check database and data handling:
145
-
146
- - [ ] **Migrations:** Reversible? Production-safe?
147
- - [ ] **Transactions:** Multi-step ops wrapped?
148
- - [ ] **Constraints:** Foreign keys, unique constraints?
149
- - [ ] **Nullability:** Null cases handled?
150
-
151
- ---
152
-
153
- #### Pass 5: 🎯 Simplicity Review
154
-
155
- Check for unnecessary complexity:
156
-
157
- - [ ] **YAGNI:** Features not needed yet?
158
- - [ ] **Dead Code:** Unused imports, functions?
159
- - [ ] **Over-Engineering:** Simpler solution exists?
160
- - [ ] **Duplication:** Code that should be extracted?
161
-
162
- ---
163
-
164
- ### Step 4: Stakeholder Perspective Analysis
165
-
166
- Think through each stakeholder's view:
167
-
168
- | Stakeholder | Key Questions |
169
- |-------------|---------------|
170
- | **Developer** | Is this easy to understand/modify? Can I test this? |
171
- | **Operations** | How do I deploy safely? What metrics available? |
172
- | **End User** | Is it intuitive? Good error messages? |
173
- | **Security** | What's the attack surface? Data protected? |
174
- | **Business** | Does this solve the problem? Any risks? |
175
-
176
- ### Step 5: Scenario Exploration
177
-
178
- Test mental models against edge cases:
179
-
180
- - [ ] **Happy Path:** Normal operation works?
181
- - [ ] **Invalid Inputs:** Handles null, empty, malformed?
182
- - [ ] **Boundary Conditions:** Min/max values?
183
- - [ ] **Concurrent Access:** Race conditions?
184
- - [ ] **Failures:** Network issues, timeouts?
185
-
186
- ### Step 6: Synthesize Findings
187
-
188
- Categorize all findings by severity:
189
-
190
- **🔴 P1 - Critical (Must fix before merge):**
191
- - Security vulnerabilities
192
- - Data loss risks
193
- - Breaking changes without migration
194
-
195
- **🟡 P2 - Important (Should fix):**
196
- - Performance issues
197
- - Missing error handling
198
- - Test coverage gaps
199
-
200
- **🔵 P3 - Nice to Have (Consider for follow-up):**
201
- - Style improvements
202
- - Minor refactors
203
- - Documentation updates
204
- - Changelog entry missing (run `npm run changelog:gen`)
205
-
206
- ### Step 7: Create Actionable Todos & Capture Deferred Work
207
-
208
- For each P1/P2 finding, create a todo.
209
-
210
- **Crucially, capture DEFERRED WORK here:**
211
- - [ ] Are there P3 items we decided not to do now?
212
- - [ ] Did we reject alternatives that have future value?
213
- - [ ] Are there implementation tasks left over from `/work`?
214
-
215
- > [!IMPORTANT]
216
- > **Single Source of Truth.** If you close/reject a PR or defer work for later, that work **must** become a todo file NOW. Do not rely on capturing it later in `/compound`.
217
-
218
- ```bash
219
- # Create todos using the centralized generator
220
- ./scripts/create-todo.sh "p1" "Security: SQL Injection in User Query" \
221
- "Raw user input is used in database query at src/api/users.ts:45. This enables potential SQL injection attacks allowing unauthorized data access." \
222
- "Replace raw query with parameterized version" \
223
- "Add input validation" \
224
- "Add test case for injection attempt"
225
- ```
226
-
227
- ### Step 8: Generate Review Summary
228
-
229
- ```markdown
230
- ## Review Summary: {PR Title}
231
-
232
- **Reviewed:** {date}
233
- **Files Changed:** {count}
234
- **Lines:** +{added} / -{removed}
235
-
236
- ### Findings
237
-
238
- #### 🔴 P1 - Critical ({count})
239
- - {Finding 1}
240
- - {Finding 2}
241
-
242
- #### 🟡 P2 - Important ({count})
243
- - {Finding 1}
244
-
245
- #### 🔵 P3 - Nice to Have ({count})
246
- - {Finding 1}
247
-
248
- ### Recommendation
249
- {APPROVE / REQUEST_CHANGES / NEEDS_DISCUSSION}
250
-
251
- ### Next Steps
252
- - [ ] Address P1 findings
253
- - [ ] Consider P2 findings
254
- - [ ] Create follow-up issues for P3
255
- ```
256
-
257
- ### Step 9: Offer Next Actions
258
-
259
- ```
260
- Review complete
261
-
262
- Findings: {P1_count} critical, {P2_count} important, {P3_count} nice-to-have
263
-
264
- What's next?
265
- 1. Address findings - Fix critical issues first
266
- 2. Approve - No blocking issues found
267
- 3. Create follow-up issues - For P3 items
268
- 4. Document learnings - Run /compound if found interesting patterns
269
- ```
270
-
271
- ### Step 10: Compound Learning
272
-
273
- Before closing the review, ask yourself:
274
-
275
- - Did you discover a reusable pattern?
276
- - Did you find a non-obvious solution?
277
- - Would this help future agents/developers?
278
-
279
- If **yes** to any Run `/compound` to document the learning.
280
-
281
- **See also:** `skills/compound-docs/SKILL.md` for pattern promotion guidelines.
282
-
283
- > [!TIP]
284
- > Reviews often surface insights that aren't captured in the code itself. Don't let them evaporate.
285
-
286
- ### Step 11: Final Validation Gate
287
-
288
- > [!CAUTION]
289
- > **Do not skip.**
290
-
291
- Before closing, run:
292
- ```bash
293
- ./scripts/validate-compound.sh
294
- ```
295
-
296
- - [ ] Script passed?
297
- - [ ] Deferred work converted to todos?
298
-
299
- ---
300
-
301
- ## Quality Guidelines
302
-
303
- **Thorough reviews:**
304
- - ✅ Check every changed file
305
- - ✅ Think about edge cases
306
- - Consider the broader system
307
- - ✅ Provide actionable feedback
308
-
309
- **Avoid:**
310
- - ❌ Rubber-stamping without reading
311
- - ❌ Style-only feedback
312
- - ❌ Vague comments ("this could be better")
313
- - Missing the forest for the trees
314
-
315
- ---
316
-
317
- ## References
318
-
319
- - Create todos: `todos/` directory
320
- - Document patterns: `/compound`
321
- - Execute fixes: `/work`
322
-
323
- ---
324
-
325
- ### Phase 5: Completion & Handoff
326
-
327
- #### Step 1: Establish Terminal UI State
328
-
329
- > [!IMPORTANT]
330
- > **Visual Completion Signal**
331
- > Call `task_boundary` one last time to signal completion in the user's UI. This prevents the "task" from appearing active after you've finished.
332
-
333
- ```javascript
334
- await task_boundary({
335
- TaskName: "[COMPLETED] Review: {PR Title / Target}",
336
- TaskStatus: "Review complete. Findings categorized. Offering next steps.",
337
- Mode: "VERIFICATION",
338
- TaskSummary: "Completed comprehensive review. Identified {P1_count} critical, {P2_count} important, and {P3_count} nice-to-have items."
339
- });
340
- ```
341
-
342
- #### Step 2: Mandatory Handoff
343
-
344
- > [!IMPORTANT]
345
- > **Exit Transition**
346
- > Do not stop here. Choose your next move based on the review outcome.
347
-
348
- ```bash
349
- ✓ Review complete
350
-
351
- Findings: {P1_count} critical, {P2_count} important, {P3_count} nice-to-have
352
-
353
- Next steps:
354
- 1. /triage - Prioritize and plan fixes for P1/P2 findings
355
- 2. /work - Start implementing immediate fixes (Self-Review)
356
- 3. /housekeeping - Cleanup and archive if no immediate work remains
357
- 4. /compound - Document interesting patterns/solutions discovered
358
- ```
359
-
1
+ ---
2
+ description: (Compound) Perform comprehensive multi-pass code review with security, performance, and architecture checks.
3
+ ---
4
+
5
+ # /review-compound - Comprehensive Code Review
6
+
7
+ Perform exhaustive code reviews using multi-perspective analysis to catch issues before they ship.
8
+
9
+ > **Sequential Review:** Unlike parallel agent systems, this review runs sequentially through each review perspective. Focus on depth over breadth.
10
+ >
11
+ > **Note:** This is the Compound version with multi-pass review. For quick review, use `/review`.
12
+
13
+
14
+ ## When To Use
15
+
16
+ - Before merging any PR
17
+ - Self-review before pushing
18
+ - After `/work` completion
19
+ - When reviewing others' code
20
+
21
+ ---
22
+
23
+ ## Workflow
24
+
25
+ ### Step -1: Resume Context (If New Session)
26
+
27
+ > [!CAUTION]
28
+ > **BLOCKING STEP.** If this is a NEW CONVERSATION, follow the session-resume skill first.
29
+
30
+ ```bash
31
+ cat skills/session-resume/SKILL.md
32
+ ./scripts/log-skill.sh "session-resume" "workflow" "/review"
33
+ ```
34
+
35
+ ### Step 0: Load Code Review Skill (MANDATORY)
36
+
37
+ > [!TIP]
38
+ > Use the **code-review skill** for checklists, security guards, and reference patterns.
39
+
40
+ ```bash
41
+ # Data collection
42
+ ./scripts/log-workflow.sh "/review" "$$"
43
+
44
+ cat skills/code-review/SKILL.md
45
+ ./scripts/log-skill.sh "code-review" "workflow" "/review"
46
+ ```
47
+
48
+ ### Step 1: Determine Review Target
49
+
50
+ **Identify what to review:**
51
+
52
+ | Input | Action |
53
+ |-------|--------|
54
+ | PR number | `gh pr view {number} --json title,body,files` |
55
+ | GitHub URL | Extract PR number, fetch metadata |
56
+ | Branch name | `git diff main...{branch}` |
57
+ | Empty | Review current branch vs main |
58
+
59
+ **Setup:**
60
+ ```bash
61
+ # If reviewing a PR, checkout the branch
62
+ gh pr checkout {PR_NUMBER}
63
+
64
+ # Or compare current branch
65
+ git diff main --stat
66
+ ```
67
+
68
+ ### Step 2: Gather Context
69
+
70
+ Before reviewing, understand:
71
+
72
+ - [ ] **What changed:** Files modified, lines added/removed
73
+ - [ ] **Why it changed:** PR description, linked issues
74
+ - [ ] **What's affected:** Dependencies, downstream code
75
+
76
+ **Prior Knowledge Check:**
77
+ > Use search to find similar past issues or patterns.
78
+
79
+ ```bash
80
+ ./scripts/compound-search.sh "{change type or component keywords}"
81
+ ```
82
+
83
+ ```bash
84
+ # View changed files
85
+ git diff main --name-only
86
+
87
+ # View detailed changes
88
+ git diff main
89
+ ```
90
+
91
+ ### Step 3: Sequential Review Passes
92
+
93
+ Run through each review perspective sequentially:
94
+
95
+ ---
96
+
97
+ #### Pass 1: 🔒 Security Review
98
+
99
+ **Action:** Perform a comprehensive security review utilizing `@mcp:superkit` security analysis capabilities.
100
+
101
+ - [ ] Use `@mcp:superkit` to execute a security audit on the modified files to check for vulnerabilities.
102
+ - [ ] Have you verified there are NO hardcoded secrets?
103
+ - [ ] Have you verified Auth guards and Access Controls?
104
+ - [ ] If vulnerabilities are found, produce a structured report and actionable recommendations assigning severity using the Security Severity Assessment rubric.
105
+
106
+ ```bash
107
+ # Optional manual fallback if @mcp:superkit tools are unavailable for specific checks
108
+ grep -rn "eval\|exec\|dangerouslySetInnerHTML" --include="*.ts" --include="*.js" src/
109
+ grep -rn "password\|secret\|api_key" --include="*.ts" --include="*.js" src/
110
+ ```
111
+
112
+ ---
113
+
114
+ #### Pass 2: ⚡ Performance Review
115
+
116
+ Check for:
117
+ - [ ] Unnecessary re-renders
118
+ - [ ] N+1 queries
119
+ - [ ] Large bundle sizes
120
+
121
+ ```bash
122
+ # Look for loop patterns with async calls
123
+ grep -rn "forEach.*await\|map.*await" --include="*.ts" src/
124
+ ```
125
+
126
+ ---
127
+
128
+ #### Pass 3: 🏛️ Architecture & Visual Review
129
+
130
+ Check structural integrity and visual communication:
131
+
132
+ - [ ] **Single Responsibility:** Each function does one thing?
133
+ - [ ] **Dependencies:** Proper layering? No circular deps?
134
+ - [ ] **Schematics:** Are complex workflows visually documented (mermaid/diagrams)?
135
+ - [ ] **Naming:** Clear, consistent naming?
136
+ - [ ] **Patterns:** Following project conventions?
137
+ - [ ] **Tests:** Adequate test coverage?
138
+
139
+ ---
140
+
141
+ #### Pass 4: 💾 Data Integrity Review
142
+
143
+ Check database and data handling:
144
+
145
+ - [ ] **Migrations:** Reversible? Production-safe?
146
+ - [ ] **Transactions:** Multi-step ops wrapped?
147
+ - [ ] **Constraints:** Foreign keys, unique constraints?
148
+ - [ ] **Nullability:** Null cases handled?
149
+
150
+ ---
151
+
152
+ #### Pass 5: 🎯 Simplicity Review
153
+
154
+ Check for unnecessary complexity:
155
+
156
+ - [ ] **YAGNI:** Features not needed yet?
157
+ - [ ] **Dead Code:** Unused imports, functions?
158
+ - [ ] **Over-Engineering:** Simpler solution exists?
159
+ - [ ] **Duplication:** Code that should be extracted?
160
+
161
+ ---
162
+
163
+ #### Pass 6: 🔬 Algorithmic & State Rigor (Scientific Review)
164
+
165
+ Apply rigorous scientific evaluation to the core logic:
166
+
167
+ - [ ] **Circular Logic Check:** Are conclusions/states derived independently?
168
+ - [ ] **Control Variables:** Are side-effects properly controlled/isolated?
169
+ - [ ] **Statistical/Algorithmic Soundness:** Are the algorithms appropriate for the scale? Are edge-cases proven handled?
170
+ - [ ] **Reproducibility:** If this fails in production, is there enough logging to perfectly reproduce the state?
171
+
172
+ ---
173
+
174
+ ### Step 4: Stakeholder Perspective Analysis
175
+
176
+ Think through each stakeholder's view:
177
+
178
+ | Stakeholder | Key Questions |
179
+ |-------------|---------------|
180
+ | **Developer** | Is this easy to understand/modify? Can I test this? |
181
+ | **Operations** | How do I deploy safely? What metrics available? |
182
+ | **End User** | Is it intuitive? Good error messages? |
183
+ | **Security** | What's the attack surface? Data protected? |
184
+ | **Business** | Does this solve the problem? Any risks? |
185
+
186
+ ### Step 5: Scenario Exploration
187
+
188
+ Test mental models against edge cases:
189
+
190
+ - [ ] **Happy Path:** Normal operation works?
191
+ - [ ] **Invalid Inputs:** Handles null, empty, malformed?
192
+ - [ ] **Boundary Conditions:** Min/max values?
193
+ - [ ] **Concurrent Access:** Race conditions?
194
+ - [ ] **Failures:** Network issues, timeouts?
195
+
196
+ ### Step 6: Synthesize Findings
197
+
198
+ Categorize all findings by severity:
199
+
200
+ **🔴 P1 - Critical (Must fix before merge):**
201
+ - Security vulnerabilities
202
+ - Data loss risks
203
+ - Breaking changes without migration
204
+
205
+ **🟡 P2 - Important (Should fix):**
206
+ - Performance issues
207
+ - Missing error handling
208
+ - Test coverage gaps
209
+
210
+ **🔵 P3 - Nice to Have (Consider for follow-up):**
211
+ - Style improvements
212
+ - Minor refactors
213
+ - Documentation updates
214
+ - Changelog entry missing (run `npm run changelog:gen`)
215
+
216
+ ### Step 7: Create Actionable Todos & Capture Deferred Work
217
+
218
+ For each P1/P2 finding, create a todo.
219
+
220
+ **Crucially, capture DEFERRED WORK here:**
221
+ - [ ] Are there P3 items we decided not to do now?
222
+ - [ ] Did we reject alternatives that have future value?
223
+ - [ ] Are there implementation tasks left over from `/work`?
224
+
225
+ > [!IMPORTANT]
226
+ > **Single Source of Truth.** If you close/reject a PR or defer work for later, that work **must** become a todo file NOW. Do not rely on capturing it later in `/compound`.
227
+
228
+ ```bash
229
+ # Create todos using the centralized generator
230
+ ./scripts/create-todo.sh "p1" "Security: SQL Injection in User Query" \
231
+ "Raw user input is used in database query at src/api/users.ts:45. This enables potential SQL injection attacks allowing unauthorized data access." \
232
+ "Replace raw query with parameterized version" \
233
+ "Add input validation" \
234
+ "Add test case for injection attempt"
235
+ ```
236
+
237
+ ### Step 8: Generate Review Summary
238
+
239
+ ```markdown
240
+ ## Peer Review Report: {PR Title}
241
+
242
+ **Reviewed:** {date}
243
+ **Files Changed:** {count}
244
+ **Lines:** +{added} / -{removed}
245
+
246
+ ### Summary Statement
247
+ Provide a concise overall assessment containing:
248
+ - Brief synopsis of the changes
249
+ - Overall recommendation (APPROVE, REQUEST_CHANGES, NEEDS_DISCUSSION)
250
+ - Key strengths
251
+ - Key weaknesses
252
+
253
+ ### Major Comments (Critical/P1)
254
+ Critical flaws that must be addressed (security, architectural errors, data loss):
255
+ - 1. {Finding 1} - *Suggested fix*
256
+ - 2. {Finding 2} - *Suggested fix*
257
+
258
+ ### Minor Comments (P2/P3)
259
+ Important to Nice-to-Have improvements (performance, conventions, dead code):
260
+ - 1. {Finding 1} - *Suggested fix*
261
+ - 2. {Finding 2} - *Suggested fix*
262
+
263
+ ### Questions for Author
264
+ Requests for clarification, unstated assumptions, or missing reproduction steps:
265
+ - 1. Why was {approach} chosen over {alternative}?
266
+ - 2. How are we handling {edge case} in {file}?
267
+
268
+ ### Next Steps
269
+ - [ ] Address Major Comments
270
+ - [ ] Answer Questions
271
+ - [ ] Create follow-up issues for Minor Comments (if deferred)
272
+ ```
273
+
274
+ ### Step 9: Offer Next Actions
275
+
276
+ ```
277
+ Review complete
278
+
279
+ Findings: {P1_count} critical, {P2_count} important, {P3_count} nice-to-have
280
+
281
+ What's next?
282
+ 1. Address findings - Fix critical issues first
283
+ 2. Approve - No blocking issues found
284
+ 3. Create follow-up issues - For P3 items
285
+ 4. Document learnings - Run /compound if found interesting patterns
286
+ ```
287
+
288
+ ### Step 10: Compound Learning
289
+
290
+ Before closing the review, ask yourself:
291
+
292
+ - Did you discover a reusable pattern?
293
+ - Did you find a non-obvious solution?
294
+ - Would this help future agents/developers?
295
+
296
+ If **yes** to any → Run `/compound` to document the learning.
297
+
298
+ **See also:** `skills/compound-docs/SKILL.md` for pattern promotion guidelines.
299
+
300
+ > [!TIP]
301
+ > Reviews often surface insights that aren't captured in the code itself. Don't let them evaporate.
302
+
303
+ ### Step 11: Final Validation Gate
304
+
305
+ > [!CAUTION]
306
+ > **Do not skip.**
307
+
308
+ Before closing, run:
309
+ ```bash
310
+ ./scripts/validate-compound.sh
311
+ ```
312
+
313
+ - [ ] Script passed?
314
+ - [ ] Deferred work converted to todos?
315
+
316
+ ---
317
+
318
+ ## Quality Guidelines
319
+
320
+ **Thorough reviews:**
321
+ - Check every changed file
322
+ - ✅ Think about edge cases
323
+ - ✅ Consider the broader system
324
+ - ✅ Provide actionable feedback
325
+
326
+ **Avoid:**
327
+ - Rubber-stamping without reading
328
+ - ❌ Style-only feedback
329
+ - ❌ Vague comments ("this could be better")
330
+ - Missing the forest for the trees
331
+
332
+ ---
333
+
334
+ ## References
335
+
336
+ - Create todos: `todos/` directory
337
+ - Document patterns: `/compound`
338
+ - Execute fixes: `/work`
339
+
340
+ ---
341
+
342
+ ### Phase 5: Completion & Handoff
343
+
344
+ #### Step 1: Establish Terminal UI State
345
+
346
+ > [!IMPORTANT]
347
+ > **Visual Completion Signal**
348
+ > Call `task_boundary` one last time to signal completion in the user's UI. This prevents the "task" from appearing active after you've finished.
349
+
350
+ ```javascript
351
+ await task_boundary({
352
+ TaskName: "[COMPLETED] Review: {PR Title / Target}",
353
+ TaskStatus: "Review complete. Findings categorized. Offering next steps.",
354
+ Mode: "VERIFICATION",
355
+ TaskSummary: "Completed comprehensive review. Identified {P1_count} critical, {P2_count} important, and {P3_count} nice-to-have items."
356
+ });
357
+ ```
358
+
359
+ #### Step 2: Mandatory Handoff
360
+
361
+ > [!IMPORTANT]
362
+ > **Exit Transition**
363
+ > Do not stop here. Choose your next move based on the review outcome.
364
+
365
+ ```bash
366
+ ✓ Review complete
367
+
368
+ Findings: {P1_count} critical, {P2_count} important, {P3_count} nice-to-have
369
+
370
+ Next steps:
371
+ 1. /triage - Prioritize and plan fixes for P1/P2 findings
372
+ 2. /work - Start implementing immediate fixes (Self-Review)
373
+ 3. /housekeeping - Cleanup and archive if no immediate work remains
374
+ 4. /compound - Document interesting patterns/solutions discovered
375
+ ```
376
+