@hustle-together/api-dev-tools 3.10.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 +331 -0
- package/.claude/commands/README.md +196 -0
- package/.claude/commands/add-command.md +212 -0
- package/.claude/commands/api-create.md +510 -0
- package/.claude/commands/api-env.md +51 -0
- package/.claude/commands/api-interview.md +344 -0
- package/.claude/commands/api-research.md +357 -0
- package/.claude/commands/api-status.md +279 -0
- package/.claude/commands/api-verify.md +232 -0
- package/.claude/commands/beepboop.md +96 -0
- package/.claude/commands/busycommit.md +111 -0
- package/.claude/commands/commit.md +82 -0
- package/.claude/commands/cycle.md +137 -0
- package/.claude/commands/gap.md +85 -0
- package/.claude/commands/green.md +137 -0
- package/.claude/commands/issue.md +187 -0
- package/.claude/commands/ntfy-setup.md +91 -0
- package/.claude/commands/ntfy-test.md +74 -0
- package/.claude/commands/plan.md +167 -0
- package/.claude/commands/pr.md +121 -0
- package/.claude/commands/publish.md +40 -0
- package/.claude/commands/red.md +137 -0
- package/.claude/commands/refactor.md +137 -0
- package/.claude/commands/spike.md +137 -0
- package/.claude/commands/summarize.md +93 -0
- package/.claude/commands/tdd.md +139 -0
- package/.claude/commands/worktree-add.md +307 -0
- package/.claude/commands/worktree-cleanup.md +275 -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 +144 -0
- package/.claude/settings.local.json +12 -0
- package/.claude-plugin/marketplace.json +103 -0
- package/.skills/README.md +293 -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 +227 -0
- package/.skills/api-create/SKILL.md +623 -0
- package/.skills/api-env/SKILL.md +64 -0
- package/.skills/api-interview/SKILL.md +357 -0
- package/.skills/api-research/SKILL.md +370 -0
- package/.skills/api-status/SKILL.md +292 -0
- package/.skills/api-verify/SKILL.md +245 -0
- package/.skills/beepboop/SKILL.md +111 -0
- package/.skills/busycommit/SKILL.md +126 -0
- package/.skills/commit/SKILL.md +97 -0
- package/.skills/cycle/SKILL.md +152 -0
- package/.skills/gap/SKILL.md +100 -0
- package/.skills/green/SKILL.md +152 -0
- package/.skills/issue/SKILL.md +202 -0
- package/.skills/plan/SKILL.md +182 -0
- package/.skills/pr/SKILL.md +136 -0
- package/.skills/publish/SKILL.md +160 -0
- package/.skills/red/SKILL.md +152 -0
- package/.skills/refactor/SKILL.md +152 -0
- package/.skills/spike/SKILL.md +152 -0
- package/.skills/summarize/SKILL.md +108 -0
- package/.skills/tdd/SKILL.md +154 -0
- package/.skills/update-todos/SKILL.md +250 -0
- package/.skills/worktree-add/SKILL.md +322 -0
- package/.skills/worktree-cleanup/SKILL.md +290 -0
- package/CHANGELOG.md +115 -0
- package/README.md +161 -7101
- 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 +33 -12
- 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,290 @@
|
|
|
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
|
+
|
|
16
|
+
description: Clean up merged worktrees by verifying PR/issue status, consolidating settings, and removing stale worktrees
|
|
17
|
+
argument-hint: (no arguments)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Worktree Cleanup
|
|
22
|
+
|
|
23
|
+
## General Guidelines
|
|
24
|
+
|
|
25
|
+
### Output Style
|
|
26
|
+
|
|
27
|
+
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
28
|
+
- Write natural, descriptive code without meta-commentary about the development process
|
|
29
|
+
- The code should speak for itself - TDD is the process, not the product
|
|
30
|
+
|
|
31
|
+
Clean up merged worktrees by finding the oldest merged branch, consolidating settings, and removing stale worktrees.
|
|
32
|
+
|
|
33
|
+
Additional info: $ARGUMENTS
|
|
34
|
+
|
|
35
|
+
<current_state>
|
|
36
|
+
Current branch: !git branch --show-current`
|
|
37
|
+
Current worktrees: !git worktree list`
|
|
38
|
+
</current_state>
|
|
39
|
+
|
|
40
|
+
<execution_steps>
|
|
41
|
+
<step_0>
|
|
42
|
+
<description>Validate MCP dependencies</description>
|
|
43
|
+
<check_github_mcp>
|
|
44
|
+
<requirement>GitHub MCP server must be configured</requirement>
|
|
45
|
+
<fallback>If unavailable, use `gh` CLI commands</fallback>
|
|
46
|
+
<validation> - Try listing available MCP resources - If GitHub MCP not found, switch to CLI fallback - Inform user about MCP configuration if needed
|
|
47
|
+
</validation>
|
|
48
|
+
</check_github_mcp>
|
|
49
|
+
<error_handling>
|
|
50
|
+
If MCP validation fails: - Show clear error message - Provide setup instructions - Fallback to CLI if possible
|
|
51
|
+
</error_handling>
|
|
52
|
+
<purpose>Ensure required MCP dependencies are available before proceeding</purpose>
|
|
53
|
+
</step_0>
|
|
54
|
+
|
|
55
|
+
<step_1>
|
|
56
|
+
<description>Verify we're in main branch</description>
|
|
57
|
+
<check_command>git branch --show-current</check_command>
|
|
58
|
+
<required_branch>main</required_branch>
|
|
59
|
+
<error_if_not_main>Exit with error message: "This command must be run from the main branch"</error_if_not_main>
|
|
60
|
+
<purpose>Ensure we're consolidating to the main worktree</purpose>
|
|
61
|
+
</step_1>
|
|
62
|
+
|
|
63
|
+
<step_2>
|
|
64
|
+
<description>Get list of all worktrees</description>
|
|
65
|
+
<command>git worktree list --porcelain</command>
|
|
66
|
+
<parse_output>Extract worktree paths and branch names</parse_output>
|
|
67
|
+
<exclude_main>Filter out the main worktree from cleanup candidates</exclude_main>
|
|
68
|
+
<purpose>Identify all worktrees that could potentially be cleaned up</purpose>
|
|
69
|
+
</step_2>
|
|
70
|
+
|
|
71
|
+
<step_3>
|
|
72
|
+
<description>Find oldest worktree by directory age</description>
|
|
73
|
+
<get_worktree_ages>
|
|
74
|
+
<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>
|
|
75
|
+
<command_linux>git worktree list | grep -v "main" | awk '{print $1}' | xargs stat -c "%y|%n" | sort</command_linux>
|
|
76
|
+
<purpose>List all worktrees sorted by directory modification time (oldest first)</purpose>
|
|
77
|
+
<note>Use full path /usr/bin/stat on macOS, regular stat on Linux.</note>
|
|
78
|
+
</get_worktree_ages>
|
|
79
|
+
<filter_recent>
|
|
80
|
+
<exclude_new>For worktrees created within the last 24 hours, let user know that this worktree might not be worth cleaning</exclude_new>
|
|
81
|
+
<get_current_time>date +"%Y-%m-%d %H:%M"</get_current_time>
|
|
82
|
+
</filter_recent>
|
|
83
|
+
<select_oldest>
|
|
84
|
+
<extract_branch_name>Parse branch name from oldest worktree path</extract_branch_name>
|
|
85
|
+
<important_note>DO NOT use "git branch --merged" to check merge status - it's unreliable</important_note>
|
|
86
|
+
<proceed_to_pr_check>Move directly to step 4 to verify PR merge status instead</proceed_to_pr_check>
|
|
87
|
+
</select_oldest>
|
|
88
|
+
<purpose>Identify oldest worktree candidate - actual merge verification happens via GitHub PR in next step</purpose>
|
|
89
|
+
</step_3>
|
|
90
|
+
|
|
91
|
+
<step_4>
|
|
92
|
+
<description>Verify GitHub PR merge status (primary merge verification)</description>
|
|
93
|
+
<determine_repo>
|
|
94
|
+
<check_remote>git remote get-url origin</check_remote>
|
|
95
|
+
<parse_repo>Extract owner/repo from GitHub URL</parse_repo>
|
|
96
|
+
<fallback>Use project repository from git remote (owner/repo format)</fallback>
|
|
97
|
+
</determine_repo>
|
|
98
|
+
<search_pr>
|
|
99
|
+
<tool>mcp**github**search_pull_requests</tool>
|
|
100
|
+
<query>repo:owner/repo head:{branch_name} base:main</query>
|
|
101
|
+
<purpose>Find PR for this branch targeting main</purpose>
|
|
102
|
+
<important>This is the PRIMARY way to verify if a branch was merged - NOT git commands</important>
|
|
103
|
+
</search_pr>
|
|
104
|
+
<verify_pr_merged>
|
|
105
|
+
<if_pr_found>
|
|
106
|
+
<get_pr_details>Use mcp**github**pull_request_read to get full PR info</get_pr_details>
|
|
107
|
+
<confirm_merged>Verify PR state is "closed" AND merged_at is not null AND base is "main"</confirm_merged>
|
|
108
|
+
<extract_issue_number>Look for issue references in PR title/body (e.g., #14533, owner/repo#14533)</extract_issue_number>
|
|
109
|
+
<if_merged>Proceed with cleanup - this branch was definitively merged to main</if_merged>
|
|
110
|
+
<if_not_merged>
|
|
111
|
+
<skip_worktree>This worktree is NOT merged - continue to next oldest worktree</skip_worktree>
|
|
112
|
+
<repeat_from_step_3>Go back and find the next oldest worktree to check</repeat_from_step_3>
|
|
113
|
+
</if_not_merged>
|
|
114
|
+
</if_pr_found>
|
|
115
|
+
<if_no_pr>
|
|
116
|
+
<skip_worktree>No PR found - this branch was likely never submitted for review</skip_worktree>
|
|
117
|
+
<continue_to_next>Continue checking next oldest worktree</continue_to_next>
|
|
118
|
+
</if_no_pr>
|
|
119
|
+
</verify_pr_merged>
|
|
120
|
+
<purpose>Use GitHub PR status as the authoritative source for merge verification instead of unreliable git commands</purpose>
|
|
121
|
+
</step_4>
|
|
122
|
+
|
|
123
|
+
<step_4_5>
|
|
124
|
+
<description>Check and close related GitHub issue</description>
|
|
125
|
+
<if_issue_found>
|
|
126
|
+
<get_issue_details>
|
|
127
|
+
<tool>mcp**github**issue_read</tool>
|
|
128
|
+
<method>get</method>
|
|
129
|
+
<extract_repo>From issue reference (main-repo vs cross-repo)</extract_repo>
|
|
130
|
+
</get_issue_details>
|
|
131
|
+
<check_issue_state>
|
|
132
|
+
<if_open>
|
|
133
|
+
<ask_close>Ask user: "Related issue #{number} is still open. Should I close it? (y/N)"</ask_close>
|
|
134
|
+
<if_yes_close>
|
|
135
|
+
<add_closing_comment>
|
|
136
|
+
<tool>mcp**github**add_issue_comment</tool>
|
|
137
|
+
<body_template>Closing this issue as branch {branch_name} was merged to main on {merge_date} via PR #{pr_number}.</body_template>
|
|
138
|
+
<get_merge_date>Extract merge date from PR details</get_merge_date>
|
|
139
|
+
<get_pr_number>Use PR number from search results</get_pr_number>
|
|
140
|
+
</add_closing_comment>
|
|
141
|
+
<close_issue>
|
|
142
|
+
<tool>mcp**github**issue_write</tool>
|
|
143
|
+
<method>update</method>
|
|
144
|
+
<state>closed</state>
|
|
145
|
+
<state_reason>completed</state_reason>
|
|
146
|
+
</close_issue>
|
|
147
|
+
</if_yes_close>
|
|
148
|
+
</if_open>
|
|
149
|
+
<if_closed>Inform user issue is already closed</if_closed>
|
|
150
|
+
</check_issue_state>
|
|
151
|
+
</if_issue_found>
|
|
152
|
+
<if_no_issue>Continue without issue management</if_no_issue>
|
|
153
|
+
<purpose>Ensure proper issue lifecycle management</purpose>
|
|
154
|
+
</step_4_5>
|
|
155
|
+
|
|
156
|
+
<step_5>
|
|
157
|
+
<description>Check if worktree is locked</description>
|
|
158
|
+
<check_command>git worktree list --porcelain | grep -A5 "worktree {path}" | grep "locked"</check_command>
|
|
159
|
+
<if_locked>
|
|
160
|
+
<unlock_command>git worktree unlock {path}</unlock_command>
|
|
161
|
+
<notify_user>Inform user that worktree was unlocked</notify_user>
|
|
162
|
+
</if_locked>
|
|
163
|
+
<purpose>Unlock worktree if it was locked for tracking purposes</purpose>
|
|
164
|
+
</step_5>
|
|
165
|
+
|
|
166
|
+
<step_6>
|
|
167
|
+
<description>Analyze Claude settings differences</description>
|
|
168
|
+
<read_main_settings>.claude/settings.local.json</read_main_settings>
|
|
169
|
+
<read_worktree_settings>{worktree_path}/.claude/settings.local.json</read_worktree_settings>
|
|
170
|
+
<compare_allow_lists>
|
|
171
|
+
<extract_main_allows>Extract "allow" array from main settings</extract_main_allows>
|
|
172
|
+
<extract_worktree_allows>Extract "allow" array from worktree settings</extract_worktree_allows>
|
|
173
|
+
<find_differences>Identify entries in worktree that are not in main</find_differences>
|
|
174
|
+
</compare_allow_lists>
|
|
175
|
+
<filter_suggestions>
|
|
176
|
+
<include_filesystem>Read permissions for filesystem paths</include_filesystem>
|
|
177
|
+
<exclude_intrusive>Exclude bash commands, write permissions, etc.</exclude_intrusive>
|
|
178
|
+
<focus_user_specific>Include only user-specific, non-disruptive entries</focus_user_specific>
|
|
179
|
+
</filter_suggestions>
|
|
180
|
+
<purpose>Identify useful settings to consolidate before cleanup</purpose>
|
|
181
|
+
</step_6>
|
|
182
|
+
|
|
183
|
+
<step_7>
|
|
184
|
+
<description>Suggest settings consolidation</description>
|
|
185
|
+
<if_differences_found>
|
|
186
|
+
<display_suggestions>Show filtered differences to user</display_suggestions>
|
|
187
|
+
<ask_confirmation>Ask user which entries to add to main settings</ask_confirmation>
|
|
188
|
+
<apply_changes>Update main .claude/settings.local.json with selected entries</apply_changes>
|
|
189
|
+
</if_differences_found>
|
|
190
|
+
<if_no_differences>Inform user no settings need consolidation</if_no_differences>
|
|
191
|
+
<purpose>Preserve useful development settings before removing worktree</purpose>
|
|
192
|
+
</step_7>
|
|
193
|
+
|
|
194
|
+
<step_8>
|
|
195
|
+
<description>Final cleanup confirmation</description>
|
|
196
|
+
|
|
197
|
+
<summary>
|
|
198
|
+
<display_worktree>Show worktree path and branch name</display_worktree>
|
|
199
|
+
<show_pr_status>Show merged PR details if found</show_pr_status>
|
|
200
|
+
<show_issue_status>Show related issue status if found</show_issue_status>
|
|
201
|
+
<show_last_activity>Display directory creation/modification date</show_last_activity>
|
|
202
|
+
</summary>
|
|
203
|
+
<safety_checks>
|
|
204
|
+
<check_uncommitted>git status --porcelain in worktree directory</check_uncommitted>
|
|
205
|
+
<warn_if_dirty>Alert user if uncommitted changes exist</warn_if_dirty>
|
|
206
|
+
</safety_checks>
|
|
207
|
+
<ask_deletion>Ask user confirmation: "Delete this worktree? (y/N)"</ask_deletion>
|
|
208
|
+
<purpose>Final safety check before irreversible deletion</purpose>
|
|
209
|
+
</step_8>
|
|
210
|
+
|
|
211
|
+
<step_9>
|
|
212
|
+
<description>Delete worktree</description>
|
|
213
|
+
<if_confirmed>
|
|
214
|
+
<remove_worktree>git worktree remove {path} --force</remove_worktree>
|
|
215
|
+
<cleanup_branch>git branch -d {branch_name}</cleanup_branch>
|
|
216
|
+
<success_message>Inform user worktree was successfully removed</success_message>
|
|
217
|
+
<next_steps>Suggest running command again to find next candidate</next_steps>
|
|
218
|
+
</if_confirmed>
|
|
219
|
+
<if_declined>Exit gracefully with no changes</if_declined>
|
|
220
|
+
<purpose>Perform the actual cleanup and guide user for next iteration</purpose>
|
|
221
|
+
</step_9>
|
|
222
|
+
</execution_steps>
|
|
223
|
+
|
|
224
|
+
<important_notes>
|
|
225
|
+
|
|
226
|
+
- Uses GitHub PR merge status as the ONLY reliable way to verify if a branch was merged
|
|
227
|
+
- DOES NOT use "git branch --merged" command as it's unreliable for merge verification
|
|
228
|
+
- Only processes branches with PRs that were definitively merged to main
|
|
229
|
+
- Skips worktrees without merged PRs and continues to next oldest candidate
|
|
230
|
+
- Checks and optionally closes related GitHub issues
|
|
231
|
+
- Prioritizes oldest worktrees by directory age first for systematic cleanup
|
|
232
|
+
- Warns about very recent worktrees (created within 24 hours) to avoid cleaning active work
|
|
233
|
+
- Preserves useful development settings before deletion
|
|
234
|
+
- Requires explicit confirmation before any destructive actions
|
|
235
|
+
- Handles locked worktrees automatically
|
|
236
|
+
- Processes one worktree at a time to maintain control
|
|
237
|
+
- Must be run from main branch for safety
|
|
238
|
+
- Works with standard GitHub repository URLs (owner/repo format)
|
|
239
|
+
</important_notes>
|
|
240
|
+
|
|
241
|
+
## 🛡 Project Rules (Injected into every command)
|
|
242
|
+
|
|
243
|
+
1. **NO BROKEN BUILDS:**
|
|
244
|
+
- Run `pnpm test` before every `/commit`
|
|
245
|
+
- Ensure all tests pass
|
|
246
|
+
- Fix any type errors immediately
|
|
247
|
+
|
|
248
|
+
2. **API DEVELOPMENT:**
|
|
249
|
+
- All new APIs MUST have Zod request/response schemas
|
|
250
|
+
- All APIs MUST be documented in both:
|
|
251
|
+
- OpenAPI spec ([src/lib/openapi/](src/lib/openapi/))
|
|
252
|
+
- API test manifest ([src/app/api-test/api-tests-manifest.json](src/app/api-test/api-tests-manifest.json))
|
|
253
|
+
- Test ALL parameters and edge cases
|
|
254
|
+
- Include code examples and real-world outputs
|
|
255
|
+
|
|
256
|
+
3. **TDD WORKFLOW:**
|
|
257
|
+
- ALWAYS use /red → /green → /refactor cycle
|
|
258
|
+
- NEVER write implementation without failing test first
|
|
259
|
+
- Use /cycle for feature development
|
|
260
|
+
- Use characterization tests for refactoring
|
|
261
|
+
|
|
262
|
+
4. **API KEY MANAGEMENT:**
|
|
263
|
+
- Support three loading methods:
|
|
264
|
+
- Server environment variables
|
|
265
|
+
- NEXT*PUBLIC* variables (client-side)
|
|
266
|
+
- Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
|
|
267
|
+
- Never hardcode API keys
|
|
268
|
+
- Always validate key availability before use
|
|
269
|
+
|
|
270
|
+
5. **COMPREHENSIVE TESTING:**
|
|
271
|
+
- When researching APIs, read actual implementation code
|
|
272
|
+
- Discover ALL possible parameters (not just documented ones)
|
|
273
|
+
- Test with various parameter combinations
|
|
274
|
+
- Document custom headers, query params, request/response schemas
|
|
275
|
+
- Include validation rules and testing notes
|
|
276
|
+
|
|
277
|
+
6. **NO UI BLOAT:**
|
|
278
|
+
- This is an API project with minimal frontend
|
|
279
|
+
- Only keep necessary test/documentation interfaces
|
|
280
|
+
- Delete unused components immediately
|
|
281
|
+
- No unnecessary UI libraries or features
|
|
282
|
+
|
|
283
|
+
7. **DOCUMENTATION:**
|
|
284
|
+
- If you change an API, you MUST update:
|
|
285
|
+
- OpenAPI spec
|
|
286
|
+
- api-tests-manifest.json
|
|
287
|
+
- Code examples
|
|
288
|
+
- Testing notes
|
|
289
|
+
- Document expected behavior and edge cases
|
|
290
|
+
- Include real-world output examples
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.0.1] - 2025-12-28
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **Stop hook false positive blocking**: Fixed bug where `api-workflow-check.py` incorrectly blocked Q&A sessions when no workflow was active. The hook now correctly checks for both `None` and `"not_started"` phase statuses.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## [1.0.0] - 2025-12-28
|
|
14
|
+
|
|
15
|
+
### Initial Release
|
|
16
|
+
|
|
17
|
+
Interview-driven, research-first API development toolkit with 14-phase TDD workflow.
|
|
18
|
+
|
|
19
|
+
### Core Features
|
|
20
|
+
|
|
21
|
+
**Four Main Workflows:**
|
|
22
|
+
|
|
23
|
+
- `/api-create [endpoint]` - Complete 14-phase API endpoint development
|
|
24
|
+
- `/hustle-ui-create [name]` - Component development with Storybook
|
|
25
|
+
- `/hustle-ui-create-page [name]` - Page development with Playwright E2E
|
|
26
|
+
- `/hustle-combine [type]` - Orchestrate multiple existing APIs
|
|
27
|
+
|
|
28
|
+
**14-Phase Workflow:**
|
|
29
|
+
|
|
30
|
+
1. Disambiguation - Clarify ambiguous terms
|
|
31
|
+
2. Scope - Confirm understanding
|
|
32
|
+
3. Initial Research - Context7 + WebSearch (with async parallel subagents)
|
|
33
|
+
4. Interview - Questions FROM research findings
|
|
34
|
+
5. Deep Research - Adaptive searches based on answers
|
|
35
|
+
6. Schema - Zod schema from research + interview
|
|
36
|
+
7. Environment - Verify API keys exist
|
|
37
|
+
8. TDD Red - Write failing tests
|
|
38
|
+
9. TDD Green - Minimal implementation to pass
|
|
39
|
+
10. Verify - Re-research and compare to implementation
|
|
40
|
+
11. Code Review - Greptile AI-powered review (catches issues early)
|
|
41
|
+
12. TDD Refactor - Fix review issues + clean up code
|
|
42
|
+
13. Documentation - Update manifests, cache research
|
|
43
|
+
14. Completion - Final commit and PR
|
|
44
|
+
|
|
45
|
+
**23 Enforcement Hooks:**
|
|
46
|
+
|
|
47
|
+
- SessionStart: State context injection
|
|
48
|
+
- UserPromptSubmit: Research requirement detection
|
|
49
|
+
- PreToolUse: Block writes until phases complete
|
|
50
|
+
- PostToolUse: Auto-format, token tracking, notifications, code review
|
|
51
|
+
- Stop: Block if workflow incomplete
|
|
52
|
+
|
|
53
|
+
**Greptile AI Code Review (Phase 11):**
|
|
54
|
+
|
|
55
|
+
- Runs BEFORE refactoring so issues can be fixed
|
|
56
|
+
- Bug detection with full codebase context
|
|
57
|
+
- Security vulnerability scanning (OWASP top 10)
|
|
58
|
+
- Performance issue identification
|
|
59
|
+
- Returns actionable issues with file:line references
|
|
60
|
+
- Requires: GREPTILE_API_KEY + GITHUB_TOKEN
|
|
61
|
+
|
|
62
|
+
**Async Parallel Research:**
|
|
63
|
+
|
|
64
|
+
- Spawn multiple research subagents in parallel
|
|
65
|
+
- Use Ctrl+B to background agents
|
|
66
|
+
- Use /tasks to monitor progress
|
|
67
|
+
- 3x faster research with parallel Context7 + WebSearch
|
|
68
|
+
|
|
69
|
+
**7 Subagents:**
|
|
70
|
+
|
|
71
|
+
- `parallel-researcher` (Haiku) - Parallel documentation scraping
|
|
72
|
+
- `research-validator` (Haiku) - Find all endpoints and webhooks
|
|
73
|
+
- `docs-generator` (Haiku) - TypeDoc generation
|
|
74
|
+
- `schema-generator` (Sonnet) - Zod schema creation
|
|
75
|
+
- `test-writer` (Sonnet) - Comprehensive test generation
|
|
76
|
+
- `implementation-reviewer` (Sonnet) - Compare code to docs
|
|
77
|
+
- `code-reviewer` (Sonnet) - Security and performance review
|
|
78
|
+
|
|
79
|
+
**NTFY Push Notifications:**
|
|
80
|
+
|
|
81
|
+
- Phase completion updates
|
|
82
|
+
- Input needed alerts (interview questions)
|
|
83
|
+
- Token usage per phase
|
|
84
|
+
- `/ntfy-setup` and `/ntfy-test` commands
|
|
85
|
+
|
|
86
|
+
**Component Type System:**
|
|
87
|
+
|
|
88
|
+
- Basic components (single-purpose, few props)
|
|
89
|
+
- Complex components (multi-part, user flows)
|
|
90
|
+
- AI suggests type, user confirms via hook
|
|
91
|
+
|
|
92
|
+
**CLI Installer:**
|
|
93
|
+
|
|
94
|
+
- ASCII art banner with Hustle branding
|
|
95
|
+
- 8-step progress indicators
|
|
96
|
+
- Animated spinners for long operations
|
|
97
|
+
- Optional tools: Storybook, Playwright, Sandpack
|
|
98
|
+
|
|
99
|
+
**Additional Commands:**
|
|
100
|
+
|
|
101
|
+
- TDD: `/red`, `/green`, `/refactor`, `/cycle`
|
|
102
|
+
- Git: `/commit`, `/pr`, `/busycommit`
|
|
103
|
+
- Planning: `/plan`, `/gap`, `/issue`
|
|
104
|
+
- Worktrees: `/worktree-add`, `/worktree-cleanup`
|
|
105
|
+
|
|
106
|
+
**Infrastructure:**
|
|
107
|
+
|
|
108
|
+
- State tracking in `.claude/api-dev-state.json`
|
|
109
|
+
- Research cache with 7-day freshness
|
|
110
|
+
- Registry for all created APIs/components
|
|
111
|
+
- Environment template in `templates/.env.example`
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
See [ROADMAP.md](./ROADMAP.md) for planned features.
|