@hustle-together/api-dev-tools 3.6.1 → 3.6.4
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/README.md +66 -59
- package/bin/cli.js +14 -14
- package/commands/README.md +20 -20
- package/commands/api-create.md +7 -7
- package/commands/api-interview.md +5 -5
- package/commands/api-research.md +7 -7
- package/commands/api-verify.md +8 -8
- package/demo/workflow-demo.html +53 -53
- package/hooks/enforce-deep-research.py +2 -2
- package/hooks/enforce-disambiguation.py +3 -3
- package/hooks/enforce-documentation.py +2 -2
- package/hooks/enforce-environment.py +2 -2
- package/hooks/enforce-refactor.py +3 -3
- package/hooks/enforce-research.py +2 -2
- package/hooks/enforce-schema.py +3 -3
- package/hooks/enforce-scope.py +2 -2
- package/hooks/enforce-tdd-red.py +2 -2
- package/hooks/enforce-verify.py +5 -5
- package/hooks/verify-after-green.py +2 -2
- package/package.json +1 -1
- package/templates/CLAUDE-SECTION.md +15 -15
- package/templates/api-dev-state.json +13 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# API Development Tools for Claude Code v3.6.
|
|
1
|
+
# API Development Tools for Claude Code v3.6.4
|
|
2
2
|
|
|
3
3
|
**Interview-driven, research-first API development with 100% phase enforcement**
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
│ ❯ npx @hustle-together/api-dev-tools │
|
|
8
8
|
│ --scope=project │
|
|
9
9
|
│ │
|
|
10
|
-
│ 🚀 Installing v3.6.
|
|
10
|
+
│ 🚀 Installing v3.6.4... │
|
|
11
11
|
│ │
|
|
12
12
|
│ ✅ Python 3.12.0 │
|
|
13
13
|
│ 📦 24 slash commands │
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
│ 📚 research cache ready │
|
|
18
18
|
│ 🔌 MCP: context7, github │
|
|
19
19
|
│ │
|
|
20
|
-
│
|
|
20
|
+
│ ════════════════════════════════════════════ │
|
|
21
21
|
│ 🎉 Installation complete! │
|
|
22
|
-
│
|
|
22
|
+
│ ════════════════════════════════════════════ │
|
|
23
23
|
│ │
|
|
24
24
|
│ Quick Start: /api-create my-endpoint │
|
|
25
25
|
└──────────────────────────────────────────────┘
|
|
@@ -39,17 +39,17 @@ When developers use Claude (or any LLM) to build APIs, five predictable failure
|
|
|
39
39
|
|
|
40
40
|
1. **Outdated Documentation** - LLMs use training data from months or years ago. APIs change constantly - endpoints get deprecated, parameters are renamed, authentication methods evolve. Building from stale knowledge means broken code.
|
|
41
41
|
|
|
42
|
-
2. **Memory-Based Implementation** - Even after doing research, Claude often implements from memory by the time it gets to Phase
|
|
42
|
+
2. **Memory-Based Implementation** - Even after doing research, Claude often implements from memory by the time it gets to Phase 9 (writing code). It forgets the specific parameter names, error codes, and edge cases it discovered 20 messages ago.
|
|
43
43
|
|
|
44
44
|
3. **Self-Answering Questions** - Claude asks "Which format do you want?" then immediately answers "I'll use JSON" without waiting for your response. You lose control of the decision-making process.
|
|
45
45
|
|
|
46
|
-
4. **Context Dilution** - In a 50-message session, the context from Phase
|
|
46
|
+
4. **Context Dilution** - In a 50-message session, the context from Phase 4 (research) is diluted by Phase 10 (implementation). Critical details get lost. Claude starts guessing instead of referencing research.
|
|
47
47
|
|
|
48
48
|
5. **Skipped Steps** - Without enforcement, Claude jumps directly to implementation. No tests. No verification. No documentation. You get code that "works" but fails in production because edge cases weren't tested.
|
|
49
49
|
|
|
50
50
|
### Our Solution
|
|
51
51
|
|
|
52
|
-
**A
|
|
52
|
+
**A 13-phase workflow enforced by Python hooks that BLOCK progress** until each phase is complete with explicit user approval. Not suggestions. Not guidelines. **Hard stops using Exit Code 2.**
|
|
53
53
|
|
|
54
54
|
This means:
|
|
55
55
|
- Claude cannot skip research
|
|
@@ -62,9 +62,9 @@ Every decision is tracked. Every phase is verified. Every step is enforced.
|
|
|
62
62
|
|
|
63
63
|
---
|
|
64
64
|
|
|
65
|
-
## The
|
|
65
|
+
## The 13-Phase Workflow
|
|
66
66
|
|
|
67
|
-
When you run `/api-create brandfetch`, Claude is guided through
|
|
67
|
+
When you run `/api-create brandfetch`, Claude is guided through 13 enforced phases. Each phase has three components:
|
|
68
68
|
|
|
69
69
|
1. **The Problem** - What goes wrong without enforcement
|
|
70
70
|
2. **The Solution** - How the phase prevents the problem
|
|
@@ -72,7 +72,7 @@ When you run `/api-create brandfetch`, Claude is guided through 12 enforced phas
|
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
|
|
75
|
-
### Phase
|
|
75
|
+
### Phase 1: Disambiguation
|
|
76
76
|
|
|
77
77
|
**The Problem We're Solving:**
|
|
78
78
|
Ambiguous terms waste hours of work. When you say "brandfetch," do you mean:
|
|
@@ -121,7 +121,7 @@ Five seconds of clarification saves an hour of wasted research. Everyone starts
|
|
|
121
121
|
---
|
|
122
122
|
|
|
123
123
|
<details>
|
|
124
|
-
<summary><strong>Phase
|
|
124
|
+
<summary><strong>Phase 2: Scope Confirmation</strong></summary>
|
|
125
125
|
|
|
126
126
|
**The Problem We're Solving:**
|
|
127
127
|
Misunderstood requirements lead to wrong implementations. You say "fetch brand assets" but Claude thinks you want a full-featured CMS with caching, authentication, rate limiting, and database persistence. Or worse - Claude thinks you want something simpler and omits features you need.
|
|
@@ -174,7 +174,7 @@ Requirements locked in before research begins. No backtracking. No "wait, that's
|
|
|
174
174
|
---
|
|
175
175
|
|
|
176
176
|
<details>
|
|
177
|
-
<summary><strong>Phase
|
|
177
|
+
<summary><strong>Phase 3: Initial Research</strong></summary>
|
|
178
178
|
|
|
179
179
|
**The Problem We're Solving:**
|
|
180
180
|
Training data is stale. Claude's knowledge cutoff might be January 2024, but the Brandfetch API was updated in March 2024 with new rate limit headers. Building from outdated knowledge means broken integrations.
|
|
@@ -258,7 +258,7 @@ Current, accurate documentation prevents integration failures. Cross-referencing
|
|
|
258
258
|
---
|
|
259
259
|
|
|
260
260
|
<details>
|
|
261
|
-
<summary><strong>Phase
|
|
261
|
+
<summary><strong>Phase 4: Structured Interview</strong></summary>
|
|
262
262
|
|
|
263
263
|
**The Problem We're Solving:**
|
|
264
264
|
Generic template questions don't reflect actual API capabilities. Without research, Claude asks:
|
|
@@ -337,7 +337,7 @@ The hook monitors tool calls:
|
|
|
337
337
|
```
|
|
338
338
|
|
|
339
339
|
**Critical Insight:**
|
|
340
|
-
These decisions are saved and automatically injected during implementation phases. When Claude writes tests (Phase
|
|
340
|
+
These decisions are saved and automatically injected during implementation phases. When Claude writes tests (Phase 8), it references `decisions.error_handling = "return_objects"` to know what to test. When implementing (Phase 9), it uses `decisions.caching = "24h"` to set cache headers.
|
|
341
341
|
|
|
342
342
|
Your choices drive the entire implementation. No guessing. No forgetting.
|
|
343
343
|
|
|
@@ -349,7 +349,7 @@ Questions based on research prevent impossible requirements. Interview answers b
|
|
|
349
349
|
---
|
|
350
350
|
|
|
351
351
|
<details>
|
|
352
|
-
<summary><strong>Phase
|
|
352
|
+
<summary><strong>Phase 5: Deep Research</strong></summary>
|
|
353
353
|
|
|
354
354
|
**The Problem We're Solving:**
|
|
355
355
|
Initial research provides the overview, but your specific choices need deeper investigation. You chose "Expose rate limit headers" - but which headers does Brandfetch actually return? You chose "Return error objects" - but what's the exact structure?
|
|
@@ -442,7 +442,7 @@ Targeted research prevents assumption-based implementation. You get exact header
|
|
|
442
442
|
---
|
|
443
443
|
|
|
444
444
|
<details>
|
|
445
|
-
<summary><strong>Phase
|
|
445
|
+
<summary><strong>Phase 6: Schema Creation</strong></summary>
|
|
446
446
|
|
|
447
447
|
**The Problem We're Solving:**
|
|
448
448
|
Without a contract between tests and implementation, they drift apart. Tests check for `logoUrl` but implementation returns `logo_url`. Tests expect 400 errors but implementation returns 500. The API "works" but doesn't match the spec.
|
|
@@ -538,7 +538,7 @@ Type safety from research to production. Tests verify the schema. Implementation
|
|
|
538
538
|
---
|
|
539
539
|
|
|
540
540
|
<details>
|
|
541
|
-
<summary><strong>Phase
|
|
541
|
+
<summary><strong>Phase 7: Environment Check</strong></summary>
|
|
542
542
|
|
|
543
543
|
**The Problem We're Solving:**
|
|
544
544
|
Tests pass locally but fail in CI. Why? Missing `BRANDFETCH_API_KEY` environment variable. You waste 30 minutes debugging, checking logs, re-running tests, before realizing the environment isn't set up.
|
|
@@ -618,7 +618,7 @@ No surprises in CI. No mock/real API drift. Tests run with real API calls from d
|
|
|
618
618
|
---
|
|
619
619
|
|
|
620
620
|
<details>
|
|
621
|
-
<summary><strong>Phase
|
|
621
|
+
<summary><strong>Phase 8: TDD Red (Write Failing Tests)</strong></summary>
|
|
622
622
|
|
|
623
623
|
**The Problem We're Solving:**
|
|
624
624
|
Without tests, you don't know if your code works. You ship bugs. You break things in production. You discover edge cases after users report them.
|
|
@@ -726,7 +726,7 @@ Tests first means bugs are caught before code is written. Requirements are encod
|
|
|
726
726
|
---
|
|
727
727
|
|
|
728
728
|
<details>
|
|
729
|
-
<summary><strong>Phase
|
|
729
|
+
<summary><strong>Phase 9: TDD Green (Make Tests Pass)</strong></summary>
|
|
730
730
|
|
|
731
731
|
**The Problem We're Solving:**
|
|
732
732
|
Over-engineering wastes time. Developers often write more code than needed:
|
|
@@ -866,10 +866,10 @@ Minimal code = minimal bugs. Tests define "done." If tests pass, you're done. No
|
|
|
866
866
|
---
|
|
867
867
|
|
|
868
868
|
<details>
|
|
869
|
-
<summary><strong>Phase
|
|
869
|
+
<summary><strong>Phase 10: Verification (Re-Research After Green)</strong></summary>
|
|
870
870
|
|
|
871
871
|
**The Problem We're Solving:**
|
|
872
|
-
Even after researching in Phase
|
|
872
|
+
Even after researching in Phase 3, Claude implements from memory in Phase 9. Twenty messages have passed. Context has diluted. Claude forgets specific details:
|
|
873
873
|
- Used `format` parameter but docs say `imageFormat`
|
|
874
874
|
- Returned `logo_url` but API returns `logoUrl`
|
|
875
875
|
- Forgot that API supports `include_fonts` parameter
|
|
@@ -963,7 +963,7 @@ Verification loop ensures implementation matches current docs. Memory errors cau
|
|
|
963
963
|
---
|
|
964
964
|
|
|
965
965
|
<details>
|
|
966
|
-
<summary><strong>Phase
|
|
966
|
+
<summary><strong>Phase 11: TDD Refactor</strong></summary>
|
|
967
967
|
|
|
968
968
|
**The Problem We're Solving:**
|
|
969
969
|
First implementations are messy. Variable names are unclear. Logic is duplicated. Comments are missing. But cleaning up code might break things - you change a condition, forget a case, introduce a regression.
|
|
@@ -1077,7 +1077,7 @@ Refactor confidently. Tests prove nothing broke. Code gets cleaner without risk.
|
|
|
1077
1077
|
---
|
|
1078
1078
|
|
|
1079
1079
|
<details>
|
|
1080
|
-
<summary><strong>Phase
|
|
1080
|
+
<summary><strong>Phase 12: Documentation</strong></summary>
|
|
1081
1081
|
|
|
1082
1082
|
**The Problem We're Solving:**
|
|
1083
1083
|
Knowledge gets lost. The next developer (or the next Claude session) starts from scratch:
|
|
@@ -1231,13 +1231,13 @@ Knowledge compounds instead of resetting.
|
|
|
1231
1231
|
---
|
|
1232
1232
|
|
|
1233
1233
|
<details>
|
|
1234
|
-
<summary><strong>Phase
|
|
1234
|
+
<summary><strong>Phase 13: Completion</strong></summary>
|
|
1235
1235
|
|
|
1236
1236
|
**The Problem We're Solving:**
|
|
1237
1237
|
How do you know everything is actually done? Claude might claim "finished" but skip phases:
|
|
1238
|
-
- Skipped verification (Phase
|
|
1239
|
-
- Forgot documentation (Phase
|
|
1240
|
-
- Never wrote tests (Phase
|
|
1238
|
+
- Skipped verification (Phase 10)
|
|
1239
|
+
- Forgot documentation (Phase 12)
|
|
1240
|
+
- Never wrote tests (Phase 8)
|
|
1241
1241
|
|
|
1242
1242
|
Without verification, "done" means "Claude stopped talking" not "workflow complete."
|
|
1243
1243
|
|
|
@@ -1247,19 +1247,19 @@ The `api-workflow-check.py` hook runs on Stop event (when you try to close Claud
|
|
|
1247
1247
|
```
|
|
1248
1248
|
Checking workflow completion...
|
|
1249
1249
|
|
|
1250
|
-
Phase
|
|
1251
|
-
Phase
|
|
1252
|
-
Phase
|
|
1253
|
-
Phase
|
|
1254
|
-
Phase
|
|
1255
|
-
Phase
|
|
1256
|
-
Phase
|
|
1257
|
-
Phase
|
|
1258
|
-
Phase
|
|
1259
|
-
Phase
|
|
1260
|
-
Phase
|
|
1261
|
-
Phase
|
|
1262
|
-
Phase
|
|
1250
|
+
Phase 1: Disambiguation ✅ Complete
|
|
1251
|
+
Phase 2: Scope ✅ Complete
|
|
1252
|
+
Phase 3: Research ✅ Complete (2 sources)
|
|
1253
|
+
Phase 4: Interview ✅ Complete (5 questions)
|
|
1254
|
+
Phase 5: Deep Research ✅ Complete (3 searches)
|
|
1255
|
+
Phase 6: Schema ✅ Complete
|
|
1256
|
+
Phase 7: Environment ✅ Complete (1 key)
|
|
1257
|
+
Phase 8: TDD Red ✅ Complete (10 tests)
|
|
1258
|
+
Phase 9: TDD Green ✅ Complete (10/10 passing)
|
|
1259
|
+
Phase 10: Verification ✅ Complete (1 omission)
|
|
1260
|
+
Phase 11: Refactor ✅ Complete
|
|
1261
|
+
Phase 12: Documentation ✅ Complete
|
|
1262
|
+
Phase 13: Completion ✅ In progress
|
|
1263
1263
|
|
|
1264
1264
|
All phases verified. Workflow complete.
|
|
1265
1265
|
|
|
@@ -1532,7 +1532,7 @@ Automatically installed by `npx @hustle-together/api-dev-tools`:
|
|
|
1532
1532
|
### Automatic Re-grounding
|
|
1533
1533
|
|
|
1534
1534
|
**The Problem:**
|
|
1535
|
-
Long sessions lose context. Phase
|
|
1535
|
+
Long sessions lose context. Phase 4 (interview) happens at turn 15. Phase 10 (verification) happens at turn 47. By turn 47, Claude has forgotten your interview decisions from turn 15.
|
|
1536
1536
|
|
|
1537
1537
|
**The Solution:**
|
|
1538
1538
|
`periodic-reground.py` re-injects state summary every 7 turns.
|
|
@@ -1582,13 +1582,13 @@ Research shows context dilution accelerates after 7-10 messages. Re-grounding ev
|
|
|
1582
1582
|
## File Structure
|
|
1583
1583
|
|
|
1584
1584
|
```
|
|
1585
|
-
@hustle-together/api-dev-tools v3.6.
|
|
1585
|
+
@hustle-together/api-dev-tools v3.6.4
|
|
1586
1586
|
│
|
|
1587
1587
|
├── bin/
|
|
1588
1588
|
│ └── cli.js # NPX installer
|
|
1589
1589
|
│
|
|
1590
1590
|
├── commands/ # 24 slash commands
|
|
1591
|
-
│ ├── api-create.md # Main
|
|
1591
|
+
│ ├── api-create.md # Main 13-phase workflow
|
|
1592
1592
|
│ ├── api-interview.md # Structured interview
|
|
1593
1593
|
│ ├── api-research.md # Adaptive research
|
|
1594
1594
|
│ ├── api-verify.md # Manual verification
|
|
@@ -1622,29 +1622,29 @@ Research shows context dilution accelerates after 7-10 messages. Re-grounding ev
|
|
|
1622
1622
|
│ ├── enforce-external-research.py # Detect API terms, require research
|
|
1623
1623
|
│ │
|
|
1624
1624
|
│ │ # PreToolUse (Write/Edit) - BLOCKING
|
|
1625
|
-
│ ├── enforce-disambiguation.py # Phase
|
|
1626
|
-
│ ├── enforce-scope.py # Phase
|
|
1627
|
-
│ ├── enforce-research.py # Phase
|
|
1628
|
-
│ ├── enforce-interview.py # Phase
|
|
1629
|
-
│ ├── enforce-deep-research.py # Phase
|
|
1630
|
-
│ ├── enforce-schema.py # Phase
|
|
1631
|
-
│ ├── enforce-environment.py # Phase
|
|
1632
|
-
│ ├── enforce-tdd-red.py # Phase
|
|
1633
|
-
│ ├── verify-implementation.py # Phase
|
|
1634
|
-
│ ├── enforce-verify.py # Phase
|
|
1635
|
-
│ ├── enforce-refactor.py # Phase
|
|
1636
|
-
│ ├── enforce-documentation.py # Phase
|
|
1625
|
+
│ ├── enforce-disambiguation.py # Phase 1
|
|
1626
|
+
│ ├── enforce-scope.py # Phase 2
|
|
1627
|
+
│ ├── enforce-research.py # Phase 3
|
|
1628
|
+
│ ├── enforce-interview.py # Phase 4
|
|
1629
|
+
│ ├── enforce-deep-research.py # Phase 5
|
|
1630
|
+
│ ├── enforce-schema.py # Phase 6
|
|
1631
|
+
│ ├── enforce-environment.py # Phase 7
|
|
1632
|
+
│ ├── enforce-tdd-red.py # Phase 8
|
|
1633
|
+
│ ├── verify-implementation.py # Phase 9 helper
|
|
1634
|
+
│ ├── enforce-verify.py # Phase 10
|
|
1635
|
+
│ ├── enforce-refactor.py # Phase 11
|
|
1636
|
+
│ ├── enforce-documentation.py # Phase 12
|
|
1637
1637
|
│ │
|
|
1638
1638
|
│ │ # PostToolUse - TRACKING
|
|
1639
1639
|
│ ├── track-tool-use.py # Log all tool usage
|
|
1640
1640
|
│ ├── periodic-reground.py # Re-inject context every 7 turns
|
|
1641
|
-
│ ├── verify-after-green.py # Auto-trigger Phase
|
|
1641
|
+
│ ├── verify-after-green.py # Auto-trigger Phase 10
|
|
1642
1642
|
│ │
|
|
1643
1643
|
│ │ # Stop - BLOCKING
|
|
1644
|
-
│ └── api-workflow-check.py # Phase
|
|
1644
|
+
│ └── api-workflow-check.py # Phase 13 (block if incomplete)
|
|
1645
1645
|
│
|
|
1646
1646
|
├── templates/
|
|
1647
|
-
│ ├── api-dev-state.json #
|
|
1647
|
+
│ ├── api-dev-state.json # 13 phases + phase_exit_confirmed
|
|
1648
1648
|
│ ├── settings.json # Hook registrations
|
|
1649
1649
|
│ ├── research-index.json # 7-day freshness tracking
|
|
1650
1650
|
│ └── CLAUDE-SECTION.md # CLAUDE.md injection
|
|
@@ -1804,11 +1804,18 @@ npx @hustle-together/api-dev-tools --scope=project
|
|
|
1804
1804
|
|
|
1805
1805
|
---
|
|
1806
1806
|
|
|
1807
|
+
## What's New in v3.6.4
|
|
1808
|
+
|
|
1809
|
+
### 1-Indexed Phase Numbering
|
|
1810
|
+
- Changed from 0-indexed (Phase 0-12) to 1-indexed (Phase 1-13)
|
|
1811
|
+
- More human-readable: Phase 1 starts the workflow, Phase 13 completes it
|
|
1812
|
+
- All documentation, hooks, and demo updated consistently
|
|
1813
|
+
|
|
1807
1814
|
## What's New in v3.6.1
|
|
1808
1815
|
|
|
1809
1816
|
### README Improvements
|
|
1810
1817
|
- Removed verbose ASCII workflow simulations (was 798 lines)
|
|
1811
|
-
- Added comprehensive explanations for all
|
|
1818
|
+
- Added comprehensive explanations for all 13 phases
|
|
1812
1819
|
- Detailed sections on Exit Code 2, Context7, phase_exit_confirmed
|
|
1813
1820
|
- Better mobile/narrow display formatting (50-char width ASCII)
|
|
1814
1821
|
- Collapsible sections for easier scanning
|
package/bin/cli.js
CHANGED
|
@@ -482,7 +482,7 @@ function main() {
|
|
|
482
482
|
log(' Test UI: /api-test page + /api/test-structure API (if Next.js)', 'blue');
|
|
483
483
|
|
|
484
484
|
log('\n🆕 New in v3.0:', 'bright');
|
|
485
|
-
log(' •
|
|
485
|
+
log(' • 13 phases, each with mandatory user checkpoint', 'cyan');
|
|
486
486
|
log(' • AskUserQuestion required at EVERY phase transition', 'cyan');
|
|
487
487
|
log(' • Loop-back support when user wants changes', 'cyan');
|
|
488
488
|
log(' • Adaptive research (propose-approve, not shotgun)', 'cyan');
|
|
@@ -490,24 +490,24 @@ function main() {
|
|
|
490
490
|
log(' • Research freshness (7-day cache validity)', 'cyan');
|
|
491
491
|
|
|
492
492
|
log('\n🔒 User Checkpoint Enforcement:', 'bright');
|
|
493
|
-
log(' • Phase
|
|
494
|
-
log(' • Phase
|
|
495
|
-
log(' • Phase
|
|
496
|
-
log(' • Phase
|
|
497
|
-
log(' • Phase
|
|
498
|
-
log(' • Phase
|
|
499
|
-
log(' • Phase
|
|
500
|
-
log(' • Phase
|
|
501
|
-
log(' • Phase
|
|
502
|
-
log(' • Phase
|
|
493
|
+
log(' • Phase 1: "Which interpretation?" (disambiguation)', 'cyan');
|
|
494
|
+
log(' • Phase 2: "Scope correct?" (scope confirmation)', 'cyan');
|
|
495
|
+
log(' • Phase 3: "Proceed to interview?" (research summary)', 'cyan');
|
|
496
|
+
log(' • Phase 4: "Interview complete?" (all questions answered)', 'cyan');
|
|
497
|
+
log(' • Phase 5: "Approve searches?" (deep research proposal)', 'cyan');
|
|
498
|
+
log(' • Phase 6: "Schema matches interview?" (schema review)', 'cyan');
|
|
499
|
+
log(' • Phase 7: "Ready for testing?" (environment check)', 'cyan');
|
|
500
|
+
log(' • Phase 8: "Test plan looks good?" (test matrix)', 'cyan');
|
|
501
|
+
log(' • Phase 10: "Fix gaps?" (verification decision)', 'cyan');
|
|
502
|
+
log(' • Phase 12: "Documentation complete?" (final checklist)', 'cyan');
|
|
503
503
|
|
|
504
504
|
log('\n📚 Available Commands:', 'bright');
|
|
505
|
-
log(' /api-create [endpoint] - Complete
|
|
505
|
+
log(' /api-create [endpoint] - Complete 13-phase workflow', 'blue');
|
|
506
506
|
log(' /api-interview [endpoint] - Questions FROM research', 'blue');
|
|
507
507
|
log(' /api-research [library] - Adaptive propose-approve research', 'blue');
|
|
508
|
-
log(' /api-verify [endpoint] - Manual Phase
|
|
508
|
+
log(' /api-verify [endpoint] - Manual Phase 10 verification', 'blue');
|
|
509
509
|
log(' /api-env [endpoint] - Check API keys and environment', 'blue');
|
|
510
|
-
log(' /api-status [endpoint] - Track
|
|
510
|
+
log(' /api-status [endpoint] - Track 13-phase progress', 'blue');
|
|
511
511
|
|
|
512
512
|
log('\n🚀 Quick Start:', 'bright');
|
|
513
513
|
log(' /api-create my-endpoint', 'blue');
|
package/commands/README.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
## What's New in v3.0
|
|
6
6
|
|
|
7
|
-
- **Phase
|
|
8
|
-
- **Phase
|
|
7
|
+
- **Phase 1: Disambiguation** - Search variations before research
|
|
8
|
+
- **Phase 10: Verify** - Re-research after tests pass to catch memory errors
|
|
9
9
|
- **Adaptive Research** - Propose searches based on context, not shotgun
|
|
10
10
|
- **Questions FROM Research** - Interview generates questions from discovered params
|
|
11
11
|
- **7-Turn Re-grounding** - Periodic context injection prevents dilution
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
| `verify-implementation.py` | PreToolUse | Require test file before route |
|
|
23
23
|
| `track-tool-use.py` | PostToolUse | Log research, count turns |
|
|
24
24
|
| `periodic-reground.py` | PostToolUse | Re-ground every 7 turns |
|
|
25
|
-
| `verify-after-green.py` | PostToolUse | Trigger Phase
|
|
25
|
+
| `verify-after-green.py` | PostToolUse | Trigger Phase 10 after test pass |
|
|
26
26
|
| `api-workflow-check.py` | Stop | Block if phases incomplete |
|
|
27
27
|
|
|
28
28
|
## Available Commands
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
### Complete Workflow
|
|
31
31
|
|
|
32
32
|
**`/api-create [endpoint-name]`**
|
|
33
|
-
- Runs all
|
|
33
|
+
- Runs all 13 phases automatically
|
|
34
34
|
- Loop-back architecture at every checkpoint
|
|
35
35
|
- See [api-create.md](api-create.md) for full flow
|
|
36
36
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
- See [api-research.md](api-research.md)
|
|
48
48
|
|
|
49
49
|
**`/api-verify [endpoint-name]`** (NEW)
|
|
50
|
-
- Manual Phase
|
|
50
|
+
- Manual Phase 10 verification
|
|
51
51
|
- Re-read docs, compare to implementation
|
|
52
52
|
- Report gaps, loop back or document omissions
|
|
53
53
|
- See [api-verify.md](api-verify.md)
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
- See [api-env.md](api-env.md)
|
|
58
58
|
|
|
59
59
|
**`/api-status [endpoint-name]`**
|
|
60
|
-
- Track progress through
|
|
60
|
+
- Track progress through 13 phases
|
|
61
61
|
- See [api-status.md](api-status.md)
|
|
62
62
|
|
|
63
63
|
### TDD Commands
|
|
@@ -68,22 +68,22 @@ From [@wbern/claude-instructions](https://github.com/wbern/claude-instructions):
|
|
|
68
68
|
- `/refactor` - Clean up while tests pass
|
|
69
69
|
- `/cycle [description]` - Full Red → Green → Refactor
|
|
70
70
|
|
|
71
|
-
##
|
|
71
|
+
## 13-Phase Flow
|
|
72
72
|
|
|
73
73
|
```
|
|
74
|
-
Phase
|
|
75
|
-
Phase
|
|
76
|
-
Phase
|
|
77
|
-
Phase
|
|
78
|
-
Phase
|
|
79
|
-
Phase
|
|
80
|
-
Phase
|
|
81
|
-
Phase
|
|
82
|
-
Phase
|
|
83
|
-
Phase
|
|
84
|
-
Phase
|
|
85
|
-
Phase
|
|
86
|
-
Phase
|
|
74
|
+
Phase 1: DISAMBIGUATION - Clarify ambiguous terms
|
|
75
|
+
Phase 2: SCOPE - Confirm understanding
|
|
76
|
+
Phase 3: INITIAL RESEARCH - 2-3 targeted searches
|
|
77
|
+
Phase 4: INTERVIEW - Questions FROM research
|
|
78
|
+
Phase 5: DEEP RESEARCH - Adaptive propose-approve
|
|
79
|
+
Phase 6: SCHEMA - Zod from research + interview
|
|
80
|
+
Phase 7: ENVIRONMENT - Verify API keys
|
|
81
|
+
Phase 8: TDD RED - Write failing tests
|
|
82
|
+
Phase 9: TDD GREEN - Minimal implementation
|
|
83
|
+
Phase 10: VERIFY - Re-research, find gaps
|
|
84
|
+
Phase 11: TDD REFACTOR - Clean up code
|
|
85
|
+
Phase 12: DOCUMENTATION - Update manifests
|
|
86
|
+
Phase 13: COMPLETION - Final verification
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
## State File
|
package/commands/api-create.md
CHANGED
|
@@ -370,7 +370,7 @@ Both conditions must be true for the flag to be set.
|
|
|
370
370
|
│ │
|
|
371
371
|
│ WAIT for user response. Do NOT auto-decide. │
|
|
372
372
|
│ HOOK: PostToolUse triggers after test pass │
|
|
373
|
-
│ ──── Loop back to Phase
|
|
373
|
+
│ ──── Loop back to Phase 8 if user wants fixes ──── │
|
|
374
374
|
└───────────────────────────────────────────────────────────┘
|
|
375
375
|
│
|
|
376
376
|
▼
|
|
@@ -489,11 +489,11 @@ This command creates:
|
|
|
489
489
|
|
|
490
490
|
## Never Skip
|
|
491
491
|
|
|
492
|
-
- Phase
|
|
493
|
-
- Phase
|
|
494
|
-
- Phase
|
|
495
|
-
- Phase
|
|
496
|
-
- Phase
|
|
497
|
-
- Phase
|
|
492
|
+
- Phase 1 (Disambiguation) - Clarify before research
|
|
493
|
+
- Phase 3 (Initial Research) - Find ALL parameters
|
|
494
|
+
- Phase 4 (Interview) - Questions FROM research, not templates
|
|
495
|
+
- Phase 8 (TDD Red) - Failing tests FIRST
|
|
496
|
+
- Phase 10 (Verify) - Re-research after Green
|
|
497
|
+
- Phase 12 (Documentation) - Keep docs in sync
|
|
498
498
|
- Coverage verification - 100% required
|
|
499
499
|
</claude-commands-template>
|
|
@@ -35,7 +35,7 @@ Based on research, Brandfetch API has 7 parameters:
|
|
|
35
35
|
|
|
36
36
|
## Interview Flow
|
|
37
37
|
|
|
38
|
-
###
|
|
38
|
+
### PREREQUISITE - Research Must Be Complete (Phase 3)
|
|
39
39
|
|
|
40
40
|
**Interview is BLOCKED until research is done.**
|
|
41
41
|
|
|
@@ -52,7 +52,7 @@ Discovered parameters:
|
|
|
52
52
|
- 2 continuous ranges
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### Parameter-Based Questions
|
|
56
56
|
|
|
57
57
|
For each discovered parameter, generate an appropriate question:
|
|
58
58
|
|
|
@@ -119,7 +119,7 @@ For each discovered parameter, generate an appropriate question:
|
|
|
119
119
|
└────────────────────────────────────────────────────────────┘
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
###
|
|
122
|
+
### Feature Questions
|
|
123
123
|
|
|
124
124
|
Based on discovered features, ask about priorities:
|
|
125
125
|
|
|
@@ -139,7 +139,7 @@ Based on discovered features, ask about priorities:
|
|
|
139
139
|
└────────────────────────────────────────────────────────────┘
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
###
|
|
142
|
+
### Error Handling Questions
|
|
143
143
|
|
|
144
144
|
```
|
|
145
145
|
┌────────────────────────────────────────────────────────────┐
|
|
@@ -162,7 +162,7 @@ Based on discovered features, ask about priorities:
|
|
|
162
162
|
└────────────────────────────────────────────────────────────┘
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
###
|
|
165
|
+
### Deep Research Proposal (Phase 5)
|
|
166
166
|
|
|
167
167
|
After interview, propose additional research:
|
|
168
168
|
|
package/commands/api-research.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
## Research Phases
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### Initial Discovery (Automatic)
|
|
22
22
|
|
|
23
23
|
Run 2-3 targeted searches:
|
|
24
24
|
```
|
|
@@ -47,7 +47,7 @@ Present initial summary:
|
|
|
47
47
|
└────────────────────────────────────────────────────────────┘
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
###
|
|
50
|
+
### Deep Research (Proposed)
|
|
51
51
|
|
|
52
52
|
After interview, PROPOSE targeted searches based on user's selections:
|
|
53
53
|
|
|
@@ -78,7 +78,7 @@ After interview, PROPOSE targeted searches based on user's selections:
|
|
|
78
78
|
└────────────────────────────────────────────────────────────┘
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
###
|
|
81
|
+
### Execute Approved Searches
|
|
82
82
|
|
|
83
83
|
Only run searches that were explicitly approved:
|
|
84
84
|
- Track which searches were proposed vs approved vs skipped
|
|
@@ -257,7 +257,7 @@ Creates: `.claude/research/[library-name]/CURRENT.md`
|
|
|
257
257
|
- Every field has a source (docs, SDK types, API response)
|
|
258
258
|
- Don't guess - verify each capability
|
|
259
259
|
|
|
260
|
-
3. **Verify with Phase
|
|
260
|
+
3. **Verify with Phase 10**
|
|
261
261
|
- After implementation, re-research
|
|
262
262
|
- Compare docs to implementation
|
|
263
263
|
- Fix gaps or document intentional omissions
|
|
@@ -324,8 +324,8 @@ All research is tracked in `.claude/api-dev-state.json`:
|
|
|
324
324
|
|
|
325
325
|
## Integration with API Development
|
|
326
326
|
|
|
327
|
-
- Phase
|
|
328
|
-
- Phase
|
|
329
|
-
- Phase
|
|
327
|
+
- Phase 3 of `/api-create` uses this for initial research
|
|
328
|
+
- Phase 5 uses adaptive proposal flow
|
|
329
|
+
- Phase 10 (Verify) triggers re-research
|
|
330
330
|
- Freshness check prevents stale data
|
|
331
331
|
</claude-commands-template>
|
package/commands/api-verify.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# API Verify - Implementation Verification (Phase
|
|
1
|
+
# API Verify - Implementation Verification (Phase 10) v3.0
|
|
2
2
|
|
|
3
3
|
**Usage:** `/api-verify [endpoint-name]`
|
|
4
4
|
|
|
5
|
-
**Purpose:** Manually trigger Phase
|
|
5
|
+
**Purpose:** Manually trigger Phase 10 verification - re-research documentation and compare to implementation to catch memory-based errors.
|
|
6
6
|
|
|
7
7
|
## When to Use
|
|
8
8
|
|
|
@@ -170,7 +170,7 @@ Creates: `.claude/research/[api-name]/verification.md`
|
|
|
170
170
|
## Intentional Omissions
|
|
171
171
|
|
|
172
172
|
1. **webhook support**
|
|
173
|
-
- Reason: User declined in interview (Phase
|
|
173
|
+
- Reason: User declined in interview (Phase 4)
|
|
174
174
|
- Decision recorded: api-dev-state.json
|
|
175
175
|
- May add in v2
|
|
176
176
|
|
|
@@ -197,17 +197,17 @@ Manual invocation is useful when:
|
|
|
197
197
|
## Workflow Position
|
|
198
198
|
|
|
199
199
|
```
|
|
200
|
-
Phase
|
|
200
|
+
Phase 8: TDD Red (write tests)
|
|
201
201
|
│
|
|
202
202
|
▼
|
|
203
|
-
Phase
|
|
203
|
+
Phase 9: TDD Green (implementation)
|
|
204
204
|
│
|
|
205
205
|
▼
|
|
206
|
-
Phase
|
|
206
|
+
Phase 10: VERIFY ← /api-verify triggers this
|
|
207
207
|
│
|
|
208
|
-
├─► Gaps found? → Loop back to Phase
|
|
208
|
+
├─► Gaps found? → Loop back to Phase 8
|
|
209
209
|
│
|
|
210
|
-
└─► All verified → Proceed to Phase
|
|
210
|
+
└─► All verified → Proceed to Phase 11 (Refactor)
|
|
211
211
|
```
|
|
212
212
|
|
|
213
213
|
<claude-commands-template>
|