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