@hustle-together/api-dev-tools 3.6.5 → 3.9.2

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 (61) hide show
  1. package/README.md +5307 -258
  2. package/bin/cli.js +348 -20
  3. package/commands/README.md +459 -71
  4. package/commands/hustle-api-continue.md +158 -0
  5. package/commands/{api-create.md → hustle-api-create.md} +22 -2
  6. package/commands/{api-env.md → hustle-api-env.md} +4 -4
  7. package/commands/{api-interview.md → hustle-api-interview.md} +1 -1
  8. package/commands/{api-research.md → hustle-api-research.md} +3 -3
  9. package/commands/hustle-api-sessions.md +149 -0
  10. package/commands/{api-status.md → hustle-api-status.md} +16 -16
  11. package/commands/{api-verify.md → hustle-api-verify.md} +2 -2
  12. package/commands/hustle-combine.md +763 -0
  13. package/commands/hustle-ui-create.md +825 -0
  14. package/hooks/api-workflow-check.py +385 -19
  15. package/hooks/cache-research.py +337 -0
  16. package/hooks/check-playwright-setup.py +103 -0
  17. package/hooks/check-storybook-setup.py +81 -0
  18. package/hooks/detect-interruption.py +165 -0
  19. package/hooks/enforce-brand-guide.py +131 -0
  20. package/hooks/enforce-documentation.py +60 -8
  21. package/hooks/enforce-freshness.py +184 -0
  22. package/hooks/enforce-questions-sourced.py +146 -0
  23. package/hooks/enforce-schema-from-interview.py +248 -0
  24. package/hooks/enforce-ui-disambiguation.py +108 -0
  25. package/hooks/enforce-ui-interview.py +130 -0
  26. package/hooks/generate-manifest-entry.py +981 -0
  27. package/hooks/session-logger.py +297 -0
  28. package/hooks/session-startup.py +65 -10
  29. package/hooks/track-scope-coverage.py +220 -0
  30. package/hooks/track-tool-use.py +81 -1
  31. package/hooks/update-api-showcase.py +149 -0
  32. package/hooks/update-registry.py +352 -0
  33. package/hooks/update-ui-showcase.py +148 -0
  34. package/package.json +8 -2
  35. package/templates/BRAND_GUIDE.md +299 -0
  36. package/templates/CLAUDE-SECTION.md +56 -24
  37. package/templates/SPEC.json +640 -0
  38. package/templates/api-dev-state.json +179 -161
  39. package/templates/api-showcase/APICard.tsx +153 -0
  40. package/templates/api-showcase/APIModal.tsx +375 -0
  41. package/templates/api-showcase/APIShowcase.tsx +231 -0
  42. package/templates/api-showcase/APITester.tsx +522 -0
  43. package/templates/api-showcase/page.tsx +41 -0
  44. package/templates/component/Component.stories.tsx +172 -0
  45. package/templates/component/Component.test.tsx +237 -0
  46. package/templates/component/Component.tsx +86 -0
  47. package/templates/component/Component.types.ts +55 -0
  48. package/templates/component/index.ts +15 -0
  49. package/templates/dev-tools/_components/DevToolsLanding.tsx +320 -0
  50. package/templates/dev-tools/page.tsx +10 -0
  51. package/templates/page/page.e2e.test.ts +218 -0
  52. package/templates/page/page.tsx +42 -0
  53. package/templates/performance-budgets.json +58 -0
  54. package/templates/registry.json +13 -0
  55. package/templates/settings.json +74 -0
  56. package/templates/shared/HeroHeader.tsx +261 -0
  57. package/templates/shared/index.ts +1 -0
  58. package/templates/ui-showcase/PreviewCard.tsx +315 -0
  59. package/templates/ui-showcase/PreviewModal.tsx +676 -0
  60. package/templates/ui-showcase/UIShowcase.tsx +262 -0
  61. package/templates/ui-showcase/page.tsx +26 -0
@@ -0,0 +1,640 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "version": "3.7.0",
4
+ "name": "@hustle-together/api-dev-tools",
5
+ "description": "Interview-driven, research-first API development with 13-phase enforcement for Claude Code",
6
+
7
+ "phases": {
8
+ "1_disambiguation": {
9
+ "number": 1,
10
+ "name": "Disambiguation",
11
+ "state_key": "disambiguation",
12
+ "description": "Clarify ambiguous terms before research",
13
+ "enforcement_hook": "enforce-disambiguation.py",
14
+ "required_for_completion": false,
15
+ "blocks_writes": true,
16
+ "requires_user_confirmation": true,
17
+ "required_state_fields": {
18
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
19
+ "clarified": { "type": "string", "nullable": true },
20
+ "search_variations": { "type": "array" },
21
+ "user_question_asked": { "type": "boolean" },
22
+ "user_selected": { "type": "string", "nullable": true },
23
+ "phase_exit_confirmed": { "type": "boolean" }
24
+ },
25
+ "completion_conditions": ["user_question_asked", "phase_exit_confirmed"]
26
+ },
27
+ "2_scope": {
28
+ "number": 2,
29
+ "name": "Scope Confirmation",
30
+ "state_key": "scope",
31
+ "description": "Confirm understanding of endpoint purpose",
32
+ "enforcement_hook": "enforce-scope.py",
33
+ "required_for_completion": false,
34
+ "blocks_writes": true,
35
+ "requires_user_confirmation": true,
36
+ "required_state_fields": {
37
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
38
+ "confirmed": { "type": "boolean" },
39
+ "user_question_asked": { "type": "boolean" },
40
+ "user_confirmed": { "type": "boolean" },
41
+ "phase_exit_confirmed": { "type": "boolean" }
42
+ },
43
+ "completion_conditions": ["user_question_asked", "user_confirmed", "phase_exit_confirmed"]
44
+ },
45
+ "3_research_initial": {
46
+ "number": 3,
47
+ "name": "Initial Research",
48
+ "state_key": "research_initial",
49
+ "description": "Context7/WebSearch research for live documentation",
50
+ "enforcement_hook": "enforce-research.py",
51
+ "required_for_completion": true,
52
+ "blocks_writes": true,
53
+ "requires_user_confirmation": true,
54
+ "required_state_fields": {
55
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
56
+ "sources": { "type": "array" },
57
+ "summary_shown": { "type": "boolean" },
58
+ "user_question_asked": { "type": "boolean" },
59
+ "user_approved": { "type": "boolean" },
60
+ "phase_exit_confirmed": { "type": "boolean" }
61
+ },
62
+ "completion_conditions": ["sources.length > 0", "user_approved", "phase_exit_confirmed"]
63
+ },
64
+ "4_interview": {
65
+ "number": 4,
66
+ "name": "Interview",
67
+ "state_key": "interview",
68
+ "description": "Structured interview about requirements (generated FROM research)",
69
+ "enforcement_hook": "enforce-interview.py",
70
+ "required_for_completion": true,
71
+ "blocks_writes": true,
72
+ "requires_user_confirmation": true,
73
+ "required_state_fields": {
74
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
75
+ "questions": { "type": "array" },
76
+ "user_question_count": { "type": "number" },
77
+ "structured_question_count": { "type": "number" },
78
+ "decisions": { "type": "object" },
79
+ "user_question_asked": { "type": "boolean" },
80
+ "user_completed": { "type": "boolean" },
81
+ "phase_exit_confirmed": { "type": "boolean" }
82
+ },
83
+ "completion_conditions": ["user_question_count >= 1", "user_completed", "phase_exit_confirmed"]
84
+ },
85
+ "5_research_deep": {
86
+ "number": 5,
87
+ "name": "Deep Research",
88
+ "state_key": "research_deep",
89
+ "description": "Deep dive based on interview answers (adaptive, not shotgun)",
90
+ "enforcement_hook": "enforce-deep-research.py",
91
+ "required_for_completion": false,
92
+ "blocks_writes": true,
93
+ "requires_user_confirmation": true,
94
+ "required_state_fields": {
95
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete", "skipped"] },
96
+ "sources": { "type": "array" },
97
+ "proposed_searches": { "type": "array" },
98
+ "approved_searches": { "type": "array" },
99
+ "executed_searches": { "type": "array" },
100
+ "skipped_searches": { "type": "array" },
101
+ "user_question_asked": { "type": "boolean" },
102
+ "user_approved": { "type": "boolean" },
103
+ "phase_exit_confirmed": { "type": "boolean" }
104
+ },
105
+ "completion_conditions": ["user_approved", "phase_exit_confirmed"]
106
+ },
107
+ "6_schema": {
108
+ "number": 6,
109
+ "name": "Schema Creation",
110
+ "state_key": "schema_creation",
111
+ "description": "Zod schema creation from research + interview",
112
+ "enforcement_hook": "enforce-schema.py",
113
+ "required_for_completion": false,
114
+ "blocks_writes": true,
115
+ "requires_user_confirmation": true,
116
+ "required_state_fields": {
117
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
118
+ "schema_file": { "type": "string", "nullable": true },
119
+ "fields_count": { "type": "number" },
120
+ "schema_shown": { "type": "boolean" },
121
+ "user_question_asked": { "type": "boolean" },
122
+ "user_confirmed": { "type": "boolean" },
123
+ "phase_exit_confirmed": { "type": "boolean" }
124
+ },
125
+ "completion_conditions": ["schema_file !== null", "user_confirmed", "phase_exit_confirmed"]
126
+ },
127
+ "7_environment": {
128
+ "number": 7,
129
+ "name": "Environment Check",
130
+ "state_key": "environment_check",
131
+ "description": "API key and environment verification",
132
+ "enforcement_hook": "enforce-environment.py",
133
+ "required_for_completion": false,
134
+ "blocks_writes": true,
135
+ "requires_user_confirmation": true,
136
+ "required_state_fields": {
137
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
138
+ "keys_required": { "type": "array" },
139
+ "keys_found": { "type": "array" },
140
+ "keys_missing": { "type": "array" },
141
+ "env_shown": { "type": "boolean" },
142
+ "user_question_asked": { "type": "boolean" },
143
+ "user_ready": { "type": "boolean" },
144
+ "phase_exit_confirmed": { "type": "boolean" }
145
+ },
146
+ "completion_conditions": ["user_ready", "phase_exit_confirmed"]
147
+ },
148
+ "8_tdd_red": {
149
+ "number": 8,
150
+ "name": "TDD Red",
151
+ "state_key": "tdd_red",
152
+ "description": "Write failing tests first",
153
+ "enforcement_hook": "enforce-tdd-red.py",
154
+ "required_for_completion": true,
155
+ "blocks_writes": true,
156
+ "requires_user_confirmation": true,
157
+ "required_state_fields": {
158
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
159
+ "test_file": { "type": "string", "nullable": true },
160
+ "test_count": { "type": "number" },
161
+ "test_scenarios": { "type": "array" },
162
+ "matrix_shown": { "type": "boolean" },
163
+ "user_question_asked": { "type": "boolean" },
164
+ "user_approved": { "type": "boolean" },
165
+ "phase_exit_confirmed": { "type": "boolean" }
166
+ },
167
+ "completion_conditions": ["test_file !== null", "test_count > 0", "user_approved", "phase_exit_confirmed"]
168
+ },
169
+ "9_tdd_green": {
170
+ "number": 9,
171
+ "name": "TDD Green",
172
+ "state_key": "tdd_green",
173
+ "description": "Minimal implementation to pass tests",
174
+ "enforcement_hook": "verify-implementation.py",
175
+ "required_for_completion": true,
176
+ "blocks_writes": true,
177
+ "requires_user_confirmation": false,
178
+ "required_state_fields": {
179
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
180
+ "implementation_file": { "type": "string", "nullable": true },
181
+ "all_tests_passing": { "type": "boolean" },
182
+ "phase_exit_confirmed": { "type": "boolean" }
183
+ },
184
+ "completion_conditions": ["all_tests_passing"]
185
+ },
186
+ "10_verify": {
187
+ "number": 10,
188
+ "name": "Verification",
189
+ "state_key": "verify",
190
+ "description": "Re-research after Green to verify implementation matches docs",
191
+ "enforcement_hook": "enforce-verify.py",
192
+ "required_for_completion": true,
193
+ "blocks_writes": true,
194
+ "requires_user_confirmation": true,
195
+ "required_state_fields": {
196
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
197
+ "gaps_found": { "type": "number" },
198
+ "gaps_fixed": { "type": "number" },
199
+ "gaps_skipped": { "type": "number" },
200
+ "intentional_omissions": { "type": "array" },
201
+ "re_research_done": { "type": "boolean" },
202
+ "gap_analysis_shown": { "type": "boolean" },
203
+ "user_question_asked": { "type": "boolean" },
204
+ "user_decided": { "type": "boolean" },
205
+ "user_decision": { "type": "string", "nullable": true },
206
+ "phase_exit_confirmed": { "type": "boolean" }
207
+ },
208
+ "completion_conditions": ["re_research_done", "user_decided", "phase_exit_confirmed"]
209
+ },
210
+ "11_refactor": {
211
+ "number": 11,
212
+ "name": "TDD Refactor",
213
+ "state_key": "tdd_refactor",
214
+ "description": "Code cleanup while keeping tests green",
215
+ "enforcement_hook": "enforce-refactor.py",
216
+ "required_for_completion": false,
217
+ "blocks_writes": false,
218
+ "requires_user_confirmation": false,
219
+ "required_state_fields": {
220
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete", "skipped"] },
221
+ "phase_exit_confirmed": { "type": "boolean" }
222
+ },
223
+ "completion_conditions": ["status === 'complete' || status === 'skipped'"]
224
+ },
225
+ "12_documentation": {
226
+ "number": 12,
227
+ "name": "Documentation",
228
+ "state_key": "documentation",
229
+ "description": "Update manifests, OpenAPI, cache research",
230
+ "enforcement_hook": "enforce-documentation.py",
231
+ "required_for_completion": true,
232
+ "blocks_writes": true,
233
+ "requires_user_confirmation": true,
234
+ "required_state_fields": {
235
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
236
+ "files_updated": { "type": "array" },
237
+ "manifest_updated": { "type": "boolean" },
238
+ "openapi_updated": { "type": "boolean" },
239
+ "research_cached": { "type": "boolean" },
240
+ "checklist_shown": { "type": "boolean" },
241
+ "user_question_asked": { "type": "boolean" },
242
+ "user_confirmed": { "type": "boolean" },
243
+ "phase_exit_confirmed": { "type": "boolean" }
244
+ },
245
+ "completion_conditions": ["manifest_updated", "research_cached", "user_confirmed", "phase_exit_confirmed"]
246
+ },
247
+ "13_completion": {
248
+ "number": 13,
249
+ "name": "Completion",
250
+ "state_key": "completion",
251
+ "description": "Final verification and output generation",
252
+ "enforcement_hook": "api-workflow-check.py",
253
+ "required_for_completion": true,
254
+ "blocks_writes": false,
255
+ "requires_user_confirmation": false,
256
+ "required_state_fields": {
257
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"] },
258
+ "all_tests_passing": { "type": "boolean" },
259
+ "coverage_100_percent": { "type": "boolean" },
260
+ "typescript_compiles": { "type": "boolean" },
261
+ "docs_updated": { "type": "boolean" },
262
+ "commit_ready": { "type": "boolean" },
263
+ "files_created": { "type": "array" },
264
+ "files_modified": { "type": "array" },
265
+ "phase_exit_confirmed": { "type": "boolean" }
266
+ },
267
+ "completion_conditions": ["all_tests_passing", "docs_updated"],
268
+ "output_generates": ["summary", "files_created", "files_modified", "test_commands", "curl_examples", "parameter_table", "scope_coverage", "research_cache_location", "next_steps"]
269
+ }
270
+ },
271
+
272
+ "hooks": {
273
+ "SessionStart": {
274
+ "session-startup.py": {
275
+ "description": "Inject state context at session start",
276
+ "actions": ["read_state", "inject_context", "check_freshness"]
277
+ },
278
+ "detect-interruption.py": {
279
+ "description": "Detect and prompt for interrupted workflows",
280
+ "actions": ["check_in_progress", "prompt_resume"],
281
+ "added_in": "3.6.7"
282
+ }
283
+ },
284
+ "UserPromptSubmit": {
285
+ "enforce-external-research.py": {
286
+ "description": "Require research for API-related prompts",
287
+ "actions": ["detect_api_terms", "inject_research_reminder"]
288
+ }
289
+ },
290
+ "PreToolUse": {
291
+ "enforce-disambiguation.py": {
292
+ "description": "Phase 1 enforcement - clarify before research",
293
+ "matcher": "Write|Edit",
294
+ "blocks": true,
295
+ "phase": 1
296
+ },
297
+ "enforce-scope.py": {
298
+ "description": "Phase 2 enforcement - confirm scope",
299
+ "matcher": "Write|Edit",
300
+ "blocks": true,
301
+ "phase": 2
302
+ },
303
+ "enforce-research.py": {
304
+ "description": "Phase 3 enforcement - research before implementation",
305
+ "matcher": "Write|Edit",
306
+ "blocks": true,
307
+ "phase": 3
308
+ },
309
+ "enforce-interview.py": {
310
+ "description": "Phase 4 enforcement - interview with questions from research",
311
+ "matcher": "Write|Edit",
312
+ "blocks": true,
313
+ "phase": 4
314
+ },
315
+ "enforce-deep-research.py": {
316
+ "description": "Phase 5 enforcement - adaptive deep research",
317
+ "matcher": "Write|Edit",
318
+ "blocks": true,
319
+ "phase": 5
320
+ },
321
+ "enforce-schema.py": {
322
+ "description": "Phase 6 enforcement - schema from research + interview",
323
+ "matcher": "Write|Edit",
324
+ "blocks": true,
325
+ "phase": 6
326
+ },
327
+ "enforce-environment.py": {
328
+ "description": "Phase 7 enforcement - verify API keys",
329
+ "matcher": "Write|Edit",
330
+ "blocks": true,
331
+ "phase": 7
332
+ },
333
+ "enforce-tdd-red.py": {
334
+ "description": "Phase 8 enforcement - tests before implementation",
335
+ "matcher": "Write|Edit",
336
+ "blocks": true,
337
+ "phase": 8
338
+ },
339
+ "verify-implementation.py": {
340
+ "description": "Phase 9 helper - ensure test file exists before route",
341
+ "matcher": "Write|Edit",
342
+ "blocks": true,
343
+ "phase": 9
344
+ },
345
+ "enforce-verify.py": {
346
+ "description": "Phase 10 enforcement - re-research after green",
347
+ "matcher": "Write|Edit",
348
+ "blocks": true,
349
+ "phase": 10
350
+ },
351
+ "enforce-refactor.py": {
352
+ "description": "Phase 11 enforcement - cleanup while tests pass",
353
+ "matcher": "Write|Edit",
354
+ "blocks": false,
355
+ "phase": 11
356
+ },
357
+ "enforce-documentation.py": {
358
+ "description": "Phase 12 enforcement - update docs before completion",
359
+ "matcher": "Write|Edit",
360
+ "blocks": true,
361
+ "phase": 12
362
+ },
363
+ "enforce-questions-sourced.py": {
364
+ "description": "Validate interview questions come from research",
365
+ "matcher": "AskUserQuestion",
366
+ "blocks": true,
367
+ "phase": 4,
368
+ "added_in": "3.6.7"
369
+ },
370
+ "enforce-schema-from-interview.py": {
371
+ "description": "Validate schema fields match interview decisions",
372
+ "matcher": "Write|Edit",
373
+ "blocks": true,
374
+ "phase": 6,
375
+ "added_in": "3.6.7"
376
+ },
377
+ "enforce-freshness.py": {
378
+ "description": "Block API-related writes if research is stale (>7 days) for active endpoint",
379
+ "matcher": "Write|Edit",
380
+ "blocks": true,
381
+ "phase": "*",
382
+ "configurable": {
383
+ "enforce_freshness": "boolean (default: true)",
384
+ "freshness_threshold_days": "number (default: 7)"
385
+ },
386
+ "added_in": "3.7.0"
387
+ }
388
+ },
389
+ "PostToolUse": {
390
+ "track-tool-use.py": {
391
+ "description": "Log research and tool usage, update state",
392
+ "matcher": "WebSearch|WebFetch|mcp__context7.*|AskUserQuestion",
393
+ "actions": ["log_research", "update_state", "count_turns", "populate_research_index"]
394
+ },
395
+ "periodic-reground.py": {
396
+ "description": "Re-inject context every 7 turns",
397
+ "matcher": "WebSearch|WebFetch|mcp__context7.*|AskUserQuestion",
398
+ "interval": 7,
399
+ "actions": ["inject_endpoint", "inject_phase", "inject_decisions", "inject_freshness_warning"]
400
+ },
401
+ "verify-after-green.py": {
402
+ "description": "Trigger Phase 10 verification after tests pass",
403
+ "matcher": "Bash",
404
+ "actions": ["detect_test_pass", "trigger_verification"]
405
+ },
406
+ "cache-research.py": {
407
+ "description": "Create research cache files from state",
408
+ "matcher": "Write|Edit",
409
+ "actions": ["create_sources_json", "create_interview_json", "create_schema_json", "update_current_md", "update_index_json"],
410
+ "added_in": "3.6.7"
411
+ },
412
+ "track-scope-coverage.py": {
413
+ "description": "Track implemented vs deferred features",
414
+ "matcher": "AskUserQuestion",
415
+ "actions": ["record_feature_decision", "update_coverage"],
416
+ "added_in": "3.6.7"
417
+ }
418
+ },
419
+ "Stop": {
420
+ "api-workflow-check.py": {
421
+ "description": "Block if phases incomplete, generate completion output",
422
+ "actions": ["verify_phases", "generate_output", "block_if_incomplete"]
423
+ },
424
+ "session-logger.py": {
425
+ "description": "Save session to .claude/api-sessions/",
426
+ "actions": ["copy_jsonl", "convert_to_markdown", "snapshot_state", "generate_summary"],
427
+ "added_in": "3.6.7"
428
+ }
429
+ }
430
+ },
431
+
432
+ "commands": {
433
+ "api-create": {
434
+ "usage": "/api-create [endpoint-name]",
435
+ "description": "Complete 13-phase API development workflow",
436
+ "file": "commands/api-create.md",
437
+ "phases_used": "all",
438
+ "required": true
439
+ },
440
+ "api-interview": {
441
+ "usage": "/api-interview [endpoint-name]",
442
+ "description": "Run Phase 4 interview with questions from research",
443
+ "file": "commands/api-interview.md",
444
+ "phases_used": ["interview"]
445
+ },
446
+ "api-research": {
447
+ "usage": "/api-research [library-name]",
448
+ "description": "Run Phase 3/5 research with Context7 and WebSearch",
449
+ "file": "commands/api-research.md",
450
+ "phases_used": ["research_initial", "research_deep"]
451
+ },
452
+ "api-verify": {
453
+ "usage": "/api-verify [endpoint-name]",
454
+ "description": "Run Phase 10 verification against current docs",
455
+ "file": "commands/api-verify.md",
456
+ "phases_used": ["verify"]
457
+ },
458
+ "api-env": {
459
+ "usage": "/api-env [endpoint-name]",
460
+ "description": "Run Phase 7 environment check",
461
+ "file": "commands/api-env.md",
462
+ "phases_used": ["environment_check"]
463
+ },
464
+ "api-status": {
465
+ "usage": "/api-status [endpoint-name] [--all]",
466
+ "description": "Show progress through 13 phases",
467
+ "file": "commands/api-status.md",
468
+ "phases_used": []
469
+ },
470
+ "api-continue": {
471
+ "usage": "/api-continue [endpoint-name]",
472
+ "description": "Resume interrupted workflow from last completed phase",
473
+ "file": "commands/api-continue.md",
474
+ "phases_used": [],
475
+ "added_in": "3.6.7"
476
+ },
477
+ "api-sessions": {
478
+ "usage": "/api-sessions [--list|--view|--export|--search]",
479
+ "description": "Browse and export saved session logs",
480
+ "file": "commands/api-sessions.md",
481
+ "phases_used": [],
482
+ "added_in": "3.6.7"
483
+ }
484
+ },
485
+
486
+ "state_structure": {
487
+ "root": {
488
+ "version": { "type": "string", "description": "State file version" },
489
+ "created_at": { "type": "string", "nullable": true, "description": "ISO timestamp of creation" },
490
+ "active_endpoint": { "type": "string", "nullable": true, "description": "Currently active endpoint name" },
491
+ "endpoints": { "type": "object", "description": "All endpoint workflows" },
492
+ "turn_count": { "type": "number", "description": "Total turns in session" },
493
+ "last_turn_timestamp": { "type": "string", "nullable": true },
494
+ "research_queries": { "type": "array", "description": "All research queries made" },
495
+ "prompt_detections": { "type": "array", "description": "Detected API terms in prompts" },
496
+ "decisions_history": { "type": "array", "description": "History of interview decision changes", "added_in": "3.6.7" },
497
+ "reground_history": { "type": "array", "description": "History of re-grounding injections" }
498
+ },
499
+ "endpoint": {
500
+ "started_at": { "type": "string", "description": "ISO timestamp when workflow started" },
501
+ "status": { "type": "enum", "values": ["not_started", "in_progress", "complete"], "description": "Overall workflow status" },
502
+ "library": { "type": "string", "nullable": true, "description": "External library/API name" },
503
+ "phases": { "type": "object", "description": "Phase-specific state" },
504
+ "scope": {
505
+ "type": "object",
506
+ "description": "Feature scope tracking",
507
+ "added_in": "3.6.7",
508
+ "fields": {
509
+ "discovered_features": { "type": "array" },
510
+ "implemented_features": { "type": "array" },
511
+ "deferred_features": { "type": "array" },
512
+ "coverage_percent": { "type": "number" }
513
+ }
514
+ },
515
+ "session": {
516
+ "type": "object",
517
+ "description": "Session interruption tracking",
518
+ "added_in": "3.6.7",
519
+ "fields": {
520
+ "interrupted_at": { "type": "string", "nullable": true },
521
+ "interrupted_phase": { "type": "string", "nullable": true },
522
+ "recovery_checkpoint": { "type": "object", "nullable": true }
523
+ }
524
+ }
525
+ }
526
+ },
527
+
528
+ "file_structure": {
529
+ ".claude/api-dev-state.json": {
530
+ "description": "Main state file tracking all workflows",
531
+ "created_by": "installer"
532
+ },
533
+ ".claude/api-sessions/": {
534
+ "description": "Session logs directory",
535
+ "created_by": "session-logger.py",
536
+ "added_in": "3.6.7",
537
+ "contents": {
538
+ "{endpoint}_{timestamp}/": {
539
+ "session.jsonl": "Raw Claude conversation",
540
+ "session.md": "Human-readable markdown",
541
+ "state-snapshot.json": "State at completion",
542
+ "files-created.txt": "List of files made",
543
+ "summary.md": "Executive summary"
544
+ },
545
+ "index.json": "Session index with metadata"
546
+ }
547
+ },
548
+ ".claude/research/": {
549
+ "description": "Research cache directory",
550
+ "created_by": "cache-research.py",
551
+ "contents": {
552
+ "{endpoint}/": {
553
+ "CURRENT.md": "Aggregated research (main reference)",
554
+ "sources.json": "Research sources with URLs and summaries",
555
+ "interview.json": "Interview decisions",
556
+ "schema.json": "Schema snapshot"
557
+ },
558
+ "index.json": "Research freshness index"
559
+ }
560
+ },
561
+ ".claude/hooks/": {
562
+ "description": "Python enforcement hooks",
563
+ "created_by": "installer"
564
+ },
565
+ ".claude/commands/": {
566
+ "description": "Slash command markdown files",
567
+ "created_by": "installer"
568
+ }
569
+ },
570
+
571
+ "completion_output": {
572
+ "description": "Structured output generated at Phase 13 completion",
573
+ "sections": [
574
+ {
575
+ "name": "summary",
576
+ "title": "API Implementation Complete",
577
+ "includes": ["status", "phases_completed", "test_count", "coverage", "duration"]
578
+ },
579
+ {
580
+ "name": "files_created",
581
+ "title": "Files Created",
582
+ "includes": ["route_file", "test_file", "schema_file"]
583
+ },
584
+ {
585
+ "name": "files_modified",
586
+ "title": "Files Modified",
587
+ "includes": ["manifest", "research_cache"]
588
+ },
589
+ {
590
+ "name": "test_commands",
591
+ "title": "Test Commands",
592
+ "format": "bash",
593
+ "includes": ["endpoint_tests", "full_suite", "watch_mode"]
594
+ },
595
+ {
596
+ "name": "curl_examples",
597
+ "title": "API Usage (curl)",
598
+ "format": "bash",
599
+ "includes": ["basic_request", "with_auth", "with_headers"]
600
+ },
601
+ {
602
+ "name": "parameter_table",
603
+ "title": "Parameters Discovered",
604
+ "format": "markdown_table",
605
+ "columns": ["name", "type", "required", "description"]
606
+ },
607
+ {
608
+ "name": "scope_coverage",
609
+ "title": "Implementation Scope",
610
+ "includes": ["implemented_features", "deferred_features", "coverage_percent"],
611
+ "added_in": "3.6.7"
612
+ },
613
+ {
614
+ "name": "research_cache_location",
615
+ "title": "Research Cache",
616
+ "includes": ["current_md_path", "sources_json_path"]
617
+ },
618
+ {
619
+ "name": "next_steps",
620
+ "title": "Next Steps",
621
+ "includes": ["review_tests", "manual_testing", "deploy"]
622
+ }
623
+ ]
624
+ },
625
+
626
+ "constants": {
627
+ "REGROUND_INTERVAL": 7,
628
+ "RESEARCH_FRESHNESS_DAYS": 7,
629
+ "MIN_INTERVIEW_QUESTIONS": 1,
630
+ "EXIT_CODE_BLOCK": 2
631
+ },
632
+
633
+ "migration": {
634
+ "from_single_endpoint": {
635
+ "description": "Migrate from single endpoint to multi-API state",
636
+ "detect": "state.endpoint !== undefined && state.endpoints === undefined",
637
+ "action": "wrap_in_endpoints_object"
638
+ }
639
+ }
640
+ }