beo-executing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Beo Executing

Beo 执行

Overview

概述

Executing is the per-worker implementation loop. It picks the next actionable task, assembles a worker prompt, dispatches a subagent to implement it, and reports results back.
执行是每个工作者的实现循环,它会选取下一个可执行任务,组装工作者提示词,调度subagent完成实现,并返回结果。

Key Terms

核心术语

  • current phase: the approved slice being implemented now
  • worker mode: this skill is being used by a worker inside a swarm, so it should implement directly
  • standalone mode: this skill is driving execution outside a swarm and may dispatch or implement directly depending on scope
  • reactive fix bead: a post-planning fix bead created by review, debugging, or instant routing rather than initial planning
  • current phase(当前阶段):当前正在实施的已批准工作切片
  • worker mode(工作者模式):该功能由swarm内的工作者调用,因此需要直接执行实现
  • standalone mode(独立模式):该功能在swarm外驱动执行,可根据工作范围调度任务或直接实现
  • reactive fix bead(响应式修复bead):由评审、调试或即时路由创建的计划后修复bead,而非初始规划生成的

Default Execution Loop

默认执行循环

  1. pick the next truly ready bead
  2. verify the bead spec is complete enough to execute
  3. reserve files and transition the bead cleanly
  4. assemble only the context needed for this bead
  5. dispatch if appropriate, otherwise implement directly
  6. run verification
  7. write the report artifact and update bead state
  8. loop, or hand off when the current phase is complete
Use
references/execution-operations.md
for the exact scheduling cascade, transition protocol, dispatch contract, and completion bookkeeping.
Two operating modes:
  • Worker mode (dispatched by
    beo-swarming
    ): Receives identity and epic ID from the orchestrator. Reports progress via Agent Mail. Implements code directly. Does NOT spawn sub-subagents.
  • Standalone mode (after
    beo-validating
    for ≤2 tasks): Acts as both dispatcher and executor. Reports progress via
    STATE.md
    . Can delegate implementation through the session's normal subagent/task mechanism, or implement directly for single-task features.
In both modes the loop is identical; the difference is how results are reported (Agent Mail vs
STATE.md
) and whether implementation is direct (worker mode) or delegated (standalone mode with multiple tasks).
Core principle: One task at a time. Implement, verify, report, loop.
Execution scope is always the currently approved phase. If planning mode is
multi-phase
, execution must not silently expand into later phases.
  1. 选取下一个完全就绪的bead
  2. 验证bead规范的完整度满足执行要求
  3. 预留文件并平滑切换bead状态
  4. 仅组装该bead所需的上下文
  5. 合适的情况下调度任务,否则直接实现
  6. 执行验证
  7. 编写报告产物并更新bead状态
  8. 循环执行,或在当前阶段完成后移交工作
具体的调度层级、状态切换协议、调度契约和完成台账请参考
references/execution-operations.md
两种运行模式:
  • Worker mode(工作者模式)(由
    beo-swarming
    调度):从编排器接收身份标识和epic ID,通过Agent Mail上报进度,直接实现代码,不生成二级subagent。
  • Standalone mode(独立模式)(用于
    beo-validating
    后任务数≤2的场景):同时承担调度者和执行者的角色,通过
    STATE.md
    上报进度,可通过会话常规的subagent/任务机制委派实现,也可针对单任务功能直接实现。
两种模式的执行循环完全一致,区别仅在于结果上报方式(Agent Mail 与
STATE.md
)以及实现方式是直接执行(工作者模式)还是委派执行(多任务的独立模式)。
核心原则:一次执行一个任务,按「实现→验证→上报→循环」流程推进。
执行范围始终限定在当前已批准阶段内,如果规划模式为
multi-phase
(多阶段),执行过程不得静默扩展到后续阶段。

Dispatch Modes and Fallbacks

调度模式与降级方案

When this skill says "dispatch a worker", use the session's normal subagent or task-execution mechanism. The exact tool name can vary by environment; the intent does not.
  • Worker mode: do not dispatch again; implement the claimed bead directly.
  • Standalone delegated mode: use when 2 or more ready beads exist and a worker-dispatch mechanism is available.
  • Standalone direct mode: use when only one bead is ready, or delegation overhead would exceed the benefit.
  • Fallback rule: if no subagent or task-dispatch mechanism is available, execute directly in standalone mode instead of inventing a pseudo-dispatch workflow.
Never block execution on finding a perfect dispatcher. Prefer direct execution over a vague or unreliable delegation path.
当本功能要求“调度工作者”时,请使用会话常规的subagent或任务执行机制,具体工具名称可随环境变化,但执行意图保持一致。
  • 工作者模式:无需再次调度,直接实现已认领的bead。
  • 独立委派模式:当存在2个及以上就绪bead且有可用的工作者调度机制时使用。
  • 独立直接模式:当仅存在1个就绪bead,或委派开销高于收益时使用。
  • 降级规则:如果没有可用的subagent或任务调度机制,直接在独立模式下执行,不要创建伪调度工作流。
永远不要为了寻找完美的调度器阻塞执行,优先选择直接执行,而非模糊或不可靠的委派路径。

Prerequisites

前置条件

Default checks:
bash
br show <EPIC_ID> --json
br dep list <EPIC_ID> --direction up --type parent-child --json
cat .beads/artifacts/<feature-name>/CONTEXT.md 2>/dev/null
cat .beads/artifacts/<feature-name>/plan.md 2>/dev/null
cat .beads/artifacts/<feature-name>/phase-contract.md 2>/dev/null
cat .beads/artifacts/<feature-name>/story-map.md 2>/dev/null
Load
references/execution-operations.md
for the exact prerequisite checks, current-phase scope verification, and epic-claim procedure.
<HARD-GATE> If the epic does not have the `approved` label, do not treat planning artifacts as implicit approval. First verify the label was not accidentally removed or the wrong epic was selected. If approval is genuinely missing, route to `beo-validating`. </HARD-GATE>
默认检查项:
bash
br show <EPIC_ID> --json
br dep list <EPIC_ID> --direction up --type parent-child --json
cat .beads/artifacts/<feature-name>/CONTEXT.md 2>/dev/null
cat .beads/artifacts/<feature-name>/plan.md 2>/dev/null
cat .beads/artifacts/<feature-name>/phase-contract.md 2>/dev/null
cat .beads/artifacts/<feature-name>/story-map.md 2>/dev/null
具体的前置条件检查、当前阶段范围验证和epic认领流程请参考
references/execution-operations.md
<HARD-GATE> 如果epic没有`approved`标签,不要将规划产物视为默认获批,首先确认标签不是被意外移除,或者选中了错误的epic,如果确实缺少审批,请流转到`beo-validating`。 </HARD-GATE>

The Execution Loop

执行循环

┌─→ Schedule (pick next task)
│        ↓
│   Dispatch (build prompt, launch worker)
│        ↓
│   Monitor (worker runs, returns result)
│        ↓
│   Update (record outcome, update bead)
│        ↓
│   Check (more tasks? blockers? done?)
│        ↓
└── Loop or Complete
┌─→ Schedule (pick next task)
│        ↓
│   Dispatch (build prompt, launch worker)
│        ↓
│   Monitor (worker runs, returns result)
│        ↓
│   Update (record outcome, update bead)
│        ↓
│   Check (more tasks? blockers? done?)
│        ↓
└── Loop or Complete

Phase 1: Select Next Task

阶段1:选择下一个任务

Load
references/execution-operations.md
for the scheduling cascade and task-selection procedure.
具体的调度层级和任务选择流程请参考
references/execution-operations.md

Phase 2: Pre-Dispatch Checks

阶段2:调度前检查

Load
references/execution-operations.md
for the exact pre-dispatch checks, stale-label cleanup, task-transition protocol, and current-phase scope check.
<HARD-GATE> If `.description` is empty, or is missing file scope AND verification criteria, stop and treat the bead as invalid for execution.
"Task <TASK_ID> has an empty or underspecified description. Route back to beo-planning or beo-validating to complete the bead spec."
Do not reconstruct the full spec from
plan.md
or
CONTEXT.md
; that produces low-quality worker output. If the gap is purely clerical and the intended spec already exists verbatim elsewhere in the bead package, restore it faithfully. Otherwise route back. </HARD-GATE>
具体的调度前检查、过期标签清理、任务切换协议和当前阶段范围检查请参考
references/execution-operations.md
<HARD-GATE> 如果`.description`为空,或同时缺少文件范围和验证标准,请停止执行,将该bead标记为无效执行对象。
“任务<TASK_ID>的描述为空或规格不全,请流转回beo-planning或beo-validating完善bead规范。”
不要从
plan.md
CONTEXT.md
重构完整规范,这会导致工作者输出质量低下。如果缺失内容仅为文书错误,且预期规范已完整存在于bead包的其他位置,请如实恢复,否则请流转回上游。 </HARD-GATE>

Bead Classes

Bead类别

Two classes of beads may reach execution:
ClassCreated ByStory Context RequiredMinimum Description
Planned execution beadbeo-planningYes (full story context block)Story context + file scope + steps + verification
Reactive fix beadbeo-reviewing (P1), beo-debugging, beo-router (instant)No (exempt)File scope + what to fix + verification
Reactive fix beads are exempt from the story context requirement because they are created after planning completes. They still require file scope and verification criteria.
可进入执行阶段的bead分为两类:
类别创建方是否需要需求上下文最低描述要求
规划执行beadbeo-planning是(完整需求上下文块)需求上下文 + 文件范围 + 执行步骤 + 验证标准
响应式修复beadbeo-reviewing(P1)、beo-debugging、beo-router(即时)否(豁免)文件范围 + 修复内容 + 验证标准
响应式修复bead豁免需求上下文要求,因为它们是在规划完成后创建的,但仍然需要提供文件范围和验证标准。

Transition to In-Progress

切换到进行中状态

Reserve files before editing (required in worker mode, recommended in standalone mode). Use Agent Mail
file_reservation_paths
or coordinate via the file convention your project uses. Do not edit files without reserving them first.
Follow the canonical transition sequence in
references/execution-operations.md
.
编辑前请先预留文件(工作者模式下必填,独立模式下推荐),使用Agent Mail
file_reservation_paths
或按照项目使用的文件约定进行协调,未预留文件前不得编辑文件。
请遵循
references/execution-operations.md
中的规范状态切换流程。

Phase 3: Worker Prompt Assembly

阶段3:组装工作者提示词

Build the complete worker prompt for the subagent. The prompt includes current-phase exit state, story context, plan summary, task spec, relevant
CONTEXT.md
decisions, previous task results, and verification criteria.
Minimum prompt payload:
  • the full bead spec
  • the current-phase exit state
  • only the relevant story context
  • only the relevant
    CONTEXT.md
    decisions
  • only the prior task results this bead actually depends on
  • the verification criteria
See
references/worker-prompt-guide.md
for the full prompt template, data gathering commands, and budget truncation rules.
Key rule: Never truncate the task spec itself; that is the core payload.
为subagent组装完整的工作者提示词,提示词包含当前阶段退出状态、需求上下文、规划摘要、任务规范、
CONTEXT.md
中的相关决策、之前的任务结果以及验证标准。
提示词最低负载要求:
  • 完整的bead规范
  • 当前阶段退出状态
  • 仅相关的需求上下文
  • CONTEXT.md
    中的相关决策
  • 仅该bead实际依赖的前置任务结果
  • 验证标准
完整的提示词模板、数据收集命令和上下文预算截断规则请参考
references/worker-prompt-guide.md
核心规则:永远不要截断任务规范本身,这是核心负载。

Phase 4: Worker Dispatch

阶段4:工作者调度

Standalone mode only: in worker mode, implement the task directly (skip to Phase 5 after implementation).
Load
references/execution-operations.md
for the canonical dispatch contract and worker-report expectations.
仅独立模式适用:工作者模式下直接实现任务(实现完成后跳转到阶段5)。
规范的调度契约和工作者上报要求请参考
references/execution-operations.md

Phase 5: Post-Worker Update

阶段5:工作者执行后更新

After the worker returns, update the bead graph.
Load
references/execution-operations.md
for the status-mapping quick table, report-artifact write pattern, and flush sequence.
工作者返回结果后,更新bead图谱。
状态映射速查表、报告产物写入规则和刷新流程请参考
references/execution-operations.md

Phase 6: Progress Check

阶段6:进度检查

After each worker completes, load
references/execution-operations.md
for the canonical progress-check commands and decision table.
每个工作者执行完成后,规范的进度检查命令和决策表请参考
references/execution-operations.md

Blocker Handling

阻塞处理

When a task reports blocked, follow the classification and resolution protocol in
references/blocker-handling.md
. Key steps: understand the blocker, classify it (missing dependency / external / scope / ambiguous / technical), ask the user for a decision, then resume from Phase 1.
当任务上报阻塞时,请遵循
references/blocker-handling.md
中的分类和解决协议,核心步骤:了解阻塞原因、分类(依赖缺失/外部依赖/范围问题/描述模糊/技术问题)、请求用户决策,然后从阶段1重新开始。

Completion

完成

When all current-phase tasks under the epic are closed, first verify that the phase exit state now appears true in practice, then load
references/execution-operations.md
for the final verification steps and canonical completion behavior for swarming mode vs single-worker mode.
Announce:
text
Current-phase execution complete.
- <N>/<total> tasks completed successfully
- Build: <pass/fail>
- Tests: <pass/fail>
If
planning_mode = single-phase
and no later phases remain, load
beo-reviewing
for quality verification and feature completion.
If
planning_mode = multi-phase
and later phases remain, route back through the planning-aware flow instead of claiming the whole feature is complete.
当epic下所有当前阶段任务都关闭后,首先验证阶段退出状态是否实际已满足,然后参考
references/execution-operations.md
中的最终验证步骤,以及swarm模式与单工作者模式下的规范完成行为。
输出提示:
text
Current-phase execution complete.
- <N>/<total> tasks completed successfully
- Build: <pass/fail>
- Tests: <pass/fail>
如果
planning_mode = single-phase
且无后续阶段,进入
beo-reviewing
进行质量验证和功能收尾。
如果
planning_mode = multi-phase
且存在后续阶段,请流转回支持规划的流程,不要宣称整个功能已完成。

Context Budget

上下文预算

If context usage exceeds 65%, load
references/execution-operations.md
and follow the checkpoint procedure for the current operating mode.
如果上下文使用率超过65%,请参考
references/execution-operations.md
,遵循当前运行模式对应的检查点流程。

Post-Compaction Recovery

上下文压缩后恢复

If you detect that context has been compacted (prior conversation is summarized), follow the recovery procedure in
references/execution-guardrails.md
to re-read
CONTEXT.md
,
approach.md
, current-phase context, and task state before resuming.
如果检测到上下文已被压缩(之前的对话被摘要),请遵循
references/execution-guardrails.md
中的恢复流程,重新读取
CONTEXT.md
approach.md
、当前阶段上下文和任务状态后再恢复执行。

Red Flags & Anti-Patterns

风险警示与反模式

See
references/execution-guardrails.md
for the complete red flags and anti-patterns tables.
完整的风险警示和反模式表格请参考
references/execution-guardrails.md