@hustle-together/api-dev-tools 3.10.0 → 3.11.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/api-dev-state.json +159 -0
- package/.claude/commands/README.md +185 -0
- package/.claude/commands/add-command.md +209 -0
- package/.claude/commands/api-create.md +499 -0
- package/.claude/commands/api-env.md +50 -0
- package/.claude/commands/api-interview.md +331 -0
- package/.claude/commands/api-research.md +331 -0
- package/.claude/commands/api-status.md +259 -0
- package/.claude/commands/api-verify.md +231 -0
- package/.claude/commands/beepboop.md +97 -0
- package/.claude/commands/busycommit.md +112 -0
- package/.claude/commands/commit.md +83 -0
- package/.claude/commands/cycle.md +142 -0
- package/.claude/commands/gap.md +86 -0
- package/.claude/commands/green.md +142 -0
- package/.claude/commands/issue.md +192 -0
- package/.claude/commands/plan.md +168 -0
- package/.claude/commands/pr.md +122 -0
- package/.claude/commands/red.md +142 -0
- package/.claude/commands/refactor.md +142 -0
- package/.claude/commands/spike.md +142 -0
- package/.claude/commands/summarize.md +94 -0
- package/.claude/commands/tdd.md +144 -0
- package/.claude/commands/worktree-add.md +315 -0
- package/.claude/commands/worktree-cleanup.md +281 -0
- package/.claude/hooks/api-workflow-check.py +227 -0
- package/.claude/hooks/enforce-deep-research.py +185 -0
- package/.claude/hooks/enforce-disambiguation.py +155 -0
- package/.claude/hooks/enforce-documentation.py +192 -0
- package/.claude/hooks/enforce-environment.py +253 -0
- package/.claude/hooks/enforce-external-research.py +328 -0
- package/.claude/hooks/enforce-interview.py +421 -0
- package/.claude/hooks/enforce-refactor.py +189 -0
- package/.claude/hooks/enforce-research.py +159 -0
- package/.claude/hooks/enforce-schema.py +186 -0
- package/.claude/hooks/enforce-scope.py +160 -0
- package/.claude/hooks/enforce-tdd-red.py +250 -0
- package/.claude/hooks/enforce-verify.py +186 -0
- package/.claude/hooks/periodic-reground.py +154 -0
- package/.claude/hooks/session-startup.py +151 -0
- package/.claude/hooks/track-tool-use.py +626 -0
- package/.claude/hooks/verify-after-green.py +282 -0
- package/.claude/hooks/verify-implementation.py +225 -0
- package/.claude/research/index.json +6 -0
- package/.claude/settings.json +93 -0
- package/.claude/settings.local.json +11 -0
- package/.claude-plugin/marketplace.json +112 -0
- package/.skills/README.md +291 -0
- package/.skills/_shared/convert-commands.py +192 -0
- package/.skills/_shared/hooks/api-workflow-check.py +227 -0
- package/.skills/_shared/hooks/enforce-deep-research.py +185 -0
- package/.skills/_shared/hooks/enforce-disambiguation.py +155 -0
- package/.skills/_shared/hooks/enforce-documentation.py +192 -0
- package/.skills/_shared/hooks/enforce-environment.py +253 -0
- package/.skills/_shared/hooks/enforce-external-research.py +328 -0
- package/.skills/_shared/hooks/enforce-interview.py +421 -0
- package/.skills/_shared/hooks/enforce-refactor.py +189 -0
- package/.skills/_shared/hooks/enforce-research.py +159 -0
- package/.skills/_shared/hooks/enforce-schema.py +186 -0
- package/.skills/_shared/hooks/enforce-scope.py +160 -0
- package/.skills/_shared/hooks/enforce-tdd-red.py +250 -0
- package/.skills/_shared/hooks/enforce-verify.py +186 -0
- package/.skills/_shared/hooks/periodic-reground.py +154 -0
- package/.skills/_shared/hooks/session-startup.py +151 -0
- package/.skills/_shared/hooks/track-tool-use.py +626 -0
- package/.skills/_shared/hooks/verify-after-green.py +282 -0
- package/.skills/_shared/hooks/verify-implementation.py +225 -0
- package/.skills/_shared/install.sh +114 -0
- package/.skills/_shared/settings.json +93 -0
- package/.skills/add-command/SKILL.md +222 -0
- package/.skills/api-create/SKILL.md +512 -0
- package/.skills/api-env/SKILL.md +63 -0
- package/.skills/api-interview/SKILL.md +344 -0
- package/.skills/api-research/SKILL.md +344 -0
- package/.skills/api-status/SKILL.md +272 -0
- package/.skills/api-verify/SKILL.md +244 -0
- package/.skills/beepboop/SKILL.md +110 -0
- package/.skills/busycommit/SKILL.md +125 -0
- package/.skills/commit/SKILL.md +96 -0
- package/.skills/cycle/SKILL.md +155 -0
- package/.skills/gap/SKILL.md +99 -0
- package/.skills/green/SKILL.md +155 -0
- package/.skills/issue/SKILL.md +205 -0
- package/.skills/plan/SKILL.md +181 -0
- package/.skills/pr/SKILL.md +135 -0
- package/.skills/red/SKILL.md +155 -0
- package/.skills/refactor/SKILL.md +155 -0
- package/.skills/spike/SKILL.md +155 -0
- package/.skills/summarize/SKILL.md +107 -0
- package/.skills/tdd/SKILL.md +157 -0
- package/.skills/update-todos/SKILL.md +228 -0
- package/.skills/worktree-add/SKILL.md +328 -0
- package/.skills/worktree-cleanup/SKILL.md +294 -0
- package/CHANGELOG.md +97 -0
- package/README.md +66 -20
- package/bin/cli.js +7 -6
- package/package.json +22 -11
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: worktree-cleanup
|
|
3
|
+
description: Clean up merged worktrees by verifying PR/issue status, consolidating settings, removing stale worktrees. Use after merging features. Keywords: git, worktree, cleanup, maintenance, branches
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires Claude Code with MCP servers (Context7, GitHub), Python 3.9+ for hooks, pnpm 10.11.0+
|
|
6
|
+
metadata:
|
|
7
|
+
version: "3.0.0"
|
|
8
|
+
category: "git"
|
|
9
|
+
tags: ['git', 'worktree', 'cleanup', 'maintenance']
|
|
10
|
+
author: "Hustle Together"
|
|
11
|
+
allowed-tools: WebSearch WebFetch mcp__context7 mcp__github AskUserQuestion Read Write Edit Bash TodoWrite
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
description: Clean up merged worktrees by verifying PR/issue status, consolidating settings, and removing stale worktrees
|
|
16
|
+
argument-hint: (no arguments)
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Worktree Cleanup
|
|
20
|
+
|
|
21
|
+
## General Guidelines
|
|
22
|
+
|
|
23
|
+
### Output Style
|
|
24
|
+
|
|
25
|
+
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
26
|
+
- Write natural, descriptive code without meta-commentary about the development process
|
|
27
|
+
- The code should speak for itself - TDD is the process, not the product
|
|
28
|
+
|
|
29
|
+
Clean up merged worktrees by finding the oldest merged branch, consolidating settings, and removing stale worktrees.
|
|
30
|
+
|
|
31
|
+
Additional info: $ARGUMENTS
|
|
32
|
+
|
|
33
|
+
<current_state>
|
|
34
|
+
Current branch: !git branch --show-current`
|
|
35
|
+
Current worktrees: !git worktree list`
|
|
36
|
+
</current_state>
|
|
37
|
+
|
|
38
|
+
<execution_steps>
|
|
39
|
+
<step_0>
|
|
40
|
+
<description>Validate MCP dependencies</description>
|
|
41
|
+
<check_github_mcp>
|
|
42
|
+
<requirement>GitHub MCP server must be configured</requirement>
|
|
43
|
+
<fallback>If unavailable, use `gh` CLI commands</fallback>
|
|
44
|
+
<validation>
|
|
45
|
+
- Try listing available MCP resources
|
|
46
|
+
- If GitHub MCP not found, switch to CLI fallback
|
|
47
|
+
- Inform user about MCP configuration if needed
|
|
48
|
+
</validation>
|
|
49
|
+
</check_github_mcp>
|
|
50
|
+
<error_handling>
|
|
51
|
+
If MCP validation fails:
|
|
52
|
+
- Show clear error message
|
|
53
|
+
- Provide setup instructions
|
|
54
|
+
- Fallback to CLI if possible
|
|
55
|
+
</error_handling>
|
|
56
|
+
<purpose>Ensure required MCP dependencies are available before proceeding</purpose>
|
|
57
|
+
</step_0>
|
|
58
|
+
|
|
59
|
+
<step_1>
|
|
60
|
+
<description>Verify we're in main branch</description>
|
|
61
|
+
<check_command>git branch --show-current</check_command>
|
|
62
|
+
<required_branch>main</required_branch>
|
|
63
|
+
<error_if_not_main>Exit with error message: "This command must be run from the main branch"</error_if_not_main>
|
|
64
|
+
<purpose>Ensure we're consolidating to the main worktree</purpose>
|
|
65
|
+
</step_1>
|
|
66
|
+
|
|
67
|
+
<step_2>
|
|
68
|
+
<description>Get list of all worktrees</description>
|
|
69
|
+
<command>git worktree list --porcelain</command>
|
|
70
|
+
<parse_output>Extract worktree paths and branch names</parse_output>
|
|
71
|
+
<exclude_main>Filter out the main worktree from cleanup candidates</exclude_main>
|
|
72
|
+
<purpose>Identify all worktrees that could potentially be cleaned up</purpose>
|
|
73
|
+
</step_2>
|
|
74
|
+
|
|
75
|
+
<step_3>
|
|
76
|
+
<description>Find oldest worktree by directory age</description>
|
|
77
|
+
<get_worktree_ages>
|
|
78
|
+
<command_macos>git worktree list | grep -v "main" | awk '{print $1}' | while read path; do /usr/bin/stat -f "%Sm|%N" -t "%Y-%m-%d %H:%M:%S" "$path" 2>/dev/null; done | sort</command_macos>
|
|
79
|
+
<command_linux>git worktree list | grep -v "main" | awk '{print $1}' | xargs stat -c "%y|%n" | sort</command_linux>
|
|
80
|
+
<purpose>List all worktrees sorted by directory modification time (oldest first)</purpose>
|
|
81
|
+
<note>Use full path /usr/bin/stat on macOS, regular stat on Linux.</note>
|
|
82
|
+
</get_worktree_ages>
|
|
83
|
+
<filter_recent>
|
|
84
|
+
<exclude_new>For worktrees created within the last 24 hours, let user know that this worktree might not be worth cleaning</exclude_new>
|
|
85
|
+
<get_current_time>date +"%Y-%m-%d %H:%M"</get_current_time>
|
|
86
|
+
</filter_recent>
|
|
87
|
+
<select_oldest>
|
|
88
|
+
<extract_branch_name>Parse branch name from oldest worktree path</extract_branch_name>
|
|
89
|
+
<important_note>DO NOT use "git branch --merged" to check merge status - it's unreliable</important_note>
|
|
90
|
+
<proceed_to_pr_check>Move directly to step 4 to verify PR merge status instead</proceed_to_pr_check>
|
|
91
|
+
</select_oldest>
|
|
92
|
+
<purpose>Identify oldest worktree candidate - actual merge verification happens via GitHub PR in next step</purpose>
|
|
93
|
+
</step_3>
|
|
94
|
+
|
|
95
|
+
<step_4>
|
|
96
|
+
<description>Verify GitHub PR merge status (primary merge verification)</description>
|
|
97
|
+
<determine_repo>
|
|
98
|
+
<check_remote>git remote get-url origin</check_remote>
|
|
99
|
+
<parse_repo>Extract owner/repo from GitHub URL</parse_repo>
|
|
100
|
+
<fallback>Use project repository from git remote (owner/repo format)</fallback>
|
|
101
|
+
</determine_repo>
|
|
102
|
+
<search_pr>
|
|
103
|
+
<tool>mcp__github__search_pull_requests</tool>
|
|
104
|
+
<query>repo:owner/repo head:{branch_name} base:main</query>
|
|
105
|
+
<purpose>Find PR for this branch targeting main</purpose>
|
|
106
|
+
<important>This is the PRIMARY way to verify if a branch was merged - NOT git commands</important>
|
|
107
|
+
</search_pr>
|
|
108
|
+
<verify_pr_merged>
|
|
109
|
+
<if_pr_found>
|
|
110
|
+
<get_pr_details>Use mcp__github__pull_request_read to get full PR info</get_pr_details>
|
|
111
|
+
<confirm_merged>Verify PR state is "closed" AND merged_at is not null AND base is "main"</confirm_merged>
|
|
112
|
+
<extract_issue_number>Look for issue references in PR title/body (e.g., #14533, owner/repo#14533)</extract_issue_number>
|
|
113
|
+
<if_merged>Proceed with cleanup - this branch was definitively merged to main</if_merged>
|
|
114
|
+
<if_not_merged>
|
|
115
|
+
<skip_worktree>This worktree is NOT merged - continue to next oldest worktree</skip_worktree>
|
|
116
|
+
<repeat_from_step_3>Go back and find the next oldest worktree to check</repeat_from_step_3>
|
|
117
|
+
</if_not_merged>
|
|
118
|
+
</if_pr_found>
|
|
119
|
+
<if_no_pr>
|
|
120
|
+
<skip_worktree>No PR found - this branch was likely never submitted for review</skip_worktree>
|
|
121
|
+
<continue_to_next>Continue checking next oldest worktree</continue_to_next>
|
|
122
|
+
</if_no_pr>
|
|
123
|
+
</verify_pr_merged>
|
|
124
|
+
<purpose>Use GitHub PR status as the authoritative source for merge verification instead of unreliable git commands</purpose>
|
|
125
|
+
</step_4>
|
|
126
|
+
|
|
127
|
+
<step_4_5>
|
|
128
|
+
<description>Check and close related GitHub issue</description>
|
|
129
|
+
<if_issue_found>
|
|
130
|
+
<get_issue_details>
|
|
131
|
+
<tool>mcp__github__issue_read</tool>
|
|
132
|
+
<method>get</method>
|
|
133
|
+
<extract_repo>From issue reference (main-repo vs cross-repo)</extract_repo>
|
|
134
|
+
</get_issue_details>
|
|
135
|
+
<check_issue_state>
|
|
136
|
+
<if_open>
|
|
137
|
+
<ask_close>Ask user: "Related issue #{number} is still open. Should I close it? (y/N)"</ask_close>
|
|
138
|
+
<if_yes_close>
|
|
139
|
+
<add_closing_comment>
|
|
140
|
+
<tool>mcp__github__add_issue_comment</tool>
|
|
141
|
+
<body_template>Closing this issue as branch {branch_name} was merged to main on {merge_date} via PR #{pr_number}.</body_template>
|
|
142
|
+
<get_merge_date>Extract merge date from PR details</get_merge_date>
|
|
143
|
+
<get_pr_number>Use PR number from search results</get_pr_number>
|
|
144
|
+
</add_closing_comment>
|
|
145
|
+
<close_issue>
|
|
146
|
+
<tool>mcp__github__issue_write</tool>
|
|
147
|
+
<method>update</method>
|
|
148
|
+
<state>closed</state>
|
|
149
|
+
<state_reason>completed</state_reason>
|
|
150
|
+
</close_issue>
|
|
151
|
+
</if_yes_close>
|
|
152
|
+
</if_open>
|
|
153
|
+
<if_closed>Inform user issue is already closed</if_closed>
|
|
154
|
+
</check_issue_state>
|
|
155
|
+
</if_issue_found>
|
|
156
|
+
<if_no_issue>Continue without issue management</if_no_issue>
|
|
157
|
+
<purpose>Ensure proper issue lifecycle management</purpose>
|
|
158
|
+
</step_4_5>
|
|
159
|
+
|
|
160
|
+
<step_5>
|
|
161
|
+
<description>Check if worktree is locked</description>
|
|
162
|
+
<check_command>git worktree list --porcelain | grep -A5 "worktree {path}" | grep "locked"</check_command>
|
|
163
|
+
<if_locked>
|
|
164
|
+
<unlock_command>git worktree unlock {path}</unlock_command>
|
|
165
|
+
<notify_user>Inform user that worktree was unlocked</notify_user>
|
|
166
|
+
</if_locked>
|
|
167
|
+
<purpose>Unlock worktree if it was locked for tracking purposes</purpose>
|
|
168
|
+
</step_5>
|
|
169
|
+
|
|
170
|
+
<step_6>
|
|
171
|
+
<description>Analyze Claude settings differences</description>
|
|
172
|
+
<read_main_settings>.claude/settings.local.json</read_main_settings>
|
|
173
|
+
<read_worktree_settings>{worktree_path}/.claude/settings.local.json</read_worktree_settings>
|
|
174
|
+
<compare_allow_lists>
|
|
175
|
+
<extract_main_allows>Extract "allow" array from main settings</extract_main_allows>
|
|
176
|
+
<extract_worktree_allows>Extract "allow" array from worktree settings</extract_worktree_allows>
|
|
177
|
+
<find_differences>Identify entries in worktree that are not in main</find_differences>
|
|
178
|
+
</compare_allow_lists>
|
|
179
|
+
<filter_suggestions>
|
|
180
|
+
<include_filesystem>Read permissions for filesystem paths</include_filesystem>
|
|
181
|
+
<exclude_intrusive>Exclude bash commands, write permissions, etc.</exclude_intrusive>
|
|
182
|
+
<focus_user_specific>Include only user-specific, non-disruptive entries</focus_user_specific>
|
|
183
|
+
</filter_suggestions>
|
|
184
|
+
<purpose>Identify useful settings to consolidate before cleanup</purpose>
|
|
185
|
+
</step_6>
|
|
186
|
+
|
|
187
|
+
<step_7>
|
|
188
|
+
<description>Suggest settings consolidation</description>
|
|
189
|
+
<if_differences_found>
|
|
190
|
+
<display_suggestions>Show filtered differences to user</display_suggestions>
|
|
191
|
+
<ask_confirmation>Ask user which entries to add to main settings</ask_confirmation>
|
|
192
|
+
<apply_changes>Update main .claude/settings.local.json with selected entries</apply_changes>
|
|
193
|
+
</if_differences_found>
|
|
194
|
+
<if_no_differences>Inform user no settings need consolidation</if_no_differences>
|
|
195
|
+
<purpose>Preserve useful development settings before removing worktree</purpose>
|
|
196
|
+
</step_7>
|
|
197
|
+
|
|
198
|
+
<step_8>
|
|
199
|
+
<description>Final cleanup confirmation</description>
|
|
200
|
+
<summary>
|
|
201
|
+
<display_worktree>Show worktree path and branch name</display_worktree>
|
|
202
|
+
<show_pr_status>Show merged PR details if found</show_pr_status>
|
|
203
|
+
<show_issue_status>Show related issue status if found</show_issue_status>
|
|
204
|
+
<show_last_activity>Display directory creation/modification date</show_last_activity>
|
|
205
|
+
</summary>
|
|
206
|
+
<safety_checks>
|
|
207
|
+
<check_uncommitted>git status --porcelain in worktree directory</check_uncommitted>
|
|
208
|
+
<warn_if_dirty>Alert user if uncommitted changes exist</warn_if_dirty>
|
|
209
|
+
</safety_checks>
|
|
210
|
+
<ask_deletion>Ask user confirmation: "Delete this worktree? (y/N)"</ask_deletion>
|
|
211
|
+
<purpose>Final safety check before irreversible deletion</purpose>
|
|
212
|
+
</step_8>
|
|
213
|
+
|
|
214
|
+
<step_9>
|
|
215
|
+
<description>Delete worktree</description>
|
|
216
|
+
<if_confirmed>
|
|
217
|
+
<remove_worktree>git worktree remove {path} --force</remove_worktree>
|
|
218
|
+
<cleanup_branch>git branch -d {branch_name}</cleanup_branch>
|
|
219
|
+
<success_message>Inform user worktree was successfully removed</success_message>
|
|
220
|
+
<next_steps>Suggest running command again to find next candidate</next_steps>
|
|
221
|
+
</if_confirmed>
|
|
222
|
+
<if_declined>Exit gracefully with no changes</if_declined>
|
|
223
|
+
<purpose>Perform the actual cleanup and guide user for next iteration</purpose>
|
|
224
|
+
</step_9>
|
|
225
|
+
</execution_steps>
|
|
226
|
+
|
|
227
|
+
<important_notes>
|
|
228
|
+
|
|
229
|
+
- Uses GitHub PR merge status as the ONLY reliable way to verify if a branch was merged
|
|
230
|
+
- DOES NOT use "git branch --merged" command as it's unreliable for merge verification
|
|
231
|
+
- Only processes branches with PRs that were definitively merged to main
|
|
232
|
+
- Skips worktrees without merged PRs and continues to next oldest candidate
|
|
233
|
+
- Checks and optionally closes related GitHub issues
|
|
234
|
+
- Prioritizes oldest worktrees by directory age first for systematic cleanup
|
|
235
|
+
- Warns about very recent worktrees (created within 24 hours) to avoid cleaning active work
|
|
236
|
+
- Preserves useful development settings before deletion
|
|
237
|
+
- Requires explicit confirmation before any destructive actions
|
|
238
|
+
- Handles locked worktrees automatically
|
|
239
|
+
- Processes one worktree at a time to maintain control
|
|
240
|
+
- Must be run from main branch for safety
|
|
241
|
+
- Works with standard GitHub repository URLs (owner/repo format)
|
|
242
|
+
</important_notes>
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
## 🛡 Project Rules (Injected into every command)
|
|
246
|
+
|
|
247
|
+
1. **NO BROKEN BUILDS:**
|
|
248
|
+
- Run `pnpm test` before every `/commit`
|
|
249
|
+
- Ensure all tests pass
|
|
250
|
+
- Fix any type errors immediately
|
|
251
|
+
|
|
252
|
+
2. **API DEVELOPMENT:**
|
|
253
|
+
- All new APIs MUST have Zod request/response schemas
|
|
254
|
+
- All APIs MUST be documented in both:
|
|
255
|
+
- OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
|
|
256
|
+
- API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
|
|
257
|
+
- Test ALL parameters and edge cases
|
|
258
|
+
- Include code examples and real-world outputs
|
|
259
|
+
|
|
260
|
+
3. **TDD WORKFLOW:**
|
|
261
|
+
- ALWAYS use /red → /green → /refactor cycle
|
|
262
|
+
- NEVER write implementation without failing test first
|
|
263
|
+
- Use /cycle for feature development
|
|
264
|
+
- Use characterization tests for refactoring
|
|
265
|
+
|
|
266
|
+
4. **API KEY MANAGEMENT:**
|
|
267
|
+
- Support three loading methods:
|
|
268
|
+
- Server environment variables
|
|
269
|
+
- NEXT_PUBLIC_ variables (client-side)
|
|
270
|
+
- Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
|
|
271
|
+
- Never hardcode API keys
|
|
272
|
+
- Always validate key availability before use
|
|
273
|
+
|
|
274
|
+
5. **COMPREHENSIVE TESTING:**
|
|
275
|
+
- When researching APIs, read actual implementation code
|
|
276
|
+
- Discover ALL possible parameters (not just documented ones)
|
|
277
|
+
- Test with various parameter combinations
|
|
278
|
+
- Document custom headers, query params, request/response schemas
|
|
279
|
+
- Include validation rules and testing notes
|
|
280
|
+
|
|
281
|
+
6. **NO UI BLOAT:**
|
|
282
|
+
- This is an API project with minimal frontend
|
|
283
|
+
- Only keep necessary test/documentation interfaces
|
|
284
|
+
- Delete unused components immediately
|
|
285
|
+
- No unnecessary UI libraries or features
|
|
286
|
+
|
|
287
|
+
7. **DOCUMENTATION:**
|
|
288
|
+
- If you change an API, you MUST update:
|
|
289
|
+
- OpenAPI spec
|
|
290
|
+
- api-tests-manifest.json
|
|
291
|
+
- Code examples
|
|
292
|
+
- Testing notes
|
|
293
|
+
- Document expected behavior and edge cases
|
|
294
|
+
- Include real-world output examples
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@hustle-together/api-dev-tools` will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [3.10.0] - 2025-12-12
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **UI Page Mode** - Full `/hustle-ui-create-page` workflow with dedicated documentation
|
|
9
|
+
- Page types: landing, dashboard, form, list, detail, auth
|
|
10
|
+
- Playwright E2E test generation (15+ test cases)
|
|
11
|
+
- Data schema validation before implementation
|
|
12
|
+
- **Page-Specific Hooks**
|
|
13
|
+
- `check-api-routes.py` - Verifies required API routes exist before page implementation
|
|
14
|
+
- `enforce-page-components.py` - Checks registry for reusable components
|
|
15
|
+
- `enforce-page-data-schema.py` - Validates API response types defined
|
|
16
|
+
- `enforce-a11y-audit.py` - Triggers WCAG audit after TDD Green phase
|
|
17
|
+
- **Combine Workflow Validation**
|
|
18
|
+
- 2+ API selection enforcement
|
|
19
|
+
- Registry verification for source APIs
|
|
20
|
+
- Flow type validation (sequential, parallel, conditional)
|
|
21
|
+
- Orchestration examples in manifest generation
|
|
22
|
+
- **Brand Color Validation** in `enforce-brand-guide.py`
|
|
23
|
+
- Extracts allowed colors from BRAND_GUIDE.md
|
|
24
|
+
- Validates hex colors, Tailwind classes, CSS variables
|
|
25
|
+
- Notifies on non-brand color usage
|
|
26
|
+
- **UI Showcase Auto-Population** in `update-ui-showcase.py`
|
|
27
|
+
- Generates `data.json` from registry automatically
|
|
28
|
+
- Component and page metadata extraction
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
- **State Template** (`api-dev-state.json`)
|
|
32
|
+
- Added `workflow` field: api-create, combine-api, ui-create-component, ui-create-page
|
|
33
|
+
- Added `combine_config` section for orchestration settings
|
|
34
|
+
- Added `ui_config` section for component/page settings
|
|
35
|
+
- **Session Startup** (`session-startup.py`)
|
|
36
|
+
- Workflow-specific context injection
|
|
37
|
+
- Combine: source APIs, flow type, error strategy
|
|
38
|
+
- UI: brand guide status, component/page type, a11y level
|
|
39
|
+
- **Manifest Generation** (`generate-manifest-entry.py`)
|
|
40
|
+
- Orchestration examples for combined endpoints
|
|
41
|
+
- Flow diagrams and error handling examples
|
|
42
|
+
- Version updated to 3.10.0
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
- Phase numbering now correctly uses 1-13 (was 0-12 in some files)
|
|
46
|
+
- Workflow type detection in api-workflow-check.py for all workflow types
|
|
47
|
+
|
|
48
|
+
## [3.9.2] - 2025-12-10
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
- Animated Hero Header with 3D perspective grid
|
|
52
|
+
- Dev Tools landing page at `/dev-tools`
|
|
53
|
+
- Multi-endpoint selector for APIs with sub-endpoints
|
|
54
|
+
- Audio playback for TTS/voice API responses
|
|
55
|
+
- CLI flags: `--with-sandpack`, `--with-storybook`, `--with-playwright`
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
- Updated BRAND_GUIDE.md with complete Hustle brand
|
|
59
|
+
- Enhanced showcase components with dark mode support
|
|
60
|
+
- Boxy 90s styling with 2px borders
|
|
61
|
+
|
|
62
|
+
## [3.9.0] - 2025-12-08
|
|
63
|
+
|
|
64
|
+
### Added
|
|
65
|
+
- `/hustle-ui-create` command for UI components/pages
|
|
66
|
+
- Brand guide integration with time to update
|
|
67
|
+
- ShadCN component detection in Phase 5
|
|
68
|
+
- 4-step verification (desktop/tablet/mobile + brand + tests + memory)
|
|
69
|
+
- UI Showcase auto-generation at `/ui-showcase`
|
|
70
|
+
|
|
71
|
+
## [3.8.0] - 2025-12-05
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
- `/hustle-combine` command for API orchestration
|
|
75
|
+
- Registry.json central tracking
|
|
76
|
+
- Combined entry support in update-registry.py
|
|
77
|
+
- Orchestration flow types: sequential, parallel, conditional
|
|
78
|
+
|
|
79
|
+
## [3.7.0] - 2025-12-01
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
- Multi-API state support (endpoints object)
|
|
83
|
+
- Research cache freshness tracking (7-day threshold)
|
|
84
|
+
- Comprehensive manifest generation with 50+ test cases
|
|
85
|
+
- Session logging in api-sessions/
|
|
86
|
+
|
|
87
|
+
## [3.6.7] - 2025-11-28
|
|
88
|
+
|
|
89
|
+
### Added
|
|
90
|
+
- Phase 13 completion output with curl examples
|
|
91
|
+
- Scope coverage report
|
|
92
|
+
- Research cache location in output
|
|
93
|
+
- Gap fixes for file tracking and verification
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
Note: v3.x is the final major version. All future updates will be v3.x.y releases.
|
package/README.md
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# API Development Tools v3.11.0
|
|
2
2
|
|
|
3
|
-
**Interview-driven, research-first API
|
|
3
|
+
**Interview-driven, research-first API development with 13-phase TDD workflow**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://agentskills.io)
|
|
6
|
+
[](https://github.com/hustle-together/api-dev-tools)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
> Now with **23 Agent Skills** for cross-platform compatibility across Claude Code, VS Code, Cursor, ChatGPT, and GitHub Copilot
|
|
10
|
+
|
|
11
|
+
## ⚡ Quick Start
|
|
12
|
+
|
|
13
|
+
### Via Claude Code Plugin (Recommended)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
/plugin marketplace add hustle-together/api-dev-tools
|
|
17
|
+
/plugin install api-dev-tools
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Via NPM
|
|
6
21
|
|
|
7
22
|
```bash
|
|
8
23
|
npx @hustle-together/api-dev-tools --scope=project
|
|
@@ -20,25 +35,51 @@ npx @hustle-together/api-dev-tools --with-sandpack --with-storybook
|
|
|
20
35
|
```
|
|
21
36
|
|
|
22
37
|
**What Gets Installed:**
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **Showcase pages** - `/dev-tools`, `/api-showcase`, `/ui-showcase`
|
|
29
|
-
- **Component/Page templates** - Storybook stories, Playwright E2E tests
|
|
30
|
-
- Research cache with 7-day freshness (`research/`)
|
|
31
|
-
- Session logging (`api-sessions/`)
|
|
32
|
-
- MCP server integrations (Context7, GitHub)
|
|
38
|
+
- **23 Agent Skills** (cross-platform compatible)
|
|
39
|
+
- **18 Enforcement Hooks** (Python scripts for Claude Code)
|
|
40
|
+
- **State Tracking** (`.claude/api-dev-state.json`)
|
|
41
|
+
- **Research Cache** (`.claude/research/` with 7-day freshness)
|
|
42
|
+
- **MCP Server Integration** (Context7 for docs, GitHub for PRs)
|
|
33
43
|
|
|
34
44
|
**Start Your First Workflow:**
|
|
35
45
|
```bash
|
|
36
|
-
/
|
|
37
|
-
/
|
|
38
|
-
/
|
|
39
|
-
/
|
|
46
|
+
/api-create my-endpoint # Complete 13-phase API workflow
|
|
47
|
+
/red # Write failing test
|
|
48
|
+
/green # Minimal implementation
|
|
49
|
+
/refactor # Clean up code
|
|
50
|
+
/commit # Semantic commit
|
|
51
|
+
/pr # Create pull request
|
|
40
52
|
```
|
|
41
53
|
|
|
54
|
+
## 🎉 What's New in v3.11.0
|
|
55
|
+
|
|
56
|
+
### Agent Skills Migration 🎯
|
|
57
|
+
|
|
58
|
+
**We've migrated to the [Agent Skills open standard](https://agentskills.io)!**
|
|
59
|
+
|
|
60
|
+
#### Cross-Platform Compatibility
|
|
61
|
+
- ✅ **Claude Code**: Full support with hooks and enforcement
|
|
62
|
+
- ✅ **VS Code**: Works with GitHub Copilot (manual hook setup)
|
|
63
|
+
- ✅ **Cursor**: Skills available (manual hook setup)
|
|
64
|
+
- ✅ **ChatGPT**: Skills available (no hooks)
|
|
65
|
+
- ✅ **Any Agent Skills-compatible platform**
|
|
66
|
+
|
|
67
|
+
#### What Changed
|
|
68
|
+
- **23 Skills**: All commands converted to `SKILL.md` format with YAML frontmatter
|
|
69
|
+
- **Plugin Marketplace**: One-command installation via `/plugin install`
|
|
70
|
+
- **Backward Compatible**: Original `.claude/commands/` still works
|
|
71
|
+
- **Enhanced Discovery**: Rich metadata and keywords for better skill selection
|
|
72
|
+
- **Automated Setup**: Installation script handles hooks and settings
|
|
73
|
+
|
|
74
|
+
#### Distribution
|
|
75
|
+
- **GitHub**: [hustle-together/api-dev-tools](https://github.com/hustle-together/api-dev-tools)
|
|
76
|
+
- **NPM**: [@hustle-together/api-dev-tools](https://npmjs.com/package/@hustle-together/api-dev-tools)
|
|
77
|
+
- **SkillsMP**: Coming soon
|
|
78
|
+
|
|
79
|
+
See [`.skills/README.md`](./.skills/README.md) for complete skills documentation.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
42
83
|
## What's New in v3.10.0
|
|
43
84
|
|
|
44
85
|
### UI Page Mode Complete
|
|
@@ -175,7 +216,7 @@ During Phase 3, Claude prompts: *"NOW is the time to update your brand guide!"*
|
|
|
175
216
|
- `update-ui-showcase.py` - Auto-update UI Showcase registry
|
|
176
217
|
- `update-api-showcase.py` - Auto-update API Showcase registry
|
|
177
218
|
|
|
178
|
-
## What's in v3.8.0
|
|
219
|
+
## What's New in v3.8.0
|
|
179
220
|
|
|
180
221
|
### `/hustle-combine` Command
|
|
181
222
|
Combine existing APIs from the registry into orchestration endpoints:
|
|
@@ -4125,7 +4166,7 @@ const researchCache = `.claude/research/${endpoint}/CURRENT.md`;
|
|
|
4125
4166
|
When you install with `npx @hustle-together/api-dev-tools --scope=project`, the following files are created in your project's `.claude/` directory:
|
|
4126
4167
|
|
|
4127
4168
|
```
|
|
4128
|
-
@hustle-together/api-dev-tools v3.
|
|
4169
|
+
@hustle-together/api-dev-tools v3.10.0
|
|
4129
4170
|
│
|
|
4130
4171
|
├── bin/
|
|
4131
4172
|
│ └── cli.js # NPX installer
|
|
@@ -4221,7 +4262,7 @@ When you install with `npx @hustle-together/api-dev-tools --scope=project`, the
|
|
|
4221
4262
|
│ ├── extract-parameters.ts # Extract Zod params
|
|
4222
4263
|
│ └── collect-test-results.ts # Run tests → results
|
|
4223
4264
|
│
|
|
4224
|
-
└── package.json # v3.
|
|
4265
|
+
└── package.json # v3.10.0
|
|
4225
4266
|
```
|
|
4226
4267
|
|
|
4227
4268
|
### Files Installed to Your Project
|
|
@@ -4870,6 +4911,9 @@ When `/hustle-ui-create` runs, it uses these templates as starting points, custo
|
|
|
4870
4911
|
|
|
4871
4912
|
---
|
|
4872
4913
|
|
|
4914
|
+
<details>
|
|
4915
|
+
<summary>📜 Older Version History (v3.6.0 - v3.7.0)</summary>
|
|
4916
|
+
|
|
4873
4917
|
## What's New in v3.7.0
|
|
4874
4918
|
|
|
4875
4919
|
### Hustle Branding
|
|
@@ -4994,6 +5038,8 @@ Upgraded hooks:
|
|
|
4994
5038
|
|
|
4995
5039
|
Every phase requires an "exit confirmation" question and affirmative user response before advancing. Prevents Claude from self-answering questions.
|
|
4996
5040
|
|
|
5041
|
+
</details>
|
|
5042
|
+
|
|
4997
5043
|
---
|
|
4998
5044
|
|
|
4999
5045
|
## All Hooks Reference (34 Hooks)
|
package/bin/cli.js
CHANGED
|
@@ -365,16 +365,17 @@ function main() {
|
|
|
365
365
|
fs.existsSync(path.join(targetDir, 'next.config.mjs')) ||
|
|
366
366
|
fs.existsSync(path.join(targetDir, 'next.config.ts'));
|
|
367
367
|
|
|
368
|
+
// Detect App Router structure (used by Test UI and Showcase Pages)
|
|
369
|
+
const appDir = fs.existsSync(path.join(targetDir, 'src', 'app'))
|
|
370
|
+
? path.join(targetDir, 'src', 'app')
|
|
371
|
+
: fs.existsSync(path.join(targetDir, 'app'))
|
|
372
|
+
? path.join(targetDir, 'app')
|
|
373
|
+
: null;
|
|
374
|
+
|
|
368
375
|
if (!hasNextJs) {
|
|
369
376
|
log(' ⚠️ Next.js not detected - skipping Test UI installation', 'yellow');
|
|
370
377
|
log(' 💡 Test UI requires Next.js App Router', 'yellow');
|
|
371
378
|
} else if (fs.existsSync(testUiSourceDir)) {
|
|
372
|
-
// Detect App Router structure
|
|
373
|
-
const appDir = fs.existsSync(path.join(targetDir, 'src', 'app'))
|
|
374
|
-
? path.join(targetDir, 'src', 'app')
|
|
375
|
-
: fs.existsSync(path.join(targetDir, 'app'))
|
|
376
|
-
? path.join(targetDir, 'app')
|
|
377
|
-
: null;
|
|
378
379
|
|
|
379
380
|
if (!appDir) {
|
|
380
381
|
log(' ⚠️ App Router not detected - skipping Test UI installation', 'yellow');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hustle-together/api-dev-tools",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Interview-driven, research-first API
|
|
3
|
+
"version": "3.11.1",
|
|
4
|
+
"description": "Interview-driven, research-first API development toolkit with 13-phase TDD workflow, enforcement hooks, and 23 Agent Skills for cross-platform AI agents",
|
|
5
5
|
"main": "bin/cli.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"api-dev-tools": "./bin/cli.js"
|
|
@@ -12,8 +12,12 @@
|
|
|
12
12
|
"hooks/",
|
|
13
13
|
"scripts/",
|
|
14
14
|
"templates/",
|
|
15
|
+
".claude/",
|
|
16
|
+
".claude-plugin/",
|
|
17
|
+
".skills/",
|
|
15
18
|
"README.md",
|
|
16
|
-
"LICENSE"
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"CHANGELOG.md"
|
|
17
21
|
],
|
|
18
22
|
"scripts": {
|
|
19
23
|
"test": "node bin/cli.js --scope=project"
|
|
@@ -21,20 +25,20 @@
|
|
|
21
25
|
"keywords": [
|
|
22
26
|
"claude",
|
|
23
27
|
"claude-code",
|
|
28
|
+
"agent-skills",
|
|
24
29
|
"api-development",
|
|
25
|
-
"ui-development",
|
|
26
|
-
"components",
|
|
27
|
-
"storybook",
|
|
28
|
-
"playwright",
|
|
29
30
|
"tdd",
|
|
30
31
|
"test-driven-development",
|
|
31
32
|
"interview-driven",
|
|
33
|
+
"research-first",
|
|
34
|
+
"verification",
|
|
35
|
+
"hooks",
|
|
36
|
+
"mcp",
|
|
32
37
|
"api-testing",
|
|
33
|
-
"api-orchestration",
|
|
34
|
-
"combine",
|
|
35
38
|
"documentation",
|
|
36
39
|
"workflow",
|
|
37
|
-
"automation"
|
|
40
|
+
"automation",
|
|
41
|
+
"cross-platform"
|
|
38
42
|
],
|
|
39
43
|
"author": "Hustle Together",
|
|
40
44
|
"license": "MIT",
|
|
@@ -47,6 +51,13 @@
|
|
|
47
51
|
},
|
|
48
52
|
"homepage": "https://github.com/hustle-together/api-dev-tools#readme",
|
|
49
53
|
"engines": {
|
|
50
|
-
"node": ">=
|
|
54
|
+
"node": ">=18.0.0",
|
|
55
|
+
"pnpm": ">=10.11.0"
|
|
56
|
+
},
|
|
57
|
+
"claudeCode": {
|
|
58
|
+
"marketplace": ".claude-plugin/marketplace.json",
|
|
59
|
+
"skills": ".skills",
|
|
60
|
+
"hooks": ".skills/_shared/hooks",
|
|
61
|
+
"settings": ".skills/_shared/settings.json"
|
|
51
62
|
}
|
|
52
63
|
}
|