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.
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
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/beads-integrator/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How beads-integrator Compares
| Feature / Agent | beads-integrator | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/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
Multi-agent orchestration for GitHub Issues using BEADS task tracking
api-integrator
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
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
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.
moai-lang-r
R 4.4+ best practices with testthat 3.2, lintr 3.2, and data analysis patterns.
moai-lang-python
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
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
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
Persistent memory across sessions using MCP Memory Server for user preferences, project context, and learned patterns
moai-foundation-core
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
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
Auto-detects project language and framework from package.json, pyproject.toml, etc.