@hustle-together/api-dev-tools 3.11.1 → 3.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.claude/agents/code-reviewer.md +170 -0
  2. package/.claude/agents/docs-generator.md +80 -0
  3. package/.claude/agents/implementation-reviewer.md +119 -0
  4. package/.claude/agents/parallel-researcher.md +52 -0
  5. package/.claude/agents/research-validator.md +116 -0
  6. package/.claude/agents/schema-generator.md +70 -0
  7. package/.claude/agents/test-writer.md +104 -0
  8. package/.claude/api-dev-state.json +305 -56
  9. package/.claude/commands/README.md +21 -10
  10. package/.claude/commands/add-command.md +8 -5
  11. package/.claude/commands/api-create.md +36 -25
  12. package/.claude/commands/api-env.md +1 -0
  13. package/.claude/commands/api-interview.md +32 -19
  14. package/.claude/commands/api-research.md +47 -21
  15. package/.claude/commands/api-status.md +21 -1
  16. package/.claude/commands/api-verify.md +14 -13
  17. package/.claude/commands/beepboop.md +4 -5
  18. package/.claude/commands/busycommit.md +2 -3
  19. package/.claude/commands/commit.md +2 -3
  20. package/.claude/commands/cycle.md +2 -7
  21. package/.claude/commands/gap.md +2 -3
  22. package/.claude/commands/green.md +2 -7
  23. package/.claude/commands/issue.md +3 -8
  24. package/.claude/commands/ntfy-setup.md +91 -0
  25. package/.claude/commands/ntfy-test.md +74 -0
  26. package/.claude/commands/plan.md +2 -3
  27. package/.claude/commands/pr.md +2 -3
  28. package/.claude/commands/publish.md +40 -0
  29. package/.claude/commands/red.md +2 -7
  30. package/.claude/commands/refactor.md +2 -7
  31. package/.claude/commands/spike.md +2 -7
  32. package/.claude/commands/summarize.md +2 -3
  33. package/.claude/commands/tdd.md +2 -7
  34. package/.claude/commands/worktree-add.md +208 -216
  35. package/.claude/commands/worktree-cleanup.md +172 -178
  36. package/.claude/settings.json +63 -12
  37. package/.claude/settings.local.json +2 -1
  38. package/.claude-plugin/marketplace.json +2 -11
  39. package/.skills/README.md +55 -53
  40. package/.skills/_shared/settings.json +1 -1
  41. package/.skills/add-command/SKILL.md +10 -5
  42. package/.skills/api-create/SKILL.md +146 -35
  43. package/.skills/api-env/SKILL.md +1 -0
  44. package/.skills/api-interview/SKILL.md +32 -19
  45. package/.skills/api-research/SKILL.md +47 -21
  46. package/.skills/api-status/SKILL.md +21 -1
  47. package/.skills/api-verify/SKILL.md +14 -13
  48. package/.skills/beepboop/SKILL.md +6 -5
  49. package/.skills/busycommit/SKILL.md +4 -3
  50. package/.skills/commit/SKILL.md +4 -3
  51. package/.skills/cycle/SKILL.md +4 -7
  52. package/.skills/gap/SKILL.md +4 -3
  53. package/.skills/green/SKILL.md +4 -7
  54. package/.skills/issue/SKILL.md +5 -8
  55. package/.skills/plan/SKILL.md +4 -3
  56. package/.skills/pr/SKILL.md +4 -3
  57. package/.skills/publish/SKILL.md +160 -0
  58. package/.skills/red/SKILL.md +4 -7
  59. package/.skills/refactor/SKILL.md +4 -7
  60. package/.skills/spike/SKILL.md +4 -7
  61. package/.skills/summarize/SKILL.md +4 -3
  62. package/.skills/tdd/SKILL.md +4 -7
  63. package/.skills/update-todos/SKILL.md +22 -0
  64. package/.skills/worktree-add/SKILL.md +210 -216
  65. package/.skills/worktree-cleanup/SKILL.md +183 -187
  66. package/CHANGELOG.md +97 -79
  67. package/README.md +161 -7142
  68. package/bin/cli.js +448 -805
  69. package/commands/README.md +66 -31
  70. package/commands/add-command.md +8 -5
  71. package/commands/beepboop.md +4 -5
  72. package/commands/busycommit.md +2 -3
  73. package/commands/commit.md +2 -3
  74. package/commands/cycle.md +2 -7
  75. package/commands/gap.md +2 -3
  76. package/commands/green.md +2 -7
  77. package/commands/hustle-api-continue.md +8 -5
  78. package/commands/hustle-api-create.md +70 -29
  79. package/commands/hustle-api-env.md +1 -0
  80. package/commands/hustle-api-interview.md +32 -19
  81. package/commands/hustle-api-research.md +47 -21
  82. package/commands/hustle-api-sessions.md +8 -7
  83. package/commands/hustle-api-status.md +21 -1
  84. package/commands/hustle-api-verify.md +14 -13
  85. package/commands/hustle-combine.md +488 -241
  86. package/commands/hustle-ui-create-page.md +113 -50
  87. package/commands/hustle-ui-create.md +179 -26
  88. package/commands/issue.md +3 -8
  89. package/commands/plan.md +2 -3
  90. package/commands/pr.md +2 -3
  91. package/commands/red.md +2 -7
  92. package/commands/refactor.md +2 -7
  93. package/commands/spike.md +2 -7
  94. package/commands/summarize.md +2 -3
  95. package/commands/tdd.md +2 -7
  96. package/commands/worktree-add.md +208 -216
  97. package/commands/worktree-cleanup.md +172 -178
  98. package/hooks/api-workflow-check.py +5 -3
  99. package/hooks/enforce-component-type-confirm.py +97 -0
  100. package/hooks/lib/__init__.py +1 -0
  101. package/hooks/lib/greptile.py +355 -0
  102. package/hooks/lib/ntfy.py +209 -0
  103. package/hooks/notify-input-needed.py +73 -0
  104. package/hooks/notify-phase-complete.py +90 -0
  105. package/hooks/run-code-review.py +246 -0
  106. package/hooks/track-token-usage.py +121 -0
  107. package/package.json +13 -3
  108. package/scripts/collect-test-results.ts +102 -77
  109. package/scripts/extract-parameters.ts +112 -70
  110. package/scripts/generate-test-manifest.ts +118 -77
  111. package/templates/.env.example +57 -0
  112. package/templates/BRAND_GUIDE.md +92 -52
  113. package/templates/CLAUDE-SECTION.md +40 -37
  114. package/templates/SPEC.json +186 -38
  115. package/templates/api-dev-state.json +33 -4
  116. package/templates/api-showcase/_components/APICard.tsx +22 -18
  117. package/templates/api-showcase/_components/APIModal.tsx +110 -64
  118. package/templates/api-showcase/_components/APIShowcase.tsx +53 -35
  119. package/templates/api-showcase/_components/APITester.tsx +128 -67
  120. package/templates/api-showcase/page.tsx +4 -4
  121. package/templates/api-test/page.tsx +51 -30
  122. package/templates/api-test/test-structure/route.ts +43 -34
  123. package/templates/component/Component.stories.tsx +41 -39
  124. package/templates/component/Component.test.tsx +96 -78
  125. package/templates/component/Component.tsx +63 -52
  126. package/templates/component/Component.types.ts +10 -6
  127. package/templates/component/Component.visual.spec.ts +170 -0
  128. package/templates/component/index.ts +2 -2
  129. package/templates/dev-tools/_components/DevToolsLanding.tsx +8 -8
  130. package/templates/dev-tools/page.tsx +4 -3
  131. package/templates/mcp-servers.json +30 -2
  132. package/templates/page/page.e2e.test.ts +56 -48
  133. package/templates/page/page.tsx +3 -3
  134. package/templates/shared/HeroHeader.tsx +16 -15
  135. package/templates/shared/index.ts +1 -1
  136. package/templates/ui-showcase/_components/PreviewCard.tsx +20 -20
  137. package/templates/ui-showcase/_components/PreviewModal.tsx +149 -108
  138. package/templates/ui-showcase/_components/UIShowcase.tsx +43 -35
  139. package/templates/ui-showcase/page.tsx +4 -4
@@ -12,8 +12,10 @@ allowed-tools: WebSearch WebFetch mcp__context7 mcp__github AskUserQuestion Read
12
12
  ---
13
13
 
14
14
  ---
15
+
15
16
  description: Clean up merged worktrees by verifying PR/issue status, consolidating settings, and removing stale worktrees
16
17
  argument-hint: (no arguments)
18
+
17
19
  ---
18
20
 
19
21
  # Worktree Cleanup
@@ -37,191 +39,186 @@ Current worktrees: !git worktree list`
37
39
 
38
40
  <execution_steps>
39
41
  <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>
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>
57
53
  </step_0>
58
54
 
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>
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>
225
222
  </execution_steps>
226
223
 
227
224
  <important_notes>
@@ -239,8 +236,7 @@ Current worktrees: !git worktree list`
239
236
  - Processes one worktree at a time to maintain control
240
237
  - Must be run from main branch for safety
241
238
  - Works with standard GitHub repository URLs (owner/repo format)
242
- </important_notes>
243
-
239
+ </important_notes>
244
240
 
245
241
  ## 🛡 Project Rules (Injected into every command)
246
242
 
@@ -266,7 +262,7 @@ Current worktrees: !git worktree list`
266
262
  4. **API KEY MANAGEMENT:**
267
263
  - Support three loading methods:
268
264
  - Server environment variables
269
- - NEXT_PUBLIC_ variables (client-side)
265
+ - NEXT*PUBLIC* variables (client-side)
270
266
  - Custom headers (X-OpenAI-Key, X-Anthropic-Key, etc.)
271
267
  - Never hardcode API keys
272
268
  - Always validate key availability before use
@@ -291,4 +287,4 @@ Current worktrees: !git worktree list`
291
287
  - Code examples
292
288
  - Testing notes
293
289
  - Document expected behavior and edge cases
294
- - Include real-world output examples
290
+ - Include real-world output examples
package/CHANGELOG.md CHANGED
@@ -1,97 +1,115 @@
1
1
  # Changelog
2
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
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.0.1] - 2025-12-28
43
6
 
44
7
  ### 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
8
 
48
- ## [3.9.2] - 2025-12-10
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
49
78
 
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`
79
+ **NTFY Push Notifications:**
56
80
 
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
81
+ - Phase completion updates
82
+ - Input needed alerts (interview questions)
83
+ - Token usage per phase
84
+ - `/ntfy-setup` and `/ntfy-test` commands
61
85
 
62
- ## [3.9.0] - 2025-12-08
86
+ **Component Type System:**
63
87
 
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`
88
+ - Basic components (single-purpose, few props)
89
+ - Complex components (multi-part, user flows)
90
+ - AI suggests type, user confirms via hook
70
91
 
71
- ## [3.8.0] - 2025-12-05
92
+ **CLI Installer:**
72
93
 
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
94
+ - ASCII art banner with Hustle branding
95
+ - 8-step progress indicators
96
+ - Animated spinners for long operations
97
+ - Optional tools: Storybook, Playwright, Sandpack
78
98
 
79
- ## [3.7.0] - 2025-12-01
99
+ **Additional Commands:**
80
100
 
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/
101
+ - TDD: `/red`, `/green`, `/refactor`, `/cycle`
102
+ - Git: `/commit`, `/pr`, `/busycommit`
103
+ - Planning: `/plan`, `/gap`, `/issue`
104
+ - Worktrees: `/worktree-add`, `/worktree-cleanup`
86
105
 
87
- ## [3.6.7] - 2025-11-28
106
+ **Infrastructure:**
88
107
 
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
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`
94
112
 
95
113
  ---
96
114
 
97
- Note: v3.x is the final major version. All future updates will be v3.x.y releases.
115
+ See [ROADMAP.md](./ROADMAP.md) for planned features.