fix(coordinator): use remote:true on cleanup remove, document merged cleanup action
This commit is contained in:
@@ -38,7 +38,8 @@ worktree({action: "message", args: {sessionID: "ses_...", message: "..."}}) →
|
|||||||
worktree({action: "sessions"}) → Query spawned session status
|
worktree({action: "sessions"}) → Query spawned session status
|
||||||
worktree({action: "abort", args: {sessionID: "ses_..."}}) → Abort a session
|
worktree({action: "abort", args: {sessionID: "ses_..."}}) → Abort a session
|
||||||
worktree({action: "cleanup", args: {action: "prune", dryRun: true}}) → Prune worktrees
|
worktree({action: "cleanup", args: {action: "prune", dryRun: true}}) → Prune worktrees
|
||||||
worktree({action: "cleanup", args: {action: "remove", pathOrBranch: "feat"}}) → Remove worktree
|
worktree({action: "cleanup", args: {action: "remove", pathOrBranch: "feat", remote: true}}) → Remove worktree + remote branch
|
||||||
|
worktree({action: "cleanup", args: {action: "merged", remote: true, prefix: "feat/"}}) → Bulk cleanup merged branches
|
||||||
```
|
```
|
||||||
|
|
||||||
Use `worktree({action: "help"})` for full reference or `worktree({action: "help", args: {action: "spawn"}}) ` for specific operation details.
|
Use `worktree({action: "help"})` for full reference or `worktree({action: "help", args: {action: "spawn"}}) ` for specific operation details.
|
||||||
@@ -92,14 +93,17 @@ This is the most critical coordinator responsibility. Follow it exactly:
|
|||||||
```
|
```
|
||||||
**This is critical.** Agents push their feature branches to origin, but main only moves when YOU push it. If you forget, the remote will appear stale even though all work is done locally. Push after every successful merge.
|
**This is critical.** Agents push their feature branches to origin, but main only moves when YOU push it. If you forget, the remote will appear stale even though all work is done locally. Push after every successful merge.
|
||||||
|
|
||||||
6. **Clean up the worktree and remote branch:**
|
6. **Clean up the worktree, local branch, and remote branch in one call:**
|
||||||
```text
|
```text
|
||||||
worktree({action: "cleanup", args: {action: "remove", pathOrBranch: "feat/<task-name>"}})
|
worktree({action: "cleanup", args: {action: "remove", pathOrBranch: "feat/<task-name>", remote: true}})
|
||||||
```
|
```
|
||||||
Then delete the remote branch:
|
The `remote: true` flag tells the plugin to also delete the remote branch — no separate `git push origin --delete` needed. If you need to force-remove a dirty worktree, add `force: true`.
|
||||||
```bash
|
|
||||||
git push origin --delete feat/<task-name>
|
**Bulk cleanup of merged branches** (useful after completing a generation):
|
||||||
|
```text
|
||||||
|
worktree({action: "cleanup", args: {action: "merged", remote: true, prefix: "feat/"}})
|
||||||
```
|
```
|
||||||
|
Preview first with `dryRun: true` before deleting anything.
|
||||||
|
|
||||||
### Merge Ordering
|
### Merge Ordering
|
||||||
|
|
||||||
@@ -330,8 +334,11 @@ Most merge conflicts between parallel branches are straightforward — both side
|
|||||||
### 6. Clean Up After Each Task
|
### 6. Clean Up After Each Task
|
||||||
|
|
||||||
After merging and pushing:
|
After merging and pushing:
|
||||||
1. Remove the local worktree: `worktree({action: "cleanup", args: {action: "remove", ...}})`
|
1. Remove the worktree, local branch, and remote branch in one call:
|
||||||
2. Delete the remote feature branch: `git push origin --delete feat/<task-name>`
|
```text
|
||||||
|
worktree({action: "cleanup", args: {action: "remove", pathOrBranch: "feat/<task-name>", remote: true}})
|
||||||
|
```
|
||||||
|
The `remote: true` flag handles remote branch deletion automatically — no separate `git push origin --delete` needed.
|
||||||
|
|
||||||
Don't let stale branches accumulate.
|
Don't let stale branches accumulate.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user