@wbern/claude-instructions 1.21.0 → 2.0.0
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/README.md +4 -2
- package/bin/cli.js +329 -192
- package/package.json +2 -3
- package/src/README.md +279 -0
- package/src/fragments/aaa-pattern.md +7 -0
- package/src/fragments/beads-awareness.md +1 -0
- package/src/fragments/beads-integration.md +8 -0
- package/{downloads/without-beads/commit.md → src/fragments/commit-process.md} +0 -17
- package/src/fragments/consistency-check.md +1 -0
- package/src/fragments/discovery-phase.md +22 -0
- package/src/fragments/fallback-arguments-beads.md +3 -0
- package/src/fragments/fallback-arguments.md +1 -0
- package/src/fragments/fullwidth-dollar-note.md +1 -0
- package/src/fragments/gap-beads.md +1 -0
- package/src/fragments/git-host-detection.md +19 -0
- package/src/fragments/github-issue-fetch.md +10 -0
- package/src/fragments/peeping-tom-warning.md +9 -0
- package/src/fragments/plan-beads-context-hint.md +1 -0
- package/src/fragments/plan-beads-details.md +49 -0
- package/src/fragments/plan-beads-integration.md +2 -0
- package/src/fragments/summarize-beads.md +8 -0
- package/{downloads/without-beads/summarize.md → src/fragments/summarize-structure.md} +0 -20
- package/{downloads/without-beads/tdd.md → src/fragments/tdd-fundamentals.md} +0 -21
- package/src/fragments/test-quality-criteria.md +24 -0
- package/src/fragments/universal-guidelines.md +6 -0
- package/{downloads/without-beads → src/sources}/add-command.md +11 -25
- package/{downloads/without-beads → src/sources}/ask.md +11 -6
- package/{downloads/without-beads → src/sources}/beepboop.md +7 -6
- package/{downloads/without-beads → src/sources}/busycommit.md +9 -36
- package/{downloads/without-beads → src/sources}/code-review.md +16 -30
- package/src/sources/commit.md +20 -0
- package/src/sources/cycle.md +23 -0
- package/{downloads/without-beads → src/sources}/gap.md +11 -8
- package/src/sources/green.md +23 -0
- package/src/sources/issue.md +42 -0
- package/{downloads/without-beads → src/sources}/kata.md +10 -9
- package/{downloads/without-beads → src/sources}/plan.md +18 -39
- package/{downloads/without-beads → src/sources}/pr.md +10 -6
- package/src/sources/red.md +26 -0
- package/src/sources/refactor.md +27 -0
- package/{downloads/without-beads → src/sources}/ship.md +11 -6
- package/{downloads/without-beads → src/sources}/show.md +11 -6
- package/src/sources/spike.md +23 -0
- package/src/sources/summarize.md +23 -0
- package/{downloads/without-beads → src/sources}/tdd-review.md +11 -31
- package/src/sources/tdd.md +24 -0
- package/{downloads/without-beads → src/sources}/worktree-add.md +13 -31
- package/{downloads/without-beads → src/sources}/worktree-cleanup.md +9 -27
- package/downloads/with-beads/add-command.md +0 -159
- package/downloads/with-beads/ask.md +0 -144
- package/downloads/with-beads/beepboop.md +0 -47
- package/downloads/with-beads/busycommit.md +0 -78
- package/downloads/with-beads/code-review.md +0 -263
- package/downloads/with-beads/commands-metadata.json +0 -155
- package/downloads/with-beads/commit.md +0 -49
- package/downloads/with-beads/cycle.md +0 -95
- package/downloads/with-beads/gap.md +0 -38
- package/downloads/with-beads/green.md +0 -95
- package/downloads/with-beads/issue.md +0 -152
- package/downloads/with-beads/kata.md +0 -444
- package/downloads/with-beads/plan.md +0 -186
- package/downloads/with-beads/pr.md +0 -82
- package/downloads/with-beads/red.md +0 -103
- package/downloads/with-beads/refactor.md +0 -105
- package/downloads/with-beads/ship.md +0 -98
- package/downloads/with-beads/show.md +0 -114
- package/downloads/with-beads/spike.md +0 -95
- package/downloads/with-beads/summarize.md +0 -54
- package/downloads/with-beads/tdd-review.md +0 -102
- package/downloads/with-beads/tdd.md +0 -94
- package/downloads/with-beads/worktree-add.md +0 -357
- package/downloads/with-beads/worktree-cleanup.md +0 -250
- package/downloads/without-beads/commands-metadata.json +0 -155
- package/downloads/without-beads/cycle.md +0 -90
- package/downloads/without-beads/green.md +0 -90
- package/downloads/without-beads/issue.md +0 -140
- package/downloads/without-beads/red.md +0 -98
- package/downloads/without-beads/refactor.md +0 -100
- package/downloads/without-beads/spike.md +0 -90
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Clean up merged worktrees by verifying PR/issue status, consolidating settings, and removing stale worktrees
|
|
3
|
-
argument-hint: (no arguments)
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Worktree Cleanup
|
|
7
|
-
|
|
8
|
-
## General Guidelines
|
|
9
|
-
|
|
10
|
-
### Output Style
|
|
11
|
-
|
|
12
|
-
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
13
|
-
- Write natural, descriptive code without meta-commentary about the development process
|
|
14
|
-
- The code should speak for itself - TDD is the process, not the product
|
|
15
|
-
|
|
16
|
-
Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
|
|
17
|
-
|
|
18
|
-
Clean up merged worktrees by finding the oldest merged branch, consolidating settings, and removing stale worktrees.
|
|
19
|
-
|
|
20
|
-
Additional info: $ARGUMENTS
|
|
21
|
-
|
|
22
|
-
<current_state>
|
|
23
|
-
Current branch: `git branch --show-current`
|
|
24
|
-
Current worktrees: `git worktree list`
|
|
25
|
-
</current_state>
|
|
26
|
-
|
|
27
|
-
<execution_steps>
|
|
28
|
-
<step_0>
|
|
29
|
-
<description>Detect git hosting provider and available tools</description>
|
|
30
|
-
<detect_provider>
|
|
31
|
-
<check_remote_url>git remote get-url origin</check_remote_url>
|
|
32
|
-
<identify_host>
|
|
33
|
-
- github.com → GitHub
|
|
34
|
-
- gitlab.com → GitLab
|
|
35
|
-
- bitbucket.org → Bitbucket
|
|
36
|
-
- Other → Ask user
|
|
37
|
-
</identify_host>
|
|
38
|
-
</detect_provider>
|
|
39
|
-
<check_available_tools>
|
|
40
|
-
<list_mcp_servers>Check which git-hosting MCP servers are available (github, gitlab, etc.)</list_mcp_servers>
|
|
41
|
-
<check_cli>Check if gh/glab CLI is available as fallback</check_cli>
|
|
42
|
-
</check_available_tools>
|
|
43
|
-
<select_tool>
|
|
44
|
-
<if_single_mcp>If only one relevant MCP available, confirm with user</if_single_mcp>
|
|
45
|
-
<if_multiple>Let user choose which tool to use</if_multiple>
|
|
46
|
-
<if_told_earlier>If user specified tool earlier in conversation, use that without asking again</if_told_earlier>
|
|
47
|
-
<store_as>$GIT_HOST_TOOL (e.g., "github_mcp", "gitlab_mcp", "gh_cli")</store_as>
|
|
48
|
-
</select_tool>
|
|
49
|
-
|
|
50
|
-
<purpose>Detect git hosting provider and select appropriate tool for PR verification</purpose>
|
|
51
|
-
</step_0>
|
|
52
|
-
|
|
53
|
-
<step_1>
|
|
54
|
-
<description>Determine default branch and verify we're on it</description>
|
|
55
|
-
<find_default_branch>
|
|
56
|
-
<command>git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'</command>
|
|
57
|
-
<fallback>git remote show origin | grep 'HEAD branch' | cut -d: -f2 | tr -d ' '</fallback>
|
|
58
|
-
<store_as>$DEFAULT_BRANCH (typically "main" or "master")</store_as>
|
|
59
|
-
</find_default_branch>
|
|
60
|
-
<check_current_branch>git branch --show-current</check_current_branch>
|
|
61
|
-
<verify>Current branch must equal $DEFAULT_BRANCH</verify>
|
|
62
|
-
<error_if_not_default>Exit with error: "This command must be run from the default branch ($DEFAULT_BRANCH)"</error_if_not_default>
|
|
63
|
-
<purpose>Ensure we're consolidating to the default branch worktree</purpose>
|
|
64
|
-
</step_1>
|
|
65
|
-
|
|
66
|
-
<step_2>
|
|
67
|
-
<description>Get list of all worktrees</description>
|
|
68
|
-
<command>git worktree list --porcelain</command>
|
|
69
|
-
<parse_output>Extract worktree paths and branch names</parse_output>
|
|
70
|
-
<exclude_default>Filter out the default branch worktree from cleanup candidates</exclude_default>
|
|
71
|
-
<purpose>Identify all worktrees that could potentially be cleaned up</purpose>
|
|
72
|
-
</step_2>
|
|
73
|
-
|
|
74
|
-
<step_3>
|
|
75
|
-
<description>Find oldest worktree by directory age</description>
|
|
76
|
-
<get_worktree_ages>
|
|
77
|
-
<detect_platform>uname -s (returns "Darwin" for macOS, "Linux" for Linux)</detect_platform>
|
|
78
|
-
<command_macos>git worktree list | grep -v "\[$DEFAULT_BRANCH\]" | awk '{print $1}' > /tmp/worktrees-$$.txt && while IFS= read -r path; do echo "$(/usr/bin/stat -f '%Sm' -t '%Y-%m-%d %H:%M' "$path" 2>/dev/null)|$path"; done < /tmp/worktrees-$$.txt | sort; rm -f /tmp/worktrees-$$.txt</command_macos>
|
|
79
|
-
<command_linux>git worktree list | grep -v "\[$DEFAULT_BRANCH\]" | awk '{print $1}' > /tmp/worktrees-$$.txt && while IFS= read -r path; do echo "$(stat -c '%y' "$path" 2>/dev/null | cut -d. -f1)|$path"; done < /tmp/worktrees-$$.txt | sort; rm -f /tmp/worktrees-$$.txt</command_linux>
|
|
80
|
-
<purpose>List all worktrees sorted by directory modification time (oldest first)</purpose>
|
|
81
|
-
<critical_notes>
|
|
82
|
-
- Replace $DEFAULT_BRANCH with value from step_1 (e.g., "main" or "master")
|
|
83
|
-
- grep "\[branch\]" matches branch name in brackets, not paths containing the word
|
|
84
|
-
- Temp file approach avoids subshell parsing issues with piped while-loops
|
|
85
|
-
- /usr/bin/stat on macOS avoids homebrew stat conflicts
|
|
86
|
-
</critical_notes>
|
|
87
|
-
<expected_output_format>YYYY-MM-DD HH:MM|/full/path/to/worktree (oldest first)</expected_output_format>
|
|
88
|
-
</get_worktree_ages>
|
|
89
|
-
<filter_recent>
|
|
90
|
-
<exclude_new>For worktrees created within the last 24 hours, let user know that this worktree might not be worth cleaning</exclude_new>
|
|
91
|
-
<get_current_time>date +"%Y-%m-%d %H:%M"</get_current_time>
|
|
92
|
-
</filter_recent>
|
|
93
|
-
<select_oldest>
|
|
94
|
-
<extract_branch_name>Parse branch name from oldest worktree path</extract_branch_name>
|
|
95
|
-
<important_note>DO NOT use "git branch --merged" to check merge status - it's unreliable</important_note>
|
|
96
|
-
<proceed_to_pr_check>Move directly to step 4 to verify PR merge status instead</proceed_to_pr_check>
|
|
97
|
-
</select_oldest>
|
|
98
|
-
<purpose>Identify oldest worktree candidate - actual merge verification happens via PR/MR in next step</purpose>
|
|
99
|
-
</step_3>
|
|
100
|
-
|
|
101
|
-
<step_4>
|
|
102
|
-
<description>Verify PR/MR merge status (primary merge verification)</description>
|
|
103
|
-
<determine_repo>
|
|
104
|
-
<check_remote>git remote get-url origin</check_remote>
|
|
105
|
-
<parse_repo>Extract owner/repo from remote URL</parse_repo>
|
|
106
|
-
</determine_repo>
|
|
107
|
-
<search_pr>
|
|
108
|
-
<tool>Use $GIT_HOST_TOOL from step_0 (e.g., mcp__github__search_pull_requests, mcp__gitlab__*, or gh CLI)</tool>
|
|
109
|
-
<query>Find PRs/MRs where head={branch_name} and base=$DEFAULT_BRANCH</query>
|
|
110
|
-
<purpose>Find PR/MR for this branch targeting default branch</purpose>
|
|
111
|
-
<important>This is the PRIMARY way to verify if a branch was merged - NOT git commands</important>
|
|
112
|
-
</search_pr>
|
|
113
|
-
<verify_pr_merged>
|
|
114
|
-
<if_pr_found>
|
|
115
|
-
<get_pr_details>Use $GIT_HOST_TOOL to get full PR/MR info</get_pr_details>
|
|
116
|
-
<confirm_merged>Verify PR/MR state is "closed"/"merged" AND merged_at is not null AND base is "$DEFAULT_BRANCH"</confirm_merged>
|
|
117
|
-
<extract_issue_number>Look for issue references in PR title/body (e.g., #123, owner/repo#123)</extract_issue_number>
|
|
118
|
-
<if_merged>Proceed with cleanup - this branch was definitively merged to default branch</if_merged>
|
|
119
|
-
<if_not_merged>
|
|
120
|
-
<skip_worktree>This worktree is NOT merged - continue to next oldest worktree</skip_worktree>
|
|
121
|
-
<repeat_from_step_3>Go back and find the next oldest worktree to check</repeat_from_step_3>
|
|
122
|
-
</if_not_merged>
|
|
123
|
-
</if_pr_found>
|
|
124
|
-
<if_no_pr>
|
|
125
|
-
<skip_worktree>No PR found - this branch was likely never submitted for review</skip_worktree>
|
|
126
|
-
<continue_to_next>Continue checking next oldest worktree</continue_to_next>
|
|
127
|
-
</if_no_pr>
|
|
128
|
-
</verify_pr_merged>
|
|
129
|
-
<purpose>Use PR/MR status as the authoritative source for merge verification instead of unreliable git commands</purpose>
|
|
130
|
-
</step_4>
|
|
131
|
-
|
|
132
|
-
<step_4_5>
|
|
133
|
-
<description>Check and close related issue</description>
|
|
134
|
-
<if_issue_found>
|
|
135
|
-
<get_issue_details>
|
|
136
|
-
<tool>Use $GIT_HOST_TOOL to read issue details</tool>
|
|
137
|
-
<extract_repo>From issue reference (main-repo vs cross-repo)</extract_repo>
|
|
138
|
-
</get_issue_details>
|
|
139
|
-
<check_issue_state>
|
|
140
|
-
<if_open>
|
|
141
|
-
<ask_close>Ask user: "Related issue #{number} is still open. Should I close it? (y/N)"</ask_close>
|
|
142
|
-
<if_yes_close>
|
|
143
|
-
<add_closing_comment>
|
|
144
|
-
<tool>Use $GIT_HOST_TOOL to add comment</tool>
|
|
145
|
-
<body_template>Closing this issue as branch {branch_name} was merged to {default_branch} on {merge_date} via PR/MR #{pr_number}.</body_template>
|
|
146
|
-
<get_merge_date>Extract merge date from PR/MR details</get_merge_date>
|
|
147
|
-
<get_pr_number>Use PR/MR number from search results</get_pr_number>
|
|
148
|
-
</add_closing_comment>
|
|
149
|
-
<close_issue>
|
|
150
|
-
<tool>Use $GIT_HOST_TOOL to close issue</tool>
|
|
151
|
-
<state>closed</state>
|
|
152
|
-
<state_reason>completed</state_reason>
|
|
153
|
-
</close_issue>
|
|
154
|
-
</if_yes_close>
|
|
155
|
-
</if_open>
|
|
156
|
-
<if_closed>Inform user issue is already closed</if_closed>
|
|
157
|
-
</check_issue_state>
|
|
158
|
-
</if_issue_found>
|
|
159
|
-
<if_no_issue>Continue without issue management</if_no_issue>
|
|
160
|
-
<purpose>Ensure proper issue lifecycle management</purpose>
|
|
161
|
-
</step_4_5>
|
|
162
|
-
|
|
163
|
-
<step_5>
|
|
164
|
-
<description>Check if worktree is locked</description>
|
|
165
|
-
<check_command>git worktree list --porcelain | grep -A5 "worktree {path}" | grep "locked"</check_command>
|
|
166
|
-
<if_locked>
|
|
167
|
-
<unlock_command>git worktree unlock {path}</unlock_command>
|
|
168
|
-
<notify_user>Inform user that worktree was unlocked</notify_user>
|
|
169
|
-
</if_locked>
|
|
170
|
-
<purpose>Unlock worktree if it was locked for tracking purposes</purpose>
|
|
171
|
-
</step_5>
|
|
172
|
-
|
|
173
|
-
<step_6>
|
|
174
|
-
<description>Analyze Claude settings differences</description>
|
|
175
|
-
<read_main_settings>.claude/settings.local.json</read_main_settings>
|
|
176
|
-
<read_worktree_settings>{worktree_path}/.claude/settings.local.json</read_worktree_settings>
|
|
177
|
-
<compare_allow_lists>
|
|
178
|
-
<extract_main_allows>Extract "allow" array from main settings</extract_main_allows>
|
|
179
|
-
<extract_worktree_allows>Extract "allow" array from worktree settings</extract_worktree_allows>
|
|
180
|
-
<find_differences>Identify entries in worktree that are not in main</find_differences>
|
|
181
|
-
</compare_allow_lists>
|
|
182
|
-
<filter_suggestions>
|
|
183
|
-
<include_filesystem>Read permissions for filesystem paths</include_filesystem>
|
|
184
|
-
<exclude_intrusive>Exclude bash commands, write permissions, etc.</exclude_intrusive>
|
|
185
|
-
<focus_user_specific>Include only user-specific, non-disruptive entries</focus_user_specific>
|
|
186
|
-
</filter_suggestions>
|
|
187
|
-
<purpose>Identify useful settings to consolidate before cleanup</purpose>
|
|
188
|
-
</step_6>
|
|
189
|
-
|
|
190
|
-
<step_7>
|
|
191
|
-
<description>Suggest settings consolidation</description>
|
|
192
|
-
<if_differences_found>
|
|
193
|
-
<display_suggestions>Show filtered differences to user</display_suggestions>
|
|
194
|
-
<ask_confirmation>Ask user which entries to add to main settings</ask_confirmation>
|
|
195
|
-
<apply_changes>Update main .claude/settings.local.json with selected entries</apply_changes>
|
|
196
|
-
</if_differences_found>
|
|
197
|
-
<if_no_differences>Inform user no settings need consolidation</if_no_differences>
|
|
198
|
-
<purpose>Preserve useful development settings before removing worktree</purpose>
|
|
199
|
-
</step_7>
|
|
200
|
-
|
|
201
|
-
<step_8>
|
|
202
|
-
<description>Final cleanup confirmation</description>
|
|
203
|
-
<summary>
|
|
204
|
-
<display_worktree>Show worktree path and branch name</display_worktree>
|
|
205
|
-
<show_pr_status>Show merged PR details if found</show_pr_status>
|
|
206
|
-
<show_issue_status>Show related issue status if found</show_issue_status>
|
|
207
|
-
<show_last_activity>Display directory creation/modification date</show_last_activity>
|
|
208
|
-
</summary>
|
|
209
|
-
<safety_checks>
|
|
210
|
-
<check_uncommitted>git status --porcelain in worktree directory</check_uncommitted>
|
|
211
|
-
<warn_if_dirty>Alert user if uncommitted changes exist</warn_if_dirty>
|
|
212
|
-
</safety_checks>
|
|
213
|
-
<ask_deletion>Ask user confirmation: "Delete this worktree? (y/N)"</ask_deletion>
|
|
214
|
-
<purpose>Final safety check before irreversible deletion</purpose>
|
|
215
|
-
</step_8>
|
|
216
|
-
|
|
217
|
-
<step_9>
|
|
218
|
-
<description>Delete worktree</description>
|
|
219
|
-
<if_confirmed>
|
|
220
|
-
<remove_worktree>git worktree remove {path} --force</remove_worktree>
|
|
221
|
-
<cleanup_branch>git branch -d {branch_name}</cleanup_branch>
|
|
222
|
-
<success_message>Inform user worktree was successfully removed</success_message>
|
|
223
|
-
<next_steps>Suggest running command again to find next candidate</next_steps>
|
|
224
|
-
</if_confirmed>
|
|
225
|
-
<if_declined>Exit gracefully with no changes</if_declined>
|
|
226
|
-
<purpose>Perform the actual cleanup and guide user for next iteration</purpose>
|
|
227
|
-
</step_9>
|
|
228
|
-
</execution_steps>
|
|
229
|
-
|
|
230
|
-
<important_notes>
|
|
231
|
-
|
|
232
|
-
- Uses PR/MR merge status as the ONLY reliable way to verify if a branch was merged
|
|
233
|
-
- DOES NOT use "git branch --merged" command as it's unreliable for merge verification
|
|
234
|
-
- Only processes branches with PRs/MRs that were definitively merged to default branch
|
|
235
|
-
- Skips worktrees without merged PRs/MRs and continues to next oldest candidate
|
|
236
|
-
- Checks and optionally closes related issues
|
|
237
|
-
- Prioritizes oldest worktrees by directory age first for systematic cleanup
|
|
238
|
-
- Warns about very recent worktrees (created within 24 hours) to avoid cleaning active work
|
|
239
|
-
- Preserves useful development settings before deletion
|
|
240
|
-
- Requires explicit confirmation before any destructive actions
|
|
241
|
-
- Handles locked worktrees automatically
|
|
242
|
-
- Processes one worktree at a time to maintain control
|
|
243
|
-
- Must be run from default branch for safety
|
|
244
|
-
|
|
245
|
-
Limitations:
|
|
246
|
-
|
|
247
|
-
- Assumes remote is named "origin" (most common convention)
|
|
248
|
-
- Supports macOS and Linux only (no Windows support)
|
|
249
|
-
- Requires MCP server or CLI for git hosting provider (GitHub, GitLab, etc.)
|
|
250
|
-
</important_notes>
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"add-command.md": {
|
|
3
|
-
"description": "Guide for creating new slash commands",
|
|
4
|
-
"hint": "Create command",
|
|
5
|
-
"category": "Utilities",
|
|
6
|
-
"order": 3
|
|
7
|
-
},
|
|
8
|
-
"ask.md": {
|
|
9
|
-
"description": "Request team review and approval - for complex changes needing discussion",
|
|
10
|
-
"hint": "Request review",
|
|
11
|
-
"category": "Ship / Show / Ask",
|
|
12
|
-
"order": 3,
|
|
13
|
-
"selectedByDefault": false
|
|
14
|
-
},
|
|
15
|
-
"beepboop.md": {
|
|
16
|
-
"description": "Communicate AI-generated content with transparent attribution",
|
|
17
|
-
"hint": "AI attribution",
|
|
18
|
-
"category": "Utilities",
|
|
19
|
-
"order": 2
|
|
20
|
-
},
|
|
21
|
-
"busycommit.md": {
|
|
22
|
-
"description": "Create multiple atomic git commits, one logical change at a time",
|
|
23
|
-
"hint": "Atomic commits",
|
|
24
|
-
"category": "Workflow",
|
|
25
|
-
"order": 2
|
|
26
|
-
},
|
|
27
|
-
"code-review.md": {
|
|
28
|
-
"description": "Code review using dynamic category detection and domain-specific analysis",
|
|
29
|
-
"hint": "Review code",
|
|
30
|
-
"category": "Workflow",
|
|
31
|
-
"order": 35,
|
|
32
|
-
"_requested-tools": [
|
|
33
|
-
"Bash(git diff:*)",
|
|
34
|
-
"Bash(git status:*)",
|
|
35
|
-
"Bash(git log:*)",
|
|
36
|
-
"Bash(git rev-parse:*)",
|
|
37
|
-
"Bash(git merge-base:*)",
|
|
38
|
-
"Bash(git branch:*)"
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
"commit.md": {
|
|
42
|
-
"description": "Create a git commit following project standards",
|
|
43
|
-
"hint": "Git commit",
|
|
44
|
-
"category": "Workflow",
|
|
45
|
-
"order": 1
|
|
46
|
-
},
|
|
47
|
-
"cycle.md": {
|
|
48
|
-
"description": "Execute complete TDD cycle - Red, Green, and Refactor phases in sequence",
|
|
49
|
-
"hint": "Full TDD cycle",
|
|
50
|
-
"category": "Test-Driven Development",
|
|
51
|
-
"order": 5
|
|
52
|
-
},
|
|
53
|
-
"gap.md": {
|
|
54
|
-
"description": "Analyze conversation context for unaddressed items and gaps",
|
|
55
|
-
"hint": "Find gaps",
|
|
56
|
-
"category": "Workflow",
|
|
57
|
-
"order": 11
|
|
58
|
-
},
|
|
59
|
-
"green.md": {
|
|
60
|
-
"description": "Execute TDD Green Phase - write minimal implementation to pass the failing test",
|
|
61
|
-
"hint": "Make it pass",
|
|
62
|
-
"category": "Test-Driven Development",
|
|
63
|
-
"order": 3
|
|
64
|
-
},
|
|
65
|
-
"issue.md": {
|
|
66
|
-
"description": "Analyze GitHub issue and create TDD implementation plan",
|
|
67
|
-
"hint": "Analyze issue",
|
|
68
|
-
"category": "Planning",
|
|
69
|
-
"order": 1
|
|
70
|
-
},
|
|
71
|
-
"kata.md": {
|
|
72
|
-
"description": "Generate a TDD practice challenge with boilerplate test setup",
|
|
73
|
-
"hint": "Practice kata",
|
|
74
|
-
"category": "Utilities",
|
|
75
|
-
"order": 10,
|
|
76
|
-
"_requested-tools": [
|
|
77
|
-
"WebFetch(domain:raw.githubusercontent.com)",
|
|
78
|
-
"WebFetch(domain:api.github.com)"
|
|
79
|
-
]
|
|
80
|
-
},
|
|
81
|
-
"plan.md": {
|
|
82
|
-
"description": "Create implementation plan from feature/requirement with PRD-style discovery and TDD acceptance criteria",
|
|
83
|
-
"hint": "Plan feature",
|
|
84
|
-
"category": "Planning",
|
|
85
|
-
"order": 2
|
|
86
|
-
},
|
|
87
|
-
"pr.md": {
|
|
88
|
-
"description": "Creates a pull request using GitHub MCP",
|
|
89
|
-
"hint": "Create PR",
|
|
90
|
-
"category": "Workflow",
|
|
91
|
-
"order": 5
|
|
92
|
-
},
|
|
93
|
-
"red.md": {
|
|
94
|
-
"description": "Execute TDD Red Phase - write ONE failing test",
|
|
95
|
-
"hint": "Failing test",
|
|
96
|
-
"category": "Test-Driven Development",
|
|
97
|
-
"order": 2
|
|
98
|
-
},
|
|
99
|
-
"refactor.md": {
|
|
100
|
-
"description": "Execute TDD Refactor Phase - improve code structure while keeping tests green",
|
|
101
|
-
"hint": "Clean up code",
|
|
102
|
-
"category": "Test-Driven Development",
|
|
103
|
-
"order": 4
|
|
104
|
-
},
|
|
105
|
-
"ship.md": {
|
|
106
|
-
"description": "Ship code directly to main - for small, obvious changes that don't need review",
|
|
107
|
-
"hint": "Direct to main",
|
|
108
|
-
"category": "Ship / Show / Ask",
|
|
109
|
-
"order": 1,
|
|
110
|
-
"selectedByDefault": false
|
|
111
|
-
},
|
|
112
|
-
"show.md": {
|
|
113
|
-
"description": "Show code to team with auto-merge - for changes that should be visible but don't need approval",
|
|
114
|
-
"hint": "Auto-merge PR",
|
|
115
|
-
"category": "Ship / Show / Ask",
|
|
116
|
-
"order": 2,
|
|
117
|
-
"selectedByDefault": false
|
|
118
|
-
},
|
|
119
|
-
"spike.md": {
|
|
120
|
-
"description": "Execute TDD Spike Phase - exploratory coding to understand problem space before TDD",
|
|
121
|
-
"hint": "Explore first",
|
|
122
|
-
"category": "Test-Driven Development",
|
|
123
|
-
"order": 1
|
|
124
|
-
},
|
|
125
|
-
"summarize.md": {
|
|
126
|
-
"description": "Summarize conversation progress and next steps",
|
|
127
|
-
"hint": "Summarize chat",
|
|
128
|
-
"category": "Workflow",
|
|
129
|
-
"order": 10
|
|
130
|
-
},
|
|
131
|
-
"tdd-review.md": {
|
|
132
|
-
"description": "Review test suite quality against FIRST principles and TDD anti-patterns",
|
|
133
|
-
"hint": "Review tests",
|
|
134
|
-
"category": "Test-Driven Development",
|
|
135
|
-
"order": 45
|
|
136
|
-
},
|
|
137
|
-
"tdd.md": {
|
|
138
|
-
"description": "Remind agent about TDD approach and continue conversation",
|
|
139
|
-
"hint": "TDD reminder",
|
|
140
|
-
"category": "Test-Driven Development",
|
|
141
|
-
"order": 1
|
|
142
|
-
},
|
|
143
|
-
"worktree-add.md": {
|
|
144
|
-
"description": "Add a new git worktree from branch name or issue URL, copy settings, install deps, and open in current IDE",
|
|
145
|
-
"hint": "Add worktree",
|
|
146
|
-
"category": "Worktree Management",
|
|
147
|
-
"order": 1
|
|
148
|
-
},
|
|
149
|
-
"worktree-cleanup.md": {
|
|
150
|
-
"description": "Clean up merged worktrees by verifying PR/issue status, consolidating settings, and removing stale worktrees",
|
|
151
|
-
"hint": "Cleanup worktree",
|
|
152
|
-
"category": "Worktree Management",
|
|
153
|
-
"order": 2
|
|
154
|
-
}
|
|
155
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Execute complete TDD cycle - Red, Green, and Refactor phases in sequence
|
|
3
|
-
argument-hint: <feature or requirement description>
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
RED+GREEN+REFACTOR (one cycle) PHASE! Apply the below to the info given by user input here:
|
|
7
|
-
|
|
8
|
-
$ARGUMENTS
|
|
9
|
-
|
|
10
|
-
## General Guidelines
|
|
11
|
-
|
|
12
|
-
### Output Style
|
|
13
|
-
|
|
14
|
-
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
15
|
-
- Write natural, descriptive code without meta-commentary about the development process
|
|
16
|
-
- The code should speak for itself - TDD is the process, not the product
|
|
17
|
-
|
|
18
|
-
(If there was no info above, fallback to the context of the conversation)
|
|
19
|
-
|
|
20
|
-
## TDD Fundamentals
|
|
21
|
-
|
|
22
|
-
### The TDD Cycle
|
|
23
|
-
|
|
24
|
-
The foundation of TDD is the Red-Green-Refactor cycle:
|
|
25
|
-
|
|
26
|
-
1. **Red Phase**: Write ONE failing test that describes desired behavior
|
|
27
|
-
|
|
28
|
-
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
29
|
-
- Only one test at a time - this is critical for TDD discipline
|
|
30
|
-
- Exception: For browser-level tests or expensive setup (e.g., Storybook `*.stories.tsx`), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
|
|
31
|
-
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
32
|
-
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
33
|
-
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
34
|
-
- Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (`waitFor`, `findBy*`, event-based sync) instead and rely on global test configs for timeout settings
|
|
35
|
-
|
|
36
|
-
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
37
|
-
|
|
38
|
-
- Implement only what's needed for the current failing test
|
|
39
|
-
- No anticipatory coding or extra features
|
|
40
|
-
- Address the specific failure message
|
|
41
|
-
|
|
42
|
-
3. **Refactor Phase**: Improve code structure while keeping tests green
|
|
43
|
-
- Only allowed when relevant tests are passing
|
|
44
|
-
- Requires proof that tests have been run and are green
|
|
45
|
-
- Applies to BOTH implementation and test code
|
|
46
|
-
- No refactoring with failing tests - fix them first
|
|
47
|
-
|
|
48
|
-
### Core Violations
|
|
49
|
-
|
|
50
|
-
1. **Multiple Test Addition**
|
|
51
|
-
|
|
52
|
-
- Adding more than one new test at once
|
|
53
|
-
- Exception: Initial test file setup or extracting shared test utilities
|
|
54
|
-
|
|
55
|
-
2. **Over-Implementation**
|
|
56
|
-
|
|
57
|
-
- Code that exceeds what's needed to pass the current failing test
|
|
58
|
-
- Adding untested features, methods, or error handling
|
|
59
|
-
- Implementing multiple methods when test only requires one
|
|
60
|
-
|
|
61
|
-
3. **Premature Implementation**
|
|
62
|
-
- Adding implementation before a test exists and fails properly
|
|
63
|
-
- Adding implementation without running the test first
|
|
64
|
-
- Refactoring when tests haven't been run or are failing
|
|
65
|
-
|
|
66
|
-
### Critical Principle: Incremental Development
|
|
67
|
-
|
|
68
|
-
Each step in TDD should address ONE specific issue:
|
|
69
|
-
|
|
70
|
-
- Test fails "not defined" → Create empty stub/class only
|
|
71
|
-
- Test fails "not a function" → Add method stub only
|
|
72
|
-
- Test fails with assertion → Implement minimal logic only
|
|
73
|
-
|
|
74
|
-
### Optional Pre-Phase: Spike Phase
|
|
75
|
-
|
|
76
|
-
In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
|
|
77
|
-
This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
|
|
78
|
-
|
|
79
|
-
- The goal of a Spike is **exploration and learning**, not implementation.
|
|
80
|
-
- The code written during a Spike is **disposable** and **must not** be merged or reused directly.
|
|
81
|
-
- Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
|
|
82
|
-
- A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
|
|
83
|
-
|
|
84
|
-
### General Information
|
|
85
|
-
|
|
86
|
-
- Sometimes the test output shows as no tests have been run when a new test is failing due to a missing import or constructor. In such cases, allow the agent to create simple stubs. Ask them if they forgot to create a stub if they are stuck.
|
|
87
|
-
- It is never allowed to introduce new logic without evidence of relevant failing tests. However, stubs and simple implementation to make imports and test infrastructure work is fine.
|
|
88
|
-
- In the refactor phase, it is perfectly fine to refactor both test and implementation code. That said, completely new functionality is not allowed. Types, clean up, abstractions, and helpers are allowed as long as they do not introduce new behavior.
|
|
89
|
-
- Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
|
|
90
|
-
- Provide the agent with helpful directions so that they do not get stuck when blocking them.
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Execute TDD Green Phase - write minimal implementation to pass the failing test
|
|
3
|
-
argument-hint: <implementation description>
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
GREEN PHASE! Apply the below to the info given by user input here:
|
|
7
|
-
|
|
8
|
-
$ARGUMENTS
|
|
9
|
-
|
|
10
|
-
## General Guidelines
|
|
11
|
-
|
|
12
|
-
### Output Style
|
|
13
|
-
|
|
14
|
-
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
15
|
-
- Write natural, descriptive code without meta-commentary about the development process
|
|
16
|
-
- The code should speak for itself - TDD is the process, not the product
|
|
17
|
-
|
|
18
|
-
(If there was no info above, fallback to the context of the conversation)
|
|
19
|
-
|
|
20
|
-
## TDD Fundamentals
|
|
21
|
-
|
|
22
|
-
### The TDD Cycle
|
|
23
|
-
|
|
24
|
-
The foundation of TDD is the Red-Green-Refactor cycle:
|
|
25
|
-
|
|
26
|
-
1. **Red Phase**: Write ONE failing test that describes desired behavior
|
|
27
|
-
|
|
28
|
-
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
29
|
-
- Only one test at a time - this is critical for TDD discipline
|
|
30
|
-
- Exception: For browser-level tests or expensive setup (e.g., Storybook `*.stories.tsx`), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
|
|
31
|
-
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
32
|
-
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
33
|
-
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
34
|
-
- Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (`waitFor`, `findBy*`, event-based sync) instead and rely on global test configs for timeout settings
|
|
35
|
-
|
|
36
|
-
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
37
|
-
|
|
38
|
-
- Implement only what's needed for the current failing test
|
|
39
|
-
- No anticipatory coding or extra features
|
|
40
|
-
- Address the specific failure message
|
|
41
|
-
|
|
42
|
-
3. **Refactor Phase**: Improve code structure while keeping tests green
|
|
43
|
-
- Only allowed when relevant tests are passing
|
|
44
|
-
- Requires proof that tests have been run and are green
|
|
45
|
-
- Applies to BOTH implementation and test code
|
|
46
|
-
- No refactoring with failing tests - fix them first
|
|
47
|
-
|
|
48
|
-
### Core Violations
|
|
49
|
-
|
|
50
|
-
1. **Multiple Test Addition**
|
|
51
|
-
|
|
52
|
-
- Adding more than one new test at once
|
|
53
|
-
- Exception: Initial test file setup or extracting shared test utilities
|
|
54
|
-
|
|
55
|
-
2. **Over-Implementation**
|
|
56
|
-
|
|
57
|
-
- Code that exceeds what's needed to pass the current failing test
|
|
58
|
-
- Adding untested features, methods, or error handling
|
|
59
|
-
- Implementing multiple methods when test only requires one
|
|
60
|
-
|
|
61
|
-
3. **Premature Implementation**
|
|
62
|
-
- Adding implementation before a test exists and fails properly
|
|
63
|
-
- Adding implementation without running the test first
|
|
64
|
-
- Refactoring when tests haven't been run or are failing
|
|
65
|
-
|
|
66
|
-
### Critical Principle: Incremental Development
|
|
67
|
-
|
|
68
|
-
Each step in TDD should address ONE specific issue:
|
|
69
|
-
|
|
70
|
-
- Test fails "not defined" → Create empty stub/class only
|
|
71
|
-
- Test fails "not a function" → Add method stub only
|
|
72
|
-
- Test fails with assertion → Implement minimal logic only
|
|
73
|
-
|
|
74
|
-
### Optional Pre-Phase: Spike Phase
|
|
75
|
-
|
|
76
|
-
In rare cases where the problem space, interface, or expected behavior is unclear, a **Spike Phase** may be used **before the Red Phase**.
|
|
77
|
-
This phase is **not part of the regular TDD workflow** and must only be applied under exceptional circumstances.
|
|
78
|
-
|
|
79
|
-
- The goal of a Spike is **exploration and learning**, not implementation.
|
|
80
|
-
- The code written during a Spike is **disposable** and **must not** be merged or reused directly.
|
|
81
|
-
- Once sufficient understanding is achieved, all spike code is discarded, and normal TDD resumes starting from the **Red Phase**.
|
|
82
|
-
- A Spike is justified only when it is impossible to define a meaningful failing test due to technical uncertainty or unknown system behavior.
|
|
83
|
-
|
|
84
|
-
### General Information
|
|
85
|
-
|
|
86
|
-
- Sometimes the test output shows as no tests have been run when a new test is failing due to a missing import or constructor. In such cases, allow the agent to create simple stubs. Ask them if they forgot to create a stub if they are stuck.
|
|
87
|
-
- It is never allowed to introduce new logic without evidence of relevant failing tests. However, stubs and simple implementation to make imports and test infrastructure work is fine.
|
|
88
|
-
- In the refactor phase, it is perfectly fine to refactor both test and implementation code. That said, completely new functionality is not allowed. Types, clean up, abstractions, and helpers are allowed as long as they do not introduce new behavior.
|
|
89
|
-
- Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
|
|
90
|
-
- Provide the agent with helpful directions so that they do not get stuck when blocking them.
|