@hustle-together/api-dev-tools 3.11.1 → 3.12.1
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 +228 -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
package/.skills/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# API Development Tools - Agent Skills
|
|
2
2
|
|
|
3
|
-
**Version:**
|
|
3
|
+
**Version:** 1.0.0
|
|
4
4
|
**Standard:** [Agent Skills Open Format](https://agentskills.io)
|
|
5
5
|
**Platform:** Cross-platform (Claude Code, VS Code, Cursor, ChatGPT, GitHub Copilot)
|
|
6
6
|
|
|
@@ -32,55 +32,55 @@ npx @hustle-together/api-dev-tools --scope=project
|
|
|
32
32
|
|
|
33
33
|
### API Development (6 skills)
|
|
34
34
|
|
|
35
|
-
| Skill
|
|
36
|
-
|
|
37
|
-
| **api-create**
|
|
38
|
-
| **api-interview** | `/api-interview [endpoint]` | Structured requirements gathering with questions FROM research findings
|
|
39
|
-
| **api-research**
|
|
40
|
-
| **api-verify**
|
|
41
|
-
| **api-env**
|
|
42
|
-
| **api-status**
|
|
35
|
+
| Skill | Usage | Description |
|
|
36
|
+
| ----------------- | --------------------------- | -------------------------------------------------------------------------- |
|
|
37
|
+
| **api-create** | `/api-create [endpoint]` | Complete 14-phase API workflow with interview, research, TDD, verification |
|
|
38
|
+
| **api-interview** | `/api-interview [endpoint]` | Structured requirements gathering with questions FROM research findings |
|
|
39
|
+
| **api-research** | `/api-research [library]` | Adaptive documentation research with 7-day caching |
|
|
40
|
+
| **api-verify** | `/api-verify [endpoint]` | Re-research after tests pass to catch implementation gaps |
|
|
41
|
+
| **api-env** | `/api-env [endpoint]` | Check API keys and environment variables |
|
|
42
|
+
| **api-status** | `/api-status [endpoint]` | Track progress through 14 phases |
|
|
43
43
|
|
|
44
44
|
### TDD Workflow (4 skills)
|
|
45
45
|
|
|
46
|
-
| Skill
|
|
47
|
-
|
|
48
|
-
| **red**
|
|
49
|
-
| **green**
|
|
50
|
-
| **refactor** | `/refactor`
|
|
51
|
-
| **cycle**
|
|
46
|
+
| Skill | Usage | Description |
|
|
47
|
+
| ------------ | ---------------------- | -------------------------------------------------------------- |
|
|
48
|
+
| **red** | `/red` | Write ONE failing test (defines success before implementation) |
|
|
49
|
+
| **green** | `/green` | Minimal implementation to pass tests (no over-engineering) |
|
|
50
|
+
| **refactor** | `/refactor` | Clean up code while keeping tests green |
|
|
51
|
+
| **cycle** | `/cycle [description]` | Complete Red → Green → Refactor loop |
|
|
52
52
|
|
|
53
53
|
### Planning & Analysis (3 skills)
|
|
54
54
|
|
|
55
|
-
| Skill
|
|
56
|
-
|
|
57
|
-
| **plan**
|
|
58
|
-
| **gap**
|
|
59
|
-
| **issue** | `/issue [url]`
|
|
55
|
+
| Skill | Usage | Description |
|
|
56
|
+
| --------- | ----------------- | --------------------------------------------------- |
|
|
57
|
+
| **plan** | `/plan [feature]` | Create implementation plan with PRD-style discovery |
|
|
58
|
+
| **gap** | `/gap` | Analyze code vs requirements for missing pieces |
|
|
59
|
+
| **issue** | `/issue [url]` | Create TDD plan from GitHub issue |
|
|
60
60
|
|
|
61
61
|
### Git Operations (5 skills)
|
|
62
62
|
|
|
63
|
-
| Skill
|
|
64
|
-
|
|
65
|
-
| **commit**
|
|
66
|
-
| **pr**
|
|
67
|
-
| **busycommit**
|
|
68
|
-
| **worktree-add**
|
|
69
|
-
| **worktree-cleanup** | `/worktree-cleanup`
|
|
63
|
+
| Skill | Usage | Description |
|
|
64
|
+
| -------------------- | ------------------------------ | ---------------------------------------------- |
|
|
65
|
+
| **commit** | `/commit` | Semantic commit with co-author attribution |
|
|
66
|
+
| **pr** | `/pr` | Create pull request with summary and test plan |
|
|
67
|
+
| **busycommit** | `/busycommit` | Multiple atomic commits for complex changesets |
|
|
68
|
+
| **worktree-add** | `/worktree-add [branch/issue]` | Add git worktree from branch or issue |
|
|
69
|
+
| **worktree-cleanup** | `/worktree-cleanup` | Clean up merged worktrees |
|
|
70
70
|
|
|
71
71
|
### Workflow Utilities (5 skills)
|
|
72
72
|
|
|
73
|
-
| Skill
|
|
74
|
-
|
|
75
|
-
| **spike**
|
|
76
|
-
| **tdd**
|
|
77
|
-
| **beepboop**
|
|
78
|
-
| **summarize**
|
|
79
|
-
| **add-command** | `/add-command` | Guide for creating new skills
|
|
73
|
+
| Skill | Usage | Description |
|
|
74
|
+
| --------------- | -------------- | ------------------------------------ |
|
|
75
|
+
| **spike** | `/spike` | Exploratory coding before formal TDD |
|
|
76
|
+
| **tdd** | `/tdd` | Remind agent about TDD practices |
|
|
77
|
+
| **beepboop** | `/beepboop` | Transparent AI attribution markers |
|
|
78
|
+
| **summarize** | `/summarize` | Conversation progress summary |
|
|
79
|
+
| **add-command** | `/add-command` | Guide for creating new skills |
|
|
80
80
|
|
|
81
81
|
## 🏗️ Architecture
|
|
82
82
|
|
|
83
|
-
###
|
|
83
|
+
### 14-Phase Workflow
|
|
84
84
|
|
|
85
85
|
```
|
|
86
86
|
Phase 1: DISAMBIGUATION - Clarify ambiguous terms before research
|
|
@@ -93,21 +93,24 @@ Phase 7: ENVIRONMENT - Verify API keys exist
|
|
|
93
93
|
Phase 8: TDD RED - Write failing tests from schema
|
|
94
94
|
Phase 9: TDD GREEN - Minimal implementation to pass
|
|
95
95
|
Phase 10: VERIFY - Re-research docs, compare to implementation
|
|
96
|
-
Phase 11:
|
|
97
|
-
Phase 12:
|
|
98
|
-
Phase 13:
|
|
96
|
+
Phase 11: CODE REVIEW - Greptile AI review (bugs, security, performance)
|
|
97
|
+
Phase 12: TDD REFACTOR - Fix review issues, clean up code
|
|
98
|
+
Phase 13: DOCUMENTATION - Update manifests, cache research
|
|
99
|
+
Phase 14: COMPLETION - Final verification, commit
|
|
99
100
|
```
|
|
100
101
|
|
|
101
102
|
### Loop-Back Architecture
|
|
102
103
|
|
|
103
104
|
Every verification phase can loop back if not successful:
|
|
105
|
+
|
|
104
106
|
- Phase 1: Loop if disambiguation unclear
|
|
105
107
|
- Phase 3: Loop if more research needed
|
|
106
108
|
- Phase 4: Loop if interview incomplete
|
|
107
109
|
- Phase 6: Loop if schema incorrect
|
|
108
110
|
- Phase 8: Loop if test plan needs changes
|
|
109
111
|
- Phase 10: Loop if gaps found in implementation
|
|
110
|
-
- Phase
|
|
112
|
+
- Phase 11: Loop if code review finds issues to fix
|
|
113
|
+
- Phase 13: Loop if documentation incomplete
|
|
111
114
|
|
|
112
115
|
### State Tracking
|
|
113
116
|
|
|
@@ -152,22 +155,22 @@ Documentation cached in `.claude/research/` with 7-day freshness:
|
|
|
152
155
|
|
|
153
156
|
### Optional but Recommended
|
|
154
157
|
|
|
155
|
-
- **Enforcement Hooks**:
|
|
158
|
+
- **Enforcement Hooks**: 22 Python scripts that enforce workflow rules
|
|
156
159
|
- **Settings.json**: Hook registration for lifecycle events
|
|
157
160
|
|
|
158
|
-
## 🔒 Enforcement Hooks (
|
|
161
|
+
## 🔒 Enforcement Hooks (22 Total)
|
|
159
162
|
|
|
160
|
-
For full workflow enforcement, install hooks to
|
|
163
|
+
For full workflow enforcement, install hooks to `hooks/`:
|
|
161
164
|
|
|
162
165
|
### Hook Types
|
|
163
166
|
|
|
164
|
-
| Event
|
|
165
|
-
|
|
166
|
-
| **SessionStart**
|
|
167
|
-
| **UserPromptSubmit** | enforce-external-research.py
|
|
168
|
-
| **PreToolUse**
|
|
169
|
-
| **PostToolUse**
|
|
170
|
-
| **Stop**
|
|
167
|
+
| Event | Hooks | Purpose |
|
|
168
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
|
|
169
|
+
| **SessionStart** | session-startup.py | Inject state context at session start |
|
|
170
|
+
| **UserPromptSubmit** | enforce-external-research.py | Detect API terms, require research |
|
|
171
|
+
| **PreToolUse** | enforce-research.py, enforce-interview.py, verify-implementation.py, enforce-component-type-confirm.py, notify-input-needed.py | Block writes until phases complete, inject decisions, confirm component type |
|
|
172
|
+
| **PostToolUse** | track-tool-use.py, periodic-reground.py, verify-after-green.py, notify-phase-complete.py, track-token-usage.py | Log research, re-ground every 7 turns, trigger verification, notify, track tokens |
|
|
173
|
+
| **Stop** | api-workflow-check.py | Block if phases incomplete |
|
|
171
174
|
|
|
172
175
|
### What Hooks Enforce
|
|
173
176
|
|
|
@@ -194,7 +197,7 @@ For full workflow enforcement, install hooks to `.claude/hooks/`:
|
|
|
194
197
|
# Fully automated workflow
|
|
195
198
|
/api-create my-endpoint
|
|
196
199
|
|
|
197
|
-
# Follows all
|
|
200
|
+
# Follows all 14 phases automatically
|
|
198
201
|
# Asks for user input at each checkpoint
|
|
199
202
|
# Loops back if verification fails
|
|
200
203
|
# Creates tests, implementation, docs
|
|
@@ -282,10 +285,9 @@ See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines
|
|
|
282
285
|
|
|
283
286
|
- [Agent Skills Specification](https://agentskills.io/specification)
|
|
284
287
|
- [Claude Code Documentation](https://code.claude.com/docs)
|
|
285
|
-
- [
|
|
286
|
-
- [Skills Migration Checklist](../../SKILLS_MIGRATION_CHECKLIST.md)
|
|
288
|
+
- [Future Roadmap](../../ROADMAP.md)
|
|
287
289
|
|
|
288
290
|
---
|
|
289
291
|
|
|
290
292
|
**Built with ❤️ by Hustle Together**
|
|
291
|
-
|
|
293
|
+
_Empowering developers with interview-driven, research-first API development_
|
|
@@ -12,8 +12,10 @@ allowed-tools: WebSearch WebFetch mcp__context7 mcp__github AskUserQuestion Read
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
---
|
|
15
|
+
|
|
15
16
|
description: Guide for creating new slash commands
|
|
16
17
|
argument-hint: <command-name> <description>
|
|
18
|
+
|
|
17
19
|
---
|
|
18
20
|
|
|
19
21
|
## General Guidelines
|
|
@@ -67,7 +69,7 @@ Bash command output: (exclamation)git status(backticks)
|
|
|
67
69
|
**Bash Commands (exclamation prefix)**: Limited to current working directory only.
|
|
68
70
|
|
|
69
71
|
- ✅ Works: `! + backtick + git status + backtick` (in project dir)
|
|
70
|
-
- ❌ Blocked: `! + backtick + ls /outside/project + backtick` (outside project)
|
|
72
|
+
- ❌ Blocked: `! + backtick + ls /outside/project + backtick` (outside project)
|
|
71
73
|
- ❌ Blocked: `! + backtick + pwd + backtick` (if referencing dirs outside project)
|
|
72
74
|
|
|
73
75
|
**File References (`@` prefix)**: No directory restrictions.
|
|
@@ -103,6 +105,7 @@ Compare @src/old.js with @src/new.js and explain differences
|
|
|
103
105
|
---
|
|
104
106
|
allowed-tools: Bash(git status:*), Bash(git branch:*), Bash(git log:*)
|
|
105
107
|
---
|
|
108
|
+
|
|
106
109
|
Current status: (!)git status(`)
|
|
107
110
|
Current branch: (!)git branch --show-current(`)
|
|
108
111
|
Recent commits: (!)git log --oneline -5(`)
|
|
@@ -136,7 +139,8 @@ echo "Ask GPT-5 about: $ARGUMENTS" > ~/.claude/commands/ai/gpt5.md
|
|
|
136
139
|
### Safe Commands (No Security Issues)
|
|
137
140
|
|
|
138
141
|
```markdown
|
|
139
|
-
# System prompt editor (file reference only)
|
|
142
|
+
# System prompt editor (file reference only)
|
|
143
|
+
|
|
140
144
|
(@)path/to/system/prompt.md
|
|
141
145
|
|
|
142
146
|
Edit your system prompt above.
|
|
@@ -148,6 +152,7 @@ Edit your system prompt above.
|
|
|
148
152
|
---
|
|
149
153
|
allowed-tools: Bash(git status:*), Bash(npm list:*)
|
|
150
154
|
---
|
|
155
|
+
|
|
151
156
|
Current git status: (!)git status(`)
|
|
152
157
|
Package info: (!)npm list --depth=0(`)
|
|
153
158
|
|
|
@@ -158,6 +163,7 @@ Review project state and suggest next steps.
|
|
|
158
163
|
|
|
159
164
|
```markdown
|
|
160
165
|
# Compare config files
|
|
166
|
+
|
|
161
167
|
Compare (@)path/to/system.md with (@)project/config.md
|
|
162
168
|
|
|
163
169
|
Show differences and suggest improvements.
|
|
@@ -169,7 +175,6 @@ After creating: `/<command-name> [arguments]`
|
|
|
169
175
|
|
|
170
176
|
Example: `/review` or `/ai:gpt5 "explain this code"`
|
|
171
177
|
|
|
172
|
-
|
|
173
178
|
## 🛡 Project Rules (Injected into every command)
|
|
174
179
|
|
|
175
180
|
1. **NO BROKEN BUILDS:**
|
|
@@ -194,7 +199,7 @@ Example: `/review` or `/ai:gpt5 "explain this code"`
|
|
|
194
199
|
4. **API KEY MANAGEMENT:**
|
|
195
200
|
- Support three loading methods:
|
|
196
201
|
- Server environment variables
|
|
197
|
-
-
|
|
202
|
+
- NEXT*PUBLIC* variables (client-side)
|
|
198
203
|
- Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
|
|
199
204
|
- Never hardcode API keys
|
|
200
205
|
- Always validate key availability before use
|
|
@@ -219,4 +224,4 @@ Example: `/review` or `/ai:gpt5 "explain this code"`
|
|
|
219
224
|
- Code examples
|
|
220
225
|
- Testing notes
|
|
221
226
|
- Document expected behavior and edge cases
|
|
222
|
-
- Include real-world output examples
|
|
227
|
+
- Include real-world output examples
|
|
@@ -22,6 +22,7 @@ allowed-tools: WebSearch WebFetch mcp__context7 mcp__github AskUserQuestion Read
|
|
|
22
22
|
**YOU MUST USE THE `AskUserQuestion` TOOL AT EVERY CHECKPOINT.**
|
|
23
23
|
|
|
24
24
|
This workflow requires REAL user input at each phase. You are **FORBIDDEN** from:
|
|
25
|
+
|
|
25
26
|
- Self-answering questions
|
|
26
27
|
- Assuming user responses
|
|
27
28
|
- Proceeding without explicit user confirmation
|
|
@@ -39,9 +40,9 @@ At every `[Y/n]` or multiple-choice prompt in this workflow, you MUST call the `
|
|
|
39
40
|
"header": "Phase",
|
|
40
41
|
"multiSelect": false,
|
|
41
42
|
"options": [
|
|
42
|
-
{"label": "Option A", "description": "What this option means"},
|
|
43
|
-
{"label": "Option B", "description": "What this option means"},
|
|
44
|
-
{"label": "Other", "description": "I'll type my own answer"}
|
|
43
|
+
{ "label": "Option A", "description": "What this option means" },
|
|
44
|
+
{ "label": "Option B", "description": "What this option means" },
|
|
45
|
+
{ "label": "Other", "description": "I'll type my own answer" }
|
|
45
46
|
]
|
|
46
47
|
}
|
|
47
48
|
]
|
|
@@ -49,6 +50,7 @@ At every `[Y/n]` or multiple-choice prompt in this workflow, you MUST call the `
|
|
|
49
50
|
```
|
|
50
51
|
|
|
51
52
|
**CRITICAL REQUIREMENTS:**
|
|
53
|
+
|
|
52
54
|
- `header`: Max 12 characters (e.g., "Scope", "Research", "Format")
|
|
53
55
|
- `options`: 2-4 options, each with `label` (1-5 words) and `description`
|
|
54
56
|
- `multiSelect`: Required boolean (true for checkboxes, false for radio)
|
|
@@ -60,6 +62,7 @@ At every `[Y/n]` or multiple-choice prompt in this workflow, you MUST call the `
|
|
|
60
62
|
### Violation Detection
|
|
61
63
|
|
|
62
64
|
The enforcement hooks will BLOCK your progress if:
|
|
65
|
+
|
|
63
66
|
- `user_question_asked` is false for any phase
|
|
64
67
|
- `user_confirmed`/`user_approved`/`user_completed` is false
|
|
65
68
|
- `phase_exit_confirmed` is false (user must explicitly approve proceeding to next phase)
|
|
@@ -72,27 +75,35 @@ If you see "BLOCKED" messages, it means you skipped user interaction.
|
|
|
72
75
|
**Every phase requires an EXIT CONFIRMATION question** before proceeding to the next phase. This prevents Claude from self-answering and moving on without explicit user approval.
|
|
73
76
|
|
|
74
77
|
The exit confirmation question MUST:
|
|
78
|
+
|
|
75
79
|
1. Summarize what was accomplished in the current phase
|
|
76
80
|
2. Ask if user is ready to proceed to the next phase
|
|
77
81
|
3. Include options like "Yes, proceed", "No, I have changes", "Add more"
|
|
78
82
|
|
|
79
83
|
Example exit confirmation:
|
|
84
|
+
|
|
80
85
|
```json
|
|
81
86
|
{
|
|
82
|
-
"questions": [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
"questions": [
|
|
88
|
+
{
|
|
89
|
+
"question": "Phase complete. Research found 5 sources. Ready to proceed to Interview phase?",
|
|
90
|
+
"header": "Proceed",
|
|
91
|
+
"multiSelect": false,
|
|
92
|
+
"options": [
|
|
93
|
+
{ "label": "Yes, proceed", "description": "Move to next phase" },
|
|
94
|
+
{
|
|
95
|
+
"label": "No, more research",
|
|
96
|
+
"description": "I need additional research on [topic]"
|
|
97
|
+
},
|
|
98
|
+
{ "label": "Review sources", "description": "Show me what was found" }
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
]
|
|
92
102
|
}
|
|
93
103
|
```
|
|
94
104
|
|
|
95
105
|
The `phase_exit_confirmed` flag is automatically set when:
|
|
106
|
+
|
|
96
107
|
1. An `AskUserQuestion` is called with a question containing words like "proceed", "continue", "ready", "confirm", "approve"
|
|
97
108
|
2. The user responds with an affirmative answer (yes, proceed, confirm, approve, etc.)
|
|
98
109
|
|
|
@@ -100,6 +111,37 @@ Both conditions must be true for the flag to be set.
|
|
|
100
111
|
|
|
101
112
|
---
|
|
102
113
|
|
|
114
|
+
## Progress Tracking (TodoWrite Integration)
|
|
115
|
+
|
|
116
|
+
**FIRST ACTION:** Initialize the todo list to show user real-time progress:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
TodoWrite([
|
|
120
|
+
{"content": "Phase 1: Disambiguation", "status": "in_progress", "activeForm": "Clarifying API terms"},
|
|
121
|
+
{"content": "Phase 2: Scope", "status": "pending", "activeForm": "Confirming endpoint scope"},
|
|
122
|
+
{"content": "Phase 3: Initial Research", "status": "pending", "activeForm": "Researching documentation"},
|
|
123
|
+
{"content": "Phase 4: Interview", "status": "pending", "activeForm": "Gathering requirements"},
|
|
124
|
+
{"content": "Phase 5: Deep Research", "status": "pending", "activeForm": "Deep diving documentation"},
|
|
125
|
+
{"content": "Phase 6: Schema", "status": "pending", "activeForm": "Creating Zod schema"},
|
|
126
|
+
{"content": "Phase 7: Environment", "status": "pending", "activeForm": "Verifying API keys"},
|
|
127
|
+
{"content": "Phase 8: TDD Red", "status": "pending", "activeForm": "Writing failing tests"},
|
|
128
|
+
{"content": "Phase 9: TDD Green", "status": "pending", "activeForm": "Implementing to pass tests"},
|
|
129
|
+
{"content": "Phase 10: Verify", "status": "pending", "activeForm": "Verifying against docs"},
|
|
130
|
+
{"content": "Phase 11: Code Review (Greptile)", "status": "pending", "activeForm": "Running AI code review"},
|
|
131
|
+
{"content": "Phase 12: Refactor", "status": "pending", "activeForm": "Fixing issues, cleaning up"},
|
|
132
|
+
{"content": "Phase 13: Documentation", "status": "pending", "activeForm": "Updating documentation"},
|
|
133
|
+
{"content": "Phase 14: Completion", "status": "pending", "activeForm": "Final commit and PR"}
|
|
134
|
+
])
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**At each phase transition:**
|
|
138
|
+
|
|
139
|
+
1. Mark current phase as `completed`
|
|
140
|
+
2. Mark next phase as `in_progress`
|
|
141
|
+
3. This gives the user visual progress during long workflows
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
103
145
|
## Key Principles
|
|
104
146
|
|
|
105
147
|
1. **Loop Until Green** - Every verification phase loops back if not successful
|
|
@@ -107,6 +149,7 @@ Both conditions must be true for the flag to be set.
|
|
|
107
149
|
3. **Adaptive Research** - Propose searches based on context, not shotgun approach
|
|
108
150
|
4. **Self-Documenting** - State file captures everything for re-grounding
|
|
109
151
|
5. **Verify After Green** - Re-research docs to catch memory-based implementation errors
|
|
152
|
+
6. **Visual Progress** - Update TodoWrite at every phase for user visibility
|
|
110
153
|
|
|
111
154
|
## Complete Phase Flow
|
|
112
155
|
|
|
@@ -166,9 +209,34 @@ Both conditions must be true for the flag to be set.
|
|
|
166
209
|
└───────────────────────────────────────────────────────────┘
|
|
167
210
|
│
|
|
168
211
|
▼
|
|
169
|
-
┌─ PHASE 3: INITIAL RESEARCH
|
|
212
|
+
┌─ PHASE 3: INITIAL RESEARCH (Parallel Subagents) ──────────┐
|
|
170
213
|
│ │
|
|
171
|
-
│ Execute 2-3 initial searches:
|
|
214
|
+
│ Execute 2-3 initial searches using PARALLEL SUBAGENTS: │
|
|
215
|
+
│ │
|
|
216
|
+
│ ** ASYNC PARALLEL RESEARCH ** │
|
|
217
|
+
│ For faster research, spawn multiple subagents in parallel │
|
|
218
|
+
│ using the Task tool with different research strategies: │
|
|
219
|
+
│ │
|
|
220
|
+
│ // Spawn 3 parallel research agents │
|
|
221
|
+
│ Task({ │
|
|
222
|
+
│ subagent_type: "parallel-researcher", │
|
|
223
|
+
│ prompt: "Research [API] via Context7 - find all │
|
|
224
|
+
│ endpoints, parameters, webhooks", │
|
|
225
|
+
│ model: "haiku" │
|
|
226
|
+
│ }) │
|
|
227
|
+
│ // Press Ctrl+B to background this agent │
|
|
228
|
+
│ │
|
|
229
|
+
│ Task({ │
|
|
230
|
+
│ subagent_type: "parallel-researcher", │
|
|
231
|
+
│ prompt: "WebSearch [API] official docs and guides", │
|
|
232
|
+
│ model: "haiku" │
|
|
233
|
+
│ }) │
|
|
234
|
+
│ // Press Ctrl+B to background this agent │
|
|
235
|
+
│ │
|
|
236
|
+
│ // Use /tasks to monitor progress of background agents │
|
|
237
|
+
│ │
|
|
238
|
+
│ ** ALTERNATIVE: Sequential Research ** │
|
|
239
|
+
│ If not using parallel agents, execute sequentially: │
|
|
172
240
|
│ • Context7: "[library/api name]" │
|
|
173
241
|
│ • WebSearch: "[name] official documentation" │
|
|
174
242
|
│ • WebSearch: "site:[domain] api reference" │
|
|
@@ -387,9 +455,46 @@ Both conditions must be true for the flag to be set.
|
|
|
387
455
|
└───────────────────────────────────────────────────────────┘
|
|
388
456
|
│
|
|
389
457
|
▼
|
|
390
|
-
┌─ PHASE 11:
|
|
458
|
+
┌─ PHASE 11: AI CODE REVIEW (Greptile) ────────────────────┐
|
|
459
|
+
│ │
|
|
460
|
+
│ Run Greptile BEFORE refactoring to catch issues early: │
|
|
461
|
+
│ • Bug detection with full codebase context │
|
|
462
|
+
│ • Security vulnerability scanning (OWASP top 10) │
|
|
463
|
+
│ • Performance issue identification │
|
|
464
|
+
│ • Code quality and maintainability checks │
|
|
465
|
+
│ │
|
|
466
|
+
│ Greptile uses query endpoint to review your diff: │
|
|
467
|
+
│ POST https://api.greptile.com/v2/query │
|
|
468
|
+
│ - Analyzes changes against entire codebase │
|
|
469
|
+
│ - Returns issues with file:line references │
|
|
470
|
+
│ - Provides actionable fix suggestions │
|
|
471
|
+
│ │
|
|
472
|
+
│ ⚠️ REQUIRED: Use AskUserQuestion tool: │
|
|
473
|
+
│ │
|
|
474
|
+
│ AskUserQuestion({ │
|
|
475
|
+
│ questions: [{ │
|
|
476
|
+
│ question: "Greptile review complete. Score: [N]/10 │
|
|
477
|
+
│ Issues found: [list]. How to proceed?", │
|
|
478
|
+
│ header: "Review", │
|
|
479
|
+
│ multiSelect: false, │
|
|
480
|
+
│ options: [ │
|
|
481
|
+
│ {"label": "Fix all issues", "description": "Address each issue in Phase 12"},│
|
|
482
|
+
│ {"label": "Fix critical only", "description": "Skip medium/low priority"},│
|
|
483
|
+
│ {"label": "Skip review", "description": "Proceed without fixes (not recommended)"}│
|
|
484
|
+
│ ] │
|
|
485
|
+
│ }] │
|
|
486
|
+
│ }) │
|
|
487
|
+
│ │
|
|
488
|
+
│ WAIT for user response. Do NOT auto-skip issues. │
|
|
489
|
+
│ REQUIRES: GREPTILE_API_KEY + GITHUB_TOKEN in .env │
|
|
490
|
+
│ ──── Loop back to Phase 9 if major issues found ──── │
|
|
491
|
+
└───────────────────────────────────────────────────────────┘
|
|
492
|
+
│
|
|
493
|
+
▼
|
|
494
|
+
┌─ PHASE 12: TDD REFACTOR ──────────────────────────────────┐
|
|
391
495
|
│ │
|
|
392
|
-
│
|
|
496
|
+
│ Fix Greptile issues AND clean up code: │
|
|
497
|
+
│ • Fix all issues from Phase 11 code review │
|
|
393
498
|
│ • Extract reusable patterns │
|
|
394
499
|
│ • Improve error messages │
|
|
395
500
|
│ • Add JSDoc comments │
|
|
@@ -399,7 +504,7 @@ Both conditions must be true for the flag to be set.
|
|
|
399
504
|
└───────────────────────────────────────────────────────────┘
|
|
400
505
|
│
|
|
401
506
|
▼
|
|
402
|
-
┌─ PHASE
|
|
507
|
+
┌─ PHASE 13: DOCUMENTATION ─────────────────────────────────┐
|
|
403
508
|
│ │
|
|
404
509
|
│ Update documentation files, then: │
|
|
405
510
|
│ │
|
|
@@ -410,10 +515,11 @@ Both conditions must be true for the flag to be set.
|
|
|
410
515
|
│ question: "Documentation checklist: [list files]. │
|
|
411
516
|
│ All documentation complete?", │
|
|
412
517
|
│ header: "Docs", │
|
|
518
|
+
│ multiSelect: false, │
|
|
413
519
|
│ options: [ │
|
|
414
|
-
│ "Yes,
|
|
415
|
-
│ "
|
|
416
|
-
│ "Skip
|
|
520
|
+
│ {"label": "Yes, complete", "description": "All docs updated"},│
|
|
521
|
+
│ {"label": "Need to add more", "description": "I'll describe what's missing"},│
|
|
522
|
+
│ {"label": "Skip for now", "description": "Not recommended"}│
|
|
417
523
|
│ ] │
|
|
418
524
|
│ }] │
|
|
419
525
|
│ }) │
|
|
@@ -424,16 +530,18 @@ Both conditions must be true for the flag to be set.
|
|
|
424
530
|
└───────────────────────────────────────────────────────────┘
|
|
425
531
|
│
|
|
426
532
|
▼
|
|
427
|
-
┌─ PHASE
|
|
533
|
+
┌─ PHASE 14: COMPLETION ────────────────────────────────────┐
|
|
428
534
|
│ │
|
|
429
535
|
│ Final verification: │
|
|
430
536
|
│ • All tests passing │
|
|
431
537
|
│ • 100% coverage │
|
|
432
538
|
│ • TypeScript compiles │
|
|
539
|
+
│ • Code review issues addressed │
|
|
433
540
|
│ • Docs updated │
|
|
434
541
|
│ • State file shows all phases complete │
|
|
435
542
|
│ │
|
|
436
543
|
│ Run /commit to create semantic commit. │
|
|
544
|
+
│ Run /pr to create pull request. │
|
|
437
545
|
└───────────────────────────────────────────────────────────┘
|
|
438
546
|
```
|
|
439
547
|
|
|
@@ -456,8 +564,10 @@ All phases are tracked in `.claude/api-dev-state.json`:
|
|
|
456
564
|
"tdd_red": { "status": "complete", "test_count": 23 },
|
|
457
565
|
"tdd_green": { "status": "complete" },
|
|
458
566
|
"verify": { "status": "complete", "gaps_found": 2, "gaps_fixed": 2 },
|
|
567
|
+
"code_review": { "status": "complete", "score": 9, "issues_found": 1, "issues_fixed": 1 },
|
|
459
568
|
"tdd_refactor": { "status": "complete" },
|
|
460
|
-
"documentation": { "status": "complete" }
|
|
569
|
+
"documentation": { "status": "complete" },
|
|
570
|
+
"completion": { "status": "complete" }
|
|
461
571
|
}
|
|
462
572
|
}
|
|
463
573
|
```
|
|
@@ -477,16 +587,17 @@ This command creates:
|
|
|
477
587
|
|
|
478
588
|
## Hooks That Enforce This Workflow
|
|
479
589
|
|
|
480
|
-
| Phase | Hook
|
|
481
|
-
|
|
482
|
-
| 0
|
|
483
|
-
| 2-4
|
|
484
|
-
| 7-8
|
|
485
|
-
| 7-8
|
|
486
|
-
| 8
|
|
487
|
-
| 9
|
|
488
|
-
|
|
|
489
|
-
|
|
|
590
|
+
| Phase | Hook | Purpose |
|
|
591
|
+
| ----- | ------------------------------ | ------------------------------------------ |
|
|
592
|
+
| 0 | `enforce-external-research.py` | Detects API terms, requires disambiguation |
|
|
593
|
+
| 2-4 | `track-tool-use.py` | Logs all research, tracks turns |
|
|
594
|
+
| 7-8 | `enforce-research.py` | Blocks Write if no research done |
|
|
595
|
+
| 7-8 | `enforce-interview.py` | Injects interview decisions |
|
|
596
|
+
| 8 | `verify-implementation.py` | Blocks route if no test file |
|
|
597
|
+
| 9 | `verify-after-green.py` | Triggers verification after tests pass |
|
|
598
|
+
| 10 | `run-code-review.py` | Triggers Greptile AI code review |
|
|
599
|
+
| All | `periodic-reground.py` | Re-grounds every 7 turns |
|
|
600
|
+
| 14 | `api-workflow-check.py` | Blocks completion if docs incomplete |
|
|
490
601
|
|
|
491
602
|
<claude-commands-template>
|
|
492
603
|
## Project-Specific Rules
|
|
@@ -497,7 +608,7 @@ This command creates:
|
|
|
497
608
|
4. **AI SDK**: Use Vercel AI SDK 5.0.11 patterns from `/src/v2/docs/ai-sdk-catalog.json`
|
|
498
609
|
5. **Package Manager**: Use `pnpm` for all operations
|
|
499
610
|
6. **Documentation**: Follow patterns in `/src/v2/docs/Main Doc – V2 Development Patterns.md`
|
|
500
|
-
7. **API Keys**: Support three methods (env,
|
|
611
|
+
7. **API Keys**: Support three methods (env, NEXT*PUBLIC*, custom headers)
|
|
501
612
|
8. **Test Command**: `pnpm test:run` before commits
|
|
502
613
|
|
|
503
614
|
## Never Skip
|
|
@@ -509,4 +620,4 @@ This command creates:
|
|
|
509
620
|
- Phase 10 (Verify) - Re-research after Green
|
|
510
621
|
- Phase 12 (Documentation) - Keep docs in sync
|
|
511
622
|
- Coverage verification - 100% required
|
|
512
|
-
</claude-commands-template>
|
|
623
|
+
</claude-commands-template>
|
package/.skills/api-env/SKILL.md
CHANGED
|
@@ -55,6 +55,7 @@ Status: BLOCKED - Cannot proceed without FIRECRAWL_API_KEY
|
|
|
55
55
|
## API Key Support
|
|
56
56
|
|
|
57
57
|
The project supports three methods:
|
|
58
|
+
|
|
58
59
|
1. Server env: `OPENAI_API_KEY=sk-...`
|
|
59
60
|
2. Client env: `NEXT_PUBLIC_OPENAI_API_KEY=sk-...`
|
|
60
61
|
3. Custom headers: `X-OpenAI-Key: sk-...`
|