From a61f6aead7ec0bf4a2d8aeeec97b77bb207b5e55 Mon Sep 17 00:00:00 2001 From: "glm-5.1" Date: Thu, 21 May 2026 20:44:19 +0000 Subject: [PATCH] fix(coordinator): use remote:true on cleanup remove, document merged cleanup action --- .opencode/agents/coordinator.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.opencode/agents/coordinator.md b/.opencode/agents/coordinator.md index 2e9d94b..6731180 100644 --- a/.opencode/agents/coordinator.md +++ b/.opencode/agents/coordinator.md @@ -38,7 +38,8 @@ worktree({action: "message", args: {sessionID: "ses_...", message: "..."}}) → worktree({action: "sessions"}) → Query spawned session status worktree({action: "abort", args: {sessionID: "ses_..."}}) → Abort a session 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. @@ -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. -6. **Clean up the worktree and remote branch:** +6. **Clean up the worktree, local branch, and remote branch in one call:** ```text - worktree({action: "cleanup", args: {action: "remove", pathOrBranch: "feat/"}}) + worktree({action: "cleanup", args: {action: "remove", pathOrBranch: "feat/", remote: true}}) ``` - Then delete the remote branch: - ```bash - git push origin --delete feat/ + 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`. + + **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 @@ -330,8 +334,11 @@ Most merge conflicts between parallel branches are straightforward — both side ### 6. Clean Up After Each Task After merging and pushing: -1. Remove the local worktree: `worktree({action: "cleanup", args: {action: "remove", ...}})` -2. Delete the remote feature branch: `git push origin --delete feat/` +1. Remove the worktree, local branch, and remote branch in one call: + ```text + worktree({action: "cleanup", args: {action: "remove", pathOrBranch: "feat/", remote: true}}) + ``` + The `remote: true` flag handles remote branch deletion automatically — no separate `git push origin --delete` needed. Don't let stale branches accumulate.