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.

16 stars

Best use case

beads-integrator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using beads-integrator should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/beads-integrator/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/cli-automation/beads-integrator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/beads-integrator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How beads-integrator Compares

Feature / Agentbeads-integratorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Beads 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 `main` or `master`)
  - If unclear, detect with: `git symbolic-ref --short refs/remotes/origin/HEAD`
- Store base name for reuse:
  ```bash
  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:
    ```bash
    REMOTE="$(git remote | head -n 1)"
    if git remote get-url origin >/dev/null 2>&1; then REMOTE=origin; fi
    ```
- Task id (sanitized for branch/worktree)
  ```bash
  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)
1. Ensure base is clean and current:
   - If dirty: wait 60 seconds, then re-check.
   - If still dirty:
     - If only `.beads/issues.jsonl` changed: continue and commit your updates as usual.
     - Otherwise: stash to unblock:
       ```bash
       git stash push -u -m "beads-integrator-auto"
       ```
   - `git checkout "$BASE"`
   - `git pull --rebase` (if a remote is configured)
2. Update task branch with base:
   - `git checkout "$BRANCH"`
   - `git rebase "$BASE"` (or `git merge "$BASE"` if policy avoids rebasing)
3. Verify:
   - run the agreed verification commands
4. Merge:
   - `git checkout "$BASE"`
   - `git merge --ff-only "$BRANCH"` (or merge-commit policy)
   - `git push "$REMOTE" "$BASE"` (use detected `$REMOTE`, or skip if no remote)
5. Record in Beads:
   - merge commit SHA, method, verification performed, follow-ups if needed
6. Clean worktree:
   - remove `$WORKTREE_PATH` when safe

## If conflicts occur
- Resolve conflicts in the task branch context.
- If conflict complexity suggests architectural ambiguity:
  - pause and request `$beads-architect` consult
  - or defer with follow-up tasks instead of brute forcing a risky merge

## If merge breaks base branch (rollback procedure)
If verification fails after merging to base branch, act immediately:

1. **Revert the merge commit:**
   ```bash
   git revert -m 1 "$MERGE_SHA" --no-edit
   git push "$REMOTE" "$BASE"
   ```
   This creates a new commit that undoes the merge while preserving history.

2. **Document in Beads:**
   - Update the task with: "Merge reverted due to: $REASON"
   - Include the revert commit SHA
   - Change task status back to "needs work"

3. **Notify orchestrator:**
   - The task needs re-review after fixes
   - Consider whether the issue indicates a gap in verification steps

4. **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.

Related Skills

beads-orchestration

16
from diegosouzapw/awesome-omni-skill

Multi-agent orchestration for GitHub Issues using BEADS task tracking

api-integrator

16
from diegosouzapw/awesome-omni-skill

Integrate external REST and GraphQL APIs with proper authentication (Bearer, Basic, OAuth), error handling, retry logic, and JSON schema validation. Use when making API calls, database queries, or integrating external services like Stripe, Twilio, AWS. Achieves 10-30x cost savings through direct execution vs LLM-based calls. Triggers on "API call", "REST API", "GraphQL", "external service", "API integration", "HTTP request".

agent-integrator

16
from diegosouzapw/awesome-omni-skill

Use this skill to create or update the root AGENTS.md file to register AgenticDev skills for AI agent discovery. Triggers include "register AgenticDev", "update AGENTS.md", "setup agent guide", or initializing a new project.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

moai-lang-r

16
from diegosouzapw/awesome-omni-skill

R 4.4+ best practices with testthat 3.2, lintr 3.2, and data analysis patterns.

moai-lang-python

16
from diegosouzapw/awesome-omni-skill

Python 3.13+ development specialist covering FastAPI, Django, async patterns, data science, testing with pytest, and modern Python features. Use when developing Python APIs, web applications, data pipelines, or writing tests.

moai-icons-vector

16
from diegosouzapw/awesome-omni-skill

Vector icon libraries ecosystem guide covering 10+ major libraries with 200K+ icons, including React Icons (35K+), Lucide (1000+), Tabler Icons (5900+), Iconify (200K+), Heroicons, Phosphor, and Radix Icons with implementation patterns, decision trees, and best practices.

moai-foundation-trust

16
from diegosouzapw/awesome-omni-skill

Complete TRUST 4 principles guide covering Test First, Readable, Unified, Secured. Validation methods, enterprise quality gates, metrics, and November 2025 standards. Enterprise v4.0 with 50+ software quality standards references.

moai-foundation-memory

16
from diegosouzapw/awesome-omni-skill

Persistent memory across sessions using MCP Memory Server for user preferences, project context, and learned patterns

moai-foundation-core

16
from diegosouzapw/awesome-omni-skill

MoAI-ADK's foundational principles - TRUST 5, SPEC-First TDD, delegation patterns, token optimization, progressive disclosure, modular architecture, agent catalog, command reference, and execution rules for building AI-powered development workflows

moai-cc-claude-md

16
from diegosouzapw/awesome-omni-skill

Authoring CLAUDE.md Project Instructions. Design project-specific AI guidance, document workflows, define architecture patterns. Use when creating CLAUDE.md files for projects, documenting team standards, or establishing AI collaboration guidelines.

moai-alfred-language-detection

16
from diegosouzapw/awesome-omni-skill

Auto-detects project language and framework from package.json, pyproject.toml, etc.