claude-init 1.0.26 → 1.0.28
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.
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cleans up all git branches marked as [gone] (branches that have been deleted on the remote but still exist locally), including removing associated worktrees.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Your Task
|
|
6
|
+
|
|
7
|
+
You need to execute the following bash commands to clean up stale local branches that have been deleted from the remote repository.
|
|
8
|
+
|
|
9
|
+
## Commands to Execute
|
|
10
|
+
|
|
11
|
+
1. **First, list branches to identify any with [gone] status**
|
|
12
|
+
Execute this command:
|
|
13
|
+
```bash
|
|
14
|
+
git branch -v
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Note: Branches with a '+' prefix have associated worktrees and must have their worktrees removed before deletion.
|
|
18
|
+
|
|
19
|
+
2. **Next, identify worktrees that need to be removed for [gone] branches**
|
|
20
|
+
Execute this command:
|
|
21
|
+
```bash
|
|
22
|
+
git worktree list
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
3. **Finally, remove worktrees and delete [gone] branches (handles both regular and worktree branches)**
|
|
26
|
+
Execute this command:
|
|
27
|
+
```bash
|
|
28
|
+
# Process all [gone] branches, removing '+' prefix if present
|
|
29
|
+
git branch -v | grep '\[gone\]' | sed 's/^[+* ]//' | awk '{print $1}' | while read branch; do
|
|
30
|
+
echo "Processing branch: $branch"
|
|
31
|
+
# Find and remove worktree if it exists
|
|
32
|
+
worktree=$(git worktree list | grep "\\[$branch\\]" | awk '{print $1}')
|
|
33
|
+
if [ ! -z "$worktree" ] && [ "$worktree" != "$(git rev-parse --show-toplevel)" ]; then
|
|
34
|
+
echo " Removing worktree: $worktree"
|
|
35
|
+
git worktree remove --force "$worktree"
|
|
36
|
+
fi
|
|
37
|
+
# Delete the branch
|
|
38
|
+
echo " Deleting branch: $branch"
|
|
39
|
+
git branch -D "$branch"
|
|
40
|
+
done
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Expected Behavior
|
|
44
|
+
|
|
45
|
+
After executing these commands, you will:
|
|
46
|
+
|
|
47
|
+
- See a list of all local branches with their status
|
|
48
|
+
- Identify and remove any worktrees associated with [gone] branches
|
|
49
|
+
- Delete all branches marked as [gone]
|
|
50
|
+
- Provide feedback on which worktrees and branches were removed
|
|
51
|
+
|
|
52
|
+
If no branches are marked as [gone], report that no cleanup was needed.
|
|
53
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git push:*)
|
|
3
|
+
description: Create a git commit then push
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
- Current git status: !`git status`
|
|
9
|
+
- Current git diff (staged and unstaged changes): !`git diff HEAD`
|
|
10
|
+
- Current branch: !`git branch --show-current`
|
|
11
|
+
- Recent commits: !`git log --oneline -10`
|
|
12
|
+
|
|
13
|
+
## Your task
|
|
14
|
+
|
|
15
|
+
Based on the above changes, create a single git commit and push to origin.
|
|
16
|
+
|
|
17
|
+
You have the capability to call multiple tools in a single response. Stage and create the commit using a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls. Don't add Claude Code attribution in the message.
|
package/.claude/settings.json
CHANGED
package/CLAUDE.md
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
1
|
+ During you interaction with the user, if you find anything reusable in this project (e.g. version of a library, model name), especially about a fix to a mistake you made or a correction you received, you should take note in the `Lessons` section in the `CLAUDE.md` file so you will not make the same mistake again.
|
|
2
|
+
|
|
3
|
+
## Lessons
|
|
4
|
+
|
|
5
|
+
### Test Maintenance
|
|
6
|
+
- When tests fail after removing template files, update the test assertions to reference existing template files. For example, after removing `.claude/commands/commit.md`, the test was updated to check for `simple-planning.md` instead (commit 348f79d removed the custom commit command).
|
package/package.json
CHANGED