Awesome-omni-skill beads-integrator
Merge Beads task branches into main/master safely (serialized), verify, push to remote, record merge SHAs back into tasks, and clean worktrees. Use when merging branches, integrating code to base branch, or finalizing reviewed task branches.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/cli-automation/beads-integrator" ~/.claude/skills/diegosouzapw-awesome-omni-skill-beads-integrator && rm -rf "$T"
skills/cli-automation/beads-integrator/SKILL.mdBeads Integrator
Orchestrator role
This skill is typically invoked by
$beads-orchestrator. Users normally start with the orchestrator, not this role.
Core rule
You are the only entity that merges to the base branch during an orchestration run.
Inputs
- List of task ids + branch names approved by reviewer
- Base branch (usually
ormain
)master- If unclear, detect with:
git symbolic-ref --short refs/remotes/origin/HEAD
- If unclear, detect with:
- Store base name for reuse:
if git symbolic-ref --short refs/remotes/origin/HEAD >/dev/null 2>&1; then BASE="$(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's|^origin/||')" elif git show-ref --verify --quiet "refs/heads/main"; then BASE=main else BASE=master fi - Remote name
- Detect with:
REMOTE="$(git remote | head -n 1)" if git remote get-url origin >/dev/null 2>&1; then REMOTE=origin; fi
- Detect with:
- Task id (sanitized for branch/worktree)
TASK_ID_SANITIZED="${TASK_ID//\//-}" TASK_ID_SANITIZED="${TASK_ID_SANITIZED//./-}" BRANCH="beads/$TASK_ID_SANITIZED" WORKTREE_PATH=".worktrees/$TASK_ID_SANITIZED"
Procedure (repeat per task branch)
- Ensure base is clean and current:
- If dirty: wait 60 seconds, then re-check.
- If still dirty:
- If only
changed: continue and commit your updates as usual..beads/issues.jsonl - Otherwise: stash to unblock:
git stash push -u -m "beads-integrator-auto"
- If only
git checkout "$BASE"
(if a remote is configured)git pull --rebase
- Update task branch with base:
git checkout "$BRANCH"
(orgit rebase "$BASE"
if policy avoids rebasing)git merge "$BASE"
- Verify:
- run the agreed verification commands
- Merge:
git checkout "$BASE"
(or merge-commit policy)git merge --ff-only "$BRANCH"
(use detectedgit push "$REMOTE" "$BASE"
, or skip if no remote)$REMOTE
- Record in Beads:
- merge commit SHA, method, verification performed, follow-ups if needed
- Clean worktree:
- remove
when safe$WORKTREE_PATH
- remove
If conflicts occur
- Resolve conflicts in the task branch context.
- If conflict complexity suggests architectural ambiguity:
- pause and request
consult$beads-architect - or defer with follow-up tasks instead of brute forcing a risky merge
- pause and request
If merge breaks base branch (rollback procedure)
If verification fails after merging to base branch, act immediately:
-
Revert the merge commit:
git revert -m 1 "$MERGE_SHA" --no-edit git push "$REMOTE" "$BASE"This creates a new commit that undoes the merge while preserving history.
-
Document in Beads:
- Update the task with: "Merge reverted due to: $REASON"
- Include the revert commit SHA
- Change task status back to "needs work"
-
Notify orchestrator:
- The task needs re-review after fixes
- Consider whether the issue indicates a gap in verification steps
-
Create follow-up task (if needed):
- If the failure reveals a deeper issue, create a new Beads task to address root cause
- Link it as a blocker to the original task
Prevention: Always run full verification on the integrated branch before pushing. If CI is available, wait for CI to pass before considering the merge complete.