@hustle-together/api-dev-tools 2.0.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +283 -478
  2. package/bin/cli.js +55 -11
  3. package/commands/README.md +124 -251
  4. package/commands/api-create.md +318 -136
  5. package/commands/api-interview.md +252 -256
  6. package/commands/api-research.md +209 -234
  7. package/commands/api-verify.md +231 -0
  8. package/demo/audio/generate-all-narrations.js +516 -0
  9. package/demo/audio/generate-voice-previews.js +140 -0
  10. package/demo/audio/narration-adam-timing.json +3666 -0
  11. package/demo/audio/narration-adam.mp3 +0 -0
  12. package/demo/audio/narration-creature-timing.json +3666 -0
  13. package/demo/audio/narration-creature.mp3 +0 -0
  14. package/demo/audio/narration-gaming-timing.json +3666 -0
  15. package/demo/audio/narration-gaming.mp3 +0 -0
  16. package/demo/audio/narration-hope-timing.json +3666 -0
  17. package/demo/audio/narration-hope.mp3 +0 -0
  18. package/demo/audio/narration-mark-timing.json +3666 -0
  19. package/demo/audio/narration-mark.mp3 +0 -0
  20. package/demo/audio/previews/manifest.json +30 -0
  21. package/demo/audio/previews/preview-creature.mp3 +0 -0
  22. package/demo/audio/previews/preview-gaming.mp3 +0 -0
  23. package/demo/audio/previews/preview-hope.mp3 +0 -0
  24. package/demo/audio/previews/preview-mark.mp3 +0 -0
  25. package/demo/audio/voices-manifest.json +50 -0
  26. package/demo/hustle-together/blog/gemini-vs-claude-widgets.html +30 -28
  27. package/demo/hustle-together/blog/interview-driven-api-development.html +37 -23
  28. package/demo/hustle-together/index.html +142 -109
  29. package/demo/workflow-demo.html +1054 -544
  30. package/hooks/periodic-reground.py +154 -0
  31. package/hooks/session-startup.py +151 -0
  32. package/hooks/track-tool-use.py +109 -17
  33. package/hooks/verify-after-green.py +152 -0
  34. package/package.json +2 -2
  35. package/templates/api-dev-state.json +42 -7
  36. package/templates/research-index.json +6 -0
  37. package/templates/settings.json +23 -0
@@ -0,0 +1,231 @@
1
+ # API Verify - Implementation Verification (Phase 9) v3.0
2
+
3
+ **Usage:** `/api-verify [endpoint-name]`
4
+
5
+ **Purpose:** Manually trigger Phase 9 verification - re-research documentation and compare to implementation to catch memory-based errors.
6
+
7
+ ## When to Use
8
+
9
+ - After tests pass (TDD Green complete)
10
+ - Before proceeding to Refactor phase
11
+ - When unsure if implementation matches documentation
12
+ - After significant time has passed since initial research
13
+
14
+ ## Verification Process
15
+
16
+ ### Step 1: Re-Read Original Documentation
17
+
18
+ ```
19
+ ┌────────────────────────────────────────────────────────────┐
20
+ │ RE-RESEARCHING DOCUMENTATION │
21
+ │ │
22
+ │ Fetching current documentation for: [endpoint-name] │
23
+ │ │
24
+ │ Sources: │
25
+ │ - Context7: [library-name] │
26
+ │ - Official docs: [URL] │
27
+ │ - Cached research: .claude/research/[api]/CURRENT.md │
28
+ │ │
29
+ │ Freshness: [X days old] │
30
+ └────────────────────────────────────────────────────────────┘
31
+ ```
32
+
33
+ ### Step 2: Feature-by-Feature Comparison
34
+
35
+ ```
36
+ ┌────────────────────────────────────────────────────────────┐
37
+ │ IMPLEMENTATION VERIFICATION │
38
+ │ │
39
+ │ Comparing documentation to implementation: │
40
+ │ │
41
+ │ │ Feature │ In Docs │ Implemented │ Status │
42
+ │ ├─────────────────┼─────────┼─────────────┼───────────────│
43
+ │ │ domain param │ ✓ │ ✓ │ ✅ Match │
44
+ │ │ format param │ 4 opts │ 3 opts │ ⚠️ Missing │
45
+ │ │ quality range │ 1-100 │ 1-100 │ ✅ Match │
46
+ │ │ size param │ ✓ │ ✗ │ ⚠️ Missing │
47
+ │ │ webhook support │ ✓ │ ✗ │ ℹ️ Intentional │
48
+ │ │ batch mode │ ✓ │ ✗ │ ℹ️ Intentional │
49
+ │ │
50
+ │ MATCHES: 2 │
51
+ │ MISSING: 2 │
52
+ │ INTENTIONAL OMISSIONS: 2 │
53
+ └────────────────────────────────────────────────────────────┘
54
+ ```
55
+
56
+ ### Step 3: Gap Analysis
57
+
58
+ For each discrepancy:
59
+
60
+ ```
61
+ ┌────────────────────────────────────────────────────────────┐
62
+ │ GAP #1: format parameter │
63
+ │ │
64
+ │ Documentation says: ["json", "svg", "png", "raw"] │
65
+ │ Implementation has: ["json", "svg", "png"] │
66
+ │ │
67
+ │ Missing: "raw" format │
68
+ │ │
69
+ │ Action? │
70
+ │ [x] Fix - Add "raw" format support │
71
+ │ [ ] Skip - Mark as intentional omission │
72
+ │ [ ] Defer - Add to backlog for later │
73
+ └────────────────────────────────────────────────────────────┘
74
+
75
+ ┌────────────────────────────────────────────────────────────┐
76
+ │ GAP #2: size parameter │
77
+ │ │
78
+ │ Documentation says: size parameter exists (16-4096) │
79
+ │ Implementation has: not implemented │
80
+ │ │
81
+ │ Action? │
82
+ │ [x] Fix - Add size parameter │
83
+ │ [ ] Skip - Mark as intentional omission │
84
+ │ [ ] Defer - Add to backlog for later │
85
+ └────────────────────────────────────────────────────────────┘
86
+ ```
87
+
88
+ ### Step 4: Loop Back or Proceed
89
+
90
+ ```
91
+ ┌────────────────────────────────────────────────────────────┐
92
+ │ VERIFICATION SUMMARY │
93
+ │ │
94
+ │ Gaps to fix: 2 │
95
+ │ Intentional omissions: 2 │
96
+ │ │
97
+ │ DECISION: │
98
+ │ │
99
+ │ [x] Fix gaps → Return to TDD Red (write tests for gaps) │
100
+ │ [ ] Skip all → Document as omissions, proceed to Refactor │
101
+ └────────────────────────────────────────────────────────────┘
102
+ ```
103
+
104
+ ## State File Updates
105
+
106
+ ```json
107
+ {
108
+ "phases": {
109
+ "verify": {
110
+ "status": "complete",
111
+ "gaps_found": 2,
112
+ "gaps_fixed": 2,
113
+ "intentional_omissions": [
114
+ {
115
+ "feature": "webhook support",
116
+ "reason": "User declined in interview",
117
+ "documented_at": "..."
118
+ },
119
+ {
120
+ "feature": "batch mode",
121
+ "reason": "Out of scope for v1",
122
+ "documented_at": "..."
123
+ }
124
+ ],
125
+ "re_research_done": true,
126
+ "completed_at": "..."
127
+ }
128
+ }
129
+ }
130
+ ```
131
+
132
+ ## Verification Report
133
+
134
+ Creates: `.claude/research/[api-name]/verification.md`
135
+
136
+ ```markdown
137
+ # Verification Report: [API Name]
138
+
139
+ **Date:** [current-date]
140
+ **Implementation File:** src/app/api/v2/[endpoint]/route.ts
141
+ **Test File:** src/app/api/v2/[endpoint]/__tests__/[endpoint].api.test.ts
142
+
143
+ ## Documentation Sources Re-Checked
144
+
145
+ | Source | URL | Checked |
146
+ |--------|-----|---------|
147
+ | Official docs | [URL] | ✓ |
148
+ | Context7 | [library] | ✓ |
149
+ | Cached research | .claude/research/[api]/CURRENT.md | ✓ |
150
+
151
+ ## Feature Comparison
152
+
153
+ | Feature | In Docs | Implemented | Status |
154
+ |---------|---------|-------------|--------|
155
+ | domain param | ✓ | ✓ | ✅ Match |
156
+ | format param | 4 options | 3 options | ⚠️ Fixed |
157
+ | size param | ✓ | ✓ | ⚠️ Fixed |
158
+ | webhook | ✓ | ✗ | ℹ️ Intentional |
159
+
160
+ ## Gaps Fixed
161
+
162
+ 1. **format parameter** - Added "raw" format support
163
+ - Test added: test/format-raw.test.ts:15
164
+ - Implementation: route.ts:45
165
+
166
+ 2. **size parameter** - Added size validation
167
+ - Test added: test/size-param.test.ts:10
168
+ - Implementation: route.ts:52
169
+
170
+ ## Intentional Omissions
171
+
172
+ 1. **webhook support**
173
+ - Reason: User declined in interview (Phase 3)
174
+ - Decision recorded: api-dev-state.json
175
+ - May add in v2
176
+
177
+ 2. **batch mode**
178
+ - Reason: Out of scope for initial release
179
+ - Documented for future consideration
180
+
181
+ ## Verification Result
182
+
183
+ - **Status:** PASSED
184
+ - **All documented features accounted for**
185
+ - **Ready for Refactor phase**
186
+ ```
187
+
188
+ ## Hook Integration
189
+
190
+ This command is normally triggered automatically by `verify-after-green.py` hook after tests pass.
191
+
192
+ Manual invocation is useful when:
193
+ - Hook was skipped or didn't trigger
194
+ - Want to re-verify after changes
195
+ - Research is stale and needs refresh
196
+
197
+ ## Workflow Position
198
+
199
+ ```
200
+ Phase 7: TDD Red (write tests)
201
+
202
+
203
+ Phase 8: TDD Green (implementation)
204
+
205
+
206
+ Phase 9: VERIFY ← /api-verify triggers this
207
+
208
+ ├─► Gaps found? → Loop back to Phase 7
209
+
210
+ └─► All verified → Proceed to Phase 10 (Refactor)
211
+ ```
212
+
213
+ <claude-commands-template>
214
+ ## Verification Guidelines
215
+
216
+ 1. **Re-read, don't remember** - Fresh fetch of docs every time
217
+ 2. **Feature-by-feature** - Systematic comparison
218
+ 3. **Document omissions** - Intentional != forgotten
219
+ 4. **Loop back for gaps** - Return to TDD Red if fixes needed
220
+ 5. **Update state file** - Track everything
221
+ 6. **Create verification report** - Audit trail
222
+
223
+ ## Common Gaps to Check
224
+
225
+ - Parameter counts match?
226
+ - Enum options complete?
227
+ - Range boundaries correct?
228
+ - Error codes handled?
229
+ - Optional features accounted for?
230
+ - Default values match docs?
231
+ </claude-commands-template>