/consensus-loop:merge [target-branch]from consensus-loop
Squash-merges a worktree branch into the target branch with a structured commit message. Used after audit consensus and retrospective completion.
Ships in consensus-loop. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Squash-merge the current worktree branch back into the target branch. All WIP commits become one structured commit.
This skill is invoked by the orchestrator after:
[agree_tag] consensus reachedsession-self-improvement-complete)| Context | Behavior |
|---|---|
| Interactive | Report merge result → ask about cleanup |
| Headless | Merge → verify → report result → do NOT cleanup (orchestrator decides) |
In headless mode, do NOT ask "keep worktree or remove?" — report the result and exit. The orchestrator handles cleanup.
!git rev-parse --git-dir!git branch --show-current!git log --oneline -20!git status --shortFollow phases in order. Do NOT skip phases.
Verify worktree: git rev-parse --git-dir must contain /worktrees/. If not → stop:
"This skill must be run from inside a git worktree."
Verify retrospective complete: Check .claude/retro-marker.json in the repo root:
git -C "$(git rev-parse --git-common-dir)/.." cat-file -e HEAD:.claude/retro-marker.json 2>/dev/null || cat "$(git rev-parse --git-common-dir)/../.claude/retro-marker.json" 2>/dev/null
If retro_pending is true → stop:
"Retrospective not completed. Run retrospective first, then
session-self-improvement-complete."
Identify current branch: git branch --show-current
Resolve target branch:
$ARGUMENTS provided → use as targetmain or masterFind original repo root:
ORIGINAL_ROOT="$(git rev-parse --git-common-dir)/.."
Clean working tree: git status --porcelain must be empty. If not → stop:
"Uncommitted changes found. Commit or stash first."
Commit history: git log --oneline <target>..HEAD
File change summary: git diff <target>...HEAD --stat
Full diff: git diff <target>...HEAD — read carefully
Read key files: For significantly changed files, use Read to understand full context
Categorize changes:
Structure:
<type>(<scope>): <summary under 72 chars>
<body — what changed and why, grouped by category>
<footer — breaking changes, issue refs, co-authors>
Type rules:
feat — new functionalityfix — bug correctionrefactor — restructuring without behavior changetest — test additions/changes onlydocs — documentation onlychore — build, CI, toolingScope: the primary module affected (e.g., bus, security, orchestration, fe)
Body guidelines:
### headers if multiple typesFooter:
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
All commands use absolute paths or git -C — shell state does not persist between commands.
Squash merge (from original repo root):
git -C "${ORIGINAL_ROOT}" merge --squash <worktree_branch>
Commit with generated message:
git -C "${ORIGINAL_ROOT}" commit -m "<generated_message>"
Verify merge commit exists:
git -C "${ORIGINAL_ROOT}" log -1 --oneline
The output must show the new squash commit with the generated message. If not → merge failed — report error, do NOT proceed to cleanup.
Verify no uncommitted changes remain:
git -C "${ORIGINAL_ROOT}" status --porcelain
Must be empty. If not → partial merge — report and stop.
Report result to orchestrator:
## Merge Complete
- Branch: <worktree_branch> → <target_branch>
- Commits squashed: N
- Files changed: M
- Commit: <short_sha> <first_line>
- Verified: commit exists ✅, working tree clean ✅
Worktree can be removed with:
`git worktree remove <worktree_path>`
Report to orchestrator with cleanup options:
**Worktree merged. Cleanup options:**
1. `git worktree remove <worktree_path> && git branch -d <worktree_branch>`
2. Keep worktree for reference
The orchestrator decides — this skill does not remove worktrees autonomously.
feat(bus): add event replay port for SSE reconnection
EventBus now supports replay_since(cursor, { team_id }) for
tenant-scoped event replay. InMemory uses ring buffer,
Redis uses XRANGE.
- src/bus/types.ts: ReplayableMessageBus interface
- src/bus/service.ts: ring buffer implementation (max 1000)
- src/bus/redis-bus.ts: XRANGE-based replay
- tests/bus/replay.test.ts: 12 tests
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
If post-merge verification fails (tests break, build fails):
git log -1 --oneline → note the SHAgit -C "${ORIGINAL_ROOT}" revert --no-edit <merge-sha>
git -C "${ORIGINAL_ROOT}" diff HEAD~1..HEAD --stat shows the inverse## Emergency Rollback
- Reverted: <merge-sha> (<commit message>)
- Reason: <what failed>
- Status: tests passing after revert
- Action needed: task returns to `correcting` status
correcting, note rollback reasonDo NOT use git reset --hard — revert creates an audit trail. Hard reset loses history.
git status --porcelain shows uncommitted changesconsensus-loop:verify has unresolved failuresretro_pending: true)git status --porcelain shows uncommitted changesWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
consensus-loop@berrzebb-plugins is listed by berrzebb/claude-plugins — review the source before installing
npx claudepluginhub berrzebb/claude-plugins --plugin consensus-loop9 skills in this plugin
/auditconsensus-loop:auditRun a consensus-loop audit manually — Codex reviews pending trigger_tag items in the watch file. Use when you want to trigger an audit without editing the watch file, re-run a failed audit, or test the audit prompt./guideconsensus-loop:guideGuide for writing evidence packages for the consensus-loop watch file. Use when preparing code review submissions, structuring feedback evidence, or addressing audit rejections./toolsconsensus-loop:toolsRun consensus-loop deterministic analysis tools via CLI — code_map, dependency_graph, audit_scan, coverage_map, rtm_parse, rtm_merge, audit_history, fvm_generate, fvm_validate. Use this skill whenever you need codebase analysis (symbol index, dependency DAG, pattern scan, coverage), RTM operations (parse, merge, query), or FVM operations (generate matrix, validate against server) — even if the MCP server is not configured. This skill replaces mcp__plugin_consensus-loop_consensus-loop__* tool calls with equivalent CLI commands./orchestratorconsensus-loop:orchestratorSession orchestrator for the consensus-loop — reads handoff, picks unblocked tasks, distributes to parallel workers, tracks agent assignments, manages correction cycles via SendMessage. Use when starting a work session with pending tasks, distributing implementation work, or reviewing completed worker output./plannerconsensus-loop:plannerDesign tasks into tracks with work breakdowns and execution order. Also writes and maintains PRDs (Product Requirements Documents) — when a user requests a feature, analyzes it, adds it to the PRD, then decomposes into work breakdowns. Use for new feature planning, PRD writing, architecture changes, multi-track decomposition, requirements analysis, or adjusting existing execution plans. Trigger when user says things like 'add feature X', 'I need Y', 'plan Z', or describes any product requirement./retrospectconsensus-loop:retrospectExtract learnings from audit history and conversation, manage memories, clean up stale entries. Use after completing a track, during retrospective (③ memory step), at end of session, or anytime the user wants memory maintenance. Triggers on 'what did we learn', 'memory cleanup', 'review learnings', 'retrospective', 'update memories', '회고', '메모리 정리'.