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,433 +1,439 @@
1
- ---
2
- description: (Compound) Transform feature descriptions into well-structured project plans with solution search and pattern checks.
3
- ---
4
-
5
- # /plan-compound - Research and Plan Before Building
6
-
7
- Transform feature descriptions, bug reports, or improvement ideas into well-structured plans that follow project conventions and best practices.
8
-
9
- > **Why plan first?** Research before coding prevents building the wrong thing. A 30-minute plan saves hours of rework.
10
- >
11
- > **Note:** This is the Compound version with solution search and pattern checks. For quick planning, use `/plan`.
12
-
13
-
14
- ## When To Use
15
-
16
- - Before any feature taking >2 hours
17
- - For bugs requiring investigation
18
- - When exploring unfamiliar codebase areas
19
- - Before architectural changes
20
-
21
- ---
22
-
23
- ## Workflow
24
-
25
- ### Step 0: Search Existing Solutions (MANDATORY)
26
-
27
- > [!CAUTION]
28
- > **BLOCKING STEP.** You MUST complete this before proceeding. Skipping wastes time re-solving known problems.
29
-
30
- **Run the auto-searcher:**
31
- ```bash
32
- // turbo
33
- ./scripts/log-workflow.sh "/plan" "$$"
34
- ./scripts/compound-search.sh "{keyword1}" "{keyword2}"
35
- ```
36
-
37
- **See also:** `skills/compound-docs/SKILL.md` for advanced searching and pattern promotion.
38
-
39
- **Output required:**
40
- Copy the **table** AND the **update command** from the script output into your plan.
41
-
42
- **If relevant solutions found:**
43
- 1. List them in the plan under "## Prior Solutions"
44
- 2. Execute the update command to track usage:
45
- ```bash
46
- // turbo
47
- ./scripts/update-solution-ref.sh {paths from search output}
48
- ```
49
-
50
- ---
51
-
52
- #### ⛔ VALIDATION CHECKPOINT
53
-
54
- Before proceeding to Step 0.5, confirm:
55
-
56
- - [ ] Ran `compound-search.sh` with relevant keywords?
57
- - [ ] Reviewed all matching solutions (or confirmed none found)?
58
- - [ ] Ran `update-solution-ref.sh` if reusing any solution?
59
-
60
- **If any box is unchecked:** Complete it now. Do NOT proceed.
61
-
62
- ---
63
-
64
- ### Step 0.5: Check Active Specs
65
-
66
- Before creating a standalone plan, check if this work belongs to an active spec:
67
-
68
- ```bash
69
- ls docs/specs/*/README.md 2>/dev/null | grep -v templates
70
- ```
71
-
72
- **If active spec found:**
73
- 1. Read `docs/specs/{name}/00-START-HERE.md` for context
74
- 2. Determine if this plan belongs to the spec
75
- 3. If yes, create plan in `docs/specs/{name}/plans/{phase}-{description}.md`
76
- 4. Link to parent spec in plan header
77
- 5. Reference current phase from spec's `03-tasks.md`
78
-
79
- **If no active spec (or work is unrelated):** Proceed with standalone plan in `plans/`.
80
-
81
- > [!TIP]
82
- > Use `/specs` first if this is multi-week work that should have its own specification.
83
-
84
- ### Step 0.6: Pattern Awareness (MANDATORY)
85
-
86
- > [!CAUTION]
87
- > **BLOCKING STEP.** Before creating your plan, review the critical patterns to avoid reinventing solutions to known problems.
88
-
89
- ```bash
90
- # Quick review of critical patterns
91
- cat docs/solutions/patterns/critical-patterns.md | grep "^### Pattern"
92
- ```
93
-
94
- **Key patterns to consider during planning:**
95
- - Pattern #9: Rigorous Planning (Multi-Order Thinking)
96
- - Pattern #10: Atomic State Transitions
97
- - Pattern #3: Actionable Items → Todo Files
98
-
99
- **Why this matters:** These patterns exist because the same mistakes were made 3+ times. Consulting them now prevents wasted effort.
100
-
101
- ---
102
-
103
- ### Step 1: Clarify Requirements
104
-
105
- If the request is vague, ask clarifying questions:
106
-
107
- ```
108
- Before I create a plan, I have some questions:
109
-
110
- 1. What problem does this solve for users?
111
- 2. Are there any constraints (timeline, tech stack, etc.)?
112
- 3. Should this integrate with existing features?
113
- ```
114
-
115
- **Do not proceed until requirements are clear.**
116
-
117
- ### Step 2: Research Phase
118
-
119
- Gather context from multiple sources in parallel:
120
-
121
- **Codebase Research:**
122
- - [ ] Find similar implementations in the codebase
123
- - [ ] Identify relevant files and patterns
124
- - [ ] Check for existing utilities/helpers to reuse
125
- - [ ] Review related tests for expected behavior
126
-
127
- **Documentation Research:**
128
- - [ ] Check project README, CLAUDE.md, or GEMINI.md
129
- - [ ] Review any existing docs for the feature area
130
- - [ ] Look for team conventions and standards
131
-
132
- **External Research:**
133
- - [ ] Find best practices for this type of feature
134
- - [ ] Check framework documentation for recommended approaches
135
- - [ ] Look for common pitfalls to avoid
136
-
137
- **Reference Collection:**
138
- Document all findings with specific references:
139
- - File paths: `src/services/auth.ts:42`
140
- - URLs: `https://docs.example.com/auth`
141
- - Issues: `#123`, `#456`
142
-
143
- ### Step 3: Analyze and Identify Gaps
144
-
145
- Review collected research for:
146
-
147
- - [ ] Edge cases not covered
148
- - [ ] Potential conflicts with existing code
149
- - [ ] Missing dependencies
150
- - [ ] Security considerations
151
- - [ ] Performance implications
152
-
153
- ### Step 3.5: Deep Analysis (Think Hard)
154
-
155
- > [!IMPORTANT]
156
- > Don't rush to solutions. Invest time in rigorous analysis now to avoid costly surprises later.
157
-
158
- **Multi-Order Thinking:**
159
- - [ ] **1st order:** What does this change directly affect?
160
- - [ ] **2nd order:** What depends on those affected things?
161
- - [ ] **3rd order:** What cascading effects could occur?
162
- - [ ] **4th order:** Could this affect unrelated systems through shared dependencies?
163
-
164
- **Long-Term Implications:**
165
- - [ ] How will this age in 6 months? 1 year?
166
- - [ ] Does this create technical debt or reduce it?
167
- - [ ] Is this approach reversible if we're wrong?
168
- - [ ] Will future maintainers understand the "why"?
169
-
170
- **Edge Cases (Leave No Stone Unturned):**
171
- - [ ] Empty/null/undefined inputs
172
- - [ ] Boundary conditions (min, max, exactly-at-limit)
173
- - [ ] Concurrent/race conditions
174
- - [ ] Failure modes (network, database, external services)
175
- - [ ] User behavior extremes (fast clicking, back button, refresh)
176
- - [ ] Data migration scenarios
177
- - [ ] Rollback scenarios
178
-
179
- **Stakeholder Impact Analysis:**
180
- - [ ] **End Users:** Will this change behavior they rely on? UX disruption?
181
- - [ ] **Other Developers:** Breaking API changes? Documentation needs?
182
- - [ ] **Operations/Support:** New failure modes? Monitoring/alerting updates?
183
- - [ ] **Downstream Systems:** Integrations affected? Consumer contracts broken?
184
- - [ ] **Business Stakeholders:** Timeline/scope implications? Resource needs?
185
- - [ ] **Security/Compliance:** Data handling changes? Audit requirements?
186
-
187
- ### Step 4: Choose Detail Level
188
-
189
- **📄 MINIMAL** - Simple bugs, small improvements
190
- ```markdown
191
- ## Problem
192
- [Brief description]
193
-
194
- ## Solution
195
- [Approach]
196
-
197
- ## Acceptance Criteria
198
- - [ ] Requirement 1
199
- - [ ] Requirement 2
200
- ```
201
-
202
- **📋 STANDARD** - Most features
203
- ```markdown
204
- ## Overview
205
- [Comprehensive description]
206
-
207
- ## Problem Statement
208
- [Why this matters]
209
-
210
- ## Proposed Solution
211
- [Technical approach with code examples]
212
-
213
- ## Acceptance Criteria
214
- - [ ] Detailed requirements
215
-
216
- ## Technical Considerations
217
- - Dependencies
218
- - Risks
219
- - Alternatives considered
220
-
221
- ## References
222
- - [Links to research]
223
- ```
224
-
225
- **📚 DETAILED** - Complex features, architectural changes
226
- All of STANDARD plus:
227
- - Implementation phases
228
- - Rollback strategy
229
- - Migration plan
230
- - Testing strategy
231
- - Monitoring requirements
232
-
233
- ### Step 5.5: Register Architectural Decisions
234
-
235
- > [!IMPORTANT]
236
- > If your plan makes long-term architectural choices (library swaps, schema changes,
237
- > pattern adoptions), create ADRs to persist them.
238
-
239
- **Triggers for ADR creation:**
240
- - Choosing between competing technologies/libraries
241
- - Defining new patterns or conventions
242
- - Making breaking changes with long-term impact
243
- - Decisions that future developers need to understand "why"
244
-
245
- **If architectural decision made:**
246
- ```bash
247
- # Get next ADR ID
248
- next_id=$(printf "%03d" $(( $(ls -1 docs/decisions/*.md 2>/dev/null | xargs -n1 basename | grep -E '^[0-9]{3}-' | wc -l) + 1 )))
249
- cp docs/decisions/adr-template.md docs/decisions/${next_id}-{decision-slug}.md
250
- ```
251
-
252
- **Link in plan:**
253
- Add `## Architectural Decisions: ADR-{NNN}` section referencing the new ADR.
254
-
255
- ### Step 5.9: Create Plan Document
256
-
257
- Create plan file: `plans/{feature-name}.md`
258
-
259
- **Structure:**
260
- ```markdown
261
- # {Feature Title}
262
-
263
- > Created: {DATE}
264
- > Status: Draft
265
-
266
- ## Summary
267
- [One-paragraph overview]
268
-
269
- ## Problem Statement
270
- [What problem this solves]
271
-
272
- ## Research Findings
273
-
274
- ### Codebase Patterns
275
- [Relevant existing code with file:line references]
276
-
277
- ### Best Practices
278
- [External research findings]
279
-
280
- ## Proposed Solution
281
-
282
- ### Approach
283
- [Technical approach]
284
-
285
- ### Code Examples
286
- \`\`\`{language}
287
- // Example implementation
288
- \`\`\`
289
-
290
- ## Acceptance Criteria
291
- - [ ] Criterion 1
292
- - [ ] Criterion 2
293
-
294
- ## Technical Considerations
295
-
296
- ### Dependencies
297
- - [Required packages/services]
298
-
299
- ### Risks
300
- - [Potential issues]
301
-
302
- ### Alternatives Considered
303
- - [Other approaches and why rejected]
304
-
305
- ## Implementation Steps
306
-
307
- Tasks tracked in [03-tasks.md](../03-tasks.md#phase-{N}).
308
-
309
- **Approach:**
310
- - Task 1: [Technical details]
311
- - Task 2: [Technical details]
312
-
313
- ## References
314
- - [Research links]
315
- - [Related issues]
316
- ```
317
-
318
- ### Step 6: Create Plans Directory (if needed)
319
-
320
- ```bash
321
- mkdir -p plans
322
- ```
323
-
324
- ### Step 7: Offer Next Steps
325
-
326
- ```
327
- Plan created: plans/{feature-name}.md
328
-
329
- What's next?
330
- 1. Start work - Execute this plan with /work
331
- 2. Review plan - Get feedback before starting
332
- 3. Refine plan - Add more detail
333
- 4. Nothing for now
334
- ```
335
-
336
- ### Step 8: Create Todos for Deferred Scope
337
-
338
- > [!IMPORTANT]
339
- > If the plan identifies "out of scope" or "future work" items, create todo files for them NOW.
340
-
341
- **Check for deferred items:**
342
- - [ ] Did you mark anything as "out of scope"?
343
- - [ ] Are there "nice to have" features for later?
344
- - [ ] Did research reveal related improvements?
345
-
346
- **If YES:**
347
- ```bash
348
- # Create todo for each deferred item
349
- ./scripts/create-todo.sh "p3" "{description}" \
350
- "Deferred item from plan {feature-name}. This feature was identified as valuable but out of scope for the initial implementation." \
351
- "Implement feature" "Verify functionality"
352
- ```
353
-
354
- **Before adding plan references to the todo:**
355
-
356
- > [!CAUTION]
357
- > Verify referential integrity to prevent dead links.
358
-
359
- **If referencing this plan in the todo:**
360
- ```bash
361
- # Verify the plan file exists
362
- if [ ! -f "plans/{feature-name}.md" ]; then
363
- echo "❌ ERROR: Plan file does not exist. Cannot create reference."
364
- exit 1
365
- fi
366
- ```
367
-
368
- **Alternative references** (if plan was not persisted):
369
- - Specs: `../docs/specs/{name}/README.md`
370
- - Solutions: `../docs/solutions/{category}/{solution-name}.md`
371
- - ADRs: `../docs/decisions/{nnn}-{decision}.md`
372
-
373
- **See also:** `skills/file-todos/SKILL.md` for full todo management workflows.
374
-
375
- ---
376
-
377
- ### Phase 5: Completion & Handoff
378
-
379
- #### Step 1: Establish Terminal UI State
380
-
381
- > [!IMPORTANT]
382
- > **Visual Completion Signal**
383
- > 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.
384
-
385
- ```javascript
386
- await task_boundary({
387
- TaskName: "[COMPLETED] Planning: {Feature Name}",
388
- TaskStatus: "Plan created and ready for review or execution.",
389
- Mode: "VERIFICATION",
390
- TaskSummary: "Completed planning for {feature}. Created comprehensive plan with acceptance criteria, research findings, and implementation steps."
391
- });
392
- ```
393
-
394
- #### Step 2: Mandatory Handoff
395
-
396
- > [!IMPORTANT]
397
- > **Exit Transition**
398
- > Do not stop here. Offer the user clear paths to the next logical workflow.
399
-
400
- ```bash
401
- ✓ Plan created: plans/{feature-name}.md
402
-
403
- Next steps:
404
- 1. /plan_review - Get feedback on plan quality before execution
405
- 2. /work - Start implementing (if plan is simple and you're confident)
406
- 3. Refine plan - Add more detail based on additional research
407
- 4. Create todos - For any deferred scope identified
408
- ```
409
-
410
- ---
411
-
412
- ## Quality Guidelines
413
-
414
- **Good plans have:**
415
- - ✅ Clear problem statement (not just "what" but "why")
416
- - ✅ Research with specific file references
417
- - ✅ Concrete acceptance criteria (testable)
418
- - Code examples following existing patterns
419
- - ✅ Considered alternatives
420
-
421
- **Avoid:**
422
- - Vague requirements ("make it better")
423
- - No research ("just do X")
424
- - Missing acceptance criteria
425
- - Ignoring existing patterns
426
-
427
- ---
428
-
429
- ## References
430
-
431
- - Plans directory: `plans/`
432
- - Execute plans: `/work`
433
- - Triage deferred items: `/triage`
1
+ ---
2
+ description: (Compound) Transform feature descriptions into well-structured project plans with solution search and pattern checks.
3
+ ---
4
+
5
+ # /plan-compound - Research and Plan Before Building
6
+
7
+ Transform feature descriptions, bug reports, or improvement ideas into well-structured plans that follow project conventions and best practices.
8
+
9
+ > **Why plan first?** Research before coding prevents building the wrong thing. A 30-minute plan saves hours of rework.
10
+ >
11
+ > **Note:** This is the Compound version with solution search and pattern checks. For quick planning, use `/plan`.
12
+
13
+
14
+ ## When To Use
15
+
16
+ - Before any feature taking >2 hours
17
+ - For bugs requiring investigation
18
+ - When exploring unfamiliar codebase areas
19
+ - Before architectural changes
20
+
21
+ ---
22
+
23
+ ## Workflow
24
+
25
+ ### Step 0: Search Existing Solutions (MANDATORY)
26
+
27
+ > [!CAUTION]
28
+ > **BLOCKING STEP.** You MUST complete this before proceeding. Skipping wastes time re-solving known problems.
29
+
30
+ **Run the auto-searcher:**
31
+ ```bash
32
+ // turbo
33
+ ./scripts/log-workflow.sh "/plan" "$$"
34
+ ./scripts/compound-search.sh "{keyword1}" "{keyword2}"
35
+ ```
36
+
37
+ **See also:** `skills/compound-docs/SKILL.md` for advanced searching and pattern promotion.
38
+
39
+ **Output required:**
40
+ Copy the **table** AND the **update command** from the script output into your plan.
41
+
42
+ **If relevant solutions found:**
43
+ 1. List them in the plan under "## Prior Solutions"
44
+ 2. Execute the update command to track usage:
45
+ ```bash
46
+ // turbo
47
+ ./scripts/update-solution-ref.sh {paths from search output}
48
+ ```
49
+
50
+ ---
51
+
52
+ #### ⛔ VALIDATION CHECKPOINT
53
+
54
+ Before proceeding to Step 0.5, confirm:
55
+
56
+ - [ ] Ran `compound-search.sh` with relevant keywords?
57
+ - [ ] Reviewed all matching solutions (or confirmed none found)?
58
+ - [ ] Ran `update-solution-ref.sh` if reusing any solution?
59
+
60
+ **If any box is unchecked:** Complete it now. Do NOT proceed.
61
+
62
+ ---
63
+
64
+ ### Step 0.5: Check Active Specs
65
+
66
+ Before creating a standalone plan, check if this work belongs to an active spec:
67
+
68
+ ```bash
69
+ ls docs/specs/*/README.md 2>/dev/null | grep -v templates
70
+ ```
71
+
72
+ **If active spec found:**
73
+ 1. Read `docs/specs/{name}/00-START-HERE.md` for context
74
+ 2. Determine if this plan belongs to the spec
75
+ 3. If yes, create plan in `docs/specs/{name}/plans/{phase}-{description}.md`
76
+ 4. Link to parent spec in plan header
77
+ 5. Reference current phase from spec's `03-tasks.md`
78
+
79
+ **If no active spec (or work is unrelated):** Proceed with standalone plan in `plans/`.
80
+
81
+ > [!TIP]
82
+ > Use `/specs` first if this is multi-week work that should have its own specification.
83
+
84
+ ### Step 0.6: Pattern Awareness (MANDATORY)
85
+
86
+ > [!CAUTION]
87
+ > **BLOCKING STEP.** Before creating your plan, review the critical patterns to avoid reinventing solutions to known problems.
88
+
89
+ ```bash
90
+ # Quick review of critical patterns
91
+ cat docs/solutions/patterns/critical-patterns.md | grep "^### Pattern"
92
+ ```
93
+
94
+ **Key patterns to consider during planning:**
95
+ - Pattern #9: Rigorous Planning (Multi-Order Thinking)
96
+ - Pattern #10: Atomic State Transitions
97
+ - Pattern #3: Actionable Items → Todo Files
98
+
99
+ **Why this matters:** These patterns exist because the same mistakes were made 3+ times. Consulting them now prevents wasted effort.
100
+
101
+ ---
102
+
103
+ ### Step 1: Clarify Requirements
104
+
105
+ If the request is vague, ask clarifying questions:
106
+
107
+ ```
108
+ Before I create a plan, I have some questions:
109
+
110
+ 1. What problem does this solve for users?
111
+ 2. Are there any constraints (timeline, tech stack, etc.)?
112
+ 3. Should this integrate with existing features?
113
+ ```
114
+
115
+ **Do not proceed until requirements are clear.**
116
+
117
+ ### Step 2: Research Phase
118
+
119
+ Gather context from multiple sources in parallel:
120
+
121
+ **Codebase Research:**
122
+ - [ ] Find similar implementations in the codebase
123
+ - [ ] Identify relevant files and patterns
124
+ - [ ] Check for existing utilities/helpers to reuse
125
+ - [ ] Review related tests for expected behavior
126
+
127
+ **Documentation Research:**
128
+ - [ ] Check project README, CLAUDE.md, or GEMINI.md
129
+ - [ ] Review any existing docs for the feature area
130
+ - [ ] Look for team conventions and standards
131
+
132
+ **External Research:**
133
+ - [ ] Find best practices for this type of feature
134
+ - [ ] Check framework documentation for recommended approaches
135
+ - [ ] Look for common pitfalls to avoid
136
+
137
+ **Reference Collection:**
138
+ Document all findings with specific references:
139
+ - File paths: `src/services/auth.ts:42`
140
+ - URLs: `https://docs.example.com/auth`
141
+ - Issues: `#123`, `#456`
142
+
143
+ ### Step 3: Analyze and Identify Gaps
144
+
145
+ Review collected research for:
146
+
147
+ - [ ] Edge cases not covered
148
+ - [ ] Potential conflicts with existing code
149
+ - [ ] Missing dependencies
150
+ - [ ] Security considerations
151
+ - [ ] Performance implications
152
+
153
+ ### Step 3.5: Deep Analysis (Think Hard)
154
+
155
+ > [!IMPORTANT]
156
+ > Don't rush to solutions. Invest time in rigorous analysis now to avoid costly surprises later.
157
+
158
+ **Multi-Order Thinking:**
159
+ - [ ] **1st order:** What does this change directly affect?
160
+ - [ ] **2nd order:** What depends on those affected things?
161
+ - [ ] **3rd order:** What cascading effects could occur?
162
+ - [ ] **4th order:** Could this affect unrelated systems through shared dependencies?
163
+
164
+ **Long-Term Implications:**
165
+ - [ ] How will this age in 6 months? 1 year?
166
+ - [ ] Does this create technical debt or reduce it?
167
+ - [ ] Is this approach reversible if we're wrong?
168
+ - [ ] Will future maintainers understand the "why"?
169
+
170
+ **Edge Cases (Leave No Stone Unturned):**
171
+ - [ ] Empty/null/undefined inputs
172
+ - [ ] Boundary conditions (min, max, exactly-at-limit)
173
+ - [ ] Concurrent/race conditions
174
+ - [ ] Failure modes (network, database, external services)
175
+ - [ ] User behavior extremes (fast clicking, back button, refresh)
176
+ - [ ] Data migration scenarios
177
+ - [ ] Rollback scenarios
178
+
179
+ **Stakeholder Impact Analysis:**
180
+ - [ ] **End Users:** Will this change behavior they rely on? UX disruption?
181
+ - [ ] **Other Developers:** Breaking API changes? Documentation needs?
182
+ - [ ] **Operations/Support:** New failure modes? Monitoring/alerting updates?
183
+ - [ ] **Downstream Systems:** Integrations affected? Consumer contracts broken?
184
+ - [ ] **Business Stakeholders:** Timeline/scope implications? Resource needs?
185
+ - [ ] **Security/Compliance:** Data handling changes? Audit requirements?
186
+
187
+ ### Step 4: Choose Detail Level
188
+
189
+ **📄 MINIMAL** - Simple bugs, small improvements
190
+ ```markdown
191
+ ## Problem
192
+ [Brief description]
193
+
194
+ ## Solution
195
+ [Approach]
196
+
197
+ ## Acceptance Criteria
198
+ - [ ] Requirement 1
199
+ - [ ] Requirement 2
200
+ ```
201
+
202
+ **📋 STANDARD** - Most features
203
+ ```markdown
204
+ ## Overview
205
+ [Comprehensive description]
206
+
207
+ ## Problem Statement
208
+ [Why this matters]
209
+
210
+ ## Proposed Solution
211
+ [Technical approach with code examples]
212
+
213
+ ## Acceptance Criteria
214
+ - [ ] Detailed requirements
215
+
216
+ ## Technical Considerations
217
+ - Dependencies
218
+ - Risks
219
+ - Alternatives considered
220
+
221
+ ## References
222
+ - [Links to research]
223
+ ```
224
+
225
+ **📚 DETAILED** - Complex features, architectural changes
226
+ All of STANDARD plus:
227
+ - Implementation phases
228
+ - Rollback strategy
229
+ - Migration plan
230
+ - Testing strategy
231
+ - Monitoring requirements
232
+
233
+ ### Step 5.5: Register Architectural Decisions
234
+
235
+ > [!IMPORTANT]
236
+ > If your plan makes long-term architectural choices (library swaps, schema changes,
237
+ > pattern adoptions), create ADRs to persist them.
238
+
239
+ **Triggers for ADR creation:**
240
+ - Choosing between competing technologies/libraries
241
+ - Defining new patterns or conventions
242
+ - Making breaking changes with long-term impact
243
+ - Decisions that future developers need to understand "why"
244
+
245
+ **If architectural decision made:**
246
+ ```bash
247
+ # Get next ADR ID
248
+ next_id=$(printf "%03d" $(( $(ls -1 docs/decisions/*.md 2>/dev/null | xargs -n1 basename | grep -E '^[0-9]{3}-' | wc -l) + 1 )))
249
+ cp docs/decisions/adr-template.md docs/decisions/${next_id}-{decision-slug}.md
250
+ ```
251
+
252
+ **Link in plan:**
253
+ Add `## Architectural Decisions: ADR-{NNN}` section referencing the new ADR.
254
+
255
+ ### Step 5.9: Create Plan Document
256
+
257
+ Create plan file: `plans/{feature-name}.md`
258
+
259
+ **Structure:**
260
+ ```markdown
261
+ # {Feature Title}
262
+
263
+ > Created: {DATE}
264
+ > Status: Draft
265
+
266
+ ## Summary
267
+ [One-paragraph overview]
268
+
269
+ ## Problem Statement
270
+ [What problem this solves]
271
+
272
+ ## Research Findings
273
+
274
+ ### Codebase Patterns
275
+ [Relevant existing code with file:line references]
276
+
277
+ ### Best Practices
278
+ [External research findings]
279
+
280
+ ## Proposed Solution
281
+
282
+ ### Approach
283
+ [Technical approach]
284
+
285
+ ### Code Examples
286
+ \`\`\`{language}
287
+ // Example implementation
288
+ \`\`\`
289
+
290
+ ## Acceptance Criteria
291
+ - [ ] Criterion 1
292
+ - [ ] Criterion 2
293
+
294
+ ## Acceptance Criteria & Testing (Nyquist Validation Layer)
295
+ > **Important:** Map each requirement to a specific automated test or manual verification command *before* execution.
296
+ - [ ] Criterion 1 -> `npm test -- -t "criterion 1"`
297
+ - [ ] Criterion 2 -> `pytest -k "criterion_2"`
298
+ - [ ] Test scaffolding required: [List tests that need to be created]
299
+
300
+ ## Technical Considerations
301
+
302
+ ### Dependencies
303
+ - [Required packages/services]
304
+
305
+ ### Risks
306
+ - [Potential issues]
307
+
308
+ ### Alternatives Considered
309
+ - [Other approaches and why rejected]
310
+
311
+ ## Implementation Steps
312
+
313
+ Tasks tracked in [03-tasks.md](../03-tasks.md#phase-{N}).
314
+
315
+ **Approach:**
316
+ - Task 1: [Technical details]
317
+ - Task 2: [Technical details]
318
+
319
+ ## References
320
+ - [Research links]
321
+ - [Related issues]
322
+ ```
323
+
324
+ ### Step 6: Create Plans Directory (if needed)
325
+
326
+ ```bash
327
+ mkdir -p plans
328
+ ```
329
+
330
+ ### Step 7: Offer Next Steps
331
+
332
+ ```
333
+ Plan created: plans/{feature-name}.md
334
+
335
+ What's next?
336
+ 1. Start work - Execute this plan with /work
337
+ 2. Review plan - Get feedback before starting
338
+ 3. Refine plan - Add more detail
339
+ 4. Nothing for now
340
+ ```
341
+
342
+ ### Step 8: Create Todos for Deferred Scope
343
+
344
+ > [!IMPORTANT]
345
+ > If the plan identifies "out of scope" or "future work" items, create todo files for them NOW.
346
+
347
+ **Check for deferred items:**
348
+ - [ ] Did you mark anything as "out of scope"?
349
+ - [ ] Are there "nice to have" features for later?
350
+ - [ ] Did research reveal related improvements?
351
+
352
+ **If YES:**
353
+ ```bash
354
+ # Create todo for each deferred item
355
+ ./scripts/create-todo.sh "p3" "{description}" \
356
+ "Deferred item from plan {feature-name}. This feature was identified as valuable but out of scope for the initial implementation." \
357
+ "Implement feature" "Verify functionality"
358
+ ```
359
+
360
+ **Before adding plan references to the todo:**
361
+
362
+ > [!CAUTION]
363
+ > Verify referential integrity to prevent dead links.
364
+
365
+ **If referencing this plan in the todo:**
366
+ ```bash
367
+ # Verify the plan file exists
368
+ if [ ! -f "plans/{feature-name}.md" ]; then
369
+ echo "❌ ERROR: Plan file does not exist. Cannot create reference."
370
+ exit 1
371
+ fi
372
+ ```
373
+
374
+ **Alternative references** (if plan was not persisted):
375
+ - Specs: `../docs/specs/{name}/README.md`
376
+ - Solutions: `../docs/solutions/{category}/{solution-name}.md`
377
+ - ADRs: `../docs/decisions/{nnn}-{decision}.md`
378
+
379
+ **See also:** `skills/file-todos/SKILL.md` for full todo management workflows.
380
+
381
+ ---
382
+
383
+ ### Phase 5: Completion & Handoff
384
+
385
+ #### Step 1: Establish Terminal UI State
386
+
387
+ > [!IMPORTANT]
388
+ > **Visual Completion Signal**
389
+ > 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.
390
+
391
+ ```javascript
392
+ await task_boundary({
393
+ TaskName: "[COMPLETED] Planning: {Feature Name}",
394
+ TaskStatus: "Plan created and ready for review or execution.",
395
+ Mode: "VERIFICATION",
396
+ TaskSummary: "Completed planning for {feature}. Created comprehensive plan with acceptance criteria, research findings, and implementation steps."
397
+ });
398
+ ```
399
+
400
+ #### Step 2: Mandatory Handoff
401
+
402
+ > [!IMPORTANT]
403
+ > **Exit Transition**
404
+ > Do not stop here. Offer the user clear paths to the next logical workflow.
405
+
406
+ ```bash
407
+ Plan created: plans/{feature-name}.md
408
+
409
+ Next steps:
410
+ 1. /plan_review - Get feedback on plan quality before execution
411
+ 2. /work - Start implementing (if plan is simple and you're confident)
412
+ 3. Refine plan - Add more detail based on additional research
413
+ 4. Create todos - For any deferred scope identified
414
+ ```
415
+
416
+ ---
417
+
418
+ ## Quality Guidelines
419
+
420
+ **Good plans have:**
421
+ - ✅ Clear problem statement (not just "what" but "why")
422
+ - Research with specific file references
423
+ - Concrete acceptance criteria (testable)
424
+ - Code examples following existing patterns
425
+ - Considered alternatives
426
+
427
+ **Avoid:**
428
+ - ❌ Vague requirements ("make it better")
429
+ - ❌ No research ("just do X")
430
+ - ❌ Missing acceptance criteria
431
+ - Ignoring existing patterns
432
+
433
+ ---
434
+
435
+ ## References
436
+
437
+ - Plans directory: `plans/`
438
+ - Execute plans: `/work`
439
+ - Triage deferred items: `/triage`