@hustle-together/api-dev-tools 3.6.3 → 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 +56 -56
- package/bin/cli.js +11 -11
- package/commands/README.md +17 -17
- 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 +65 -65
- 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 +13 -13
package/hooks/enforce-schema.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Hook: PreToolUse for Write/Edit
|
|
4
4
|
Purpose: Block writing implementation if schema not reviewed WITH USER CONFIRMATION
|
|
5
5
|
|
|
6
|
-
Phase
|
|
6
|
+
Phase 6 requires:
|
|
7
7
|
1. Create Zod schemas based on interview + research
|
|
8
8
|
2. SHOW schema to user in formatted display
|
|
9
9
|
3. USE AskUserQuestion: "Schema matches interview? [Y/n]"
|
|
@@ -97,7 +97,7 @@ def main():
|
|
|
97
97
|
|
|
98
98
|
print(json.dumps({
|
|
99
99
|
"permissionDecision": "deny",
|
|
100
|
-
"reason": f"""❌ BLOCKED: Schema creation (Phase
|
|
100
|
+
"reason": f"""❌ BLOCKED: Schema creation (Phase 6) not complete.
|
|
101
101
|
|
|
102
102
|
Status: {status}
|
|
103
103
|
Schema shown: {schema_shown}
|
|
@@ -157,7 +157,7 @@ REQUIRED STEPS:
|
|
|
157
157
|
|
|
158
158
|
5. If user says "restart":
|
|
159
159
|
• Reset interview phase
|
|
160
|
-
• Go back to Phase
|
|
160
|
+
• Go back to Phase 4
|
|
161
161
|
|
|
162
162
|
6. If user says "confirm":
|
|
163
163
|
• Set schema_creation.user_confirmed = true
|
package/hooks/enforce-scope.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Hook: PreToolUse for Write/Edit
|
|
4
4
|
Purpose: Block writing API code if scope not confirmed BY USER
|
|
5
5
|
|
|
6
|
-
Phase
|
|
6
|
+
Phase 2 requires:
|
|
7
7
|
1. Present scope understanding to user
|
|
8
8
|
2. USE AskUserQuestion: "Is this correct? [Y/n]"
|
|
9
9
|
3. Record any modifications user requests
|
|
@@ -87,7 +87,7 @@ def main():
|
|
|
87
87
|
|
|
88
88
|
print(json.dumps({
|
|
89
89
|
"permissionDecision": "deny",
|
|
90
|
-
"reason": f"""❌ BLOCKED: Scope confirmation (Phase
|
|
90
|
+
"reason": f"""❌ BLOCKED: Scope confirmation (Phase 2) not complete.
|
|
91
91
|
|
|
92
92
|
Status: {status}
|
|
93
93
|
User question asked: {user_question_asked}
|
package/hooks/enforce-tdd-red.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Hook: PreToolUse for Write/Edit
|
|
4
4
|
Purpose: Block writing implementation if test matrix not approved WITH USER CONFIRMATION
|
|
5
5
|
|
|
6
|
-
Phase
|
|
6
|
+
Phase 8 (TDD Red) requires:
|
|
7
7
|
1. Propose test matrix based on interview + schema
|
|
8
8
|
2. SHOW test plan to user (scenarios, edge cases, coverage)
|
|
9
9
|
3. USE AskUserQuestion: "Test plan looks good? [Y/n]"
|
|
@@ -144,7 +144,7 @@ Example test structure:
|
|
|
144
144
|
|
|
145
145
|
print(json.dumps({
|
|
146
146
|
"permissionDecision": "deny",
|
|
147
|
-
"reason": f"""❌ BLOCKED: TDD Red phase (Phase
|
|
147
|
+
"reason": f"""❌ BLOCKED: TDD Red phase (Phase 8) not complete.
|
|
148
148
|
|
|
149
149
|
Current status: {tdd_red_status}
|
|
150
150
|
Test count: {test_count}
|
package/hooks/enforce-verify.py
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Hook: PreToolUse for Write/Edit
|
|
4
4
|
Purpose: Block refactoring until verification complete WITH USER GAP DECISION
|
|
5
5
|
|
|
6
|
-
Phase
|
|
6
|
+
Phase 10 (Verify) requires:
|
|
7
7
|
1. Re-read original documentation (after tests pass)
|
|
8
8
|
2. Compare implementation to docs - find gaps
|
|
9
9
|
3. SHOW gap analysis to user
|
|
10
10
|
4. USE AskUserQuestion: "Fix gaps? [Y] / Skip? [n]"
|
|
11
|
-
5. Loop back to Phase
|
|
11
|
+
5. Loop back to Phase 8 if user wants fixes
|
|
12
12
|
6. Only proceed to refactor when user decides
|
|
13
13
|
|
|
14
14
|
Returns:
|
|
@@ -94,7 +94,7 @@ def main():
|
|
|
94
94
|
|
|
95
95
|
print(json.dumps({
|
|
96
96
|
"permissionDecision": "deny",
|
|
97
|
-
"reason": f"""❌ BLOCKED: Verification (Phase
|
|
97
|
+
"reason": f"""❌ BLOCKED: Verification (Phase 10) not complete.
|
|
98
98
|
|
|
99
99
|
Status: {status}
|
|
100
100
|
Re-research done: {re_research_done}
|
|
@@ -116,7 +116,7 @@ MISSING:
|
|
|
116
116
|
REQUIRED STEPS:
|
|
117
117
|
|
|
118
118
|
1. Re-read the ORIGINAL API documentation:
|
|
119
|
-
• Use Context7 or WebSearch with SAME queries from Phase
|
|
119
|
+
• Use Context7 or WebSearch with SAME queries from Phase 3
|
|
120
120
|
• Compare EVERY documented feature to your implementation
|
|
121
121
|
• Don't rely on memory - actually re-read the docs
|
|
122
122
|
|
|
@@ -146,7 +146,7 @@ REQUIRED STEPS:
|
|
|
146
146
|
]
|
|
147
147
|
|
|
148
148
|
4. If user says "fix":
|
|
149
|
-
• Loop back to Phase
|
|
149
|
+
• Loop back to Phase 8 (TDD Red)
|
|
150
150
|
• Write new tests for missing features
|
|
151
151
|
• Implement and verify again
|
|
152
152
|
• REPEAT until no gaps or user says skip
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
3
|
Hook: PostToolUse (after test runs)
|
|
4
|
-
Purpose: Trigger Phase
|
|
4
|
+
Purpose: Trigger Phase 10 (Verify) + Manifest Generation after tests pass
|
|
5
5
|
|
|
6
6
|
This hook detects when tests pass (TDD Green phase complete) and:
|
|
7
7
|
1. Runs the programmatic manifest generation scripts
|
|
@@ -243,7 +243,7 @@ def main():
|
|
|
243
243
|
context_parts.append("---")
|
|
244
244
|
context_parts.append("")
|
|
245
245
|
|
|
246
|
-
context_parts.append("## Phase
|
|
246
|
+
context_parts.append("## Phase 10: Implementation Verification Required")
|
|
247
247
|
context_parts.append("")
|
|
248
248
|
context_parts.append("Tests are passing. Before proceeding, you MUST verify your implementation:")
|
|
249
249
|
context_parts.append("")
|
package/package.json
CHANGED
|
@@ -16,19 +16,19 @@ This project uses **@hustle-together/api-dev-tools** for interview-driven, resea
|
|
|
16
16
|
### 13-Phase Flow
|
|
17
17
|
|
|
18
18
|
```
|
|
19
|
-
Phase
|
|
20
|
-
Phase
|
|
21
|
-
Phase
|
|
22
|
-
Phase
|
|
23
|
-
Phase
|
|
24
|
-
Phase
|
|
25
|
-
Phase
|
|
26
|
-
Phase
|
|
27
|
-
Phase
|
|
28
|
-
Phase
|
|
29
|
-
Phase
|
|
30
|
-
Phase
|
|
31
|
-
Phase
|
|
19
|
+
Phase 1: DISAMBIGUATION - Clarify ambiguous terms before research
|
|
20
|
+
Phase 2: SCOPE - Confirm understanding of endpoint
|
|
21
|
+
Phase 3: INITIAL RESEARCH - 2-3 targeted searches (Context7, WebSearch)
|
|
22
|
+
Phase 4: INTERVIEW - Questions generated FROM discovered params
|
|
23
|
+
Phase 5: DEEP RESEARCH - Propose additional searches based on answers
|
|
24
|
+
Phase 6: SCHEMA - Create Zod schema from research + interview
|
|
25
|
+
Phase 7: ENVIRONMENT - Verify API keys exist
|
|
26
|
+
Phase 8: TDD RED - Write failing tests from schema
|
|
27
|
+
Phase 9: TDD GREEN - Minimal implementation to pass tests
|
|
28
|
+
Phase 10: VERIFY - Re-research docs, compare to implementation
|
|
29
|
+
Phase 11: TDD REFACTOR - Clean up code while tests pass
|
|
30
|
+
Phase 12: DOCUMENTATION - Update manifests, cache research
|
|
31
|
+
Phase 13: COMPLETION - Final verification, commit
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
### Key Principles
|