@wbern/claude-instructions 1.9.0 → 1.11.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/LICENSE +21 -0
- package/README.md +21 -15
- package/bin/cli.js +265 -47
- package/downloads/with-beads/busycommit.md +16 -0
- package/downloads/with-beads/code-review.md +248 -0
- package/downloads/with-beads/commands-metadata.json +15 -1
- package/downloads/with-beads/commit.md +16 -0
- package/downloads/with-beads/gap.md +1 -0
- package/downloads/with-beads/plan.md +1 -2
- package/downloads/with-beads/worktree-add.md +68 -44
- package/downloads/with-beads/worktree-cleanup.md +74 -55
- package/downloads/without-beads/busycommit.md +16 -0
- package/downloads/without-beads/code-review.md +246 -0
- package/downloads/without-beads/commands-metadata.json +15 -1
- package/downloads/without-beads/commit.md +16 -0
- package/downloads/without-beads/gap.md +1 -0
- package/downloads/without-beads/worktree-add.md +68 -44
- package/downloads/without-beads/worktree-cleanup.md +74 -55
- package/package.json +4 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Add a new git worktree from branch name or
|
|
3
|
-
argument-hint: <branch-name-or-
|
|
2
|
+
description: Add a new git worktree from branch name or issue URL, copy settings, install deps, and open in current IDE
|
|
3
|
+
argument-hint: <branch-name-or-issue-url> [optional-base-branch]
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Git Worktree Setup
|
|
@@ -16,31 +16,37 @@ argument-hint: <branch-name-or-github-issue-url> [optional-base-branch]
|
|
|
16
16
|
Create a new git worktree for branch: $ARGUMENTS
|
|
17
17
|
|
|
18
18
|
<current_state>
|
|
19
|
-
Current branch:
|
|
20
|
-
Current worktrees:
|
|
21
|
-
Remote branches:
|
|
22
|
-
Uncommitted changes:
|
|
19
|
+
Current branch: `git branch --show-current`
|
|
20
|
+
Current worktrees: `git worktree list`
|
|
21
|
+
Remote branches: `git branch -r`
|
|
22
|
+
Uncommitted changes: `git status --short`
|
|
23
23
|
</current_state>
|
|
24
24
|
|
|
25
25
|
<execution_steps>
|
|
26
26
|
<step_0>
|
|
27
|
-
<description>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<
|
|
27
|
+
<description>Detect git hosting provider and available tools (only needed if argument is an issue URL)</description>
|
|
28
|
+
<condition>Only run this step if first argument looks like a git hosting URL</condition>
|
|
29
|
+
<detect_provider>
|
|
30
|
+
<check_remote_url>git remote get-url origin</check_remote_url>
|
|
31
|
+
<identify_host>
|
|
32
|
+
- github.com → GitHub
|
|
33
|
+
- gitlab.com → GitLab
|
|
34
|
+
- bitbucket.org → Bitbucket
|
|
35
|
+
- Other → Ask user
|
|
36
|
+
</identify_host>
|
|
37
|
+
</detect_provider>
|
|
38
|
+
<check_available_tools>
|
|
39
|
+
<list_mcp_servers>Check which git-hosting MCP servers are available (github, gitlab, etc.)</list_mcp_servers>
|
|
40
|
+
<check_cli>Check if gh/glab CLI is available as fallback</check_cli>
|
|
41
|
+
</check_available_tools>
|
|
42
|
+
<select_tool>
|
|
43
|
+
<if_single_mcp>If only one relevant MCP available, confirm with user</if_single_mcp>
|
|
44
|
+
<if_multiple>Let user choose which tool to use</if_multiple>
|
|
45
|
+
<if_told_earlier>If user specified tool earlier in conversation, use that without asking again</if_told_earlier>
|
|
46
|
+
<store_as>$GIT_HOST_TOOL (e.g., "github_mcp", "gitlab_mcp", "gh_cli")</store_as>
|
|
47
|
+
</select_tool>
|
|
48
|
+
|
|
49
|
+
<purpose>Detect git hosting provider and select appropriate tool for issue lookup</purpose>
|
|
44
50
|
</step_0>
|
|
45
51
|
|
|
46
52
|
<step_1>
|
|
@@ -68,30 +74,41 @@ Uncommitted changes: !git status --short`
|
|
|
68
74
|
</step_1>
|
|
69
75
|
|
|
70
76
|
<step_2>
|
|
71
|
-
<description>
|
|
77
|
+
<description>Determine default branch and parse arguments</description>
|
|
78
|
+
<find_default_branch>
|
|
79
|
+
<command>git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'</command>
|
|
80
|
+
<fallback>git remote show origin | grep 'HEAD branch' | cut -d: -f2 | tr -d ' '</fallback>
|
|
81
|
+
<store_as>$DEFAULT_BRANCH (typically "main" or "master")</store_as>
|
|
82
|
+
</find_default_branch>
|
|
72
83
|
<input>The user-provided arguments</input>
|
|
73
|
-
<expected_format>branch-name-or-
|
|
84
|
+
<expected_format>branch-name-or-issue-url [optional-base-branch]</expected_format>
|
|
74
85
|
<example>fix/issue-123-main-content-area-visually-clipped main</example>
|
|
75
|
-
<
|
|
76
|
-
<
|
|
77
|
-
</
|
|
86
|
+
<example_issue_url>https://github.com/owner/project/issues/123 main</example_issue_url>
|
|
87
|
+
<base_branch>Use provided base branch, or $DEFAULT_BRANCH if not specified</base_branch>
|
|
88
|
+
</step_2>
|
|
78
89
|
|
|
79
90
|
<step_2_5>
|
|
80
|
-
<description>Handle
|
|
81
|
-
<condition>If first argument matches
|
|
82
|
-
<url_detection>
|
|
91
|
+
<description>Handle issue URLs from git hosting provider</description>
|
|
92
|
+
<condition>If first argument matches issue URL pattern (detected in step_0)</condition>
|
|
93
|
+
<url_detection>
|
|
94
|
+
<github>Check if argument contains "github.com" and "/issues/"</github>
|
|
95
|
+
<gitlab>Check if argument contains "gitlab.com" and "/-/issues/"</gitlab>
|
|
96
|
+
<bitbucket>Check if argument contains "bitbucket.org" and "/issues/"</bitbucket>
|
|
97
|
+
</url_detection>
|
|
83
98
|
<url_parsing>
|
|
84
|
-
<
|
|
99
|
+
<github_pattern><https://github.com/{owner}/{repo}/issues/{issue_number}></github_pattern>
|
|
100
|
+
<gitlab_pattern><https://gitlab.com/{owner}/{repo}/-/issues/{issue_number}></gitlab_pattern>
|
|
101
|
+
<bitbucket_pattern><https://bitbucket.org/{owner}/{repo}/issues/{issue_number}></bitbucket_pattern>
|
|
85
102
|
<extract>owner, repo, issue_number from URL</extract>
|
|
86
103
|
</url_parsing>
|
|
87
104
|
<fetch_issue_details>
|
|
88
|
-
<tool>
|
|
89
|
-
<method>get</method>
|
|
105
|
+
<tool>Use $GIT_HOST_TOOL from step_0</tool>
|
|
106
|
+
<method>get issue details</method>
|
|
90
107
|
<parameters>owner, repo, issue_number</parameters>
|
|
91
108
|
</fetch_issue_details>
|
|
92
109
|
<generate_branch_name>
|
|
93
110
|
<determine_type>Analyze issue title/labels to determine type (feat/fix/refactor/chore)</determine_type>
|
|
94
|
-
<format>{type}/
|
|
111
|
+
<format>{type}/issue-{issue_number}-{kebab-case-title}</format>
|
|
95
112
|
<kebab_case>Convert title to lowercase, replace spaces/special chars with hyphens</kebab_case>
|
|
96
113
|
<sanitization>
|
|
97
114
|
<rule>Always use lowercase for branch names</rule>
|
|
@@ -114,12 +131,12 @@ Uncommitted changes: !git status --short`
|
|
|
114
131
|
<title>"Fix duplicate items in list view"</title>
|
|
115
132
|
<generated>fix/issue-456-duplicate-items-in-list-view</generated>
|
|
116
133
|
</examples>
|
|
117
|
-
</
|
|
134
|
+
</step_2_5>
|
|
118
135
|
|
|
119
136
|
<step_3>
|
|
120
137
|
<description>Add all files and stash uncommitted changes if any exist</description>
|
|
121
138
|
<condition>If output is not empty (has uncommitted changes)</condition>
|
|
122
|
-
<command>git add -A && git stash push -m "Worktree switch: Moving changes to ${branch_name}"</
|
|
139
|
+
<command>git add -A && git stash push -m "Worktree switch: Moving changes to ${branch_name}"</command>
|
|
123
140
|
<purpose>Preserve work in progress before switching worktrees</purpose>
|
|
124
141
|
<note>Remember stash was created for later restoration</note>
|
|
125
142
|
</step_3>
|
|
@@ -138,20 +155,20 @@ Uncommitted changes: !git status --short`
|
|
|
138
155
|
<step_5>
|
|
139
156
|
<description>Fetch latest changes from remote</description>
|
|
140
157
|
<command>git fetch origin</command>
|
|
141
|
-
<purpose>Ensure we have the latest remote branches and
|
|
142
|
-
<note>This ensures new worktrees are created from the most recent
|
|
143
|
-
</
|
|
158
|
+
<purpose>Ensure we have the latest remote branches and default branch state</purpose>
|
|
159
|
+
<note>This ensures new worktrees are created from the most recent default branch</note>
|
|
160
|
+
</step_5>
|
|
144
161
|
|
|
145
|
-
<
|
|
162
|
+
<step_6>
|
|
146
163
|
<description>Check if branch exists on remote</description>
|
|
147
164
|
<command>git branch -r | grep "origin/${branch_name}"</command>
|
|
148
165
|
<decision>
|
|
149
166
|
<if_exists>Branch exists on remote - will checkout existing branch</if_exists>
|
|
150
167
|
<if_not_exists>Branch does not exist - will create new branch from base</if_not_exists>
|
|
151
168
|
</decision>
|
|
152
|
-
</
|
|
169
|
+
</step_6>
|
|
153
170
|
|
|
154
|
-
<
|
|
171
|
+
<step_7>
|
|
155
172
|
<description>Create the worktree</description>
|
|
156
173
|
<option_a_new_branch>
|
|
157
174
|
<condition>Remote branch does NOT exist</condition>
|
|
@@ -245,7 +262,7 @@ EOF</create_file_command>
|
|
|
245
262
|
</ide_specific_behavior>
|
|
246
263
|
<purpose>Launch development environment for the new worktree using detected IDE</purpose>
|
|
247
264
|
<confirmation_message>Opening worktree in ${ide_name}</confirmation_message>
|
|
248
|
-
</
|
|
265
|
+
</step_13>
|
|
249
266
|
</execution_steps>
|
|
250
267
|
|
|
251
268
|
<important_notes>
|
|
@@ -260,4 +277,11 @@ EOF</create_file_command>
|
|
|
260
277
|
- Uncommitted changes are automatically stashed and moved to the new worktree
|
|
261
278
|
- Your work-in-progress seamlessly transfers to the new branch
|
|
262
279
|
- IDE detection fallback: checks available editors and uses priority order
|
|
280
|
+
|
|
281
|
+
Limitations:
|
|
282
|
+
|
|
283
|
+
- Assumes remote is named "origin" (most common convention)
|
|
284
|
+
- Supports macOS and Linux only (no Windows support)
|
|
285
|
+
- Requires MCP server or CLI for git hosting provider when using issue URLs (GitHub, GitLab, etc.)
|
|
286
|
+
- Dependency install command is pnpm (modify for npm/yarn if needed)
|
|
263
287
|
</important_notes>
|
|
@@ -18,54 +18,71 @@ Clean up merged worktrees by finding the oldest merged branch, consolidating set
|
|
|
18
18
|
Additional info: $ARGUMENTS
|
|
19
19
|
|
|
20
20
|
<current_state>
|
|
21
|
-
Current branch:
|
|
22
|
-
Current worktrees:
|
|
21
|
+
Current branch: `git branch --show-current`
|
|
22
|
+
Current worktrees: `git worktree list`
|
|
23
23
|
</current_state>
|
|
24
24
|
|
|
25
25
|
<execution_steps>
|
|
26
26
|
<step_0>
|
|
27
|
-
<description>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</
|
|
43
|
-
<
|
|
27
|
+
<description>Detect git hosting provider and available tools</description>
|
|
28
|
+
<detect_provider>
|
|
29
|
+
<check_remote_url>git remote get-url origin</check_remote_url>
|
|
30
|
+
<identify_host>
|
|
31
|
+
- github.com → GitHub
|
|
32
|
+
- gitlab.com → GitLab
|
|
33
|
+
- bitbucket.org → Bitbucket
|
|
34
|
+
- Other → Ask user
|
|
35
|
+
</identify_host>
|
|
36
|
+
</detect_provider>
|
|
37
|
+
<check_available_tools>
|
|
38
|
+
<list_mcp_servers>Check which git-hosting MCP servers are available (github, gitlab, etc.)</list_mcp_servers>
|
|
39
|
+
<check_cli>Check if gh/glab CLI is available as fallback</check_cli>
|
|
40
|
+
</check_available_tools>
|
|
41
|
+
<select_tool>
|
|
42
|
+
<if_single_mcp>If only one relevant MCP available, confirm with user</if_single_mcp>
|
|
43
|
+
<if_multiple>Let user choose which tool to use</if_multiple>
|
|
44
|
+
<if_told_earlier>If user specified tool earlier in conversation, use that without asking again</if_told_earlier>
|
|
45
|
+
<store_as>$GIT_HOST_TOOL (e.g., "github_mcp", "gitlab_mcp", "gh_cli")</store_as>
|
|
46
|
+
</select_tool>
|
|
47
|
+
|
|
48
|
+
<purpose>Detect git hosting provider and select appropriate tool for PR verification</purpose>
|
|
44
49
|
</step_0>
|
|
45
50
|
|
|
46
51
|
<step_1>
|
|
47
|
-
<description>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
<description>Determine default branch and verify we're on it</description>
|
|
53
|
+
<find_default_branch>
|
|
54
|
+
<command>git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'</command>
|
|
55
|
+
<fallback>git remote show origin | grep 'HEAD branch' | cut -d: -f2 | tr -d ' '</fallback>
|
|
56
|
+
<store_as>$DEFAULT_BRANCH (typically "main" or "master")</store_as>
|
|
57
|
+
</find_default_branch>
|
|
58
|
+
<check_current_branch>git branch --show-current</check_current_branch>
|
|
59
|
+
<verify>Current branch must equal $DEFAULT_BRANCH</verify>
|
|
60
|
+
<error_if_not_default>Exit with error: "This command must be run from the default branch ($DEFAULT_BRANCH)"</error_if_not_default>
|
|
61
|
+
<purpose>Ensure we're consolidating to the default branch worktree</purpose>
|
|
52
62
|
</step_1>
|
|
53
63
|
|
|
54
64
|
<step_2>
|
|
55
65
|
<description>Get list of all worktrees</description>
|
|
56
66
|
<command>git worktree list --porcelain</command>
|
|
57
67
|
<parse_output>Extract worktree paths and branch names</parse_output>
|
|
58
|
-
<
|
|
68
|
+
<exclude_default>Filter out the default branch worktree from cleanup candidates</exclude_default>
|
|
59
69
|
<purpose>Identify all worktrees that could potentially be cleaned up</purpose>
|
|
60
70
|
</step_2>
|
|
61
71
|
|
|
62
72
|
<step_3>
|
|
63
73
|
<description>Find oldest worktree by directory age</description>
|
|
64
74
|
<get_worktree_ages>
|
|
65
|
-
<
|
|
66
|
-
<
|
|
75
|
+
<detect_platform>uname -s (returns "Darwin" for macOS, "Linux" for Linux)</detect_platform>
|
|
76
|
+
<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>
|
|
77
|
+
<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>
|
|
67
78
|
<purpose>List all worktrees sorted by directory modification time (oldest first)</purpose>
|
|
68
|
-
<
|
|
79
|
+
<critical_notes>
|
|
80
|
+
- Replace $DEFAULT_BRANCH with value from step_1 (e.g., "main" or "master")
|
|
81
|
+
- grep "\[branch\]" matches branch name in brackets, not paths containing the word
|
|
82
|
+
- Temp file approach avoids subshell parsing issues with piped while-loops
|
|
83
|
+
- /usr/bin/stat on macOS avoids homebrew stat conflicts
|
|
84
|
+
</critical_notes>
|
|
85
|
+
<expected_output_format>YYYY-MM-DD HH:MM|/full/path/to/worktree (oldest first)</expected_output_format>
|
|
69
86
|
</get_worktree_ages>
|
|
70
87
|
<filter_recent>
|
|
71
88
|
<exclude_new>For worktrees created within the last 24 hours, let user know that this worktree might not be worth cleaning</exclude_new>
|
|
@@ -76,28 +93,27 @@ Current worktrees: !git worktree list`
|
|
|
76
93
|
<important_note>DO NOT use "git branch --merged" to check merge status - it's unreliable</important_note>
|
|
77
94
|
<proceed_to_pr_check>Move directly to step 4 to verify PR merge status instead</proceed_to_pr_check>
|
|
78
95
|
</select_oldest>
|
|
79
|
-
<purpose>Identify oldest worktree candidate - actual merge verification happens via
|
|
96
|
+
<purpose>Identify oldest worktree candidate - actual merge verification happens via PR/MR in next step</purpose>
|
|
80
97
|
</step_3>
|
|
81
98
|
|
|
82
99
|
<step_4>
|
|
83
|
-
<description>Verify
|
|
100
|
+
<description>Verify PR/MR merge status (primary merge verification)</description>
|
|
84
101
|
<determine_repo>
|
|
85
102
|
<check_remote>git remote get-url origin</check_remote>
|
|
86
|
-
<parse_repo>Extract owner/repo from
|
|
87
|
-
<fallback>Use project repository from git remote (owner/repo format)</fallback>
|
|
103
|
+
<parse_repo>Extract owner/repo from remote URL</parse_repo>
|
|
88
104
|
</determine_repo>
|
|
89
105
|
<search_pr>
|
|
90
|
-
<tool>mcp__github__search_pull_requests</tool>
|
|
91
|
-
<query>
|
|
92
|
-
<purpose>Find PR for this branch targeting
|
|
106
|
+
<tool>Use $GIT_HOST_TOOL from step_0 (e.g., mcp__github__search_pull_requests, mcp__gitlab__*, or gh CLI)</tool>
|
|
107
|
+
<query>Find PRs/MRs where head={branch_name} and base=$DEFAULT_BRANCH</query>
|
|
108
|
+
<purpose>Find PR/MR for this branch targeting default branch</purpose>
|
|
93
109
|
<important>This is the PRIMARY way to verify if a branch was merged - NOT git commands</important>
|
|
94
110
|
</search_pr>
|
|
95
111
|
<verify_pr_merged>
|
|
96
112
|
<if_pr_found>
|
|
97
|
-
<get_pr_details>Use
|
|
98
|
-
<confirm_merged>Verify PR state is "closed" AND merged_at is not null AND base is "
|
|
99
|
-
<extract_issue_number>Look for issue references in PR title/body (e.g., #
|
|
100
|
-
<if_merged>Proceed with cleanup - this branch was definitively merged to
|
|
113
|
+
<get_pr_details>Use $GIT_HOST_TOOL to get full PR/MR info</get_pr_details>
|
|
114
|
+
<confirm_merged>Verify PR/MR state is "closed"/"merged" AND merged_at is not null AND base is "$DEFAULT_BRANCH"</confirm_merged>
|
|
115
|
+
<extract_issue_number>Look for issue references in PR title/body (e.g., #123, owner/repo#123)</extract_issue_number>
|
|
116
|
+
<if_merged>Proceed with cleanup - this branch was definitively merged to default branch</if_merged>
|
|
101
117
|
<if_not_merged>
|
|
102
118
|
<skip_worktree>This worktree is NOT merged - continue to next oldest worktree</skip_worktree>
|
|
103
119
|
<repeat_from_step_3>Go back and find the next oldest worktree to check</repeat_from_step_3>
|
|
@@ -108,15 +124,14 @@ Current worktrees: !git worktree list`
|
|
|
108
124
|
<continue_to_next>Continue checking next oldest worktree</continue_to_next>
|
|
109
125
|
</if_no_pr>
|
|
110
126
|
</verify_pr_merged>
|
|
111
|
-
<purpose>Use
|
|
127
|
+
<purpose>Use PR/MR status as the authoritative source for merge verification instead of unreliable git commands</purpose>
|
|
112
128
|
</step_4>
|
|
113
129
|
|
|
114
130
|
<step_4_5>
|
|
115
|
-
<description>Check and close related
|
|
131
|
+
<description>Check and close related issue</description>
|
|
116
132
|
<if_issue_found>
|
|
117
133
|
<get_issue_details>
|
|
118
|
-
<tool>
|
|
119
|
-
<method>get</method>
|
|
134
|
+
<tool>Use $GIT_HOST_TOOL to read issue details</tool>
|
|
120
135
|
<extract_repo>From issue reference (main-repo vs cross-repo)</extract_repo>
|
|
121
136
|
</get_issue_details>
|
|
122
137
|
<check_issue_state>
|
|
@@ -124,14 +139,13 @@ Current worktrees: !git worktree list`
|
|
|
124
139
|
<ask_close>Ask user: "Related issue #{number} is still open. Should I close it? (y/N)"</ask_close>
|
|
125
140
|
<if_yes_close>
|
|
126
141
|
<add_closing_comment>
|
|
127
|
-
<tool>
|
|
128
|
-
<body_template>Closing this issue as branch {branch_name} was merged to
|
|
129
|
-
<get_merge_date>Extract merge date from PR details</get_merge_date>
|
|
130
|
-
<get_pr_number>Use PR number from search results</get_pr_number>
|
|
142
|
+
<tool>Use $GIT_HOST_TOOL to add comment</tool>
|
|
143
|
+
<body_template>Closing this issue as branch {branch_name} was merged to {default_branch} on {merge_date} via PR/MR #{pr_number}.</body_template>
|
|
144
|
+
<get_merge_date>Extract merge date from PR/MR details</get_merge_date>
|
|
145
|
+
<get_pr_number>Use PR/MR number from search results</get_pr_number>
|
|
131
146
|
</add_closing_comment>
|
|
132
147
|
<close_issue>
|
|
133
|
-
<tool>
|
|
134
|
-
<method>update</method>
|
|
148
|
+
<tool>Use $GIT_HOST_TOOL to close issue</tool>
|
|
135
149
|
<state>closed</state>
|
|
136
150
|
<state_reason>completed</state_reason>
|
|
137
151
|
</close_issue>
|
|
@@ -213,17 +227,22 @@ Current worktrees: !git worktree list`
|
|
|
213
227
|
|
|
214
228
|
<important_notes>
|
|
215
229
|
|
|
216
|
-
- Uses
|
|
230
|
+
- Uses PR/MR merge status as the ONLY reliable way to verify if a branch was merged
|
|
217
231
|
- DOES NOT use "git branch --merged" command as it's unreliable for merge verification
|
|
218
|
-
- Only processes branches with PRs that were definitively merged to
|
|
219
|
-
- Skips worktrees without merged PRs and continues to next oldest candidate
|
|
220
|
-
- Checks and optionally closes related
|
|
232
|
+
- Only processes branches with PRs/MRs that were definitively merged to default branch
|
|
233
|
+
- Skips worktrees without merged PRs/MRs and continues to next oldest candidate
|
|
234
|
+
- Checks and optionally closes related issues
|
|
221
235
|
- Prioritizes oldest worktrees by directory age first for systematic cleanup
|
|
222
236
|
- Warns about very recent worktrees (created within 24 hours) to avoid cleaning active work
|
|
223
237
|
- Preserves useful development settings before deletion
|
|
224
238
|
- Requires explicit confirmation before any destructive actions
|
|
225
239
|
- Handles locked worktrees automatically
|
|
226
240
|
- Processes one worktree at a time to maintain control
|
|
227
|
-
- Must be run from
|
|
228
|
-
|
|
241
|
+
- Must be run from default branch for safety
|
|
242
|
+
|
|
243
|
+
Limitations:
|
|
244
|
+
|
|
245
|
+
- Assumes remote is named "origin" (most common convention)
|
|
246
|
+
- Supports macOS and Linux only (no Windows support)
|
|
247
|
+
- Requires MCP server or CLI for git hosting provider (GitHub, GitLab, etc.)
|
|
229
248
|
</important_notes>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wbern/claude-instructions",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "TDD workflow commands for Claude Code CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./bin/cli.js",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"test:quick-manual": "pnpm build:cli && node bin/cli.js",
|
|
35
35
|
"generate": "tsx scripts/cli-generator.ts",
|
|
36
36
|
"test": "vitest run",
|
|
37
|
+
"test:coverage": "vitest run --coverage",
|
|
37
38
|
"test:watch": "vitest",
|
|
38
39
|
"typecheck": "tsc --noEmit",
|
|
39
40
|
"knip": "knip",
|
|
@@ -45,13 +46,13 @@
|
|
|
45
46
|
"@eslint/js": "^9.39.1",
|
|
46
47
|
"@types/fs-extra": "^11.0.4",
|
|
47
48
|
"@types/node": "^24.10.1",
|
|
49
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
48
50
|
"diff": "^8.0.2",
|
|
49
51
|
"eslint": "^9.39.1",
|
|
50
52
|
"husky": "^9.1.7",
|
|
51
53
|
"jscpd": "^4.0.5",
|
|
52
54
|
"knip": "^5.70.2",
|
|
53
55
|
"lint-staged": "^16.2.7",
|
|
54
|
-
"markdown-magic": "^4.0.4",
|
|
55
56
|
"markdownlint-cli": "^0.46.0",
|
|
56
57
|
"picocolors": "^1.1.1",
|
|
57
58
|
"prettier": "^3.7.2",
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"tsx": "^4.20.6",
|
|
60
61
|
"typescript": "^5.9.3",
|
|
61
62
|
"typescript-eslint": "^8.48.0",
|
|
62
|
-
"vitest": "^4.0.
|
|
63
|
+
"vitest": "^4.0.15"
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
66
|
"@clack/prompts": "^0.11.0",
|