@hustle-together/api-dev-tools 3.10.1 → 3.12.1

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 (178) hide show
  1. package/.claude/agents/code-reviewer.md +170 -0
  2. package/.claude/agents/docs-generator.md +80 -0
  3. package/.claude/agents/implementation-reviewer.md +119 -0
  4. package/.claude/agents/parallel-researcher.md +52 -0
  5. package/.claude/agents/research-validator.md +116 -0
  6. package/.claude/agents/schema-generator.md +70 -0
  7. package/.claude/agents/test-writer.md +104 -0
  8. package/.claude/api-dev-state.json +331 -0
  9. package/.claude/commands/README.md +196 -0
  10. package/.claude/commands/add-command.md +212 -0
  11. package/.claude/commands/api-create.md +510 -0
  12. package/.claude/commands/api-env.md +51 -0
  13. package/.claude/commands/api-interview.md +344 -0
  14. package/.claude/commands/api-research.md +357 -0
  15. package/.claude/commands/api-status.md +279 -0
  16. package/.claude/commands/api-verify.md +232 -0
  17. package/.claude/commands/beepboop.md +96 -0
  18. package/.claude/commands/busycommit.md +111 -0
  19. package/.claude/commands/commit.md +82 -0
  20. package/.claude/commands/cycle.md +137 -0
  21. package/.claude/commands/gap.md +85 -0
  22. package/.claude/commands/green.md +137 -0
  23. package/.claude/commands/issue.md +187 -0
  24. package/.claude/commands/ntfy-setup.md +91 -0
  25. package/.claude/commands/ntfy-test.md +74 -0
  26. package/.claude/commands/plan.md +167 -0
  27. package/.claude/commands/pr.md +121 -0
  28. package/.claude/commands/publish.md +40 -0
  29. package/.claude/commands/red.md +137 -0
  30. package/.claude/commands/refactor.md +137 -0
  31. package/.claude/commands/spike.md +137 -0
  32. package/.claude/commands/summarize.md +93 -0
  33. package/.claude/commands/tdd.md +139 -0
  34. package/.claude/commands/worktree-add.md +307 -0
  35. package/.claude/commands/worktree-cleanup.md +275 -0
  36. package/.claude/hooks/api-workflow-check.py +227 -0
  37. package/.claude/hooks/enforce-deep-research.py +185 -0
  38. package/.claude/hooks/enforce-disambiguation.py +155 -0
  39. package/.claude/hooks/enforce-documentation.py +192 -0
  40. package/.claude/hooks/enforce-environment.py +253 -0
  41. package/.claude/hooks/enforce-external-research.py +328 -0
  42. package/.claude/hooks/enforce-interview.py +421 -0
  43. package/.claude/hooks/enforce-refactor.py +189 -0
  44. package/.claude/hooks/enforce-research.py +159 -0
  45. package/.claude/hooks/enforce-schema.py +186 -0
  46. package/.claude/hooks/enforce-scope.py +160 -0
  47. package/.claude/hooks/enforce-tdd-red.py +250 -0
  48. package/.claude/hooks/enforce-verify.py +186 -0
  49. package/.claude/hooks/periodic-reground.py +154 -0
  50. package/.claude/hooks/session-startup.py +151 -0
  51. package/.claude/hooks/track-tool-use.py +626 -0
  52. package/.claude/hooks/verify-after-green.py +282 -0
  53. package/.claude/hooks/verify-implementation.py +225 -0
  54. package/.claude/research/index.json +6 -0
  55. package/.claude/settings.json +144 -0
  56. package/.claude/settings.local.json +12 -0
  57. package/.claude-plugin/marketplace.json +103 -0
  58. package/.skills/README.md +293 -0
  59. package/.skills/_shared/convert-commands.py +192 -0
  60. package/.skills/_shared/hooks/api-workflow-check.py +227 -0
  61. package/.skills/_shared/hooks/enforce-deep-research.py +185 -0
  62. package/.skills/_shared/hooks/enforce-disambiguation.py +155 -0
  63. package/.skills/_shared/hooks/enforce-documentation.py +192 -0
  64. package/.skills/_shared/hooks/enforce-environment.py +253 -0
  65. package/.skills/_shared/hooks/enforce-external-research.py +328 -0
  66. package/.skills/_shared/hooks/enforce-interview.py +421 -0
  67. package/.skills/_shared/hooks/enforce-refactor.py +189 -0
  68. package/.skills/_shared/hooks/enforce-research.py +159 -0
  69. package/.skills/_shared/hooks/enforce-schema.py +186 -0
  70. package/.skills/_shared/hooks/enforce-scope.py +160 -0
  71. package/.skills/_shared/hooks/enforce-tdd-red.py +250 -0
  72. package/.skills/_shared/hooks/enforce-verify.py +186 -0
  73. package/.skills/_shared/hooks/periodic-reground.py +154 -0
  74. package/.skills/_shared/hooks/session-startup.py +151 -0
  75. package/.skills/_shared/hooks/track-tool-use.py +626 -0
  76. package/.skills/_shared/hooks/verify-after-green.py +282 -0
  77. package/.skills/_shared/hooks/verify-implementation.py +225 -0
  78. package/.skills/_shared/install.sh +114 -0
  79. package/.skills/_shared/settings.json +93 -0
  80. package/.skills/add-command/SKILL.md +227 -0
  81. package/.skills/api-create/SKILL.md +623 -0
  82. package/.skills/api-env/SKILL.md +64 -0
  83. package/.skills/api-interview/SKILL.md +357 -0
  84. package/.skills/api-research/SKILL.md +370 -0
  85. package/.skills/api-status/SKILL.md +292 -0
  86. package/.skills/api-verify/SKILL.md +245 -0
  87. package/.skills/beepboop/SKILL.md +111 -0
  88. package/.skills/busycommit/SKILL.md +126 -0
  89. package/.skills/commit/SKILL.md +97 -0
  90. package/.skills/cycle/SKILL.md +152 -0
  91. package/.skills/gap/SKILL.md +100 -0
  92. package/.skills/green/SKILL.md +152 -0
  93. package/.skills/issue/SKILL.md +202 -0
  94. package/.skills/plan/SKILL.md +182 -0
  95. package/.skills/pr/SKILL.md +136 -0
  96. package/.skills/publish/SKILL.md +160 -0
  97. package/.skills/red/SKILL.md +152 -0
  98. package/.skills/refactor/SKILL.md +152 -0
  99. package/.skills/spike/SKILL.md +152 -0
  100. package/.skills/summarize/SKILL.md +108 -0
  101. package/.skills/tdd/SKILL.md +154 -0
  102. package/.skills/update-todos/SKILL.md +250 -0
  103. package/.skills/worktree-add/SKILL.md +322 -0
  104. package/.skills/worktree-cleanup/SKILL.md +290 -0
  105. package/CHANGELOG.md +115 -0
  106. package/README.md +161 -7101
  107. package/bin/cli.js +448 -805
  108. package/commands/README.md +66 -31
  109. package/commands/add-command.md +8 -5
  110. package/commands/beepboop.md +4 -5
  111. package/commands/busycommit.md +2 -3
  112. package/commands/commit.md +2 -3
  113. package/commands/cycle.md +2 -7
  114. package/commands/gap.md +2 -3
  115. package/commands/green.md +2 -7
  116. package/commands/hustle-api-continue.md +8 -5
  117. package/commands/hustle-api-create.md +70 -29
  118. package/commands/hustle-api-env.md +1 -0
  119. package/commands/hustle-api-interview.md +32 -19
  120. package/commands/hustle-api-research.md +47 -21
  121. package/commands/hustle-api-sessions.md +8 -7
  122. package/commands/hustle-api-status.md +21 -1
  123. package/commands/hustle-api-verify.md +14 -13
  124. package/commands/hustle-combine.md +488 -241
  125. package/commands/hustle-ui-create-page.md +113 -50
  126. package/commands/hustle-ui-create.md +179 -26
  127. package/commands/issue.md +3 -8
  128. package/commands/plan.md +2 -3
  129. package/commands/pr.md +2 -3
  130. package/commands/red.md +2 -7
  131. package/commands/refactor.md +2 -7
  132. package/commands/spike.md +2 -7
  133. package/commands/summarize.md +2 -3
  134. package/commands/tdd.md +2 -7
  135. package/commands/worktree-add.md +208 -216
  136. package/commands/worktree-cleanup.md +172 -178
  137. package/hooks/api-workflow-check.py +5 -3
  138. package/hooks/enforce-component-type-confirm.py +97 -0
  139. package/hooks/lib/__init__.py +1 -0
  140. package/hooks/lib/greptile.py +355 -0
  141. package/hooks/lib/ntfy.py +209 -0
  142. package/hooks/notify-input-needed.py +73 -0
  143. package/hooks/notify-phase-complete.py +90 -0
  144. package/hooks/run-code-review.py +246 -0
  145. package/hooks/track-token-usage.py +121 -0
  146. package/package.json +33 -12
  147. package/scripts/collect-test-results.ts +102 -77
  148. package/scripts/extract-parameters.ts +112 -70
  149. package/scripts/generate-test-manifest.ts +118 -77
  150. package/templates/.env.example +57 -0
  151. package/templates/BRAND_GUIDE.md +92 -52
  152. package/templates/CLAUDE-SECTION.md +40 -37
  153. package/templates/SPEC.json +186 -38
  154. package/templates/api-dev-state.json +33 -4
  155. package/templates/api-showcase/_components/APICard.tsx +22 -18
  156. package/templates/api-showcase/_components/APIModal.tsx +110 -64
  157. package/templates/api-showcase/_components/APIShowcase.tsx +53 -35
  158. package/templates/api-showcase/_components/APITester.tsx +128 -67
  159. package/templates/api-showcase/page.tsx +4 -4
  160. package/templates/api-test/page.tsx +51 -30
  161. package/templates/api-test/test-structure/route.ts +43 -34
  162. package/templates/component/Component.stories.tsx +41 -39
  163. package/templates/component/Component.test.tsx +96 -78
  164. package/templates/component/Component.tsx +63 -52
  165. package/templates/component/Component.types.ts +10 -6
  166. package/templates/component/Component.visual.spec.ts +170 -0
  167. package/templates/component/index.ts +2 -2
  168. package/templates/dev-tools/_components/DevToolsLanding.tsx +8 -8
  169. package/templates/dev-tools/page.tsx +4 -3
  170. package/templates/mcp-servers.json +30 -2
  171. package/templates/page/page.e2e.test.ts +56 -48
  172. package/templates/page/page.tsx +3 -3
  173. package/templates/shared/HeroHeader.tsx +16 -15
  174. package/templates/shared/index.ts +1 -1
  175. package/templates/ui-showcase/_components/PreviewCard.tsx +20 -20
  176. package/templates/ui-showcase/_components/PreviewModal.tsx +149 -108
  177. package/templates/ui-showcase/_components/UIShowcase.tsx +43 -35
  178. package/templates/ui-showcase/page.tsx +4 -4
@@ -0,0 +1,344 @@
1
+ # API Interview - Research-Driven Dynamic Discovery v3.0
2
+
3
+ **Usage:** `/api-interview [endpoint-name]`
4
+
5
+ **Purpose:** Conduct structured interview where questions are GENERATED FROM research findings, not generic templates. Every question is specific to the discovered API capabilities.
6
+
7
+ ## Key Principle: Questions FROM Research
8
+
9
+ **OLD WAY (Generic Templates):**
10
+
11
+ ```
12
+ "Which AI provider should this endpoint support?"
13
+ - OpenAI
14
+ - Anthropic
15
+ - Google
16
+ ```
17
+
18
+ **NEW WAY (From Research):**
19
+
20
+ ```
21
+ Based on research, Brandfetch API has 7 parameters:
22
+
23
+ 1. DOMAIN (required) - string
24
+ → No question needed (always required)
25
+
26
+ 2. FORMAT: ["json", "svg", "png", "raw"]
27
+ Q: Which formats do you need?
28
+ [x] json [x] svg [x] png [ ] raw
29
+
30
+ 3. QUALITY: 1-100 (continuous range)
31
+ Q: How should we TEST this continuous parameter?
32
+ [ ] All values (100 tests)
33
+ [x] Boundary (1, 50, 100)
34
+ [ ] Sample (1, 25, 50, 75, 100)
35
+ [ ] Custom: ____
36
+ ```
37
+
38
+ ## Interview Flow
39
+
40
+ ### PREREQUISITE - Research Must Be Complete (Phase 3)
41
+
42
+ **Interview is BLOCKED until research is done.**
43
+
44
+ The interview READS from the research findings:
45
+
46
+ ```
47
+ State file shows:
48
+ research_initial.status = "complete"
49
+ research_initial.sources = [...]
50
+
51
+ Discovered parameters:
52
+ - 5 required parameters
53
+ - 12 optional parameters
54
+ - 3 enum types
55
+ - 2 continuous ranges
56
+ ```
57
+
58
+ ### Parameter-Based Questions
59
+
60
+ For each discovered parameter, generate an appropriate question:
61
+
62
+ #### Required Parameters (Confirmation Only)
63
+
64
+ ```
65
+ ┌────────────────────────────────────────────────────────────┐
66
+ │ REQUIRED PARAMETERS │
67
+ │ │
68
+ │ These parameters are required by the API: │
69
+ │ │
70
+ │ 1. domain (string) - The domain to fetch brand data for │
71
+ │ 2. apiKey (string) - Your Brandfetch API key │
72
+ │ │
73
+ │ Confirm these are understood? [Y/n] │
74
+ └────────────────────────────────────────────────────────────┘
75
+ ```
76
+
77
+ #### Enum Parameters (Multi-Select)
78
+
79
+ ```
80
+ ┌────────────────────────────────────────────────────────────┐
81
+ │ FORMAT PARAMETER │
82
+ │ │
83
+ │ Research found these format options: │
84
+ │ │
85
+ │ [x] json - Structured JSON response │
86
+ │ [x] svg - Vector logo format │
87
+ │ [x] png - Raster logo format │
88
+ │ [ ] raw - Raw API response (advanced) │
89
+ │ │
90
+ │ Which formats should we support? │
91
+ └────────────────────────────────────────────────────────────┘
92
+ ```
93
+
94
+ #### Continuous Parameters (Test Strategy)
95
+
96
+ ```
97
+ ┌────────────────────────────────────────────────────────────┐
98
+ │ QUALITY PARAMETER │
99
+ │ │
100
+ │ Research found: quality is a continuous range 1-100 │
101
+ │ │
102
+ │ How should we TEST this parameter? │
103
+ │ │
104
+ │ [ ] All values (100 tests - comprehensive but slow) │
105
+ │ [x] Boundary (1, 50, 100 - 3 tests) │
106
+ │ [ ] Sample (1, 25, 50, 75, 100 - 5 tests) │
107
+ │ [ ] Custom values: ____ │
108
+ │ │
109
+ │ Your testing strategy affects test count. │
110
+ └────────────────────────────────────────────────────────────┘
111
+ ```
112
+
113
+ #### Boolean Parameters (Enable/Disable)
114
+
115
+ ```
116
+ ┌────────────────────────────────────────────────────────────┐
117
+ │ INCLUDE_COLORS PARAMETER │
118
+ │ │
119
+ │ Research found: includeColors (boolean, default: true) │
120
+ │ │
121
+ │ Should we expose this parameter? │
122
+ │ │
123
+ │ [x] Yes - Let users toggle it │
124
+ │ [ ] No - Use default (true) always │
125
+ │ [ ] Hardcode to: ____ │
126
+ └────────────────────────────────────────────────────────────┘
127
+ ```
128
+
129
+ ### Feature Questions
130
+
131
+ Based on discovered features, ask about priorities:
132
+
133
+ ```
134
+ ┌────────────────────────────────────────────────────────────┐
135
+ │ DISCOVERED FEATURES │
136
+ │ │
137
+ │ Research found these features. Mark priorities: │
138
+ │ │
139
+ │ [x] Basic brand fetch - Get logo, colors, fonts │
140
+ │ [x] Multiple formats - Support json, svg, png │
141
+ │ [ ] Webhook callbacks - Async notification (skip for now) │
142
+ │ [ ] Batch processing - Multiple domains at once │
143
+ │ [x] Error handling - Graceful degradation │
144
+ │ │
145
+ │ Confirm feature scope? │
146
+ └────────────────────────────────────────────────────────────┘
147
+ ```
148
+
149
+ ### Error Handling Questions
150
+
151
+ ```
152
+ ┌────────────────────────────────────────────────────────────┐
153
+ │ ERROR HANDLING │
154
+ │ │
155
+ │ Research found these error cases in the API: │
156
+ │ │
157
+ │ - 400: Invalid domain format │
158
+ │ - 401: Invalid API key │
159
+ │ - 404: Brand not found │
160
+ │ - 429: Rate limit exceeded │
161
+ │ - 500: Server error │
162
+ │ │
163
+ │ How should we handle rate limits (429)? │
164
+ │ │
165
+ │ [x] Retry with exponential backoff │
166
+ │ [ ] Return error immediately │
167
+ │ [ ] Queue and retry later │
168
+ │ [ ] Custom: ____ │
169
+ └────────────────────────────────────────────────────────────┘
170
+ ```
171
+
172
+ ### Deep Research Proposal (Phase 5)
173
+
174
+ After interview, propose additional research:
175
+
176
+ ```
177
+ ┌────────────────────────────────────────────────────────────┐
178
+ │ PROPOSED DEEP RESEARCH │
179
+ │ │
180
+ │ Based on your selections, I recommend researching: │
181
+ │ │
182
+ │ [x] Rate limiting behavior │
183
+ │ Reason: You selected "retry with backoff" │
184
+ │ │
185
+ │ [x] SVG optimization │
186
+ │ Reason: You selected SVG format │
187
+ │ │
188
+ │ [ ] Webhook format │
189
+ │ Reason: You skipped webhook feature │
190
+ │ │
191
+ │ Approve these searches? [Y] │
192
+ │ Add more: ____ │
193
+ │ Skip and proceed: [n] │
194
+ └────────────────────────────────────────────────────────────┘
195
+ ```
196
+
197
+ ## Question Types Summary
198
+
199
+ | Discovered Type | Question Type | Example |
200
+ | ---------------- | ----------------- | ------------------------------- |
201
+ | Required param | Confirmation | "Confirm these are understood?" |
202
+ | Enum param | Multi-select | "Which formats to support?" |
203
+ | Continuous range | Test strategy | "How to test 1-100 range?" |
204
+ | Boolean param | Enable/disable | "Expose this parameter?" |
205
+ | Optional feature | Priority | "Include this feature?" |
206
+ | Error case | Handling strategy | "How to handle rate limits?" |
207
+
208
+ ## State Tracking
209
+
210
+ All decisions are saved to `.claude/api-dev-state.json`:
211
+
212
+ ```json
213
+ {
214
+ "phases": {
215
+ "interview": {
216
+ "status": "complete",
217
+ "questions": [
218
+ {
219
+ "parameter": "format",
220
+ "type": "enum",
221
+ "options": ["json", "svg", "png", "raw"],
222
+ "selected": ["json", "svg", "png"],
223
+ "timestamp": "..."
224
+ },
225
+ {
226
+ "parameter": "quality",
227
+ "type": "continuous",
228
+ "range": [1, 100],
229
+ "test_strategy": "boundary",
230
+ "test_values": [1, 50, 100],
231
+ "timestamp": "..."
232
+ }
233
+ ],
234
+ "decisions": {
235
+ "format": ["json", "svg", "png"],
236
+ "quality_testing": "boundary",
237
+ "quality_values": [1, 50, 100],
238
+ "rate_limit_handling": "exponential_backoff"
239
+ }
240
+ }
241
+ }
242
+ }
243
+ ```
244
+
245
+ ## Output
246
+
247
+ Creates: `.claude/research/[api-name]/interview.md`
248
+
249
+ ````markdown
250
+ # Interview: [API Name]
251
+
252
+ **Date:** [current-date]
253
+ **Research Sources:** [list from research phase]
254
+ **Status:** Interview Complete
255
+
256
+ ## Discovered Parameters
257
+
258
+ | Parameter | Type | Required | Decision |
259
+ | --------- | ------ | -------- | ---------------------------- |
260
+ | domain | string | Yes | Always required |
261
+ | format | enum | No | json, svg, png |
262
+ | quality | 1-100 | No | Boundary testing: 1, 50, 100 |
263
+
264
+ ## Feature Scope
265
+
266
+ | Feature | Included | Reason |
267
+ | ---------------- | -------- | ------------------ |
268
+ | Basic fetch | Yes | Core functionality |
269
+ | Multiple formats | Yes | User selected |
270
+ | Webhooks | No | Deferred to v2 |
271
+
272
+ ## Test Strategy
273
+
274
+ - Enum parameters: Test all selected values
275
+ - Continuous parameters: Boundary testing (3 values)
276
+ - Error cases: 400, 401, 404, 429, 500
277
+
278
+ ## Decisions Summary
279
+
280
+ ```json
281
+ {
282
+ "format": ["json", "svg", "png"],
283
+ "quality_testing": "boundary",
284
+ "rate_limit_handling": "exponential_backoff"
285
+ }
286
+ ```
287
+ ````
288
+
289
+ ## Deep Research Approved
290
+
291
+ - Rate limiting behavior (for retry logic)
292
+ - SVG optimization (for SVG format)
293
+
294
+ ## Open Questions
295
+
296
+ [Any remaining ambiguities]
297
+
298
+ ```
299
+
300
+ ## Integration with Hooks
301
+
302
+ The `enforce-interview.py` hook injects these decisions when Claude tries to write implementation:
303
+
304
+ ```
305
+
306
+ INTERVIEW CONTEXT REMINDER
307
+
308
+ When implementing, remember user decisions:
309
+
310
+ - format: ["json", "svg", "png"] (raw excluded)
311
+ - quality: boundary testing (1, 50, 100)
312
+ - rate limits: exponential backoff
313
+
314
+ Source: .claude/api-dev-state.json
315
+
316
+ ```
317
+
318
+ <claude-commands-template>
319
+ ## Interview Guidelines v3.0
320
+
321
+ 1. **Questions FROM Research** - Never use generic templates
322
+ 2. **Parameter-Specific** - Each discovered param gets appropriate question
323
+ 3. **Test Strategy for Continuous** - Ask how to test ranges
324
+ 4. **Track Decisions** - Save everything to state file
325
+ 5. **Propose Deep Research** - Based on selections
326
+ 6. **No Skipped Parameters** - Every discovered param must have a decision
327
+
328
+ ## Question Generation Rules
329
+
330
+ | If research finds... | Then ask... |
331
+ |---------------------|-------------|
332
+ | Enum with 3+ options | Multi-select: which to support |
333
+ | Continuous range | Test strategy: all/boundary/sample |
334
+ | Boolean param | Enable/disable/hardcode |
335
+ | Optional feature | Include/exclude/defer |
336
+ | Error case | Handling strategy |
337
+
338
+ ## After Interview
339
+
340
+ - Decisions saved to state file
341
+ - Decisions injected during implementation via hook
342
+ - Consistency between interview answers and code enforced
343
+ </claude-commands-template>
344
+ ```
@@ -0,0 +1,357 @@
1
+ # API Research - Adaptive Documentation Discovery v3.0
2
+
3
+ **Usage:** `/api-research [library-or-service-name]`
4
+
5
+ **Purpose:** Research external APIs and SDKs using an adaptive, propose-approve flow (not shotgun searches).
6
+
7
+ ## Key Principle: Adaptive Research
8
+
9
+ **NOT shotgun research** - We don't blindly run 20 searches.
10
+
11
+ **Adaptive flow:**
12
+
13
+ 1. Run 2-3 initial searches
14
+ 2. Summarize findings
15
+ 3. PROPOSE additional searches based on context
16
+ 4. User approves/modifies proposals
17
+ 5. Execute approved searches
18
+ 6. Repeat until complete
19
+
20
+ ## Research Phases
21
+
22
+ ### Initial Discovery (Automatic)
23
+
24
+ Run 2-3 targeted searches:
25
+
26
+ ```
27
+ - Context7: "[library-name]" (if SDK/library)
28
+ - WebSearch: "[name] official documentation"
29
+ - WebSearch: "site:[domain] api reference" (if known domain)
30
+ ```
31
+
32
+ Present initial summary:
33
+
34
+ ```
35
+ ┌────────────────────────────────────────────────────────────┐
36
+ │ INITIAL RESEARCH: [library-name] │
37
+ │ │
38
+ │ │ Source │ Status │
39
+ │ ├─────────────────────┼────────────────────────────────────│
40
+ │ │ Official docs │ ✓ Found: [URL] │
41
+ │ │ API Reference │ ✓ REST v2 documented │
42
+ │ │ Auth method │ ✓ Bearer token / API key │
43
+ │ │ TypeScript types │ ? Not confirmed │
44
+ │ │ npm package │ ? Not searched │
45
+ │ │
46
+ │ Discovered parameters: 5 required, 12 optional │
47
+ │ │
48
+ │ Proceed to interview? [Y] │
49
+ │ Search more first? [n] → What? ____ │
50
+ └────────────────────────────────────────────────────────────┘
51
+ ```
52
+
53
+ ### Deep Research (Proposed)
54
+
55
+ After interview, PROPOSE targeted searches based on user's selections:
56
+
57
+ ```
58
+ ┌────────────────────────────────────────────────────────────┐
59
+ │ PROPOSED DEEP RESEARCH │
60
+ │ │
61
+ │ Based on interview answers, I recommend researching: │
62
+ │ │
63
+ │ [x] Error response format │
64
+ │ Reason: You selected "comprehensive error handling" │
65
+ │ │
66
+ │ [x] Rate limiting behavior │
67
+ │ Reason: You selected "short cache" / high frequency │
68
+ │ │
69
+ │ [ ] Webhook support │
70
+ │ Reason: You didn't select async/webhook features │
71
+ │ │
72
+ │ [x] SVG optimization options │
73
+ │ Reason: You selected SVG output format │
74
+ │ │
75
+ │ [x] Batch processing │
76
+ │ Reason: You mentioned "multiple domains at once" │
77
+ │ │
78
+ │ Approve these searches? [Y] │
79
+ │ Add more: ____ │
80
+ │ Skip and proceed: [n] │
81
+ └────────────────────────────────────────────────────────────┘
82
+ ```
83
+
84
+ ### Execute Approved Searches
85
+
86
+ Only run searches that were explicitly approved:
87
+
88
+ - Track which searches were proposed vs approved vs skipped
89
+ - Log everything to state file for transparency
90
+
91
+ ```json
92
+ {
93
+ "research_deep": {
94
+ "proposed_searches": [
95
+ "error response format",
96
+ "rate limiting behavior",
97
+ "webhook support",
98
+ "SVG optimization options",
99
+ "batch processing"
100
+ ],
101
+ "approved_searches": [
102
+ "error response format",
103
+ "rate limiting behavior",
104
+ "SVG optimization options",
105
+ "batch processing"
106
+ ],
107
+ "skipped_searches": ["webhook support"]
108
+ }
109
+ }
110
+ ```
111
+
112
+ ## Research Caching & Freshness
113
+
114
+ Research is cached in `.claude/research/[api-name]/`:
115
+
116
+ ```
117
+ .claude/research/
118
+ ├── brandfetch/
119
+ │ ├── 2025-12-08_initial.md # Timestamped snapshot
120
+ │ ├── 2025-12-08_deep.md # Deep research after interview
121
+ │ └── CURRENT.md # Latest (copy or symlink)
122
+ ├── vercel-ai-sdk/
123
+ │ ├── providers/ # Complex APIs get subfolders
124
+ │ │ ├── openai.md
125
+ │ │ ├── anthropic.md
126
+ │ │ └── groq.md
127
+ │ └── CURRENT.md
128
+ └── index.json # Catalog with freshness
129
+ ```
130
+
131
+ ### Freshness Tracking
132
+
133
+ ```json
134
+ {
135
+ "brandfetch": {
136
+ "last_updated": "2025-12-08",
137
+ "current_file": "brandfetch/CURRENT.md",
138
+ "days_old": 0,
139
+ "parameters_discovered": 7,
140
+ "source_urls": ["https://docs.brandfetch.com"]
141
+ }
142
+ }
143
+ ```
144
+
145
+ **Freshness Rule:** If research is >7 days old when referenced:
146
+
147
+ ```
148
+ ⚠️ Research for "brandfetch" is 15 days old.
149
+ Re-research before using? [Y/n]
150
+ ```
151
+
152
+ ## Output Format
153
+
154
+ Creates: `.claude/research/[library-name]/CURRENT.md`
155
+
156
+ ````markdown
157
+ # Research: [Library/Service Name]
158
+
159
+ **Date:** [current-date]
160
+ **Version:** [version-number]
161
+ **Status:** Research Complete
162
+ **Freshness:** 0 days (valid for 7 days)
163
+
164
+ ## 1. Official Documentation Links
165
+
166
+ - Main docs: [URL]
167
+ - API reference: [URL]
168
+ - GitHub repo: [URL]
169
+ - npm package: [URL]
170
+ - TypeScript types: [URL]
171
+
172
+ ## 2. Installation & Setup
173
+
174
+ ### Installation
175
+
176
+ ```bash
177
+ [installation command]
178
+ ```
179
+ ````
180
+
181
+ ### Environment Variables
182
+
183
+ ```env
184
+ [required env vars]
185
+ ```
186
+
187
+ ### API Key Setup
188
+
189
+ [How to obtain and configure]
190
+
191
+ ## 3. Complete Request Schema
192
+
193
+ ### Required Parameters
194
+
195
+ | Parameter | Type | Description | Validation |
196
+ | --------- | ------ | ----------- | ---------- |
197
+ | [name] | [type] | [desc] | [rules] |
198
+
199
+ ### Optional Parameters
200
+
201
+ | Parameter | Type | Default | Description | Notes |
202
+ | --------- | ------ | --------- | ----------- | ------- |
203
+ | [name] | [type] | [default] | [desc] | [notes] |
204
+
205
+ ### Continuous Parameters (for test strategy)
206
+
207
+ | Parameter | Type | Range | Suggested Test Values |
208
+ | --------- | ------ | ---------- | --------------------- |
209
+ | quality | number | 1-100 | 1, 50, 100 (boundary) |
210
+ | timeout | number | 1000-30000 | 1000, 15000, 30000 |
211
+
212
+ ## 4. Complete Response Schema
213
+
214
+ ### Success Response
215
+
216
+ [TypeScript interface]
217
+
218
+ ### Error Response
219
+
220
+ [TypeScript interface with error codes]
221
+
222
+ ## 5. Features & Capabilities
223
+
224
+ ### Core Features (Discovered)
225
+
226
+ - [x] [Feature 1]: [description]
227
+ - [x] [Feature 2]: [description]
228
+
229
+ ### Features NOT Implemented (Intentional)
230
+
231
+ - [ ] [Feature]: [reason for exclusion]
232
+
233
+ ## 6. Limitations & Constraints
234
+
235
+ - Rate limits: [details]
236
+ - Size limits: [details]
237
+ - Timeout: [details]
238
+
239
+ ## 7. Testing Considerations
240
+
241
+ - [ ] Test boundary values for continuous params
242
+ - [ ] Test all enum values
243
+ - [ ] Test error responses
244
+ - [ ] Test rate limiting behavior
245
+
246
+ ## 8. Research Trail
247
+
248
+ ### Searches Performed
249
+
250
+ | Search | Tool | Found |
251
+ | ---------------------- | --------- | ----- |
252
+ | "[name] documentation" | WebSearch | ✓ |
253
+ | "[name]" | Context7 | ✓ |
254
+
255
+ ### Proposed but Skipped
256
+
257
+ - "webhook support" - User declined, not needed
258
+
259
+ ````
260
+
261
+ ## Research-First Schema Design (MANDATORY)
262
+
263
+ ### The Anti-Pattern: Schema-First Development
264
+
265
+ **NEVER DO THIS:**
266
+ - ❌ Define interfaces based on assumptions before researching
267
+ - ❌ Rely on training data for API capabilities
268
+ - ❌ Say "I think it supports..." without verification
269
+ - ❌ Build schemas from memory instead of documentation
270
+
271
+ ### The Correct Pattern: Research-First
272
+
273
+ **ALWAYS DO THIS:**
274
+
275
+ 1. **Research the Source of Truth**
276
+ - Use Context7 for SDK docs
277
+ - Use WebSearch for official docs
278
+ - Check GitHub for current implementation
279
+
280
+ 2. **Build Schema FROM Research**
281
+ - Interface fields emerge from discovered capabilities
282
+ - Every field has a source (docs, SDK types, API response)
283
+ - Don't guess - verify each capability
284
+
285
+ 3. **Verify with Phase 10**
286
+ - After implementation, re-research
287
+ - Compare docs to implementation
288
+ - Fix gaps or document intentional omissions
289
+
290
+ ## Research Query Tracking
291
+
292
+ All research is tracked in `.claude/api-dev-state.json`:
293
+
294
+ ```json
295
+ {
296
+ "research_queries": [
297
+ {
298
+ "timestamp": "2025-12-08T...",
299
+ "tool": "WebSearch",
300
+ "query": "Brandfetch API documentation",
301
+ "terms": ["brandfetch", "api", "documentation"]
302
+ },
303
+ {
304
+ "timestamp": "2025-12-08T...",
305
+ "tool": "mcp__context7__get-library-docs",
306
+ "library": "brandfetch",
307
+ "terms": ["brandfetch"]
308
+ }
309
+ ],
310
+ "phases": {
311
+ "research_initial": {
312
+ "status": "complete",
313
+ "sources": [...],
314
+ "summary_approved": true
315
+ },
316
+ "research_deep": {
317
+ "status": "complete",
318
+ "proposed_searches": [...],
319
+ "approved_searches": [...],
320
+ "skipped_searches": [...]
321
+ }
322
+ }
323
+ }
324
+ ````
325
+
326
+ ## Usage Examples
327
+
328
+ ### Research with full flow
329
+
330
+ ```bash
331
+ /api-research brandfetch
332
+ # → Initial search (2-3 queries)
333
+ # → Present summary, ask to proceed
334
+ # → Interview happens (separate phase)
335
+ # → Propose deep research based on interview
336
+ # → User approves/modifies
337
+ # → Execute approved searches
338
+ # → Cache results with freshness tracking
339
+ ```
340
+
341
+ <claude-commands-template>
342
+ ## Research Guidelines
343
+
344
+ 1. **Start minimal** - 2-3 searches, not 20
345
+ 2. **Propose before executing** - User controls depth
346
+ 3. **Track everything** - State file logs all searches
347
+ 4. **Cache with freshness** - 7-day validity
348
+ 5. **Cite sources** - Every claim has a URL
349
+ 6. **Distinguish proposed vs approved** - Transparency
350
+
351
+ ## Integration with API Development
352
+
353
+ - Phase 3 of `/api-create` uses this for initial research
354
+ - Phase 5 uses adaptive proposal flow
355
+ - Phase 10 (Verify) triggers re-research
356
+ - Freshness check prevents stale data
357
+ </claude-commands-template>