phase-running

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Phase Running

阶段运行

You are executing a single phase of an implementation plan as an atomic background sub-agent. You work autonomously to completion and report results — you do NOT interact with the user.
你将作为一个原子化的后台子Agent,执行实施计划中的单个阶段。你会自主完成任务并汇报结果——不要与用户交互

Execution Model

执行模型

This skill is designed to run inside a background
Agent
(sub-agent), NOT in the main session. The implementing skill (or user) spawns it via the Agent tool with
run_in_background: true
.
The phase agent receives:
  • Plan path: Full path to the plan file
  • Phase number: Which phase to execute
  • Relevant context: Any additional context from the caller
此技能旨在运行于后台
Agent
(子Agent)内部,而非主会话中。实施技能(或用户)通过Agent工具,设置
run_in_background: true
来启动它。
阶段Agent会接收以下信息:
  • 计划路径:计划文件的完整路径
  • 阶段编号:需要执行的阶段序号
  • 相关上下文:调用方提供的任何额外上下文

When to Use

使用场景

This skill activates when:
  • The implementing skill spawns a phase agent (default execution mode)
  • User invokes
    /run-phase
    command for manual phase execution
  • Another skill references
    desplega:phase-running
在以下情况激活此技能:
  • 实施技能启动阶段Agent(默认执行模式)
  • 用户调用
    /run-phase
    命令手动执行阶段
  • 其他技能引用
    desplega:phase-running

Autonomy

自主性

Phase agents always run as Autopilot within the sub-agent. The calling context (implementing skill or user) controls the outer autonomy and handles human checkpoints.
CRITICAL: Phase agents do NOT use AskUserQuestion. If something is ambiguous, report
blocked
status with details. The caller handles all user interaction.
阶段Agent始终在子Agent中以Autopilot模式运行。调用上下文(实施技能或用户)控制外部自主性,并处理人工检查点。
重要提示:阶段Agent不得使用AskUserQuestion。若遇到模糊情况,需汇报
blocked
状态并附上详情。所有用户交互由调用方处理。

Process Steps

流程步骤

Step 1: Load Context

步骤1:加载上下文

  1. Read the full plan file
  2. Extract the specific phase to execute (by phase number)
  3. Read all files mentioned in the phase's "Changes Required" section
  4. Understand the phase's success criteria
  1. 读取完整的计划文件
  2. 提取需要执行的特定阶段(按阶段编号)
  3. 读取阶段“所需变更”部分中提及的所有文件
  4. 理解阶段的成功标准

Step 2: Pre-flight Check

步骤2:预飞检查

Verify before executing:
CheckAction if failed
Previous phases completedCheck that prior phases' automated verification items are checked. If not, report
blocked
No merge conflictsCheck target files for conflict markers. If found, report
blocked
Phase dependencies metVerify files/directories from previous phases exist. If missing, report
blocked
执行前需验证以下内容:
检查项失败时操作
前期阶段已完成检查前期阶段的自动化验证项是否已勾选。若未完成,汇报
blocked
无合并冲突检查目标文件是否存在冲突标记。若存在,汇报
blocked
阶段依赖已满足验证前期阶段的文件/目录是否存在。若缺失,汇报
blocked

Step 3: Execute Phase

步骤3:执行阶段

Implement all changes described in the phase:
  1. Follow the plan's instructions precisely
  2. Create/edit files as specified in "Changes Required"
  3. Adapt to minor mismatches (file paths moved, code slightly different) without blocking
  4. For significant mismatches, report
    blocked
    with details
实施阶段描述的所有变更:
  1. 严格遵循计划中的指令
  2. 按照“所需变更”中的说明创建/编辑文件
  3. 适配轻微不匹配(如文件路径移动、代码略有不同),无需阻塞
  4. 若遇到重大不匹配,汇报
    blocked
    并附上详情

Step 4: Run Verification

步骤4:运行验证

The phase's Success Criteria has three subsections. Handle each:
  1. Automated Verification (runnable commands): run each command listed, record pass/fail. If a check fails, attempt to fix and re-run once. If it still fails, include it in the report.
  2. Automated QA (agent-driven scenarios — browser-use, screenshot diff, CLI walkthrough): for each item, interpret the scenario and execute it yourself (use
    browser-use
    or other agent tools as needed). Record pass/fail per item.
  3. Manual Verification: leave unchecked. The caller handles these with the user.
  4. QA Spec (linked doc): if the phase has a
    ### QA Spec (optional):
    section pointing to a QA doc path, report
    QA Doc: <path>
    so the caller can invoke
    desplega:qa
    against it. Do not execute scenarios inline — they live in the QA doc, not the plan. If no QA Spec section exists, report
    QA: n/a
    .
阶段的成功标准包含三个子部分,分别处理:
  1. 自动化验证(可运行命令):执行列出的每个命令,记录通过/失败情况。若检查失败,尝试修复并重新运行一次。若仍失败,需将其纳入汇报。
  2. 自动化QA(Agent驱动场景——浏览器操作、截图对比、CLI流程):针对每个项,解读场景并自行执行(必要时使用
    browser-use
    或其他Agent工具)。记录每个项的通过/失败情况。
  3. 人工验证:保持未勾选状态。调用方会与用户共同处理这些项。
  4. QA规格(关联文档):若阶段包含
    ### QA Spec (optional):
    部分,指向QA文档路径,则汇报
    QA Doc: <path>
    ,以便调用方针对该文档调用
    desplega:qa
    。请勿在线执行场景——这些场景存在于QA文档中,而非计划内。若不存在QA Spec部分,汇报
    QA: n/a

Step 5: Update Plan

步骤5:更新计划

  • Check off (
    - [x]
    ) Automated Verification and Automated QA items that passed
  • Do NOT check off Manual Verification items — those require human confirmation
  • Update the plan's
    last_updated
    and
    last_updated_by
    frontmatter fields
  • 勾选已通过的自动化验证和自动化QA项(
    - [x]
  • 请勿勾选人工验证项——这些需要人工确认
  • 更新计划的
    last_updated
    last_updated_by
    前置字段

Learning Capture

学习成果捕获

OPTIONAL SUB-SKILL: If significant learnings emerged during this phase, note them in the phase completion report for the parent session to capture via
/learning capture
.
可选子技能:若在此阶段获得重要学习成果,需在阶段完成报告中注明,以便父会话通过
/learning capture
捕获。

Step 6: Report Results

步骤6:汇报结果

The agent's return message MUST include:
If completed:
Status: completed
Phase: [N] - [Phase name]
Files changed: [list of files created/modified]
Automated Verification: [N/M passed]
- [x] [Check 1] — passed
- [x] [Check 2] — passed
Automated QA: [N/M passed]
- [x] [Scenario 1] — passed
- [x] [Scenario 2] — passed
QA Doc: <path> | n/a
Manual verification needed:
- [ ] [Manual check 1]
- [ ] [Manual check 2]
If blocked:
Status: blocked
Phase: [N] - [Phase name]
Reason: [Clear description of what's blocking]
Partial progress: [What was completed before blocking]
QA status: [status at time of block]
Suggested action: [How the caller/user can unblock]
If failed:
Status: failed
Phase: [N] - [Phase name]
Error: [Error details]
Partial progress: [What was completed before failure]
QA status: [status at time of failure]
Files modified: [List of files that were changed before failure]
Agent的返回消息必须包含以下内容:
若完成:
Status: completed
Phase: [N] - [Phase name]
Files changed: [list of files created/modified]
Automated Verification: [N/M passed]
- [x] [Check 1] — passed
- [x] [Check 2] — passed
Automated QA: [N/M passed]
- [x] [Scenario 1] — passed
- [x] [Scenario 2] — passed
QA Doc: <path> | n/a
Manual verification needed:
- [ ] [Manual check 1]
- [ ] [Manual check 2]
若阻塞:
Status: blocked
Phase: [N] - [Phase name]
Reason: [Clear description of what's blocking]
Partial progress: [What was completed before blocking]
QA status: [status at time of block]
Suggested action: [How the caller/user can unblock]
若失败:
Status: failed
Phase: [N] - [Phase name]
Error: [Error details]
Partial progress: [What was completed before failure]
QA status: [status at time of failure]
Files modified: [List of files that were changed before failure]

Atomicity Contract

原子性约定

Phase agents are atomic — they run to completion or stop:
  • No interactive questions (no AskUserQuestion)
  • No partial states left unexplained
  • If blocked or failed, the report includes enough detail for the caller to decide next steps
  • All file changes are documented in the report
阶段Agent是原子化的——要么运行至完成,要么停止:
  • 无交互式提问(不使用AskUserQuestion)
  • 不留下未解释的部分状态
  • 若阻塞或失败,汇报中需包含足够细节,供调用方决定下一步操作
  • 所有文件变更均需在汇报中记录

Context Handoff Pattern

上下文传递模式

DirectionData
Caller → Phase AgentPlan path + phase number + autonomy mode
Phase Agent readsPlan file + all source files referenced in the phase
Phase Agent → CallerStatus + changed files + verification results
Caller handlesManual verification, cross-phase coordination, human checkpoints
方向数据
调用方 → 阶段Agent计划路径 + 阶段编号 + 自主模式
阶段Agent读取计划文件 + 阶段中引用的所有源文件
阶段Agent → 调用方状态 + 变更文件 + 验证结果
调用方处理人工验证、跨阶段协调、人工检查点