@hustle-together/api-dev-tools 3.11.1 → 3.12.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.
- package/.claude/agents/code-reviewer.md +170 -0
- package/.claude/agents/docs-generator.md +80 -0
- package/.claude/agents/implementation-reviewer.md +119 -0
- package/.claude/agents/parallel-researcher.md +52 -0
- package/.claude/agents/research-validator.md +116 -0
- package/.claude/agents/schema-generator.md +70 -0
- package/.claude/agents/test-writer.md +104 -0
- package/.claude/api-dev-state.json +305 -56
- package/.claude/commands/README.md +21 -10
- package/.claude/commands/add-command.md +8 -5
- package/.claude/commands/api-create.md +36 -25
- package/.claude/commands/api-env.md +1 -0
- package/.claude/commands/api-interview.md +32 -19
- package/.claude/commands/api-research.md +47 -21
- package/.claude/commands/api-status.md +21 -1
- package/.claude/commands/api-verify.md +14 -13
- package/.claude/commands/beepboop.md +4 -5
- package/.claude/commands/busycommit.md +2 -3
- package/.claude/commands/commit.md +2 -3
- package/.claude/commands/cycle.md +2 -7
- package/.claude/commands/gap.md +2 -3
- package/.claude/commands/green.md +2 -7
- package/.claude/commands/issue.md +3 -8
- package/.claude/commands/ntfy-setup.md +91 -0
- package/.claude/commands/ntfy-test.md +74 -0
- package/.claude/commands/plan.md +2 -3
- package/.claude/commands/pr.md +2 -3
- package/.claude/commands/publish.md +40 -0
- package/.claude/commands/red.md +2 -7
- package/.claude/commands/refactor.md +2 -7
- package/.claude/commands/spike.md +2 -7
- package/.claude/commands/summarize.md +2 -3
- package/.claude/commands/tdd.md +2 -7
- package/.claude/commands/worktree-add.md +208 -216
- package/.claude/commands/worktree-cleanup.md +172 -178
- package/.claude/settings.json +63 -12
- package/.claude/settings.local.json +2 -1
- package/.claude-plugin/marketplace.json +2 -11
- package/.skills/README.md +55 -53
- package/.skills/_shared/settings.json +1 -1
- package/.skills/add-command/SKILL.md +10 -5
- package/.skills/api-create/SKILL.md +146 -35
- package/.skills/api-env/SKILL.md +1 -0
- package/.skills/api-interview/SKILL.md +32 -19
- package/.skills/api-research/SKILL.md +47 -21
- package/.skills/api-status/SKILL.md +21 -1
- package/.skills/api-verify/SKILL.md +14 -13
- package/.skills/beepboop/SKILL.md +6 -5
- package/.skills/busycommit/SKILL.md +4 -3
- package/.skills/commit/SKILL.md +4 -3
- package/.skills/cycle/SKILL.md +4 -7
- package/.skills/gap/SKILL.md +4 -3
- package/.skills/green/SKILL.md +4 -7
- package/.skills/issue/SKILL.md +5 -8
- package/.skills/plan/SKILL.md +4 -3
- package/.skills/pr/SKILL.md +4 -3
- package/.skills/publish/SKILL.md +160 -0
- package/.skills/red/SKILL.md +4 -7
- package/.skills/refactor/SKILL.md +4 -7
- package/.skills/spike/SKILL.md +4 -7
- package/.skills/summarize/SKILL.md +4 -3
- package/.skills/tdd/SKILL.md +4 -7
- package/.skills/update-todos/SKILL.md +22 -0
- package/.skills/worktree-add/SKILL.md +210 -216
- package/.skills/worktree-cleanup/SKILL.md +183 -187
- package/CHANGELOG.md +97 -79
- package/README.md +161 -7142
- package/bin/cli.js +448 -805
- package/commands/README.md +66 -31
- package/commands/add-command.md +8 -5
- package/commands/beepboop.md +4 -5
- package/commands/busycommit.md +2 -3
- package/commands/commit.md +2 -3
- package/commands/cycle.md +2 -7
- package/commands/gap.md +2 -3
- package/commands/green.md +2 -7
- package/commands/hustle-api-continue.md +8 -5
- package/commands/hustle-api-create.md +70 -29
- package/commands/hustle-api-env.md +1 -0
- package/commands/hustle-api-interview.md +32 -19
- package/commands/hustle-api-research.md +47 -21
- package/commands/hustle-api-sessions.md +8 -7
- package/commands/hustle-api-status.md +21 -1
- package/commands/hustle-api-verify.md +14 -13
- package/commands/hustle-combine.md +488 -241
- package/commands/hustle-ui-create-page.md +113 -50
- package/commands/hustle-ui-create.md +179 -26
- package/commands/issue.md +3 -8
- package/commands/plan.md +2 -3
- package/commands/pr.md +2 -3
- package/commands/red.md +2 -7
- package/commands/refactor.md +2 -7
- package/commands/spike.md +2 -7
- package/commands/summarize.md +2 -3
- package/commands/tdd.md +2 -7
- package/commands/worktree-add.md +208 -216
- package/commands/worktree-cleanup.md +172 -178
- package/hooks/api-workflow-check.py +5 -3
- package/hooks/enforce-component-type-confirm.py +97 -0
- package/hooks/lib/__init__.py +1 -0
- package/hooks/lib/greptile.py +355 -0
- package/hooks/lib/ntfy.py +209 -0
- package/hooks/notify-input-needed.py +73 -0
- package/hooks/notify-phase-complete.py +90 -0
- package/hooks/run-code-review.py +246 -0
- package/hooks/track-token-usage.py +121 -0
- package/package.json +13 -3
- package/scripts/collect-test-results.ts +102 -77
- package/scripts/extract-parameters.ts +112 -70
- package/scripts/generate-test-manifest.ts +118 -77
- package/templates/.env.example +57 -0
- package/templates/BRAND_GUIDE.md +92 -52
- package/templates/CLAUDE-SECTION.md +40 -37
- package/templates/SPEC.json +186 -38
- package/templates/api-dev-state.json +33 -4
- package/templates/api-showcase/_components/APICard.tsx +22 -18
- package/templates/api-showcase/_components/APIModal.tsx +110 -64
- package/templates/api-showcase/_components/APIShowcase.tsx +53 -35
- package/templates/api-showcase/_components/APITester.tsx +128 -67
- package/templates/api-showcase/page.tsx +4 -4
- package/templates/api-test/page.tsx +51 -30
- package/templates/api-test/test-structure/route.ts +43 -34
- package/templates/component/Component.stories.tsx +41 -39
- package/templates/component/Component.test.tsx +96 -78
- package/templates/component/Component.tsx +63 -52
- package/templates/component/Component.types.ts +10 -6
- package/templates/component/Component.visual.spec.ts +170 -0
- package/templates/component/index.ts +2 -2
- package/templates/dev-tools/_components/DevToolsLanding.tsx +8 -8
- package/templates/dev-tools/page.tsx +4 -3
- package/templates/mcp-servers.json +30 -2
- package/templates/page/page.e2e.test.ts +56 -48
- package/templates/page/page.tsx +3 -3
- package/templates/shared/HeroHeader.tsx +16 -15
- package/templates/shared/index.ts +1 -1
- package/templates/ui-showcase/_components/PreviewCard.tsx +20 -20
- package/templates/ui-showcase/_components/PreviewModal.tsx +149 -108
- package/templates/ui-showcase/_components/UIShowcase.tsx +43 -35
- package/templates/ui-showcase/page.tsx +4 -4
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-writer
|
|
3
|
+
description: Test case generator from schemas and interview decisions. Use during Phase 8 (TDD Red) to create comprehensive failing tests before implementation.
|
|
4
|
+
tools: Read, Write, Grep, Glob
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Test Writer Agent
|
|
9
|
+
|
|
10
|
+
You are a TDD specialist that writes comprehensive, failing tests based on schemas and interview decisions.
|
|
11
|
+
|
|
12
|
+
## Your Role
|
|
13
|
+
|
|
14
|
+
1. **Analyze schemas** - Understand request/response structure
|
|
15
|
+
2. **Apply interview decisions** - Test user-specified behaviors
|
|
16
|
+
3. **Write failing tests** - Tests that define expected behavior
|
|
17
|
+
4. **Cover edge cases** - Error handling, validation, edge cases
|
|
18
|
+
|
|
19
|
+
## Input Format
|
|
20
|
+
|
|
21
|
+
You will receive:
|
|
22
|
+
|
|
23
|
+
- Zod schemas for request/response
|
|
24
|
+
- Interview decisions (error handling, formats, etc.)
|
|
25
|
+
- Target test file path
|
|
26
|
+
- Endpoint path and method
|
|
27
|
+
|
|
28
|
+
## Output Format
|
|
29
|
+
|
|
30
|
+
Generate comprehensive test file:
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
34
|
+
import { NextRequest } from "next/server";
|
|
35
|
+
import { POST } from "../route";
|
|
36
|
+
|
|
37
|
+
describe("[Endpoint] API", () => {
|
|
38
|
+
describe("POST /api/v2/[endpoint]", () => {
|
|
39
|
+
// Happy path tests
|
|
40
|
+
it("should return data with valid request", async () => {
|
|
41
|
+
const request = new NextRequest("http://localhost/api/v2/endpoint", {
|
|
42
|
+
method: "POST",
|
|
43
|
+
body: JSON.stringify({
|
|
44
|
+
/* valid data */
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const response = await POST(request);
|
|
49
|
+
const data = await response.json();
|
|
50
|
+
|
|
51
|
+
expect(response.status).toBe(200);
|
|
52
|
+
expect(data).toHaveProperty("result");
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// Validation tests
|
|
56
|
+
it("should return 400 for missing required fields", async () => {
|
|
57
|
+
const request = new NextRequest("http://localhost/api/v2/endpoint", {
|
|
58
|
+
method: "POST",
|
|
59
|
+
body: JSON.stringify({}),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const response = await POST(request);
|
|
63
|
+
expect(response.status).toBe(400);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Error handling tests (from interview)
|
|
67
|
+
it("should handle API errors gracefully", async () => {
|
|
68
|
+
// Mock external API failure
|
|
69
|
+
vi.spyOn(global, "fetch").mockRejectedValueOnce(new Error("API down"));
|
|
70
|
+
|
|
71
|
+
const request = new NextRequest("http://localhost/api/v2/endpoint", {
|
|
72
|
+
method: "POST",
|
|
73
|
+
body: JSON.stringify({
|
|
74
|
+
/* valid data */
|
|
75
|
+
}),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const response = await POST(request);
|
|
79
|
+
expect(response.status).toBe(500);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Format tests (from interview)
|
|
83
|
+
it("should return requested format", async () => {
|
|
84
|
+
// Test based on interview format decisions
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Test Categories
|
|
91
|
+
|
|
92
|
+
1. **Happy Path** - Valid requests return expected data
|
|
93
|
+
2. **Validation** - Invalid input returns 400 with helpful message
|
|
94
|
+
3. **Error Handling** - API failures handled per interview decisions
|
|
95
|
+
4. **Authentication** - API key handling
|
|
96
|
+
5. **Edge Cases** - Empty data, nulls, large payloads
|
|
97
|
+
|
|
98
|
+
## Guidelines
|
|
99
|
+
|
|
100
|
+
1. **Tests MUST fail initially** - Implementation doesn't exist yet
|
|
101
|
+
2. **One assertion per test** - Clear failure messages
|
|
102
|
+
3. **Use interview decisions** - Error strategy, formats, etc.
|
|
103
|
+
4. **Mock external APIs** - Don't make real API calls in tests
|
|
104
|
+
5. **Cover 100%** - Every schema field should be tested
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.
|
|
2
|
+
"version": "3.12.0",
|
|
3
3
|
"created_at": null,
|
|
4
4
|
"endpoint": null,
|
|
5
5
|
"library": null,
|
|
@@ -63,87 +63,336 @@
|
|
|
63
63
|
"confidence": "critical"
|
|
64
64
|
},
|
|
65
65
|
"injected": true
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"timestamp": "2025-12-27T22:31:26.336088",
|
|
69
|
+
"prompt_preview": "1. CREATE PR\n - Go to GitHub: https://github.com/hustle-together/api-dev-tools\n - Create PR from...",
|
|
70
|
+
"detection": {
|
|
71
|
+
"detected": true,
|
|
72
|
+
"terms": [
|
|
73
|
+
"create pr",
|
|
74
|
+
"update version (i can do this for you now)",
|
|
75
|
+
"api",
|
|
76
|
+
"package",
|
|
77
|
+
"test",
|
|
78
|
+
"publish",
|
|
79
|
+
"@hustle-together/api-dev-tools",
|
|
80
|
+
"1.0.0",
|
|
81
|
+
"3.12.0",
|
|
82
|
+
"package.json"
|
|
83
|
+
],
|
|
84
|
+
"patterns_matched": [
|
|
85
|
+
"always_research",
|
|
86
|
+
"question_pattern",
|
|
87
|
+
"technical_term"
|
|
88
|
+
],
|
|
89
|
+
"confidence": "critical"
|
|
90
|
+
},
|
|
91
|
+
"injected": true
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"timestamp": "2025-12-27T22:32:03.480897",
|
|
95
|
+
"prompt_preview": "File Purpose\nworkflow-demo.html (247KB) Main interactive workflow demo\nexecution-trace-COMPREH...",
|
|
96
|
+
"detection": {
|
|
97
|
+
"detected": true,
|
|
98
|
+
"terms": [
|
|
99
|
+
"write integration demo",
|
|
100
|
+
"api",
|
|
101
|
+
"interview-driven-api"
|
|
102
|
+
],
|
|
103
|
+
"patterns_matched": [
|
|
104
|
+
"question_pattern",
|
|
105
|
+
"always_research",
|
|
106
|
+
"technical_term"
|
|
107
|
+
],
|
|
108
|
+
"confidence": "critical"
|
|
109
|
+
},
|
|
110
|
+
"injected": true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"timestamp": "2025-12-27T22:35:36.217406",
|
|
114
|
+
"prompt_preview": "> File Purpose\nworkflow-demo.html (247KB) Main interactive workflow demo\nexecution-trace-COMPR...",
|
|
115
|
+
"detection": {
|
|
116
|
+
"detected": true,
|
|
117
|
+
"terms": [
|
|
118
|
+
"write integration demo",
|
|
119
|
+
"api",
|
|
120
|
+
"view",
|
|
121
|
+
"interview-driven-api"
|
|
122
|
+
],
|
|
123
|
+
"patterns_matched": [
|
|
124
|
+
"technical_term",
|
|
125
|
+
"question_pattern",
|
|
126
|
+
"always_research"
|
|
127
|
+
],
|
|
128
|
+
"confidence": "critical"
|
|
129
|
+
},
|
|
130
|
+
"injected": true
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"timestamp": "2025-12-27T22:36:41.163781",
|
|
134
|
+
"prompt_preview": "how do i merge it i am on the comment page ",
|
|
135
|
+
"detection": {
|
|
136
|
+
"detected": true,
|
|
137
|
+
"terms": [
|
|
138
|
+
"how do"
|
|
139
|
+
],
|
|
140
|
+
"patterns_matched": [
|
|
141
|
+
"always_research",
|
|
142
|
+
"question_pattern"
|
|
143
|
+
],
|
|
144
|
+
"confidence": "critical"
|
|
145
|
+
},
|
|
146
|
+
"injected": true
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"timestamp": "2025-12-27T22:40:21.674198",
|
|
150
|
+
"prompt_preview": "ok i did it check the main now please",
|
|
151
|
+
"detection": {
|
|
152
|
+
"detected": false,
|
|
153
|
+
"terms": [],
|
|
154
|
+
"patterns_matched": [],
|
|
155
|
+
"confidence": "none"
|
|
156
|
+
},
|
|
157
|
+
"injected": false
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"timestamp": "2025-12-27T22:43:21.172124",
|
|
161
|
+
"prompt_preview": "wait was the github master updated witht he most current push?",
|
|
162
|
+
"detection": {
|
|
163
|
+
"detected": true,
|
|
164
|
+
"terms": [],
|
|
165
|
+
"patterns_matched": [],
|
|
166
|
+
"confidence": "low"
|
|
167
|
+
},
|
|
168
|
+
"injected": true
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"timestamp": "2025-12-27T22:45:59.739199",
|
|
172
|
+
"prompt_preview": "ok now update the npm package, make a skill for this as well based on my api-dev-tools and mcp if th...",
|
|
173
|
+
"detection": {
|
|
174
|
+
"detected": true,
|
|
175
|
+
"terms": [
|
|
176
|
+
"update the npm package, make a skill for this as w",
|
|
177
|
+
"package",
|
|
178
|
+
"api"
|
|
179
|
+
],
|
|
180
|
+
"patterns_matched": [
|
|
181
|
+
"always_research",
|
|
182
|
+
"technical_term",
|
|
183
|
+
"question_pattern"
|
|
184
|
+
],
|
|
185
|
+
"confidence": "critical"
|
|
186
|
+
},
|
|
187
|
+
"injected": true
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"timestamp": "2025-12-27T22:49:36.519292",
|
|
191
|
+
"prompt_preview": "/Users/alfonso/Documents/GitHub/api-dev-tools/demo/hustle-together/workflow-demo-backup-20251212-134...",
|
|
192
|
+
"detection": {
|
|
193
|
+
"detected": true,
|
|
194
|
+
"terms": [
|
|
195
|
+
"api",
|
|
196
|
+
"0.0.1"
|
|
197
|
+
],
|
|
198
|
+
"patterns_matched": [
|
|
199
|
+
"always_research",
|
|
200
|
+
"technical_term"
|
|
201
|
+
],
|
|
202
|
+
"confidence": "critical"
|
|
203
|
+
},
|
|
204
|
+
"injected": true
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"timestamp": "2025-12-27T22:52:43.366799",
|
|
208
|
+
"prompt_preview": "help me use that publish skill how do i get that code?",
|
|
209
|
+
"detection": {
|
|
210
|
+
"detected": true,
|
|
211
|
+
"terms": [
|
|
212
|
+
"how do",
|
|
213
|
+
"publish"
|
|
214
|
+
],
|
|
215
|
+
"patterns_matched": [
|
|
216
|
+
"technical_term",
|
|
217
|
+
"always_research",
|
|
218
|
+
"question_pattern"
|
|
219
|
+
],
|
|
220
|
+
"confidence": "critical"
|
|
221
|
+
},
|
|
222
|
+
"injected": true
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"timestamp": "2025-12-27T22:53:54.327491",
|
|
226
|
+
"prompt_preview": "id rather use the terminal command to open the pafge",
|
|
227
|
+
"detection": {
|
|
228
|
+
"detected": true,
|
|
229
|
+
"terms": [],
|
|
230
|
+
"patterns_matched": [],
|
|
231
|
+
"confidence": "low"
|
|
232
|
+
},
|
|
233
|
+
"injected": true
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"timestamp": "2025-12-27T22:58:35.375132",
|
|
237
|
+
"prompt_preview": "No no, I use a secret key, so you just open my page for me, and I just gave it access by using my se...",
|
|
238
|
+
"detection": {
|
|
239
|
+
"detected": true,
|
|
240
|
+
"terms": [
|
|
241
|
+
"secret",
|
|
242
|
+
"key"
|
|
243
|
+
],
|
|
244
|
+
"patterns_matched": [
|
|
245
|
+
"technical_term"
|
|
246
|
+
],
|
|
247
|
+
"confidence": "high"
|
|
248
|
+
},
|
|
249
|
+
"injected": true
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"timestamp": "2025-12-27T22:59:14.000695",
|
|
253
|
+
"prompt_preview": "No, that's dumb. Normally you just give me some commands that I run in terminal and they just work.N...",
|
|
254
|
+
"detection": {
|
|
255
|
+
"detected": true,
|
|
256
|
+
"terms": [
|
|
257
|
+
"publish"
|
|
258
|
+
],
|
|
259
|
+
"patterns_matched": [
|
|
260
|
+
"technical_term",
|
|
261
|
+
"question_pattern"
|
|
262
|
+
],
|
|
263
|
+
"confidence": "high"
|
|
264
|
+
},
|
|
265
|
+
"injected": true
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"timestamp": "2025-12-27T22:59:56.192298",
|
|
269
|
+
"prompt_preview": " npm login run that and i will tap the security code access then you can run the publish command",
|
|
270
|
+
"detection": {
|
|
271
|
+
"detected": true,
|
|
272
|
+
"terms": [
|
|
273
|
+
"publish"
|
|
274
|
+
],
|
|
275
|
+
"patterns_matched": [
|
|
276
|
+
"technical_term"
|
|
277
|
+
],
|
|
278
|
+
"confidence": "high"
|
|
279
|
+
},
|
|
280
|
+
"injected": true
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"timestamp": "2025-12-27T23:02:25.007015",
|
|
284
|
+
"prompt_preview": "ok i pushed it already",
|
|
285
|
+
"detection": {
|
|
286
|
+
"detected": false,
|
|
287
|
+
"terms": [],
|
|
288
|
+
"patterns_matched": [],
|
|
289
|
+
"confidence": "none"
|
|
290
|
+
},
|
|
291
|
+
"injected": false
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"timestamp": "2025-12-27T23:05:45.854012",
|
|
295
|
+
"prompt_preview": "Yeah, let's create a new project with maybe a base Next.js application in it. We'll install the npm ...",
|
|
296
|
+
"detection": {
|
|
297
|
+
"detected": true,
|
|
298
|
+
"terms": [
|
|
299
|
+
"create a new project with maybe a base next.js app",
|
|
300
|
+
"install the npm command for this, so that we can t",
|
|
301
|
+
"test",
|
|
302
|
+
"install",
|
|
303
|
+
"next.js"
|
|
304
|
+
],
|
|
305
|
+
"patterns_matched": [
|
|
306
|
+
"technical_term",
|
|
307
|
+
"question_pattern",
|
|
308
|
+
"always_research"
|
|
309
|
+
],
|
|
310
|
+
"confidence": "critical"
|
|
311
|
+
},
|
|
312
|
+
"injected": true
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"timestamp": "2025-12-27T23:10:02.864062",
|
|
316
|
+
"prompt_preview": "alfonso@Alfonsos-MacBook-Pro test-api-dev-tools % /api-create brandfetch\nzsh: no such file or direct...",
|
|
317
|
+
"detection": {
|
|
318
|
+
"detected": true,
|
|
319
|
+
"terms": [
|
|
320
|
+
"create brandfetch",
|
|
321
|
+
"api",
|
|
322
|
+
"test",
|
|
323
|
+
"test-api"
|
|
324
|
+
],
|
|
325
|
+
"patterns_matched": [
|
|
326
|
+
"always_research",
|
|
327
|
+
"question_pattern",
|
|
328
|
+
"technical_term"
|
|
329
|
+
],
|
|
330
|
+
"confidence": "critical"
|
|
331
|
+
},
|
|
332
|
+
"injected": true
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"timestamp": "2025-12-27T23:12:38.166540",
|
|
336
|
+
"prompt_preview": "\n A gift for you\n Your rate limits are 2x higher through 12/31. Enjoy the extra room to think!\n \u23bf...",
|
|
337
|
+
"detection": {
|
|
338
|
+
"detected": true,
|
|
339
|
+
"terms": [
|
|
340
|
+
"create brandfetch ",
|
|
341
|
+
"error",
|
|
342
|
+
"api",
|
|
343
|
+
"test",
|
|
344
|
+
"hook",
|
|
345
|
+
"hustle-api",
|
|
346
|
+
"test-api",
|
|
347
|
+
"v2.0.76",
|
|
348
|
+
"4.5"
|
|
349
|
+
],
|
|
350
|
+
"patterns_matched": [
|
|
351
|
+
"always_research",
|
|
352
|
+
"technical_term",
|
|
353
|
+
"question_pattern"
|
|
354
|
+
],
|
|
355
|
+
"confidence": "critical"
|
|
356
|
+
},
|
|
357
|
+
"injected": true
|
|
66
358
|
}
|
|
67
359
|
],
|
|
68
360
|
"phases": {
|
|
69
361
|
"disambiguation": {
|
|
70
|
-
"status": "not_started"
|
|
71
|
-
"clarified": null,
|
|
72
|
-
"search_variations": [],
|
|
73
|
-
"description": "Pre-research disambiguation to clarify ambiguous requests"
|
|
362
|
+
"status": "not_started"
|
|
74
363
|
},
|
|
75
364
|
"scope": {
|
|
76
|
-
"status": "not_started"
|
|
77
|
-
"confirmed": false,
|
|
78
|
-
"description": "Initial scope understanding and confirmation"
|
|
365
|
+
"status": "not_started"
|
|
79
366
|
},
|
|
80
367
|
"research_initial": {
|
|
81
|
-
"status": "not_started"
|
|
82
|
-
"sources": [],
|
|
83
|
-
"summary_approved": false,
|
|
84
|
-
"description": "Context7/WebSearch research for live documentation"
|
|
368
|
+
"status": "not_started"
|
|
85
369
|
},
|
|
86
370
|
"interview": {
|
|
87
|
-
"status": "not_started"
|
|
88
|
-
"questions": [],
|
|
89
|
-
"user_question_count": 0,
|
|
90
|
-
"structured_question_count": 0,
|
|
91
|
-
"decisions": {},
|
|
92
|
-
"description": "Structured interview about requirements (generated FROM research)"
|
|
371
|
+
"status": "not_started"
|
|
93
372
|
},
|
|
94
373
|
"research_deep": {
|
|
95
|
-
"status": "not_started"
|
|
96
|
-
"sources": [],
|
|
97
|
-
"proposed_searches": [],
|
|
98
|
-
"approved_searches": [],
|
|
99
|
-
"skipped_searches": [],
|
|
100
|
-
"description": "Deep dive based on interview answers (adaptive, not shotgun)"
|
|
374
|
+
"status": "not_started"
|
|
101
375
|
},
|
|
102
376
|
"schema_creation": {
|
|
103
|
-
"status": "not_started"
|
|
104
|
-
"schema_file": null,
|
|
105
|
-
"schema_approved": false,
|
|
106
|
-
"description": "Zod schema creation from research"
|
|
377
|
+
"status": "not_started"
|
|
107
378
|
},
|
|
108
379
|
"environment_check": {
|
|
109
|
-
"status": "not_started"
|
|
110
|
-
"keys_verified": [],
|
|
111
|
-
"keys_missing": [],
|
|
112
|
-
"confirmed": false,
|
|
113
|
-
"description": "API key and environment verification"
|
|
380
|
+
"status": "not_started"
|
|
114
381
|
},
|
|
115
382
|
"tdd_red": {
|
|
116
|
-
"status": "not_started"
|
|
117
|
-
"test_file": null,
|
|
118
|
-
"test_count": 0,
|
|
119
|
-
"test_matrix_approved": false,
|
|
120
|
-
"description": "Write failing tests first"
|
|
383
|
+
"status": "not_started"
|
|
121
384
|
},
|
|
122
385
|
"tdd_green": {
|
|
123
|
-
"status": "not_started"
|
|
124
|
-
"implementation_file": null,
|
|
125
|
-
"all_tests_passing": false,
|
|
126
|
-
"description": "Minimal implementation to pass tests"
|
|
386
|
+
"status": "not_started"
|
|
127
387
|
},
|
|
128
388
|
"verify": {
|
|
129
|
-
"status": "not_started"
|
|
130
|
-
"gaps_found": 0,
|
|
131
|
-
"gaps_fixed": 0,
|
|
132
|
-
"intentional_omissions": [],
|
|
133
|
-
"re_research_done": false,
|
|
134
|
-
"description": "Re-research after Green to verify implementation matches docs"
|
|
389
|
+
"status": "not_started"
|
|
135
390
|
},
|
|
136
391
|
"tdd_refactor": {
|
|
137
|
-
"status": "not_started"
|
|
138
|
-
"description": "Code cleanup while keeping tests green"
|
|
392
|
+
"status": "not_started"
|
|
139
393
|
},
|
|
140
394
|
"documentation": {
|
|
141
|
-
"status": "not_started"
|
|
142
|
-
"files_updated": [],
|
|
143
|
-
"manifest_updated": false,
|
|
144
|
-
"openapi_updated": false,
|
|
145
|
-
"research_cached": false,
|
|
146
|
-
"description": "Update manifests, OpenAPI, cache research"
|
|
395
|
+
"status": "not_started"
|
|
147
396
|
}
|
|
148
397
|
},
|
|
149
398
|
"verification": {
|
|
@@ -13,23 +13,24 @@
|
|
|
13
13
|
|
|
14
14
|
## Hook Architecture (9 Hooks)
|
|
15
15
|
|
|
16
|
-
| Hook
|
|
17
|
-
|
|
18
|
-
| `session-startup.py`
|
|
16
|
+
| Hook | Event | Purpose |
|
|
17
|
+
| ------------------------------ | ---------------- | ---------------------------------- |
|
|
18
|
+
| `session-startup.py` | SessionStart | Inject state at session start |
|
|
19
19
|
| `enforce-external-research.py` | UserPromptSubmit | Detect API terms, require research |
|
|
20
|
-
| `enforce-research.py`
|
|
21
|
-
| `enforce-interview.py`
|
|
22
|
-
| `verify-implementation.py`
|
|
23
|
-
| `track-tool-use.py`
|
|
24
|
-
| `periodic-reground.py`
|
|
25
|
-
| `verify-after-green.py`
|
|
26
|
-
| `api-workflow-check.py`
|
|
20
|
+
| `enforce-research.py` | PreToolUse | Block writes until research done |
|
|
21
|
+
| `enforce-interview.py` | PreToolUse | Inject interview decisions |
|
|
22
|
+
| `verify-implementation.py` | PreToolUse | Require test file before route |
|
|
23
|
+
| `track-tool-use.py` | PostToolUse | Log research, count turns |
|
|
24
|
+
| `periodic-reground.py` | PostToolUse | Re-ground every 7 turns |
|
|
25
|
+
| `verify-after-green.py` | PostToolUse | Trigger Phase 10 after test pass |
|
|
26
|
+
| `api-workflow-check.py` | Stop | Block if phases incomplete |
|
|
27
27
|
|
|
28
28
|
## Available Commands
|
|
29
29
|
|
|
30
30
|
### Complete Workflow
|
|
31
31
|
|
|
32
32
|
**`/api-create [endpoint-name]`**
|
|
33
|
+
|
|
33
34
|
- Runs all 13 phases automatically
|
|
34
35
|
- Loop-back architecture at every checkpoint
|
|
35
36
|
- See [api-create.md](api-create.md) for full flow
|
|
@@ -37,32 +38,38 @@
|
|
|
37
38
|
### Individual Phases
|
|
38
39
|
|
|
39
40
|
**`/api-interview [endpoint-name]`**
|
|
41
|
+
|
|
40
42
|
- Questions GENERATED from research findings
|
|
41
43
|
- Different question types: enum, continuous, boolean
|
|
42
44
|
- See [api-interview.md](api-interview.md)
|
|
43
45
|
|
|
44
46
|
**`/api-research [library-or-service]`**
|
|
47
|
+
|
|
45
48
|
- Adaptive propose-approve flow (not shotgun)
|
|
46
49
|
- Research cached with 7-day freshness
|
|
47
50
|
- See [api-research.md](api-research.md)
|
|
48
51
|
|
|
49
52
|
**`/api-verify [endpoint-name]`** (NEW)
|
|
53
|
+
|
|
50
54
|
- Manual Phase 10 verification
|
|
51
55
|
- Re-read docs, compare to implementation
|
|
52
56
|
- Report gaps, loop back or document omissions
|
|
53
57
|
- See [api-verify.md](api-verify.md)
|
|
54
58
|
|
|
55
59
|
**`/api-env [endpoint-name]`**
|
|
60
|
+
|
|
56
61
|
- Check API keys and environment
|
|
57
62
|
- See [api-env.md](api-env.md)
|
|
58
63
|
|
|
59
64
|
**`/api-status [endpoint-name]`**
|
|
65
|
+
|
|
60
66
|
- Track progress through 13 phases
|
|
61
67
|
- See [api-status.md](api-status.md)
|
|
62
68
|
|
|
63
69
|
### TDD Commands
|
|
64
70
|
|
|
65
71
|
From [@wbern/claude-instructions](https://github.com/wbern/claude-instructions):
|
|
72
|
+
|
|
66
73
|
- `/red` - Write ONE failing test
|
|
67
74
|
- `/green` - Minimal implementation to pass
|
|
68
75
|
- `/refactor` - Clean up while tests pass
|
|
@@ -131,11 +138,13 @@ Research cached in `.claude/research/`:
|
|
|
131
138
|
## Quick Start
|
|
132
139
|
|
|
133
140
|
### Automated
|
|
141
|
+
|
|
134
142
|
```bash
|
|
135
143
|
/api-create my-endpoint
|
|
136
144
|
```
|
|
137
145
|
|
|
138
146
|
### Manual Step-by-Step
|
|
147
|
+
|
|
139
148
|
```bash
|
|
140
149
|
/api-research [library] # Initial research
|
|
141
150
|
/api-interview [endpoint] # Questions from research
|
|
@@ -154,6 +163,7 @@ npx @hustle-together/api-dev-tools --scope=project
|
|
|
154
163
|
```
|
|
155
164
|
|
|
156
165
|
Installs:
|
|
166
|
+
|
|
157
167
|
- Commands in `.claude/commands/`
|
|
158
168
|
- Hooks in `.claude/hooks/`
|
|
159
169
|
- Settings in `.claude/settings.json`
|
|
@@ -163,6 +173,7 @@ Installs:
|
|
|
163
173
|
### Team-Wide
|
|
164
174
|
|
|
165
175
|
Add to `package.json`:
|
|
176
|
+
|
|
166
177
|
```json
|
|
167
178
|
{
|
|
168
179
|
"scripts": {
|
|
@@ -54,7 +54,7 @@ Bash command output: (exclamation)git status(backticks)
|
|
|
54
54
|
**Bash Commands (exclamation prefix)**: Limited to current working directory only.
|
|
55
55
|
|
|
56
56
|
- ✅ Works: `! + backtick + git status + backtick` (in project dir)
|
|
57
|
-
- ❌ Blocked: `! + backtick + ls /outside/project + backtick` (outside project)
|
|
57
|
+
- ❌ Blocked: `! + backtick + ls /outside/project + backtick` (outside project)
|
|
58
58
|
- ❌ Blocked: `! + backtick + pwd + backtick` (if referencing dirs outside project)
|
|
59
59
|
|
|
60
60
|
**File References (`@` prefix)**: No directory restrictions.
|
|
@@ -90,6 +90,7 @@ Compare @src/old.js with @src/new.js and explain differences
|
|
|
90
90
|
---
|
|
91
91
|
allowed-tools: Bash(git status:*), Bash(git branch:*), Bash(git log:*)
|
|
92
92
|
---
|
|
93
|
+
|
|
93
94
|
Current status: (!)git status(`)
|
|
94
95
|
Current branch: (!)git branch --show-current(`)
|
|
95
96
|
Recent commits: (!)git log --oneline -5(`)
|
|
@@ -123,7 +124,8 @@ echo "Ask GPT-5 about: $ARGUMENTS" > ~/.claude/commands/ai/gpt5.md
|
|
|
123
124
|
### Safe Commands (No Security Issues)
|
|
124
125
|
|
|
125
126
|
```markdown
|
|
126
|
-
# System prompt editor (file reference only)
|
|
127
|
+
# System prompt editor (file reference only)
|
|
128
|
+
|
|
127
129
|
(@)path/to/system/prompt.md
|
|
128
130
|
|
|
129
131
|
Edit your system prompt above.
|
|
@@ -135,6 +137,7 @@ Edit your system prompt above.
|
|
|
135
137
|
---
|
|
136
138
|
allowed-tools: Bash(git status:*), Bash(npm list:*)
|
|
137
139
|
---
|
|
140
|
+
|
|
138
141
|
Current git status: (!)git status(`)
|
|
139
142
|
Package info: (!)npm list --depth=0(`)
|
|
140
143
|
|
|
@@ -145,6 +148,7 @@ Review project state and suggest next steps.
|
|
|
145
148
|
|
|
146
149
|
```markdown
|
|
147
150
|
# Compare config files
|
|
151
|
+
|
|
148
152
|
Compare (@)path/to/system.md with (@)project/config.md
|
|
149
153
|
|
|
150
154
|
Show differences and suggest improvements.
|
|
@@ -156,7 +160,6 @@ After creating: `/<command-name> [arguments]`
|
|
|
156
160
|
|
|
157
161
|
Example: `/review` or `/ai:gpt5 "explain this code"`
|
|
158
162
|
|
|
159
|
-
|
|
160
163
|
## 🛡 Project Rules (Injected into every command)
|
|
161
164
|
|
|
162
165
|
1. **NO BROKEN BUILDS:**
|
|
@@ -181,7 +184,7 @@ Example: `/review` or `/ai:gpt5 "explain this code"`
|
|
|
181
184
|
4. **API KEY MANAGEMENT:**
|
|
182
185
|
- Support three loading methods:
|
|
183
186
|
- Server environment variables
|
|
184
|
-
-
|
|
187
|
+
- NEXT*PUBLIC* variables (client-side)
|
|
185
188
|
- Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
|
|
186
189
|
- Never hardcode API keys
|
|
187
190
|
- Always validate key availability before use
|
|
@@ -206,4 +209,4 @@ Example: `/review` or `/ai:gpt5 "explain this code"`
|
|
|
206
209
|
- Code examples
|
|
207
210
|
- Testing notes
|
|
208
211
|
- Document expected behavior and edge cases
|
|
209
|
-
- Include real-world output examples
|
|
212
|
+
- Include real-world output examples
|