comet-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseComet 阶段 2:深度设计(Design)
Comet Phase 2: In-depth Design (Design)
前置条件
Prerequisites
- 活跃 change 已存在(proposal.md、design.md、tasks.md)
- 无 Design Doc(下无对应文件)
docs/superpowers/specs/
- An active change exists (proposal.md, design.md, tasks.md)
- No Design Doc exists (no corresponding file under )
docs/superpowers/specs/
步骤
Steps
0. 入口状态验证(Entry Check)
0. Entry Check
执行入口验证:
bash
COMET_SEARCH_ROOTS=("." "$HOME/.claude/skills" "$HOME/.codex/skills" "$HOME/.cursor/skills")
COMET_STATE="${COMET_STATE:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-state.sh' -type f -print -quit 2>/dev/null)}"
COMET_GUARD="${COMET_GUARD:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-guard.sh' -type f -print -quit 2>/dev/null)}"
COMET_HANDOFF="${COMET_HANDOFF:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-handoff.sh' -type f -print -quit 2>/dev/null)}"
bash "$COMET_STATE" check <name> design验证通过后继续 Step 1。验证失败时脚本会输出具体失败原因。
Perform entry verification:
bash
COMET_SEARCH_ROOTS=("." "$HOME/.claude/skills" "$HOME/.codex/skills" "$HOME/.cursor/skills")
COMET_STATE="${COMET_STATE:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-state.sh' -type f -print -quit 2>/dev/null)}"
COMET_GUARD="${COMET_GUARD:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-guard.sh' -type f -print -quit 2>/dev/null)}"
COMET_HANDOFF="${COMET_HANDOFF:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-handoff.sh' -type f -print -quit 2>/dev/null)}"
bash "$COMET_STATE" check <name> designProceed to Step 1 after verification passes. The script will output specific failure reasons if verification fails.
1a. 生成 OpenSpec → Superpowers 交接包
1a. Generate OpenSpec → Superpowers Handoff Package
必须由脚本生成,不允许 agent 临场手写 summary 代替。
bash
bash "$COMET_HANDOFF" <change-name> design --write脚本会生成并记录:
openspec/changes/<name>/.comet/handoff/design-context.json
openspec/changes/<name>/.comet/handoff/design-context.md并在 写入:
.comet.yamlyaml
handoff_context: openspec/changes/<name>/.comet/handoff/design-context.json
handoff_hash: <sha256>默认交接包是 compact 可追溯摘录,不是 agent summary:
- :机器索引,包含 change、phase、canonical spec、source paths、hash
design-context.json - :供 Superpowers 阅读的上下文,包含脚本标记、source path、line range、sha256、确定性摘录
design-context.md - 超出摘录预算时标记 ,并保留 Full source 路径
[TRUNCATED]
如确实需要全文上下文,可显式运行:
bash
bash "$COMET_HANDOFF" <change-name> design --write --full交接包来源来自 OpenSpec open 阶段产物:
- :目标、动机、范围、非目标
proposal.md - :高层架构决策、方案约束
design.md - :初始任务边界
tasks.md - :delta 能力规格
specs/*/spec.md
Must be generated by script; agent-improvised summaries are not allowed.
bash
bash "$COMET_HANDOFF" <change-name> design --writeThe script will generate and record:
openspec/changes/<name>/.comet/handoff/design-context.json
openspec/changes/<name>/.comet/handoff/design-context.mdAnd write to :
.comet.yamlyaml
handoff_context: openspec/changes/<name>/.comet/handoff/design-context.json
handoff_hash: <sha256>The default handoff package is a compact, traceable excerpt, not an agent summary:
- : Machine index containing change, phase, canonical spec, source paths, hash
design-context.json - : Context for Superpowers reading, including script markers, source path, line range, sha256, deterministic excerpts
design-context.md - Mark when exceeding excerpt budget, and retain the Full source path
[TRUNCATED]
If full-text context is truly needed, explicitly run:
bash
bash "$COMET_HANDOFF" <change-name> design --write --fullThe handoff package comes from OpenSpec open-phase outputs:
- : Goals, motivations, scope, non-goals
proposal.md - : High-level architecture decisions, solution constraints
design.md - : Initial task boundaries
tasks.md - : Delta capability specifications
specs/*/spec.md
1b. 执行 Brainstorming(带上下文)
1b. Execute Brainstorming (with Context)
立即执行: 使用 Skill 工具加载 技能,ARGUMENTS 包含:
superpowers:brainstormingChange: <change-name>
OpenSpec Context Pack: openspec/changes/<name>/.comet/handoff/design-context.md
Machine handoff: openspec/changes/<name>/.comet/handoff/design-context.json
OpenSpec 产物是上游事实源,不要重新定义需求,不要重写 proposal/spec。
你的任务是基于交接包做深度技术设计:实现方案、技术风险、测试策略、边界条件。
如发现 OpenSpec delta spec 缺少验收场景,只能提出 Spec Patch,并回写 OpenSpec delta spec;不要在 Design Doc 中创建第二份需求 spec。
Design Doc frontmatter 必须最小化,只包含:
---
comet_change: <change-name>
role: technical-design
canonical_spec: openspec
---
跳过重复上下文探索,直接进入设计提问。禁止跳过此步骤,禁止在未加载该技能的情况下继续。
如 不可用,停止流程并提示安装或启用 Superpowers 技能,不要用普通对话替代该步骤。
superpowers:brainstorming技能加载后,按其指引产出设计方案(以对话形式呈现):
- 技术方案:架构、数据流、关键技术选型与风险
- 测试策略
- 如需补充验收场景,标明将回写的 delta spec 变更
brainstorming 阶段不写入 Design Doc 文件,仅产出设计方案供 Step 1c 用户确认。确认后才创建 并回写 delta spec。
docs/superpowers/specs/YYYY-MM-DD-<topic>-design.mdExecute immediately: Use the Skill tool to load the skill, with ARGUMENTS including:
superpowers:brainstormingChange: <change-name>
OpenSpec Context Pack: openspec/changes/<name>/.comet/handoff/design-context.md
Machine handoff: openspec/changes/<name>/.comet/handoff/design-context.json
OpenSpec outputs are upstream factual sources; do not redefine requirements or rewrite proposal/spec.
Your task is to conduct in-depth technical design based on the handoff package: implementation plan, technical risks, testing strategy, boundary conditions.
If you find that the OpenSpec delta spec lacks acceptance scenarios, you can only propose a Spec Patch and write back to the OpenSpec delta spec; do not create a second requirement spec in the Design Doc.
Design Doc frontmatter must be minimal, containing only:
---
comet_change: <change-name>
role: technical-design
canonical_spec: openspec
---
Skip repeated context exploration and directly proceed to design questions.Skipping this step is prohibited; do not proceed without loading this skill.
If is unavailable, stop the process and prompt to install or enable the Superpowers skill; do not use regular conversation as a substitute.
superpowers:brainstormingAfter loading the skill, produce the design plan in the form of dialogue as guided:
- Technical solution: Architecture, data flow, key technology selection and risks
- Testing strategy
- If acceptance scenarios need to be supplemented, mark the delta spec changes to be written back
No Design Doc file is written during the brainstorming phase; only the design plan is produced for user confirmation in Step 1c. Only after confirmation is created and the delta spec written back.
docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md1c. 用户确认设计方案(阻塞点)
1c. User Confirmation of Design Plan (Blocking Point)
brainstorming 产出设计方案后,必须暂停并等待用户明确确认设计方案。不得在用户确认前创建最终 Design Doc、写入 、运行 design guard,或进入 。
design_doc/comet-build暂停时只展示必要摘要:
- 采用的技术方案
- 关键取舍与风险
- 测试策略
- 如有 Spec Patch,列出将回写的 delta spec 变更
用户明确确认后,才继续 Step 2。若用户要求调整,继续 brainstorming 迭代,直到用户确认。
After the brainstorming produces the design plan, must pause and wait for explicit user confirmation of the design plan. Do not create the final Design Doc, write to , run the design guard, or enter before user confirmation.
design_doc/comet-buildOnly display necessary summaries when pausing:
- Adopted technical solution
- Key trade-offs and risks
- Testing strategy
- If there is a Spec Patch, list the delta spec changes to be written back
Proceed to Step 2 only after explicit user confirmation. If the user requests adjustments, continue brainstorming iterations until confirmation is obtained.
2. 更新 Comet 状态
2. Update Comet State
先记录 design_doc 路径。如果 Step 1c 回写了 delta spec(新增或修改了 ),必须重新生成 handoff 以更新 hash:
specs/*/spec.mdbash
undefinedFirst record the design_doc path. If Step 1c wrote back to the delta spec (created or modified ), the handoff must be regenerated to update the hash:
specs/*/spec.mdbash
undefined记录 design_doc 路径
Record design_doc path
bash "$COMET_STATE" set <name> design_doc docs/superpowers/specs/YYYY-MM-DD-topic-design.md
bash "$COMET_STATE" set <name> design_doc docs/superpowers/specs/YYYY-MM-DD-topic-design.md
如有 delta spec 变更,重新生成 handoff(更新 hash)
If delta spec changed, regenerate handoff (update hash)
bash "$COMET_HANDOFF" <change-name> design --write
bash "$COMET_HANDOFF" <change-name> design --write
自动流转到下一阶段
Automatically transition to next phase
bash "$COMET_GUARD" <change-name> design --apply
如果没有 delta spec 变更,跳过 handoff 重新生成步骤。状态文件自动更新,无需手动编辑其他字段。bash "$COMET_GUARD" <change-name> design --apply
If there are no delta spec changes, skip the handoff regeneration step. The state file is updated automatically; no need to manually edit other fields.退出条件
Exit Conditions
- Design Doc 已创建并保存
- Design Doc frontmatter 包含 、
comet_change、role: technical-designcanonical_spec: openspec - 和
handoff_context已写入handoff_hash(由 guard 强制校验).comet.yaml - 与当前 OpenSpec open 阶段产物一致(由 guard 强制校验)
handoff_hash - 必须是脚本生成,且包含 source path、mode、sha256 等可追溯标记(由 guard 强制校验)
design-context.md - 如有新能力或补充验收场景,OpenSpec delta spec 已创建/更新
- 已写入
design_doc.comet.yaml - 阶段守卫:运行 ,全部 PASS 后自动流转到
bash "$COMET_GUARD" <change-name> design --applyphase: build
退出前必须使用 :
--applybash
bash "$COMET_GUARD" <change-name> design --apply- Design Doc has been created and saved
- Design Doc frontmatter contains ,
comet_change,role: technical-designcanonical_spec: openspec - and
handoff_contexthave been written tohandoff_hash(enforced by guard validation).comet.yaml - matches the current OpenSpec open-phase outputs (enforced by guard validation)
handoff_hash - must be generated by script and contain traceable markers such as source path, mode, sha256 (enforced by guard validation)
design-context.md - If there are new capabilities or supplementary acceptance scenarios, the OpenSpec delta spec has been created/updated
- has been written to
design_doc.comet.yaml - Phase Guard: Run , and automatically transition to
bash "$COMET_GUARD" <change-name> design --applyafter all checks PASSphase: build
Must use before exiting:
--applybash
bash "$COMET_GUARD" <change-name> design --apply自动流转
Automatic Transition
退出条件满足后,无需等待用户再次输入,直接执行下一阶段:
REQUIRED NEXT SKILL: 调用skill 进入计划与构建阶段。comet-build
After meeting the exit conditions, no need to wait for user input again, directly execute the next phase:
REQUIRED NEXT SKILL: Invoke theskill to enter the planning and build phase.comet-build