Execute approved beads using sub-agent model. Each bead is a work package - agent loads surgical context, designs, implements, and verifies. Continues until feature complete.
Philosophy: Each bead is a self-contained work package. The agent loads surgical context, designs the implementation from codebase patterns, implements, verifies, and commits — then resets context and moves to the next bead. Beads carry intent, not implementation. The agent writes code by understanding the codebase, not by copying from the bead. Execution is autonomous — the agent runs until all beads are complete or a genuine blocker requires human input.
Duration targets: BRIEF ~15-30 minutes (3-6 simple beads), STANDARD ~1-3 hours (typical feature), COMPREHENSIVE ~3-8 hours (multi-service, high-risk). These vary widely with feature complexity — the key signal is whether individual beads are completing smoothly, not total elapsed time.
A well-written bead tells the agent what to build and how to verify it. But execution is where the value is delivered — turning intent into working, tested code. The execution loop must be:
Run this skill when:
/beads completed — beads are a mechanical decomposition of an approved plan, not separately user-approved)At every PAUSE point in this skill, call the AskUserQuestion tool to present structured options to the user. Do not present options as plain markdown text — use the tool. The YAML blocks at each PAUSE point show the exact parameters to pass.
For pattern details and examples: ../_shared/references/stage-gates.md
Fallback: Only if
AskUserQuestionis not available as a tool (check your tool list), fall back to presenting options as markdown text and waiting for freeform response.
Before starting execution, load these shared reference files when applicable:
../_shared/references/multi-agent-execution.md — load when other agents are active on the same branch../_shared/references/execution-manifest.md — load when writing the manifest in Phase 4| Mode | When | Behaviour | |------|------|-----------| | BRIEF | 3-6 simple beads | Execute all, commit per bead, report at end | | STANDARD | Typical feature | Execute all, self-review per bead, upstream verification, report at end | | COMPREHENSIVE | Multi-service, high-risk | Execute with per-bead user check-in for high-risk beads, full upstream verification |
In COMPREHENSIVE mode, beads tagged as high-risk in the plan get a user check-in after implementation and before committing. Present the implementation summary and use AskUserQuestion (Decision Gate — Pattern 1) with options: "Approve & commit", "Modify", "Escalate". All other beads execute autonomously.
Phase 1: Verify Baseline
Phase 2: Execute Beads (loop until all complete)
├─ Orient → Load → Design → Implement → Verify → Commit → Push → Reset
└─ (if blocker) PAUSE: "Blocker encountered. How to proceed?"
Phase 3: Blocker Handling (as needed)
Phase 4: Feature Completion — write execution manifest, close epic
Before starting, verify:
/beads completed — the plan approval is the approval, beads are not separately user-approved)/beads firstBead source: Read bead descriptions from br show bd-{id} --json — the .description field is the execution contract populated by /beads. This is the primary source because hive's BeadsAdapter uses the same path. Fall back to docs/plans/{feature}/beads.md if the br description is empty (legacy bead sets created before description push was standard). The beads.md file is the human-readable authoritative record but br is the machine-readable execution contract.
┌─────────────────────────────────────────────────────────────┐
│ BEAD EXECUTION CYCLE │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. ORIENT │
│ └─ Read bead: objective, criteria, context refs │
│ └─ Check progress for prior state │
│ │
│ 2. LOAD CONTEXT (surgical) │
│ └─ Read ONLY files listed in "Context to Load" │
│ └─ Understand patterns from referenced code │
│ └─ DO NOT load entire plan or design docs │
│ └─ DO NOT carry forward previous bead's context │
│ │
│ 3. DESIGN (on-the-fly) │
│ └─ Plan implementation based on loaded context │
│ └─ Choose the pattern to follow from referenced code │
│ └─ If uncertain → ASK user, don't guess │
│ │
│ 4. IMPLEMENT │
│ └─ Write tests that verify success criteria │
│ └─ Write code following codebase patterns │
│ └─ Apply project standards (CLAUDE.md) │
│ └─ Run build after each file change (fail fast) │
│ │
│ 5. VERIFY │
│ └─ Run bead's verification commands │
│ └─ Run full test suite (no regressions) │
│ └─ Self-review against success/failure criteria │
│ │
│ 6. COMMIT │
│ └─ Stage specific files (not git add -A) │
│ └─ Commit with message from bead │
│ └─ Close bead in issue tracker │
│ │
│ 7. SUMMARISE & RESET │
│ └─ Record what was done for this bead │
│ └─ Update progress tracking │
│ └─ Clear mental model of previous bead │
│ └─ Check execution health │
│ └─ Start next bead fresh │
│ │
└─────────────────────────────────────────────────────────────┘
Step 1.1 — Identify Available Work:
Query the issue tracker for ready beads and the feature's dependency tree. Produce a flat execution plan:
## Execution Plan: {feature}
**Ready now (no unmet dependencies):**
- bd-{id}: {title}
- bd-{id}: {title}
**Blocked (will unlock as above complete):**
- bd-{id}: {title} — blocked by: bd-{parent}
- bd-{id}: {title} — blocked by: bd-{parent1}, bd-{parent2}
**Other modules (not this session):**
- bd-{id}: {title} — different module, skip
Filter to YOUR module's beads only. Epic dependency trees often include beads from other modules — identify and exclude them upfront so you don't waste time tracing irrelevant dependencies.
Pre-scan for completed work: Before creating beads in the tracker, check whether the work already exists:
git log --oneline for commit messages matching bead titlesBatch-verify mode (>70% verification-only): When pre-scan reveals most beads are already implemented, switch to batch-verify mode:
Stale bead descriptions: If beads.md says "17 new tests needed" but the test files already have full coverage, flag the discrepancy. Proceed with verification-only mode rather than treating stale descriptions as authoritative. Close with a comment noting the discrepancy (e.g., "Verified — code has 14 items, bead said 13, extra is valid Translation Keys addition").
Step 1.2 — Verify Baseline:
Run the project's build and test commands. If baseline fails, assess severity before proceeding:
Use AskUserQuestion if systemic failures are found:
AskUserQuestion:
question: "{N} tests failing across {M} modules. This is a systemic blocker. How should we proceed?"
header: "Baseline"
multiSelect: false
options:
- label: "Fix blockers first (Recommended)"
description: "Diagnose and fix the systemic issue before claiming any beads."
- label: "Investigate only"
description: "Diagnose the root cause and report without fixing."
- label: "Proceed anyway"
description: "Claim beads despite failing baseline (risky — failures may cascade)."
Step 1.3 — Initialise Progress Tracking:
Track overall progress so you (and the user) can see what's been completed and what remains. Use whatever progress mechanism is available (TodoWrite, comments, etc.).
Loop until all beads are complete.
When multiple beads are ready simultaneously (no dependency between them), they can be executed in any order. Prefer: data model beads before service beads, service beads before integration beads. Execute each bead fully before starting the next.
When multiple agents execute on the same branch simultaneously, expect build collisions, file reverts, and test interference. Full guidance: ../_shared/references/multi-agent-execution.md
Key rules:
macro_file_reservation_cycle) by default when agent-mail is availablegit show --stat HEAD — other agents can steal staged filesTest gate beads: When the next bead is a test gate (tagged test), run the verification commands specified in the gate bead. If all pass, close the gate and proceed. If any fail, fix the failing implementation beads before continuing.
Review/simplify gate beads (legacy): If you encounter /review or /simplify gate beads (from older bead sets), do NOT launch full /review or /simplify agents. Instead:
E2E / Aspire beads: If a bead requires a different execution context (e.g., Aspire AppHost, browser automation, Docker compose), skip it with a comment: "Requires {context} — deferred to separate session." Do not block on beads that can't run in the current environment. Close as "deferred" not "completed."
Frontend test gate health check: Before claiming any frontend test bead, run a single small test to verify the test runner works. If the runner hangs, can't resolve path aliases, or produces unparseable output, note it as a blocker immediately — don't spend 10 minutes discovering this at the end of execution.
UC verification gates: When the next bead is a UC verification gate (verify({module}): UC-{ID}), trace the use case's main scenario steps through the implemented code:
Module completion gates: When the next bead is a module completion gate (verify({module}): module complete), run the full test suite for the module and verify all UC gates passed.
Step 2.1 — Verify Module is Unblocked:
Before starting any bead, check if its module epic has upstream dependencies:
br dep tree bd-{module-epic} # Check if upstream epics are closed
If the module epic depends on unclosed upstream epics, do NOT start work on this module. Pick a bead from an unblocked module instead.
The dependency map at docs/plans/dependency-map.md shows the tier ordering.
Step 2.1a — Claim Bead:
Mark the next available bead as in-progress to track state.
Step 2.2 — Orient (Read Bead):
Read the full bead description from br show bd-{id} --json (primary — the .description field is the execution contract). Fall back to docs/plans/{feature}/beads.md if the br description is empty. Parse:
Step 2.3 — Load Surgical Context:
Read ONLY the files specified in the bead's "Context to Load" section. Understand the patterns. Do NOT load:
Well-scoped beads typically load 3-5 files. If a bead references significantly more, it may be too coarse — flag as a potential splitting candidate before proceeding.
Step 2.3a — Load Module Specs (first bead in module only):
When starting the FIRST bead in a module, load the module's key design documents. Use the doc map from docs/plans/{feature}/beads.md (if it contains one) or discover paths using the project's doc structure:
Common path patterns (vary by project):
docs/designs/{module}/ — technical design (source of truth for HOW)
docs/prd/{module}/ — requirements (source of truth for WHAT)
docs/use-cases/ or docs/prd/{module}/use-cases/ — UC scenarios
docs/adr/ — architectural decisions (source of truth for WHY)
docs/patterns/ — coding patterns (source of truth for STYLE)
docs/architecture/ — system architecture (source of truth for CONSTRAINTS)
For subsequent beads in the same module, module specs persist until context compaction — don't re-read every bead.
Step 2.4 — Design Implementation:
Based on loaded context:
If uncertain about anything:
Step 2.5 — Implement:
Write tests first:
Then implement:
Step 2.5a — Checkpoint (for large beads):
If a bead involves modifying more than 8 files, checkpoint periodically:
git stash push -m "checkpoint: bd-{id} - {description}"
This prevents total work loss on crash. After all files are done, pop the stashes and make a single clean commit.
Most beads modify 1-8 files — skip checkpointing for these. The per-file stash overhead isn't worth it for small beads.
Step 2.6 — Verify:
Solo execution: Run the full test suite, not filtered tests. Filtered tests miss cross-module regressions.
Concurrent execution (other agents active): Use module-scoped tests per bead (e.g., test filter for your module name). The full suite is unreliable when other agents have broken code or shared test infrastructure collisions cause batch failures. If module-scoped tests ALSO fail due to concurrent interference, fall back to per-class execution. Defer the full suite to the test gate bead when your module is complete and concurrent activity has settled.
In both cases: if the suite is slow (>5 minutes), run bead-specific verification commands first as a fast check.
Rationalization Prevention (Iron Law): Every completion claim requires FRESH verification evidence. Common rationalizations to catch:
Step 2.7 — Self-Review:
Before committing, run a lightweight self-review. This is a fast sanity check — deep adversarial verification is done by /review-execute after all beads complete.
Proportionality: For verification beads (checking existing code matches design) and test-only beads, the self-review can skip pattern/style/slop checks — focus only on: objective achieved, success criteria met, tests pass.
Per-Bead Self-Review (lightweight):
- [ ] Re-read bead objective — does the implementation achieve it?
- [ ] Each success criterion met (check specifically)
- [ ] No failure criterion violated (check specifically — failure criteria often encode
design decisions like "Do NOT use SaveRequest" per command-pattern.md; verify
against the referenced decision doc, not just as arbitrary rules)
- [ ] No scope creep (nothing added beyond the objective)
- [ ] Implementation follows the referenced pattern doc
- [ ] Code style matches existing codebase
- [ ] Tests verify application logic, not framework guarantees
- [ ] Run tests before committing (full suite solo, module-scoped if concurrent — see Multi-Agent section)
- [ ] Staged specific files (not git add -A)
- [ ] No AI slop: unnecessary abstractions for single-use logic
- [ ] No AI slop: docstrings/comments on obvious methods
- [ ] No AI slop: defensive coding against impossible internal states
- [ ] No AI slop: premature generalization (config for one value, wrapper class with no added behavior)
If any item fails, fix the issue, re-run tests, then re-review.
Note: Deep design/spec alignment (api-surface match, data-model match, ADR compliance, FR acceptance criteria, UC scenario coverage) is verified by /review-execute post-execution. The self-review catches obvious mismatches but does not replace adversarial review.
Step 2.8 — Commit:
Verification-only fast path: Does the existing code already satisfy this bead's objective? If YES (all checks pass, zero code changes needed):
This is the correct path for verification beads where the codebase already matches the design.
If code was changed: Track which files you created or modified. Stage ONLY those files — NEVER use git add -A or git add .. Minimize the stage-to-commit window — other agents running git add -A can steal your staged files during the pre-commit hook. Stage and commit in a single shell command when possible, or use git stash before staging to protect your changes. Close the bead in the issue tracker.
Step 2.8a — Push (if committed):
git push
Push after each bead that produces a commit. Do NOT accumulate unpushed commits. This prevents work loss on crash.
Step 2.9 — Summarise & Reset:
Append a per-bead entry to the manifest (see ../_shared/references/execution-manifest.md for full template). For verification-only beads, use: Status: Verified — no changes needed.
Update progress tracking. Then reset implementation context:
Handle issues automatically before asking the user. Different errors need different strategies.
Build Failure:
Test Failure:
Regression (Other Tests Break):
Implementation Doesn't Work:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer