implement-outline

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Implement a Structure Outline

实现结构大纲

Orchestrate implementation directly from a structure outline in
.agent-work/tasks/
. The outline supplies intent and signatures; the
outline-implementer-agent
writes the code. Keep every phase behind a verification gate.
直接根据
.agent-work/tasks/
中的结构大纲编排实现过程。大纲提供意图和签名;由
outline-implementer-agent
编写代码。每个阶段都必须经过相应的验证关卡。

Modes

模式

  • One phase is the default. Stop at the human gate before committing or starting another phase.
  • Consecutive phases apply only when the user names a range or explicitly asks to continue through multiple phases. Use a fresh implementer agent and an automated gate for every phase, then hold one human gate for the requested range.
  • Resume starts at the first phase without a
    ✅
    marker, using validation checkboxes to recover finer-grained progress. Treat completed work as valid unless the code, diff, or reported failure gives concrete reason to inspect it.
This skill is the orchestrator. Use the agent whose base name is
outline-implementer-agent
(the host may add a plugin namespace); the generic plan implementer is a different role. If that agent is unavailable, execute the same single-phase contract inline: reread the outline and companion documents, limit edits to that phase, run its automated checks, and return the same accounting. Start each later phase from a fresh reread rather than carrying unstated conclusions forward.
  • 单阶段是默认模式。在提交或开始另一个阶段之前,停在人工关卡处。
  • 连续阶段仅在用户指定范围或明确要求连续完成多个阶段时使用。每个阶段都使用全新的实现 Agent 和自动关卡,然后在所请求的整个范围末尾设置一个统一的人工关卡。
  • 恢复从第一个不含
    ✅
    标记的阶段开始,使用验证复选框恢复更细粒度的进度。除非代码、diff 或已报告的失败提供了需要检查的具体理由,否则将已完成工作视为有效。
本 skill 是编排器。使用基础名称为
outline-implementer-agent
的 Agent(宿主可能会添加插件命名空间);通用的 plan implementer 属于不同角色。如果该 Agent 不可用,则以内联方式执行相同的单阶段约定:重新阅读大纲和配套文档,将编辑范围限制在该阶段内,运行其自动检查,并返回相同的执行结果汇总。每个后续阶段都应从重新阅读开始,而不是沿用未言明的结论。

Steps

步骤

1. Establish the run

1. 确定运行上下文

Require a task directory or structure-outline path. Resolve its task directory, then run
ls -La .agent-work/tasks/<task-slug>
because that path may be a symlink. An exact outline path selects that file; otherwise identify the single
*-structure-outline.md
file. Locate every available ticket or task, research, design-discussion, PRD, and TDD document. Ask the user to resolve a missing or ambiguous outline.
Read the repository instructions, outline, and all discovered companion documents in full. Repository instructions constrain work in the checkout; resolve conflicts among task artifacts in this order:
  1. structure outline
  2. TDD
  3. PRD
  4. design discussion
  5. research
  6. ticket or task
Inspect the current branch/worktree and working-tree changes. Implementation runs in the current checkout: preserve pre-existing changes, create or switch no worktree, and exclude
.agent-work/tasks/
from commits because it points to the artifact repository. Select the phase or explicit phase range according to the mode above, confirm that each dependency is either already complete or is an earlier phase inside the selected ordered range, and identify the code paths and symbols each selected phase expects to affect.
Complete when: exactly one outline, every applicable repository instruction, every available companion document, the current git state, the execution mode, and every selected phase are known; every selected phase has dependencies that are already satisfied or will be satisfied earlier in the same ordered run, and an accounted-for implementation surface.
需要一个任务目录或结构大纲路径。确定其任务目录后,运行
ls -La .agent-work/tasks/<task-slug>
,因为该路径可能是符号链接。准确的大纲路径用于选定对应文件;否则,识别唯一的
*-structure-outline.md
文件。查找所有可用的 ticket 或 task、research、design discussion、PRD 和 TDD 文档。请用户补充缺失或存在歧义的大纲。
完整阅读仓库指令、大纲以及所有已发现的配套文档。仓库指令约束当前 checkout 中的工作;如果任务资料之间存在冲突,按以下顺序解决:
  1. 结构大纲
  2. TDD
  3. PRD
  4. 设计讨论
  5. 研究
  6. ticket 或 task
检查当前分支、worktree 和工作区更改。实现工作在当前 checkout 中进行:保留预先存在的更改,不创建或切换 worktree,并将
.agent-work/tasks/
排除在提交之外,因为该路径指向制品仓库。根据上述模式选定阶段或明确的阶段范围,确认每个依赖项要么已经完成,要么是所选有序范围内更早的阶段,并确定每个选定阶段预计影响的代码路径和符号。
完成条件: 已确定唯一的大纲、所有适用的仓库指令、所有可用的配套文档、当前 git 状态、执行模式以及每个选定阶段;每个选定阶段的依赖项均已满足,或会在同一次有序运行中更早的阶段得到满足;并且已明确核算实施范围。

2. Delegate one phase

2. 委派单个阶段

Before each selected phase, verify that its dependencies now pass: a dependency inside the requested range counts only after that earlier phase passed its automated gate. Then launch a fresh
outline-implementer-agent
for the phase, or use the inline fallback described above. For delegation, keep the prompt compact: provide the exact outline path, all companion-document paths, the phase number, the precedence rule, and this contract:
text
Implement only Phase <N> from <outline-path>.
Read these companion documents for context: <paths>.
The structure outline wins conflicts. Use its intent and signatures to write
the implementation, adapting only where the repository requires it.
Run every automated validation item for this phase. Mark a validation checkbox
[x] only when that check passes. Leave manual items and the phase-title ✅ for
human confirmation. Return changed files, automated results, manual checks, and
any mismatch. Stop after this phase.
Let the agent read the documents; repeating their contents in the prompt wastes context and risks creating a second source of truth.
Complete when: the phase's dependencies pass and one fresh agent or inline execution pass has attempted exactly that phase and returned an exhaustive accounting of changed files, automated validation, remaining manual validation, and mismatches.
在每个选定阶段之前,先验证其依赖项此时已通过:请求范围内的依赖项,只有在此前阶段通过其自动关卡后才算通过。然后为该阶段启动全新的
outline-implementer-agent
,或使用上述内联回退方式。对于委派,保持提示词简洁:提供准确的大纲路径、所有配套文档路径、阶段编号、优先级规则以及以下约定:
text
Implement only Phase <N> from <outline-path>.
Read these companion documents for context: <paths>.
The structure outline wins conflicts. Use its intent and signatures to write
the implementation, adapting only where the repository requires it.
Run every automated validation item for this phase. Mark a validation checkbox
[x] only when that check passes. Leave manual items and the phase-title ✅ for
human confirmation. Return changed files, automated results, manual checks, and
any mismatch. Stop after this phase.
让 Agent 阅读文档;在提示词中重复其内容会浪费上下文,并可能造成第二个事实来源。
完成条件: 该阶段的依赖项已通过,并且一次全新的 Agent 或内联执行仅尝试执行了该阶段,并全面汇报了变更文件、自动验证、剩余人工验证和不匹配项。

3. Enforce the automated gate

3. 执行自动关卡

Review the agent's report and the actual diff. Account for every new or modified path, including generated files, and preserve every pre-existing change. Confirm that the implementation matches the phase's intent in the wider codebase, then run any phase validation command the agent omitted. After the last selected phase, run the repository's relevant broader integration checks. Record exact commands and outcomes.
Set
- [x]
only for automated checks that passed. A failing or unrun check stays unchecked. Route implementation defects back through an
outline-implementer-agent
for the same phase, then repeat this gate.
Use these failure branches:
  • Outline mismatch: report
    Expected
    ,
    Found
    , and
    Why this matters
    , then ask the user to choose the direction. If the outline itself is stale, hand off by recommending an explicit
    iterate-structure-outline
    invocation.
  • Environmental or unavailable check: report the command, failure, and unverified consequence; ask whether the user wants to resolve it or accept the documented gap. Acceptance records a gap and does not turn the checkbox into a pass.
  • Unexpected or overlapping change: identify the affected paths and pause for ownership guidance before modifying or staging them.
Complete when: every selected phase change is explained, every runnable automated validation item passes and is marked accurately, every unverified item has an explicit consequence, and the exact manual-validation list is ready.
审查 Agent 的报告和实际 diff。核算每个新增或修改的路径,包括生成文件,并保留每项预先存在的更改。确认实现符合该阶段在更广泛代码库中的意图,然后运行 Agent 遗漏的任何阶段验证命令。在最后一个选定阶段结束后,运行仓库中相关的更广泛集成检查。记录准确的命令和结果。
仅当自动检查通过时才设置
- [x]
。失败或未运行的检查必须保持未勾选。将实现缺陷退回同一阶段的
outline-implementer-agent
处理,然后重复此关卡。
使用以下失败分支:
  • 大纲不匹配: 报告
    Expected
    、
    Found
    和
    Why this matters
    ,然后请用户选择处理方向。如果大纲本身已过时,则建议显式调用
    iterate-structure-outline
    完成交接。
  • 环境问题或检查不可用: 报告命令、失败情况以及未经验证所带来的后果;询问用户希望解决该问题,还是接受已记录的缺口。接受缺口只会记录该缺口,不会将复选框标记为通过。
  • 意外更改或重叠更改: 确定受影响的路径,并在修改或暂存这些路径之前暂停,等待有关所有权的指导。
完成条件: 每个选定阶段的更改均已得到说明;每项可运行的自动验证均已通过并被准确标记;每项未验证项都有明确后果;并且准确的人工验证清单已准备就绪。

4. Cross the human gate

4. 通过人工关卡

For one-phase mode, report immediately. For consecutive-phase mode, repeat Steps 2–3 for each selected phase, retaining each phase's manual checklist, then report the whole requested range. Use this structure:
markdown
undefined
在单阶段模式下,立即报告。在连续阶段模式下,对每个选定阶段重复步骤 2–3,保留每个阶段的人工检查清单,然后报告整个请求范围。使用以下结构:
markdown
undefined

Phase <N> implementation summary

Phase <N> implementation summary

Implemented
  • <observable changes>
Automated verification
  • <command>
    — <result>
Manual verification required
  • <unchecked manual validation from the outline>
Ready for your manual-verification result and approval to commit. In one-phase mode, also ask for permission to continue to Phase <N+1>.

When several phases were requested, include one section per phase. If the user
reports a problem, delegate the correction to the outline implementer for the
affected phase and repeat the automated and human gates. After the user confirms
all manual items for a phase, mark those items complete and add `✅` to that phase
title. The marker means both automated and manual validation passed.

**Complete when:** the user has confirmed every manual item in the selected
phase or range, approved the resulting changes, and—when more phases remain
outside the selected range—explicitly permitted the next phase.
Implemented
  • <observable changes>
Automated verification
  • <command>
    — <result>
Manual verification required
  • <unchecked manual validation from the outline>
Ready for your manual-verification result and approval to commit. In one-phase mode, also ask for permission to continue to Phase <N+1>.

请求多个阶段时,每个阶段包含一个章节。如果用户报告问题,将修正工作委派给受影响阶段的 `outline-implementer-agent`,然后重复自动关卡和人工关卡。用户确认某阶段的所有人工检查项后,将这些项标记为完成,并在该阶段标题中添加 `✅`。该标记表示自动验证和人工验证均已通过。

**完成条件:** 用户已确认选定阶段或范围内的每个检查项,批准了由此产生的更改,并且当选定范围之外仍有更多阶段时,明确允许进入下一阶段。

5. Commit approved work

5. 提交获批工作

Reinspect the diff, stage only implementation files owned by the approved phase or range, and keep
.agent-work/tasks/
plus unrelated changes out of the commit. Create the commit only after the human gate. If commit creation fails, report the exact failure and retain the verified working tree for recovery.
Complete when: the approved implementation is committed, or a commit failure has been reported without losing or mis-staging work.
重新检查 diff,仅暂存由获批阶段或范围拥有的实现文件,并将
.agent-work/tasks/
及无关更改排除在提交之外。仅在通过人工关卡后创建 commit。如果创建 commit 失败,报告准确的失败原因,并保留已验证的 working tree 以供恢复。
完成条件: 获批实现已提交,或者提交失败已被报告,且工作未丢失或被错误暂存。

6. Continue or finish

6. 继续或结束

Return to Step 2 only for a phase the user already selected or explicitly approved. A partial run ends with the completed phase markers, commit, remaining phase, and next required gate clearly stated.
After the last outline phase, confirm that every phase title has
✅
, every validation item is complete, all approved implementation is committed, and the working tree contains no unexplained changes. Then read
references/implement_outline_final_answer.md
and render that handoff exactly, substituting real values and adding no separate summary.
Complete when: either the partial-run handoff identifies the next incomplete phase and gate, or the final-response reference has been rendered after every outline phase passed both verification gates and all approved work was committed.
仅当用户已经选择或明确批准某个阶段时,才返回步骤 2。部分运行结束时,应清楚列出已完成的阶段标记、commit、剩余阶段以及下一项所需关卡。
完成最后一个大纲阶段后,确认每个阶段标题均包含
✅
,每个验证项均已完成,所有获批实现均已提交,并且工作区中不存在无法解释的更改。然后读取
references/implement_outline_final_answer.md
,严格按其格式呈现交接内容,替换为真实值,并且不添加单独的摘要。
完成条件: 要么部分运行的交接结果明确指出下一个未完成阶段及其关卡,要么在所有大纲阶段均通过双重验证关卡且所有获批工作均已提交后,已按最终响应参考文件呈现交接内容。