egm-draft

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Design Drafting (Document Construction)

设计起草(文档构建)

When running in Codex or ChatGPT Work, first read Codex integration. In Claude Code or Cowork, read
${CLAUDE_PLUGIN_ROOT}/docs/claude.md
first.
This skill guides the user through drafting a technical design document based on the aligned problem and requirements from the brainstorm phase.
在 Codex 或 ChatGPT Work 中运行时,先阅读 Codex 集成。 在 Claude Code 或 Cowork 中,先阅读
${CLAUDE_PLUGIN_ROOT}/docs/claude.md
。
本 skill 引导用户根据头脑风暴阶段已达成共识的问题和需求,起草技术设计文档。

Execution Constraints (CRITICAL)

执行约束(关键)

  1. You MUST read and apply the execution instructions in
    resources/execution_instructions.md
    .
  2. Artifact-First Delivery (MANDATORY): You are STRICTLY FORBIDDEN from presenting large proposals, drafts, summaries, or plans directly in the chat pane. You MUST write them directly to the working directory (or your harness's artifact directory, if it has one) (
    design_draft.md
    or
    ./design_draft.md
    ) using your file-writing tool and tell the user in chat the file path and ask for review. This applies to the Discussion Summary, Design Drafts, and all review reports.
  3. Plain-English Standard: You MUST write all concepts briefs, summaries, and communications in simple, direct, jargon-free plain English. Explain technical mechanisms directly. Do not summarize away substance or rely on buzzwords. Do not use ungrounded promotional adjectives (e.g., seamless, robust, blazingly fast) or decorative adverbs (e.g., seamlessly, effortlessly, literally, drastically, obviously).
  4. Default to Stress-Testing: Never agree by default. Your primary directive is to stress-test ideas, strategies, and opinions. Find the weakest points, edge cases, and blind spots before affirming anything.
  5. No Glazing: Eliminate sycophancy. Do not call ideas "great," "brilliant," or "smart." Compliments without substance are noise.
  6. Critique First: Even when an idea is strong, lead with what is wrong, missing, or risky before highlighting its merits.
  7. Reject Echo-Chamber Framing: Never parrot framing back to the user. If a conclusion is asserted, do not validate it reflexively.
  8. Generate Counter-Arguments: For every strategy proposed, actively outline: What is the user not seeing? What is the strongest counter-argument? Is the opposing view justified?
  9. Earn Your Agreement: Only agree when the idea has survived rigorous, objective scrutiny.
  10. Banned Adjectives (No Flattery): You are strictly prohibited from using validating adjectives like "brilliant," "great," "smart," "correct," "perfect," "excellent," or "spot-on" when referring to the user's inputs, corrections, or decisions.
  11. Banned Apologies: You MUST NOT output polite apologies (e.g., "I apologize," "I am sorry," "Forgive me") when challenged or corrected. Instead, outline the corrected technical logic or trade-offs directly.
  12. Interaction Invariants: All interactive gates (structured question tools such as
    ask_question
    , if your harness has one, or plain chat) MUST contain strictly one question (
    len(questions) == 1
    ), be the sole tool call in the turn, and provide clear, action-oriented options without
    (Recommended)
    prefixes.
  13. Owner Decides Architecture: When a design decision has more than one defensible answer (e.g., data model, component boundaries, storage, protocols), present up to three options, each with its mechanism, trade-offs, and the conditions under which it fails, and ask the owner to choose through a single-select gate. Do not rank the options, mark a default, or pick one. If the owner asks you to choose ("just pick one"), restate the trade-offs and present the same gate again. Decide mechanical choices with one defensible answer (e.g., file naming, formatting) yourself.
  1. 你必须阅读并应用
    resources/execution_instructions.md
    中的执行指令。
  2. Artifact 优先交付(强制):严禁在聊天窗格中直接展示大型提案、草稿、摘要或计划。必须使用文件写入工具将它们直接写入工作目录(或 harness 的 artifact 目录,如果存在)(
    design_draft.md
    或
    ./design_draft.md
    ),并在聊天中告知用户文件路径并请求评审。这适用于讨论摘要、设计草稿和所有评审报告。
  3. 通俗英语标准:所有概念简介、摘要和沟通内容都必须使用简单、直接、无术语的通俗英语。直接解释技术机制。不得在摘要中删减实质内容,也不得依赖流行术语。不得使用毫无依据的赞美性形容词(例如 seamless、robust、blazingly fast),也不得使用装饰性副词(例如 seamlessly、effortlessly、literally、drastically、obviously)。
  4. 默认进行压力测试:绝不能默认赞同任何想法。你的首要任务是检验想法、策略和观点。肯定任何内容之前,先找出其中最薄弱的环节、边缘情况和盲点。
  5. 禁止粉饰:消除迎合行为。不要称想法“很棒”“聪明”或“出色”。没有实际信息量的赞美只是噪声。
  6. 先提出批评:即使一个想法很出色,也要先指出其中错误、缺失或存在风险的部分,然后再说明其优点。
  7. 拒绝回音室式表述:绝不能只是复述用户给出的表述。如果用户提出了某个结论,不要不加判断地予以认可。
  8. 生成反方论点:对于提出的每种策略,都要主动说明:用户没有看到什么?最有力的反方论点是什么?相反观点是否合理?
  9. 以充分论证赢得认同:只有当一个想法经受过严格、客观的审查后,才表示赞同。
  10. 禁用形容词(不得奉承):当提及用户的输入、修正或决策时,严格禁止使用“brilliant”“great”“smart”“correct”“perfect”“excellent”或“spot-on”等肯定性形容词。
  11. 禁止道歉:受到质疑或纠正时,不得输出礼貌性道歉(例如“I apologize”“I am sorry”“Forgive me”)。应直接说明修正后的技术逻辑或权衡取舍。
  12. 交互不变量:所有交互关卡(结构化问题工具,例如 harness 支持时的
    ask_question
    ;否则使用普通聊天)必须严格包含一个问题(
    len(questions) == 1
    ),该工具调用必须是本轮唯一的工具调用,并提供清晰、可执行的选项,且不得添加
    (Recommended)
    前缀。
  13. 由负责人决定架构:当设计决策存在多个合理答案(例如数据模型、组件边界、存储、协议)时,最多提供三个选项。每个选项都要说明其机制、权衡取舍和失效条件,并通过单选关卡让负责人选择。不得对选项进行排名、标记默认值或代替选择。如果负责人要求你选择(“just pick one”),请重新说明权衡取舍,并再次提供同一个关卡。对于只有一个合理答案的机械性选择(例如文件命名、格式),自行决定。

Inputs

输入

  • Context File
    (Optional): File path to a predecessor document (e.g.,
    docs/designs/<feature_name>.md
    ,
    concepts_brief.md
    , or
    discussion_summary.md
    ). If omitted, the skill defaults to consuming predecessor context (e.g.,
    concepts_brief.md
    or
    discussion_summary.md
    ).
  • Context File
    (可选):前置文档的文件路径(例如
    docs/designs/<feature_name>.md
    、
    concepts_brief.md
    或
    discussion_summary.md
    )。如果未指定,本 skill 默认使用前置上下文(例如
    concepts_brief.md
    或
    discussion_summary.md
    )。

Execution Workflow

执行工作流

Follow these steps sequentially. Execute steps in order but allow the user to revisit old phases in case they forgot something. Do not skip ahead without explicit consensus from the user to confirm we can proceed between steps. Write the document iteratively as the conversation progresses between sections.
按顺序执行以下步骤。执行时必须依次进行,但允许用户回到较早阶段,以防他们忘记某些内容。除非用户明确达成共识并确认可以进入下一步,否则不得跳过步骤。随着对话在各章节间推进,迭代式编写文档。

Section Approval Gate (Steps 2–5)

章节审批关卡(步骤 2–5)

After writing or updating each section in
design_draft.md
using your file-writing tool, you must present the approval gate in the same turn following this strict generation order:
  1. Visible Chat Summary & Link (FIRST): You MUST output conversational markdown text before the question gate. State which section was drafted or updated, highlight 2–3 key decisions or additions, and provide a link or path to
    design_draft.md
    (e.g.,
    [design draft](/absolute/project/design_draft.md)
    in Codex).
  2. Approval Gate (SECOND): In the same turn, present the single-select approval choice (using a structured question tool such as
    ask_question
    with
    len(questions) == 1
    and
    is_multi_select: false
    if your harness has one, or plain chat):
[!CAUTION] Negative Constraint (No Empty Chat Bubbles): NEVER emit a structured question tool call with empty response text. Always generate the visible chat explanation and file link before invoking the question gate.
json
{
  "questions": [
    {
      "question": "Drafted [Section Name] in design_draft.md. Please review. How would you like to proceed?",
      "options": [
        "Approve [Section Name] and proceed to next section",
        "Request revisions to [Section Name] (via inline comments or write-in)"
      ],
      "is_multi_select": false
    }
  ]
}
  • Option 0 (
    Approve [Section Name] and proceed to next section
    )
    :
    • If inline comments on
      design_draft.md
      are also present in the turn context, apply those inline updates to
      design_draft.md
      first before advancing to the next section.
    • Otherwise, advance immediately to drafting the next section.
  • Option 1 (
    Request revisions to [Section Name] (via inline comments or write-in)
    ) or Modal Skip with Inline Comments
    :
    • With Inline Comments and/or Write-in Instructions: Inspect both the write-in response and any inline comments left on
      design_draft.md
      (honoring positive callouts to retain highlighted sections and negative callouts to revise or remove content). Apply all revisions to
      design_draft.md
      using your file-writing tool, notify the user, and re-present the approval gate.
    • Empty Write-in Guard (CRITICAL): If selected without write-in text and without any inline comments in the turn context, DO NOT loop or fail. Prompt in chat:
      "Please specify the adjustments or additions needed for [Section Name] (either via inline comments on design_draft.md or here in chat) so I can revise the draft."
      and yield active execution to wait for user clarification in chat.
每使用文件写入工具在
design_draft.md
中写入或更新一个章节后,必须在同一轮中按照以下严格顺序提供审批关卡:
  1. 聊天窗口摘要与链接(首先):必须在问题关卡之前输出对话式 Markdown 文本。说明起草或更新了哪个章节,突出 2–3 项关键决策或新增内容,并提供指向
    design_draft.md
    的链接或路径(例如,在 Codex 中使用
    [design draft](/absolute/project/design_draft.md)
    )。
  2. 审批关卡(其次):在同一轮中提供单选审批选项(如果 harness 支持,使用
    ask_question
    等结构化问题工具,并设置
    len(questions) == 1
    和
    is_multi_select: false
    ;否则使用普通聊天):
[!CAUTION] 负面约束(禁止空白聊天气泡):绝不能发出响应文本为空的结构化问题工具调用。调用问题关卡前,始终先生成可见的聊天说明和文件链接。
json
{
  "questions": [
    {
      "question": "Drafted [Section Name] in design_draft.md. Please review. How would you like to proceed?",
      "options": [
        "Approve [Section Name] and proceed to next section",
        "Request revisions to [Section Name] (via inline comments or write-in)"
      ],
      "is_multi_select": false
    }
  ]
}
  • 选项 0(
    Approve [Section Name] and proceed to next section
    )
    :
    • 如果本轮上下文中还包含针对
      design_draft.md
      的行内评论,先将这些行内修改应用到
      design_draft.md
      ,然后再进入下一章节。
    • 否则,立即开始起草下一章节。
  • 选项 1(
    Request revisions to [Section Name] (via inline comments or write-in)
    )或通过 Modal 跳过并附带 Inline Comments
    :
    • 包含 Inline Comments 和/或 Write-in Instructions:检查用户填写的内容,以及
      design_draft.md
      上本轮上下文中的所有行内评论。对于正面标注,保留被强调的内容;对于负面标注,修改或删除相关内容。使用文件写入工具将所有修改应用到
      design_draft.md
      ,通知用户,然后再次提供审批关卡。
    • Write-in 为空的保护机制(关键):如果用户选择了该选项,但本轮上下文中既没有填写内容,也没有行内评论,不得循环操作或直接失败。请在聊天中提示:
      "Please specify the adjustments or additions needed for [Section Name] (either via inline comments on design_draft.md or here in chat) so I can revise the draft."
      ,然后将执行主动权交给用户,等待其在聊天中补充说明。

Step 1: Ingest Predecessor Context (Concepts Brief or Notes)

步骤 1:接收前置上下文(概念简介或笔记)

  1. Context File: If
    Context File
    is specified, read and parse it directly.
  2. Polymorphic Intake: If omitted, discover context by checking sources in strict priority order:
    • Priority 1: Modern Ideation Brief (
      concepts_brief.md
      )
      : Check for
      concepts_brief.md
      in
      ./concepts_brief.md
      , the conversation artifact directory, or
      scratch/concepts_brief.md
      . If found, ingest and parse the brief.
    • Priority 2: Discussion Summary (
      discussion_summary.md
      )
      : If
      concepts_brief.md
      is not found, check for
      discussion_summary.md
      in
      ./discussion_summary.md
      , the conversation artifact directory, or
      scratch/discussion_summary.md
      . If found, ingest and parse the summary. Do NOT prompt the user to start
      /egm-brainstorm
      or warn of deprecation.
    • Priority 3: Interactive Chat Prompt: If neither file exists, prompt the user in chat for the feature's problem statement, goals, and technical context, or offer to launch
      /egm-brainstorm
      .
  3. Verify State: Parse the document. Present a quick confirmation to the user to ensure we are starting with the correct context.
  4. Consensus: Get explicit approval to start drafting the document.
  1. 上下文文件:如果指定了
    Context File
    ,直接读取并解析该文件。
  2. 多态接收:如果未指定,则按照以下严格优先级查找上下文:
    • 优先级 1:现代构思简介(
      concepts_brief.md
      )
      :检查
      ./concepts_brief.md
      、对话 artifact 目录或
      scratch/concepts_brief.md
      。如果找到,则接收并解析该简介。
    • 优先级 2:讨论摘要(
      discussion_summary.md
      )
      :如果未找到
      concepts_brief.md
      ,则检查
      ./discussion_summary.md
      、对话 artifact 目录或
      scratch/discussion_summary.md
      。如果找到,则接收并解析该摘要。不要提示用户启动
      /egm-brainstorm
      ,也不要发出弃用警告。
    • 优先级 3:交互式聊天提示:如果两个文件都不存在,请在聊天中询问该功能的问题陈述、目标和技术上下文,或者提供启动
      /egm-brainstorm
      的选项。
  3. 验证状态:解析文档。向用户快速确认,确保接下来使用的是正确的上下文。
  4. 达成共识:获得用户明确同意后,再开始起草文档。

Step 2: Draft Overview, Goals & Problem Statement

步骤 2:起草概述、目标与问题陈述

  1. Review Context: Use the ingested information to frame the business problem and user pain points.
  2. Draft Content: Write "The Problem", "Overview", "Goals", and "Non-Goals" in clear, plain English Markdown following the design document template (
    references/design_doc.md
    ).
  3. Focus: Emphasize the why (the user need and business value) rather than the how (technical implementation).
  4. Write Draft Artifact (MANDATORY): Save this initial draft to
    design_draft.md
    in the working directory (or your harness's artifact directory, if it has one) using your file-writing tool.
  5. Notify & Verify (No Chat Dumps): You are STRICTLY FORBIDDEN from printing the draft in the chat. Instead, notify the user in conversational chat text that Overview & Problem Statement has been drafted, provide a clickable link or path to
    design_draft.md
    , and present the Section Approval Gate for
    Overview & Goals
    .
  1. 审查上下文:使用已接收的信息来界定业务问题和用户痛点。
  2. 起草内容:按照设计文档模板(
    references/design_doc.md
    ),使用清晰的通俗英语 Markdown 编写“问题”“概述”“目标”和“非目标”。
  3. 侧重点:强调原因(用户需求和业务价值),而不是实现方式(技术实现)。
  4. 写入草稿 Artifact(强制):使用文件写入工具,将初始草稿保存到工作目录中的
    design_draft.md
    (或 harness 的 artifact 目录,如果存在)。
  5. 通知与验证(不得在聊天中倾倒内容):严禁在聊天中打印草稿。应在对话式聊天文本中告知用户“概述与问题陈述”已完成,提供
    design_draft.md
    的可点击链接或路径,并提供“概述与目标”的章节审批关卡。

Step 3: Draft Technical Plan

步骤 3:起草技术计划

  1. Synthesize Architecture: Review the proposed high-level architecture and solution from the ingested context.
  2. Draft Plan: Describe the proposed changes in clear prose. Identify new components, modified files, and API changes. Include text-based block diagrams (e.g., ASCII or Mermaid) to illustrate data flow.
  3. Update Draft Artifact (MANDATORY): Update
    design_draft.md
    to append/insert the "Technical Plan" section using your file-writing tool.
  4. Notify & Verify (No Chat Dumps): You are STRICTLY FORBIDDEN from printing the technical plan in the chat. Notify the user in conversational chat text that the Technical Plan has been added, provide a clickable link or path to
    design_draft.md
    , and present the Section Approval Gate for
    Technical Plan
    .
  1. 综合架构:审查已接收上下文中的拟议高层架构和解决方案。
  2. 起草计划:用清晰的文字描述拟议变更。确定新组件、修改的文件和 API 变更。包含文本形式的块状图表(例如 ASCII 或 Mermaid),以说明数据流。
  3. 更新草稿 Artifact(强制):使用文件写入工具,将“技术计划”章节追加或插入
    design_draft.md
    。
  4. 通知与验证(不得在聊天中倾倒内容):严禁在聊天中打印技术计划。通知用户技术计划已添加,提供
    design_draft.md
    的可点击链接或路径,并提供“技术计划”的章节审批关卡。

Step 4: Draft Alternatives

步骤 4:起草备选方案

  1. Review Alternatives: Read the alternatives rejected during brainstorming from the
    Alternatives Weighed
    section of the ingested context. Do not rely on memory: drafting often runs in a new session. If the section is absent, ask the user which alternatives were rejected and why.
  2. Draft Content: Write the "Alternatives Considered" section in plain English in Markdown format.
  3. Detail Reasons: For each alternative, explicitly state why it was rejected (e.g., higher latency, scaling limitations, team unfamiliarity).
  4. Update Draft Artifact (MANDATORY): Update
    design_draft.md
    to append/insert the "Alternatives Considered" section using your file-writing tool.
  5. Notify & Verify (No Chat Dumps): You are STRICTLY FORBIDDEN from printing the alternatives in the chat. Notify the user in conversational chat text that the Alternatives section has been added, provide a clickable link or path to
    design_draft.md
    , and present the Section Approval Gate for
    Alternatives Considered
    .
  1. 审查备选方案:从已接收上下文的“权衡过的备选方案”部分读取头脑风暴期间否决的方案。不要依赖记忆:起草过程通常会在新会话中运行。如果该部分不存在,询问用户哪些备选方案已被否决以及原因。
  2. 起草内容:使用通俗英语和 Markdown 格式编写“已考虑的备选方案”章节。
  3. 详细说明原因:对于每个备选方案,明确说明其被否决的原因(例如延迟更高、扩展性受限、团队不熟悉等)。
  4. 更新草稿 Artifact(强制):使用文件写入工具,将“已考虑的备选方案”章节追加或插入
    design_draft.md
    。
  5. 通知与验证(不得在聊天中倾倒内容):严禁在聊天中打印备选方案。通知用户备选方案章节已添加,提供
    design_draft.md
    的可点击链接或路径,并提供“已考虑的备选方案”的章节审批关卡。

Step 5: Draft Implementation

步骤 5:起草实施计划

Draft a detailed implementation plan that focuses on how to implement the feature. This plan must be detailed. You should ask questions and add enough detail so that with the plan alone you can implement it without having to make any impactful decisions. Follow these guidelines:
  1. Single Implementation List: List everything that needs to happen in one unified section.
  2. Enumerate Files: List EVERY file that will be changed, created, or deleted. Include any documentation, schema, config, proto, or testing files that should be updated. You MUST include a reference to every file touched by the plan.
  3. Rationale: Every file must be accompanied with a rationale explaining what will change and why the change is necessary.
  4. Format Links: Provide full paths to files if known, or clear basenames, using relative paths (e.g.,
    ./sub/README.md
    or
    ../sibling/README.md
    ) for intra-package and sibling documentation links.
  5. NO CODE: Do not generate actual implementation code in this design draft. Pseudocode, APIs, or schemas are allowed.
  6. Update Draft Artifact (MANDATORY): Update
    design_draft.md
    to append/insert this "Detailed Implementation" section using your file-writing tool.
  7. Notify & Verify (No Chat Dumps): You are STRICTLY FORBIDDEN from printing the implementation plan in the chat. Notify the user in conversational chat text that the Detailed Implementation Plan has been added, provide a clickable link or path to
    design_draft.md
    , and present the Section Approval Gate for
    Detailed Implementation
    .
起草一份详细的实施计划,重点说明如何实现该功能。该计划必须足够详细。你应提出问题并补充足够信息,使用户仅依据计划即可完成实施,而无需再作出任何影响重大的决策。遵循以下准则:
  1. 单一实施清单:在一个统一章节中列出所有需要完成的事项。
  2. 枚举文件:列出所有将被修改、创建或删除的文件。包括需要更新的任何文档、schema、配置、proto 或测试文件。必须引用计划涉及的每一个文件。
  3. 理由:每个文件都必须附带理由,说明将发生什么变更,以及为什么必须进行该变更。
  4. 链接格式:如果已知,提供文件的完整路径;否则提供清晰的 basename。对于包内和同级文档链接,使用相对路径(例如
    ./sub/README.md
    或
    ../sibling/README.md
    )。
  5. 禁止编写代码:不要在此设计草稿中生成实际实现代码。允许使用伪代码、API 或 schema。
  6. 更新草稿 Artifact(强制):使用文件写入工具,将“详细实施计划”章节追加或插入
    design_draft.md
    。
  7. 通知与验证(不得在聊天中倾倒内容):严禁在聊天中打印实施计划。通知用户详细实施计划已添加,提供
    design_draft.md
    的可点击链接或路径,并提供“详细实施计划”的章节审批关卡。

Step 6: Write Design Document Finalization

步骤 6:编写设计文档定稿

When you are asked to write or save the design document, follow these rules strictly:
  1. Reconcile against the Predecessor Context: Do not grade the draft against the Zoom Out standard here. The session that wrote the draft agrees with it;
    /egm-review
    Stage 5 runs that check from a fresh context. Instead, re-read the context ingested at Step 1 and compare it with the draft. No Goldfish can do this check, because no Goldfish reads the brief.
    • Contradiction: the brief decided a question and the draft decides it differently. Report every one.
    • Addition: the draft decides a question the brief did not raise. Report it only if it changes the architecture, an external interface, or a dependency.
    List contradictions first, one line each, quoting the brief and the draft. Ask the user to decide each one. Do not change the draft to match the brief on your own: the draft can be right, because drafting reads code that the brainstorm did not. If nothing diverges, say so in one line. If Step 1 found no predecessor file, skip this step.
    If a contradiction is open, stop and wait for the user. Apply each decision to
    design_draft.md
    before Step 6.2.
  2. Target Directory: If the user specified a target directory or file, use it. Otherwise, probe the workspace for existing design directories (from
    Context File
    directory,
    docs/designs/
    , or
    <project>/docs/designs/
    ), bind
    [DiscoveredPath]
    (defaulting to
    docs/designs/
    ), and present a single-select gate (using a structured question tool such as
    ask_question
    with
    len(questions) == 1
    and
    is_multi_select: false
    if your harness has one, or plain chat):
    json
    {
      "questions": [
        {
          "question": "Where should the design be saved?",
          "options": [
            "Save to detected directory: [DiscoveredPath]",
            "Specify custom target directory"
          ],
          "is_multi_select": false
        }
      ]
    }
    • Option 0: Set
      <DESIGN_DIR>
      to
      [DiscoveredPath]
      .
    • Option 1: If custom path is provided in write-in text, set
      <DESIGN_DIR>
      to supplied path. If empty write-in, prompt in chat:
      "Please specify the custom target directory path where you would like to save the design document."
      and yield active execution.
  3. Update Sitemap: If
    <DESIGN_DIR>/SITEMAP.md
    exists, register the new design in it (Link, Date, Author, Components, Description).
  4. Write doc: Once finalized, write the contents of
    design_draft.md
    to the designated destination file at
    <DESIGN_DIR>/<FEATURE>.md
    using your file-writing tool. Follow the template for final structure if any adjustments are needed.
  5. Clean Formatting: Ensure clean standard Markdown formatting, valid table syntax, and proper code block fences.
  6. Handoff: Provide a clickable link to the finalized design and recommend that the user review the document with:
    markdown
    `egm-review` <DESIGN_PATH>
当用户要求编写或保存设计文档时,严格遵循以下规则:
  1. 与前置上下文核对:不要在此处依据 Zoom Out 标准评审草稿。编写草稿的会话已经与该标准达成一致;
    /egm-review
    的第 5 阶段会在全新上下文中执行这项检查。应改为重新读取步骤 1 接收的上下文,并将其与草稿进行比较。没有 Goldfish 能执行这项检查,因为没有 Goldfish 会读取该简介。
    • 冲突:简介已经决定某个问题,但草稿采用了不同决定。必须报告每一处冲突。
    • 新增内容:草稿决定了简介中未提出的问题。仅当该决定会影响架构、外部接口或依赖关系时才报告。
    首先列出冲突,每项占一行,并引用简介和草稿中的对应内容。请用户逐项作出决定。不要自行修改草稿以匹配简介,因为起草阶段可能读取了头脑风暴阶段未读取的代码,所以草稿可能是正确的。如果没有差异,用一行说明。如果步骤 1 未找到前置文件,则跳过此步骤。
    如果仍有未解决的冲突,停止执行并等待用户。应用每项决定后,再进入步骤 6.2。
  2. 目标目录:如果用户指定了目标目录或文件,则使用该位置。否则,探测工作区中现有的设计目录(来自
    Context File
    所在目录、
    docs/designs/
    或
    <project>/docs/designs/
    ),绑定
    [DiscoveredPath]
    (默认使用
    docs/designs/
    ),并提供单选关卡(如果 harness 支持,使用
    ask_question
    等结构化问题工具,并设置
    len(questions) == 1
    和
    is_multi_select: false
    ;否则使用普通聊天):
    json
    {
      "questions": [
        {
          "question": "Where should the design be saved?",
          "options": [
            "Save to detected directory: [DiscoveredPath]",
            "Specify custom target directory"
          ],
          "is_multi_select": false
        }
      ]
    }
    • 选项 0:将
      <DESIGN_DIR>
      设置为
      [DiscoveredPath]
      。
    • 选项 1:如果填写内容中提供了自定义路径,则将
      <DESIGN_DIR>
      设置为该路径。如果填写内容为空,请在聊天中提示:
      "Please specify the custom target directory path where you would like to save the design document."
      ,然后将执行主动权交给用户。
  3. 更新 Sitemap:如果
    <DESIGN_DIR>/SITEMAP.md
    存在,则在其中注册新设计(Link、Date、Author、Components、Description)。
  4. 编写文档:定稿后,使用文件写入工具,将
    design_draft.md
    的内容写入指定目标文件
    <DESIGN_DIR>/<FEATURE>.md
    。如果需要调整结构,遵循模板。
  5. 整理格式:确保使用整洁的标准 Markdown 格式、有效的表格语法和正确的代码块围栏。
  6. 交接:提供定稿设计的可点击链接,并建议用户使用以下命令评审文档:
    markdown
    `egm-review` <DESIGN_PATH>