Review and merge open PRs for claimed ba tasks as a cohesive batch
Reviews and merges all PRs with the drummer-merge label in a single batch. Use when you need to merge multiple related PRs while checking for logical conflicts between them.
/plugin marketplace add cloud-atlas-ai/miranda/plugin install miranda@mirandaThis skill inherits all available tools. When active, it can use any tool Claude has access to.
The collective that processes in rhythm. Holistically review pending PRs, then squash-merge them as a cohesive batch.
/drummer
Read dive context (if available) for project background:
cat .wm/dive_context.md 2>/dev/null || echo "No dive context"
This provides architecture decisions, conventions, and session intent.
Find claimed tasks:
ba list --status=in_progress
For each claimed task, find its PR with drummer-merge label:
gh pr list --head ba/<task-id> --label drummer-merge --json number,title,mergeable,additions,deletions,labels
Only PRs with the drummer-merge label are eligible for merge.
Skip PRs without this label and report them as "awaiting human approval".
Batch review - evaluate all PRs together:
sg review on the combined changesFor each PR (in dependency order):
git fetch origin
gh pr checkout <pr-number>
git rebase origin/main
git push --force-with-lease
gh pr merge <pr-number> --squash
git pull origin main
for task_id in <tasks-from-pr>; do
ba show $task_id # Check status
# If not closed, fix it:
ba finish $task_id
done
# If any fixes were needed:
git add .ba/ && git commit -m "fix: close tasks after merge" && git push origin main
Squash merge can lose .ba/ changes during conflict resolution. This step ensures
all merged tasks end in closed state regardless of what the merge preserved.Signal completion (MANDATORY) - This is the LAST thing you do:
# On success:
curl -sS -X POST "http://localhost:${MIRANDA_PORT}/complete" \
-H "Content-Type: application/json" \
-d "{\"session\": \"$TMUX_SESSION\", \"status\": \"success\"}"
# On error:
curl -sS -X POST "http://localhost:${MIRANDA_PORT}/complete" \
-H "Content-Type: application/json" \
-d "{\"session\": \"$TMUX_SESSION\", \"status\": \"error\", \"error\": \"<reason>\"}"
If you don't signal, Miranda won't know you're done and the session becomes orphaned.
When PRs target other PRs (not main), drummer detects the stack and merges in order:
Before: PR #43 → ba/abc-123 → main
PR #42 → main
After: PR #42 merged to main
PR #43 rebased onto main, merged to main
The holistic review checks what individual PR reviews can't:
.ba/issues.jsonl is line-per-task:
drummer-merge label (human approval gate)Note: The drummer-merge label must be created in the repo. This is opt-in per repo.
status: "success"status: "error" with message$ /drummer
Finding claimed tasks...
Found 3 in_progress tasks: abc-123, abc-456, abc-789
Checking for open PRs with drummer-merge label...
abc-123: PR #42 "Fix validation bug" (CI ✓, drummer-merge ✓)
abc-456: PR #43 "Add edge case tests" (CI ✓, drummer-merge ✓)
abc-789: PR #44 "Refactor validator" (CI ✓) ⏳ awaiting approval
Running batch review on combined changes...
Collecting diffs: +847 -203 across 12 files
Batch review complete:
✓ No logical conflicts
✓ No duplication
⚠ Ordering dependency: PR #44 (refactor) should merge before PR #42 (fix)
Reordering merge sequence: #44 → #42 → #43
Processing PR #44 (Refactor validator)...
Rebasing onto main... clean
Squash merging... ✓
Processing PR #42 (Fix validation bug)...
Rebasing onto main... clean
Squash merging... ✓
Processing PR #43 (Add edge case tests)...
Rebasing onto main...
Conflict in .ba/issues.jsonl (expected)
Resolving: keeping all task closures
Squash merging... ✓
Merge train complete.
Merged: 2 PRs (#42, #43)
Skipped: 1 PR (#44 - awaiting drummer-merge label)
Signaling completion...
Done.
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.