@hustle-together/api-dev-tools 3.12.16 → 4.5.3

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 (180) hide show
  1. package/.claude/adr-requests/.gitkeep +10 -0
  2. package/.claude/agents/adr-researcher.md +109 -0
  3. package/.claude/agents/visual-analyzer.md +183 -0
  4. package/.claude/api-dev-state.json +10 -0
  5. package/.claude/documentation-audit.json +114 -0
  6. package/.claude/registry.json +289 -0
  7. package/.claude/settings.json +45 -1
  8. package/.claude/settings.local.json +1 -7
  9. package/.claude/workflow-logs/None.json +49 -0
  10. package/.claude/workflow-logs/session-20251230-143727.json +106 -0
  11. package/.skills/adr-deep-research/SKILL.md +351 -0
  12. package/.skills/api-create/SKILL.md +34 -20
  13. package/.skills/api-research/SKILL.md +130 -0
  14. package/.skills/docs-update/SKILL.md +205 -0
  15. package/.skills/hustle-brand/SKILL.md +368 -0
  16. package/.skills/hustle-build/SKILL.md +365 -38
  17. package/.skills/parallel-spawn/SKILL.md +212 -0
  18. package/.skills/ralph-continue/SKILL.md +151 -0
  19. package/.skills/ralph-loop/SKILL.md +341 -0
  20. package/.skills/ralph-status/SKILL.md +87 -0
  21. package/.skills/refactor/SKILL.md +59 -0
  22. package/.skills/shadcn/SKILL.md +522 -0
  23. package/.skills/test-all/SKILL.md +210 -0
  24. package/.skills/test-builds/SKILL.md +208 -0
  25. package/.skills/test-debug/SKILL.md +212 -0
  26. package/.skills/test-e2e/SKILL.md +168 -0
  27. package/.skills/test-review/SKILL.md +707 -0
  28. package/.skills/test-unit/SKILL.md +143 -0
  29. package/.skills/test-visual/SKILL.md +301 -0
  30. package/.skills/token-report/SKILL.md +132 -0
  31. package/CHANGELOG.md +488 -0
  32. package/README.md +346 -53
  33. package/bin/cli.js +359 -123
  34. package/hooks/__pycache__/api-workflow-check.cpython-314.pyc +0 -0
  35. package/hooks/__pycache__/auto-answer.cpython-314.pyc +0 -0
  36. package/hooks/__pycache__/cache-research.cpython-314.pyc +0 -0
  37. package/hooks/__pycache__/check-api-routes.cpython-314.pyc +0 -0
  38. package/hooks/__pycache__/check-playwright-setup.cpython-314.pyc +0 -0
  39. package/hooks/__pycache__/check-storybook-setup.cpython-314.pyc +0 -0
  40. package/hooks/__pycache__/check-update.cpython-314.pyc +0 -0
  41. package/hooks/__pycache__/completion-promise-detector.cpython-314.pyc +0 -0
  42. package/hooks/__pycache__/context-capacity-warning.cpython-314.pyc +0 -0
  43. package/hooks/__pycache__/detect-interruption.cpython-314.pyc +0 -0
  44. package/hooks/__pycache__/docs-update-check.cpython-314.pyc +0 -0
  45. package/hooks/__pycache__/enforce-a11y-audit.cpython-314.pyc +0 -0
  46. package/hooks/__pycache__/enforce-brand-guide.cpython-314.pyc +0 -0
  47. package/hooks/__pycache__/enforce-component-type-confirm.cpython-314.pyc +0 -0
  48. package/hooks/__pycache__/enforce-deep-research.cpython-314.pyc +0 -0
  49. package/hooks/__pycache__/enforce-disambiguation.cpython-314.pyc +0 -0
  50. package/hooks/__pycache__/enforce-documentation.cpython-314.pyc +0 -0
  51. package/hooks/__pycache__/enforce-dry-run.cpython-314.pyc +0 -0
  52. package/hooks/__pycache__/enforce-environment.cpython-314.pyc +0 -0
  53. package/hooks/__pycache__/enforce-external-research.cpython-314.pyc +0 -0
  54. package/hooks/__pycache__/enforce-freshness.cpython-314.pyc +0 -0
  55. package/hooks/__pycache__/enforce-interview.cpython-314.pyc +0 -0
  56. package/hooks/__pycache__/enforce-page-components.cpython-314.pyc +0 -0
  57. package/hooks/__pycache__/enforce-page-data-schema.cpython-314.pyc +0 -0
  58. package/hooks/__pycache__/enforce-questions-sourced.cpython-314.pyc +0 -0
  59. package/hooks/__pycache__/enforce-refactor.cpython-314.pyc +0 -0
  60. package/hooks/__pycache__/enforce-research.cpython-314.pyc +0 -0
  61. package/hooks/__pycache__/enforce-schema-from-interview.cpython-314.pyc +0 -0
  62. package/hooks/__pycache__/enforce-schema.cpython-314.pyc +0 -0
  63. package/hooks/__pycache__/enforce-scope.cpython-314.pyc +0 -0
  64. package/hooks/__pycache__/enforce-tdd-red.cpython-314.pyc +0 -0
  65. package/hooks/__pycache__/enforce-ui-disambiguation.cpython-314.pyc +0 -0
  66. package/hooks/__pycache__/enforce-ui-interview.cpython-314.pyc +0 -0
  67. package/hooks/__pycache__/enforce-verify.cpython-314.pyc +0 -0
  68. package/hooks/__pycache__/generate-adr-options.cpython-314.pyc +0 -0
  69. package/hooks/__pycache__/generate-manifest-entry.cpython-314.pyc +0 -0
  70. package/hooks/__pycache__/hook_utils.cpython-314.pyc +0 -0
  71. package/hooks/__pycache__/notify-input-needed.cpython-314.pyc +0 -0
  72. package/hooks/__pycache__/notify-phase-complete.cpython-314.pyc +0 -0
  73. package/hooks/__pycache__/ntfy-on-question.cpython-314.pyc +0 -0
  74. package/hooks/__pycache__/orchestrator-completion.cpython-314.pyc +0 -0
  75. package/hooks/__pycache__/orchestrator-handoff.cpython-314.pyc +0 -0
  76. package/hooks/__pycache__/orchestrator-session-startup.cpython-314.pyc +0 -0
  77. package/hooks/__pycache__/parallel-orchestrator.cpython-314.pyc +0 -0
  78. package/hooks/__pycache__/periodic-reground.cpython-314.pyc +0 -0
  79. package/hooks/__pycache__/project-document-prompt.cpython-314.pyc +0 -0
  80. package/hooks/__pycache__/remote-question-proxy.cpython-314.pyc +0 -0
  81. package/hooks/__pycache__/remote-question-server.cpython-314.pyc +0 -0
  82. package/hooks/__pycache__/run-code-review.cpython-314.pyc +0 -0
  83. package/hooks/__pycache__/run-visual-qa.cpython-314.pyc +0 -0
  84. package/hooks/__pycache__/session-logger.cpython-314.pyc +0 -0
  85. package/hooks/__pycache__/session-startup.cpython-314.pyc +0 -0
  86. package/hooks/__pycache__/track-scope-coverage.cpython-314.pyc +0 -0
  87. package/hooks/__pycache__/track-token-usage.cpython-314.pyc +0 -0
  88. package/hooks/__pycache__/track-tool-use.cpython-314.pyc +0 -0
  89. package/hooks/__pycache__/update-adr-decision.cpython-314.pyc +0 -0
  90. package/hooks/__pycache__/update-api-showcase.cpython-314.pyc +0 -0
  91. package/hooks/__pycache__/update-registry.cpython-314.pyc +0 -0
  92. package/hooks/__pycache__/update-ui-showcase.cpython-314.pyc +0 -0
  93. package/hooks/__pycache__/verify-after-green.cpython-314.pyc +0 -0
  94. package/hooks/__pycache__/verify-implementation.cpython-314.pyc +0 -0
  95. package/hooks/api-workflow-check.py +34 -0
  96. package/hooks/auto-answer.py +97 -20
  97. package/{.claude/hooks → hooks}/completion-promise-detector.py +0 -0
  98. package/{.claude/hooks → hooks}/context-capacity-warning.py +0 -0
  99. package/{.claude/hooks → hooks}/docs-update-check.py +0 -0
  100. package/{.claude/hooks → hooks}/enforce-dry-run.py +0 -0
  101. package/hooks/enforce-external-research.py +25 -0
  102. package/hooks/enforce-interview.py +20 -0
  103. package/{.claude/hooks → hooks}/generate-adr-options.py +0 -0
  104. package/{.claude/hooks → hooks}/hook_utils.py +0 -0
  105. package/hooks/ntfy-on-question.py +15 -2
  106. package/hooks/orchestrator-handoff.py +81 -3
  107. package/{.claude/hooks → hooks}/parallel-orchestrator.py +0 -0
  108. package/hooks/periodic-reground.py +40 -0
  109. package/{.claude/hooks → hooks}/remote-question-server.py +0 -0
  110. package/hooks/run-code-review.py +176 -29
  111. package/{.claude/hooks → hooks}/run-visual-qa.py +0 -0
  112. package/hooks/session-logger.py +27 -1
  113. package/hooks/session-startup.py +113 -0
  114. package/{.claude/hooks → hooks}/update-adr-decision.py +0 -0
  115. package/package.json +1 -1
  116. package/templates/.skills/hustle-interview/SKILL.md +174 -0
  117. package/templates/adr-viewer/_components/ADRViewer.tsx +326 -0
  118. package/templates/api-dev-state.json +33 -1
  119. package/templates/brand-page/page.tsx +645 -0
  120. package/templates/component/Component.visual.spec.ts +30 -24
  121. package/templates/eslint-plugin-zod-schema/index.js +446 -0
  122. package/templates/eslint-plugin-zod-schema/package.json +26 -0
  123. package/templates/github-workflows/security.yml +274 -0
  124. package/templates/hustle-build-defaults.json +53 -1
  125. package/templates/page/page.e2e.test.ts +30 -26
  126. package/templates/performance-budgets.json +63 -5
  127. package/templates/registry.json +279 -3
  128. package/templates/review-dashboard/page.tsx +510 -0
  129. package/templates/settings.json +74 -7
  130. package/templates/ui-showcase/_components/UIShowcase.tsx +47 -0
  131. package/templates/ui-showcase/_components/VisualTestingDashboard.tsx +579 -0
  132. package/.claude/commands/hustle-combine.md +0 -1089
  133. package/.claude/commands/hustle-ui-create-page.md +0 -1078
  134. package/.claude/commands/hustle-ui-create.md +0 -1058
  135. package/.claude/hooks/auto-answer.py +0 -305
  136. package/.claude/hooks/cache-research.py +0 -337
  137. package/.claude/hooks/check-api-routes.py +0 -168
  138. package/.claude/hooks/check-playwright-setup.py +0 -103
  139. package/.claude/hooks/check-storybook-setup.py +0 -81
  140. package/.claude/hooks/check-update.py +0 -132
  141. package/.claude/hooks/detect-interruption.py +0 -165
  142. package/.claude/hooks/enforce-a11y-audit.py +0 -202
  143. package/.claude/hooks/enforce-brand-guide.py +0 -241
  144. package/.claude/hooks/enforce-component-type-confirm.py +0 -97
  145. package/.claude/hooks/enforce-freshness.py +0 -184
  146. package/.claude/hooks/enforce-page-components.py +0 -186
  147. package/.claude/hooks/enforce-page-data-schema.py +0 -155
  148. package/.claude/hooks/enforce-questions-sourced.py +0 -146
  149. package/.claude/hooks/enforce-schema-from-interview.py +0 -248
  150. package/.claude/hooks/enforce-ui-disambiguation.py +0 -108
  151. package/.claude/hooks/enforce-ui-interview.py +0 -130
  152. package/.claude/hooks/generate-manifest-entry.py +0 -1161
  153. package/.claude/hooks/lib/__init__.py +0 -1
  154. package/.claude/hooks/lib/greptile.py +0 -355
  155. package/.claude/hooks/lib/ntfy.py +0 -209
  156. package/.claude/hooks/notify-input-needed.py +0 -73
  157. package/.claude/hooks/notify-phase-complete.py +0 -90
  158. package/.claude/hooks/ntfy-on-question.py +0 -240
  159. package/.claude/hooks/orchestrator-completion.py +0 -313
  160. package/.claude/hooks/orchestrator-handoff.py +0 -267
  161. package/.claude/hooks/orchestrator-session-startup.py +0 -146
  162. package/.claude/hooks/run-code-review.py +0 -393
  163. package/.claude/hooks/session-logger.py +0 -323
  164. package/.claude/hooks/test-orchestrator-reground.py +0 -248
  165. package/.claude/hooks/track-scope-coverage.py +0 -220
  166. package/.claude/hooks/track-token-usage.py +0 -121
  167. package/.claude/hooks/update-api-showcase.py +0 -161
  168. package/.claude/hooks/update-registry.py +0 -352
  169. package/.claude/hooks/update-ui-showcase.py +0 -224
  170. package/.claude/test-auto-answer-bot.py +0 -183
  171. package/.claude/test-completion-detector.py +0 -263
  172. package/.claude/test-orchestrator-state.json +0 -20
  173. package/.claude/test-orchestrator.sh +0 -271
  174. /package/{.claude/commands → commands}/hustle-build.md +0 -0
  175. /package/{.claude/hooks → hooks}/lib/__pycache__/__init__.cpython-314.pyc +0 -0
  176. /package/{.claude/hooks → hooks}/lib/__pycache__/greptile.cpython-314.pyc +0 -0
  177. /package/{.claude/hooks → hooks}/lib/__pycache__/ntfy.cpython-314.pyc +0 -0
  178. /package/{.claude/hooks → hooks}/project-document-prompt.py +0 -0
  179. /package/{.claude/hooks → hooks}/remote-question-proxy.py +0 -0
  180. /package/{.claude/hooks → hooks}/update-testing-checklist.py +0 -0
@@ -0,0 +1,351 @@
1
+ ---
2
+ name: adr-deep-research
3
+ description: Research technology options for Architecture Decision Records. Spawns parallel agents to fetch official docs, extract pros/cons, pricing, and best-use cases. Creates substantive ADRs before interview phase.
4
+ license: MIT
5
+ compatibility: Requires Claude Code with MCP servers (Context7, GitHub), Python 3.9+ for hooks
6
+ metadata:
7
+ version: "1.0.0"
8
+ category: "research"
9
+ tags: ['adr', 'research', 'architecture', 'decisions']
10
+ author: "Hustle Together"
11
+ allowed-tools: WebSearch WebFetch mcp__context7 Task Read Write Edit TodoWrite
12
+ ---
13
+
14
+ # ADR Deep Research - Technology Option Investigation
15
+
16
+ **Usage:** `/adr-deep-research [category]`
17
+
18
+ **Purpose:** Research each option for an Architecture Decision Record with real documentation, creating substantive pros/cons before the interview phase.
19
+
20
+ ## When This Skill Runs
21
+
22
+ This skill is triggered when:
23
+
24
+ 1. `generate-adr-options.py` hook detects a significant decision during research
25
+ 2. A pending request exists in `.claude/adr-requests/pending-{category}.json`
26
+ 3. User needs informed choices before the interview phase
27
+
28
+ ## What It Does
29
+
30
+ ```
31
+ ┌─────────────────────────────────────────────────────────────────┐
32
+ │ ADR DEEP RESEARCH FLOW │
33
+ ├─────────────────────────────────────────────────────────────────┤
34
+ │ │
35
+ │ 1. Read pending request: │
36
+ │ .claude/adr-requests/pending-database.json │
37
+ │ { │
38
+ │ "category": "database", │
39
+ │ "options": ["supabase", "firebase", "postgres"], │
40
+ │ "context": "User building todo app with React" │
41
+ │ } │
42
+ │ │
43
+ │ 2. Spawn parallel adr-researcher agents (one per option): │
44
+ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
45
+ │ │ Agent #1 │ │ Agent #2 │ │ Agent #3 │ │
46
+ │ │ supabase │ │ firebase │ │ postgres │ │
47
+ │ │ → docs │ │ → docs │ │ → docs │ │
48
+ │ │ → pros/cons │ │ → pros/cons │ │ → pros/cons │ │
49
+ │ └──────────────┘ └──────────────┘ └──────────────┘ │
50
+ │ │
51
+ │ 3. Merge results into ADR document: │
52
+ │ .claude/adrs/ADR-NNNN-database-choice.md │
53
+ │ - Real pros/cons from official docs │
54
+ │ - Pricing information │
55
+ │ - Best-for recommendations │
56
+ │ - Source URLs for verification │
57
+ │ │
58
+ │ 4. Update state and registry: │
59
+ │ - Mark request as processed │
60
+ │ - Add ADR to registry │
61
+ │ - Inject context for interview │
62
+ │ │
63
+ └─────────────────────────────────────────────────────────────────┘
64
+ ```
65
+
66
+ ## Process Steps
67
+
68
+ ### Step 1: Read Pending Request
69
+
70
+ ```bash
71
+ # Check for pending request
72
+ cat .claude/adr-requests/pending-{category}.json
73
+ ```
74
+
75
+ Expected format:
76
+
77
+ ```json
78
+ {
79
+ "category": "database",
80
+ "options": ["supabase", "firebase", "postgres"],
81
+ "context": "User building todo app with React frontend",
82
+ "endpoint": "todo-api",
83
+ "status": "pending",
84
+ "created_at": "2025-12-30T10:00:00Z"
85
+ }
86
+ ```
87
+
88
+ ### Step 2: Spawn Parallel Research Agents
89
+
90
+ For each option in the request, spawn an `adr-researcher` agent in parallel:
91
+
92
+ ```
93
+ Use Task tool with subagent_type="adr-researcher" for each option.
94
+
95
+ Spawn ALL agents in a SINGLE message (parallel execution).
96
+ ```
97
+
98
+ **Agent prompt template:**
99
+
100
+ ```
101
+ Research the following technology option for an ADR decision:
102
+
103
+ Option: {option}
104
+ Category: {category}
105
+ Context: {context}
106
+ Comparison Options: {other_options}
107
+
108
+ Return structured JSON with:
109
+ - pros (3-5 specific, factual)
110
+ - cons (3-5 specific, factual)
111
+ - best_for (1-2 ideal use cases)
112
+ - pricing (free tier, paid tiers)
113
+ - limitations (technical constraints)
114
+ - sources (documentation URLs)
115
+ ```
116
+
117
+ ### Step 3: Collect and Merge Results
118
+
119
+ Wait for all agents to complete, then merge results into a unified ADR:
120
+
121
+ ```markdown
122
+ # ADR-{NNNN}: {Category} Choice
123
+
124
+ **Status:** PROPOSED
125
+ **Date:** {date}
126
+ **Category:** {category}
127
+ **Context:** {context}
128
+ **Endpoint:** {endpoint}
129
+
130
+ ## Options Considered
131
+
132
+ ### Option 1: {Option A} (Recommended)
133
+
134
+ **Pros:**
135
+ - {Real pro from research}
136
+ - {Real pro from research}
137
+ - {Real pro from research}
138
+
139
+ **Cons:**
140
+ - {Real con from research}
141
+ - {Real con from research}
142
+
143
+ **Best For:** {Use cases from research}
144
+
145
+ **Pricing:** {Pricing from research}
146
+
147
+ **Source:** {URL from research}
148
+
149
+ ### Option 2: {Option B}
150
+
151
+ ... (same structure)
152
+
153
+ ## Decision
154
+
155
+ _Awaiting user selection in interview phase_
156
+
157
+ ## Consequences
158
+
159
+ _Will be filled after decision is made_
160
+ ```
161
+
162
+ ### Step 4: Determine Recommendation
163
+
164
+ Based on research, mark ONE option as `(Recommended)` using these criteria:
165
+
166
+ 1. **Match to context** - Which fits user's stated project best?
167
+ 2. **Developer experience** - Which has better docs, easier setup?
168
+ 3. **Cost effectiveness** - Which has best free tier for MVPs?
169
+ 4. **Community/support** - Which has more active community?
170
+
171
+ ### Step 5: Update State and Registry
172
+
173
+ Mark request as processed:
174
+
175
+ ```json
176
+ {
177
+ "status": "completed",
178
+ "completed_at": "2025-12-30T10:15:00Z",
179
+ "adr_file": ".claude/adrs/ADR-0001-database-choice.md"
180
+ }
181
+ ```
182
+
183
+ Add to registry:
184
+
185
+ ```json
186
+ {
187
+ "adrs": {
188
+ "0001-database-choice": {
189
+ "number": 1,
190
+ "title": "Database Choice",
191
+ "status": "proposed",
192
+ "date": "2025-12-30",
193
+ "category": "database",
194
+ "options_considered": ["supabase", "firebase", "postgres"],
195
+ "recommended": "supabase",
196
+ "file": ".claude/adrs/ADR-0001-database-choice.md",
197
+ "endpoint": "todo-api"
198
+ }
199
+ }
200
+ }
201
+ ```
202
+
203
+ ### Step 6: Output Summary
204
+
205
+ ```
206
+ ═══════════════════════════════════════════════════════════════════
207
+ ADR RESEARCH COMPLETE
208
+ ═══════════════════════════════════════════════════════════════════
209
+
210
+ Category: database
211
+ Options Researched: 3
212
+ • Supabase (Recommended)
213
+ • Firebase
214
+ • PostgreSQL + Prisma
215
+
216
+ ADR Created: .claude/adrs/ADR-0001-database-choice.md
217
+
218
+ Key Findings:
219
+ ───────────────────────────────────────
220
+ Supabase: Real-time + Auth built-in, free tier generous
221
+ Firebase: Google ecosystem, NoSQL only
222
+ PostgreSQL: Full control, more setup required
223
+ ───────────────────────────────────────
224
+
225
+ This ADR will be referenced during the interview phase.
226
+ The user can review options and select their preference.
227
+
228
+ ═══════════════════════════════════════════════════════════════════
229
+ ```
230
+
231
+ ## ADR Output Template
232
+
233
+ Use this template for the generated ADR:
234
+
235
+ ```markdown
236
+ # ADR-{NUMBER}: {Title}
237
+
238
+ **Status:** PROPOSED | ACCEPTED | DEPRECATED | SUPERSEDED
239
+ **Date:** YYYY-MM-DD
240
+ **Category:** {category}
241
+ **Context:** {user's project context}
242
+ **Endpoint:** {related endpoint if any}
243
+
244
+ ## Context
245
+
246
+ {Why this decision needs to be made}
247
+
248
+ ## Options Considered
249
+
250
+ ### Option 1: {Name} (Recommended)
251
+
252
+ **Pros:**
253
+ - {Specific, factual pro with detail}
254
+ - {Specific, factual pro with detail}
255
+ - {Specific, factual pro with detail}
256
+
257
+ **Cons:**
258
+ - {Specific, factual con with detail}
259
+ - {Specific, factual con with detail}
260
+
261
+ **Best For:** {Ideal use cases}
262
+
263
+ **Pricing:**
264
+ - Free: {limits}
265
+ - Paid: {tiers}
266
+
267
+ **Source:** {URL}
268
+
269
+ ### Option 2: {Name}
270
+
271
+ {Same structure}
272
+
273
+ ### Option 3: {Name}
274
+
275
+ {Same structure}
276
+
277
+ ## Decision
278
+
279
+ _Awaiting user selection in interview phase_
280
+
281
+ ## Consequences
282
+
283
+ _Will be filled after decision is made_
284
+
285
+ ## Research Metadata
286
+
287
+ | Aspect | Details |
288
+ |--------|---------|
289
+ | Researched | {timestamp} |
290
+ | Sources | {count} official docs |
291
+ | Agents | {count} parallel researchers |
292
+ | Duration | {time} |
293
+ ```
294
+
295
+ ## Configuration
296
+
297
+ ADR categories and keywords are configured in `.claude/hustle-build-defaults.json`:
298
+
299
+ ```json
300
+ {
301
+ "adr": {
302
+ "enabled": true,
303
+ "significant_decisions": {
304
+ "database": ["supabase", "firebase", "postgres", "mysql", "mongodb"],
305
+ "auth": ["api key", "oauth", "jwt", "session", "cookie"],
306
+ "cache": ["redis", "memcached", "in-memory", "cdn"],
307
+ "hosting": ["vercel", "netlify", "aws", "cloudflare"],
308
+ "state": ["redux", "zustand", "jotai", "context"],
309
+ "styling": ["tailwind", "css modules", "styled-components"]
310
+ },
311
+ "min_options_for_adr": 2
312
+ }
313
+ }
314
+ ```
315
+
316
+ ## Directory Structure
317
+
318
+ ```
319
+ .claude/
320
+ ├── adr-requests/
321
+ │ ├── pending-database.json # Awaiting research
322
+ │ ├── pending-auth.json # Awaiting research
323
+ │ └── completed-database.json # Research done
324
+ ├── adrs/
325
+ │ ├── ADR-0001-database-choice.md
326
+ │ ├── ADR-0002-auth-method.md
327
+ │ └── index.json # ADR catalog
328
+ └── registry.json # Includes adrs section
329
+ ```
330
+
331
+ ## Integration Points
332
+
333
+ - **Triggered by:** `hooks/generate-adr-options.py` (PostToolUse)
334
+ - **Uses agent:** `.claude/agents/adr-researcher.md`
335
+ - **Updates:** `.claude/registry.json` with ADR entries
336
+ - **Referenced by:** `/api-interview` for informed user choices
337
+
338
+ ## Error Handling
339
+
340
+ | Error | Action |
341
+ |-------|--------|
342
+ | No pending request | Log warning, exit gracefully |
343
+ | Agent fails | Use fallback research (WebSearch directly) |
344
+ | Partial results | Create ADR with available data, mark incomplete |
345
+ | Rate limited | Retry with backoff, continue with other options |
346
+
347
+ ## See Also
348
+
349
+ - `/api-research` - General API documentation research
350
+ - `/api-interview` - Interview phase that uses ADR context
351
+ - `docs/ARCHITECTURE_DECISION_RECORDS.md` - Full ADR documentation
@@ -40,12 +40,18 @@ When `--auto` flag is used:
40
40
  - Always generates ALL documentation
41
41
  - Prefers "Yes" over "No" for optional features
42
42
 
43
- 3. **Error Handling:**
44
- - Test failures: Retry 3x, then log and continue
45
- - Verification gaps: Log gap, continue (will review later)
46
- - Missing API keys: Log warning, continue if possible
47
-
48
- 4. **Logging:**
43
+ 3. **Phase Execution:**
44
+ - ALL phases MUST execute - no skipping in auto mode
45
+ - Phase 10 (Verify): MUST re-research and compare to implementation
46
+ - Phase 11 (Code Review): Run if GREPTILE_API_KEY exists, else mark "no API key" but still complete
47
+ - Phase 12 (Refactor): MUST run basic refactoring even if no review issues
48
+
49
+ 4. **Error Handling:**
50
+ - Test failures: Retry 3x, then fix issues
51
+ - Verification gaps: Add tests to cover gaps, then fix
52
+ - Missing API keys: Log warning but complete the phase
53
+
54
+ 5. **Logging:**
49
55
  - All decisions logged to `.claude/workflow-logs/api-create/[workflow-id].json`
50
56
  - Review with `/api-create-review [workflow-id]`
51
57
 
@@ -245,7 +251,7 @@ TodoWrite([
245
251
  │ "header": "Disambig", │
246
252
  │ "multiSelect": false, │
247
253
  │ "options": [ │
248
- │ {"label": "REST API", "description": "Official API"},│
254
+ │ {"label": "REST API (Recommended)", "description": "Official API"},│
249
255
  │ {"label": "SDK/Package", "description": "NPM wrapper"},│
250
256
  │ {"label": "Both", "description": "API + SDK"} │
251
257
  │ ] │
@@ -270,7 +276,7 @@ TodoWrite([
270
276
  │ Is this correct?", │
271
277
  │ header: "Scope", │
272
278
  │ options: [ │
273
- │ "Yes, proceed",
279
+ │ "Yes, proceed (Recommended)",
274
280
  │ "I have modifications to add", │
275
281
  │ "No, let me clarify the purpose" │
276
282
  │ ] │
@@ -325,7 +331,7 @@ TodoWrite([
325
331
  │ for more?", │
326
332
  │ header: "Research", │
327
333
  │ options: [ │
328
- │ "Proceed to interview",
334
+ │ "Proceed to interview (Recommended)",
329
335
  │ "Search more - I need [specific topic]", │
330
336
  │ "Search for something specific (I'll describe)" │
331
337
  │ ] │
@@ -377,7 +383,7 @@ TodoWrite([
377
383
  │ [summary]. All correct?", │
378
384
  │ header: "Confirm", │
379
385
  │ options: [ │
380
- │ "Yes, proceed to schema",
386
+ │ "Yes, proceed to schema (Recommended)",
381
387
  │ "Change an answer", │
382
388
  │ "Add another question" │
383
389
  │ ] │
@@ -401,7 +407,7 @@ TodoWrite([
401
407
  │ want to research: [list]. Approve?", │
402
408
  │ header: "Deep Research", │
403
409
  │ options: [ │
404
- │ "Yes, run these searches",
410
+ │ "Yes, run these searches (Recommended)",
405
411
  │ "Add more - I also need [topic]", │
406
412
  │ "Skip deep research, proceed to schema" │
407
413
  │ ] │
@@ -427,7 +433,7 @@ TodoWrite([
427
433
  │ requirements?", │
428
434
  │ header: "Schema", │
429
435
  │ options: [ │
430
- │ "Yes, schema looks correct",
436
+ │ "Yes, schema looks correct (Recommended)",
431
437
  │ "No, I need changes (I'll describe)", │
432
438
  │ "Let's redo the interview" │
433
439
  │ ] │
@@ -451,7 +457,7 @@ TodoWrite([
451
457
  │ [M] missing. Ready to start TDD?", │
452
458
  │ header: "Environment", │
453
459
  │ options: [ │
454
- │ "Yes, ready to write tests",
460
+ │ "Yes, ready to write tests (Recommended)",
455
461
  │ "No, need to set up API keys first", │
456
462
  │ "No, need to fix something else" │
457
463
  │ ] │
@@ -476,7 +482,7 @@ TodoWrite([
476
482
  │ Approve this test plan?", │
477
483
  │ header: "Tests", │
478
484
  │ options: [ │
479
- │ "Yes, write these tests",
485
+ │ "Yes, write these tests (Recommended)",
480
486
  │ "Add more scenarios (I'll describe)", │
481
487
  │ "Change a scenario (I'll describe)" │
482
488
  │ ] │
@@ -515,7 +521,7 @@ TodoWrite([
515
521
  │ How should I proceed?", │
516
522
  │ header: "Verify", │
517
523
  │ options: [ │
518
- │ "Fix gaps - loop back to Red phase", │
524
+ │ "Fix gaps - loop back to Red phase (Recommended)",│
519
525
  │ "Skip - these are intentional omissions", │
520
526
  │ "Fix some, skip others (I'll specify)" │
521
527
  │ ] │
@@ -551,7 +557,7 @@ TodoWrite([
551
557
  │ header: "Review", │
552
558
  │ multiSelect: false, │
553
559
  │ options: [ │
554
- │ {"label": "Fix all issues", "description": "Address each issue in Phase 12"},│
560
+ │ {"label": "Fix all issues (Recommended)", "description": "Address each issue in Phase 12"},│
555
561
  │ {"label": "Fix critical only", "description": "Skip medium/low priority"},│
556
562
  │ {"label": "Skip review", "description": "Proceed without fixes (not recommended)"}│
557
563
  │ ] │
@@ -590,7 +596,7 @@ TodoWrite([
590
596
  │ header: "Docs", │
591
597
  │ multiSelect: false, │
592
598
  │ options: [ │
593
- │ {"label": "Yes, complete", "description": "All docs updated"},│
599
+ │ {"label": "Yes, complete (Recommended)", "description": "All docs updated"},│
594
600
  │ {"label": "Need to add more", "description": "I'll describe what's missing"},│
595
601
  │ {"label": "Skip for now", "description": "Not recommended"}│
596
602
  │ ] │
@@ -696,13 +702,21 @@ This command creates:
696
702
  7. **API Keys**: Support three methods (env, NEXT*PUBLIC*, custom headers)
697
703
  8. **Test Command**: `pnpm test:run` before commits
698
704
 
699
- ## Never Skip
705
+ ## Never Skip (Even in --auto mode)
706
+
707
+ **CRITICAL: ALL phases must execute - auto mode only auto-answers questions, it does NOT skip phases.**
700
708
 
701
709
  - Phase 1 (Disambiguation) - Clarify before research
702
710
  - Phase 3 (Initial Research) - Find ALL parameters
703
711
  - Phase 4 (Interview) - Questions FROM research, not templates
712
+ - Phase 5 (Deep Research) - Only skip if truly comprehensive initial research
704
713
  - Phase 8 (TDD Red) - Failing tests FIRST
705
- - Phase 10 (Verify) - Re-research after Green
706
- - Phase 12 (Documentation) - Keep docs in sync
714
+ - Phase 10 (Verify) - MUST re-research after Green - this catches memory errors
715
+ - Phase 11 (Code Review) - Run if API key exists, else document "no key" but complete phase
716
+ - Phase 12 (Refactor) - MUST run even if no review issues - always optimize
717
+ - Phase 13 (Documentation) - Keep docs in sync
718
+ - Phase 14 (Completion) - Always run final verification
707
719
  - Coverage verification - 100% required
720
+
721
+ **If a phase can't fully complete (e.g., missing API key), mark it as "partial" not "skipped".**
708
722
  </claude-commands-template>
@@ -42,6 +42,103 @@ Run 2-3 targeted searches:
42
42
  - WebSearch: "site:[domain] api reference" (if known domain)
43
43
  ```
44
44
 
45
+ ### Table of Contents Scraping (CRITICAL)
46
+
47
+ **Always fetch and parse the documentation Table of Contents first!**
48
+
49
+ ```
50
+ ┌─────────────────────────────────────────────────────────────────┐
51
+ │ TOC DISCOVERY FLOW │
52
+ ├─────────────────────────────────────────────────────────────────┤
53
+ │ │
54
+ │ Step 1: Find Docs Root │
55
+ │ ├─ WebSearch: "[name] documentation" │
56
+ │ └─ Extract: docs.example.com or example.com/docs │
57
+ │ │
58
+ │ Step 2: Fetch TOC Page │
59
+ │ ├─ WebFetch: docs.example.com + look for sidebar/nav │
60
+ │ ├─ WebFetch: docs.example.com/api-reference │
61
+ │ └─ WebFetch: docs.example.com/sitemap.xml (if available) │
62
+ │ │
63
+ │ Step 3: Extract All Sections │
64
+ │ ├─ Getting Started │
65
+ │ ├─ Authentication │
66
+ │ ├─ API Reference │
67
+ │ │ ├─ Endpoints │
68
+ │ │ ├─ Parameters │
69
+ │ │ ├─ Response Codes │
70
+ │ │ └─ Webhooks │
71
+ │ ├─ SDKs & Libraries │
72
+ │ ├─ Rate Limits │
73
+ │ ├─ Errors │
74
+ │ └─ Changelog │
75
+ │ │
76
+ │ Step 4: Prioritize for Interview │
77
+ │ ├─ Which sections have parameters we need to ask about? │
78
+ │ ├─ Which sections have optional features? │
79
+ │ └─ Which sections have configuration options? │
80
+ │ │
81
+ └─────────────────────────────────────────────────────────────────┘
82
+ ```
83
+
84
+ ### Comprehensive Discovery Checklist
85
+
86
+ Before proceeding to interview, ensure we've discovered:
87
+
88
+ ```markdown
89
+ ## Pre-Interview Discovery Checklist
90
+
91
+ ### Authentication & Authorization
92
+ - [ ] Auth method (API key, OAuth, Bearer token, Basic)
93
+ - [ ] Where to get credentials (dashboard URL)
94
+ - [ ] Token refresh mechanism
95
+ - [ ] Scopes/permissions available
96
+
97
+ ### Endpoints
98
+ - [ ] All available endpoints listed
99
+ - [ ] HTTP methods for each
100
+ - [ ] Path parameters identified
101
+ - [ ] Query parameters with types
102
+ - [ ] Request body schemas
103
+
104
+ ### Parameters (CRITICAL for Interview)
105
+ - [ ] Required vs optional distinction
106
+ - [ ] Parameter types (string, number, enum, array)
107
+ - [ ] Enum values listed
108
+ - [ ] Default values documented
109
+ - [ ] Validation rules/constraints
110
+ - [ ] Continuous parameters (ranges for testing)
111
+
112
+ ### Response Schemas
113
+ - [ ] Success response structure
114
+ - [ ] Error response format
115
+ - [ ] HTTP status codes used
116
+ - [ ] Pagination format
117
+
118
+ ### Rate Limits & Quotas
119
+ - [ ] Requests per minute/hour/day
120
+ - [ ] Rate limit headers
121
+ - [ ] Retry behavior
122
+ - [ ] Quota types (per key, per user)
123
+
124
+ ### Webhooks (if applicable)
125
+ - [ ] Available webhook events
126
+ - [ ] Payload structure
127
+ - [ ] Signature verification
128
+ - [ ] Retry behavior
129
+
130
+ ### SDKs & Libraries
131
+ - [ ] Official SDK availability
132
+ - [ ] npm/pip/cargo package names
133
+ - [ ] TypeScript types available?
134
+ - [ ] Version compatibility
135
+
136
+ ### Errors
137
+ - [ ] Error code catalog
138
+ - [ ] Error message format
139
+ - [ ] Troubleshooting steps
140
+ ```
141
+
45
142
  Present initial summary:
46
143
 
47
144
  ```
@@ -367,4 +464,37 @@ All research is tracked in `.claude/api-dev-state.json`:
367
464
  - Phase 5 uses adaptive proposal flow
368
465
  - Phase 10 (Verify) triggers re-research
369
466
  - Freshness check prevents stale data
467
+
468
+ ## ADR Integration (Automatic)
469
+
470
+ When research discovers **multiple options for a significant decision**, the
471
+ `generate-adr-options.py` hook automatically:
472
+
473
+ 1. Detects significant decisions (database, auth, cache, hosting, etc.)
474
+ 2. Creates a research request in `.claude/adr-requests/pending-{category}.json`
475
+ 3. Injects context telling you to run `/adr-deep-research {category}`
476
+
477
+ **You should then run the deep research skill to:**
478
+
479
+ - Spawn parallel agents to research each option
480
+ - Fetch official documentation for each technology
481
+ - Extract real pros, cons, pricing, and best-use cases
482
+ - Create a substantive ADR before the interview phase
483
+
484
+ ```
485
+ Example Flow:
486
+ 1. /api-research supabase
487
+ → Hook detects: database options (supabase, firebase, postgres)
488
+ → Creates: .claude/adr-requests/pending-database.json
489
+ → Injects: "Run /adr-deep-research database"
490
+
491
+ 2. /adr-deep-research database
492
+ → Spawns 3 parallel agents (one per option)
493
+ → Each agent fetches docs, extracts pros/cons
494
+ → Creates: .claude/adrs/ADR-0001-database-choice.md (with real content)
495
+
496
+ 3. Interview phase references ADR for informed decision
497
+ ```
498
+
499
+ See `/adr-deep-research` skill and `docs/ARCHITECTURE_DECISION_RECORDS.md`.
370
500
  </claude-commands-template>