一键导入
consensus-loopmerge
Squash-merge a worktree branch into the target branch with a structured commit message. Use after audit consensus and retrospective completion.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Squash-merge a worktree branch into the target branch with a structured commit message. Use after audit consensus and retrospective completion.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Design 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.
Run all done-criteria checks (CQ/T/CC/CL/S/I/FV/CV) and produce a pass/fail verification report. Use after implementing code, before submitting evidence to the quorum audit.
Run 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.
Session 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.
Extract 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', '회고', '메모리 정리'.
Show current consensus-loop status — pending reviews, audit state, retro marker, agent assignments. Use to check what's happening before starting work or after returning from a break.
| name | consensus-loop:merge |
| description | Squash-merge a worktree branch into the target branch with a structured commit message. Use after audit consensus and retrospective completion. |
| argument-hint | [target-branch] |
| disable-model-invocation | true |
| context | fork |
| allowed-tools | Read, Grep, Glob, Bash(git *) |
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
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 changes