grill-then-plan
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<what-to-do>
Run a domain-aware design session, then hand off to the superpowers planning
pipeline. Do NOT write code, scaffold, or invoke any implementation skill until
the design spec is approved and you have invoked .
</what-to-do>sp-writing-plans<what-to-do>
开展一次领域感知式设计会话,随后将任务移交至superpowers规划流程。在设计规范获得批准且已调用之前,请勿编写代码、搭建脚手架或调用任何实现类Skill。
</what-to-do>sp-writing-plansStep 0 — Note if the upstream superpowers plugin is missing
步骤0 — 注意上游superpowers插件是否缺失
sp-writing-planssuperpowerssp-writing-planssp-executing-planssp-subagent-driven-developmentsuperpowers:finishing-a-development-branchsuperpowers:using-git-worktreesDetect by skill availability (harness-agnostic, plugin-agnostic): check
whether the superpowers skills (, ) appear in your
surfaced skill list or can be loaded.
writing-plansbrainstormingIf not detected, say one line before the first grilling question: the spec
and the plan will be written normally, but and
won't be available when the plan reaches execution — install
the plugin before then if the plan will need them. Then continue to
Step 1 regardless of the answer — this is a warning, not a wait.
finishing-a-development-branchusing-git-worktreessuperpowerssp-writing-planssuperpowerssp-writing-planssp-executing-planssp-subagent-driven-developmentsuperpowers:finishing-a-development-branchsuperpowers:using-git-worktrees检测方式:通过技能可用性检测(与工具、插件无关):检查superpowers技能(、)是否出现在已加载的技能列表中,或是否可被加载。
writing-plansbrainstorming若未检测到,在第一个研讨问题前说明一句:规范和计划会正常编写,但当计划进入执行阶段时,和将无法使用——如果计划需要这些功能,请在此之前安装插件。无论用户回应如何,均继续执行步骤1——这只是警告,无需等待。
finishing-a-development-branchusing-git-worktreessuperpowersStep 1 — Explore context
步骤1 — 探索上下文
Read the codebase, recent commits, and existing docs: /
at the repo root, and . If a exists,
the repo has multiple contexts — infer which one the topic relates to (ask if
unclear).
CONTEXT.mdCONTEXT-MAP.mddocs/adr/CONTEXT-MAP.md阅读代码库、近期提交记录及现有文档:仓库根目录下的 / ,以及目录。若存在,说明仓库包含多个上下文——推断当前主题关联哪个上下文(若不明确则询问用户)。
CONTEXT.mdCONTEXT-MAP.mddocs/adr/CONTEXT-MAP.mdStep 1a — Verify the cause first when planning a fix
步骤1a — 规划修复方案时先验证根因
If the plan exists to fix something that currently misbehaves — a bug, a
failure, wrong output, "it keeps breaking" — and the root cause is not yet
verified, do not start grilling. Grilling a fix design on top of an unverified
guess about why it breaks plans on sand. Hand off to debug-mantra to
establish the confirmed cause first, then return here and grill the fix design
against that verified truth.
Skip this guard — proceed straight to Step 2 — when either holds:
- The work is new (feature, refactor, redesign) with no malfunction behind it.
- The cause is already verified — e.g. you completed debug-mantra and it confirmed the cause (do not re-diagnose). Merely entering debug-mantra without a confirmed cause does not exempt you.
This is the symmetric partner to the forward debug chain (ADR 0003):
grill-then-plan verifies the cause first when planning a fix (ADR 0011). Either
way the invariant holds — never plan a fix on an unverified cause.
若计划是为了修复当前存在异常的问题——如Bug、故障、错误输出、"频繁崩溃"等——且根因尚未验证,请勿开始研讨。基于未经验证的故障原因猜测来研讨修复设计,如同在沙地上建计划。先将任务移交至debug-mantra以确认根因,之后再返回此处,基于已验证的事实研讨修复设计。
若满足以下任一条件,则跳过此校验环节,直接进入步骤2:
- 工作内容为新功能、重构或重新设计,无背后的故障问题。
- 根因已验证——例如已完成debug-mantra并确认根因(无需重新诊断)。仅进入debug-mantra但未确认根因的情况不适用此豁免。
这与正向调试链(ADR 0003)是对称互补的:研讨后规划流程在规划修复方案时会先验证根因(ADR 0011)。无论哪种情况,均需遵守不变规则——绝不要基于未经验证的根因规划修复方案。
Step 2 — Grill relentlessly, one question at a time
步骤2 — 持续研讨,一次一个问题
Interview the user about every aspect of the plan until you reach shared
understanding. Walk down each branch of the design tree, resolving dependencies
between decisions one-by-one. For each question, provide your recommended answer.
Ask one question at a time and wait for feedback before continuing. If a question
can be answered by exploring the codebase, explore the codebase instead of asking.
就计划的各个方面与用户沟通,直至达成共识。逐一梳理设计树的每个分支,逐个解决决策间的依赖关系。对于每个问题,给出你的推荐答案。一次只问一个问题,等待反馈后再继续。若问题可通过探索代码库得到答案,则直接探索代码库而非询问用户。
Step 2.5 - Ask in the user's terms, not the model's
步骤2.5 — 用用户的语言提问,而非模型的语言
The person answering knows the product, not necessarily the schema. Pose every
question in what they can see and do -- which screen, what they press, what
happens next -- and only then give the model-level backing. When two or more
paths are in play, a small table beats prose:
| where | what you press | what it writes | |
|---|---|---|---|
| A | the screen that exists today | the control already on it | a row owned by its parent |
| B | the screen we are changing | no such control exists yet - it is what we are adding | a row owned by nobody |
The table is the SHAPE, not the scope. The same framing fits a queue, a schema,
a CLI flag or a cron job: name the surface the user would actually observe,
whatever that surface is.
Then make the stake observable with one concrete walk-through: "you save an
item while working inside project X; three months later you delete project X;
today the item disappears from your library too." A user who cannot picture
the consequence cannot choose between the options.
Two tells that the FRAMING was wrong rather than the explanation: the answer
comes back as a question ("what do you mean?", "which step of the app is
this?"), or you needed entity names and ADR numbers just to state the options.
Re-pose it - do not re-explain it at greater length.
Put trade-off reasoning in the message body where it can actually be read;
keep option labels to a few words.
回答问题的人熟悉产品,但不一定熟悉模型的架构。每个问题都要从用户能看到和操作的角度提出——哪个界面、点击什么按钮、后续会发生什么——之后再给出模型层面的依据。当有多个方案可选时,用表格比 prose 更清晰:
| 所在位置 | 操作内容 | 写入内容 | |
|---|---|---|---|
| A | 当前已存在的界面 | 界面上已有的控件 | 归属于父级的一行数据 |
| B | 我们正在修改的界面 | 尚无此控件——这是我们要新增的内容 | 无归属的一行数据 |
表格是呈现形式,而非限定范围。同样的框架适用于队列、架构、CLI标志或定时任务:明确用户实际能观察到的界面,无论该界面是什么类型。
然后用一个具体的流程演示让影响可见:"你在项目X中保存了一个条目;三个月后你删除了项目X;现在该条目也从你的库中消失了。" 用户若无法想象后果,就无法在选项中做出选择。
若出现以下两种情况,说明提问框架有误而非解释不足:用户的回复是问题("你是什么意思?"、"这是应用的哪个步骤?"),或者你需要使用实体名称和ADR编号才能说明选项。此时应重新提问——不要长篇大论地重新解释。
将权衡推理放在消息正文中以便阅读;选项标签控制在几个词以内。
Step 3 — Stay domain-aware while grilling
步骤3 — 研讨时保持领域感知
- Challenge against the glossary. If a term conflicts with , call it out: "Your glossary defines X as A, but you seem to mean B — which is it?"
CONTEXT.md - Sharpen fuzzy language. Propose a precise canonical term for vague or overloaded words: "You're saying 'account' — Customer or User?"
- Discuss concrete scenarios. Invent edge-case scenarios that force precision about boundaries between concepts.
- Cross-reference with code. When the user states how something works, check the code agrees; surface any contradiction.
- Blast radius of a new requirement. When the design adds a required input, a new validation, or otherwise tightens the contract of an existing endpoint / tool / shared function, grill what happens to the callers and code paths that don't use the new feature. Default to enforcing the requirement only where the new input is actually consumed (validate lazily) rather than globally/eagerly — eager enforcement silently regresses unrelated callers. Make the global-vs-scoped choice explicit; don't let it default to global.
- 对照术语表质疑。若某个术语与中的定义冲突,需指出:"你的术语表将X定义为A,但你的表述似乎指的是B——到底是哪个?"
CONTEXT.md - 优化模糊表述。为模糊或多义词汇提出精确的标准术语:"你提到的'account'——是Customer还是User?"
- 讨论具体场景。设计边缘场景,迫使明确概念间的边界。
- 与代码交叉验证。当用户说明某功能的工作方式时,检查代码是否一致;若有矛盾则指出。
- 新需求的影响范围。当设计新增必填输入、新验证规则,或以其他方式收紧现有接口/工具/共享函数的契约时,研讨未使用新功能的调用方和代码路径会受到何种影响。默认仅在实际使用新输入的场景中强制执行要求(延迟验证),而非全局/提前验证——提前验证会悄无声息地导致无关调用方出现回归问题。需明确选择全局验证还是范围验证;不要默认采用全局验证。
Step 3.5 — Mock the UI when seeing would change the answer
步骤3.5 — 若可视化会改变答案则制作UI原型
Some grilling questions are about a UI surface — layout, where an element sits,
what's on screen, the flow between states. Words agree falsely here: you and the
user both think you understand each other and picture different screens, because
neither saw it. When a question can only be resolved by looking, make the mockup
the question — render it from the UI decisions resolved so far, in the project's
own design language, and ask the user to confirm or correct, then loop. If the
project has no design system, first have the user establish a minimal design
baseline (you propose the starter) — never wireframe ad-hoc, or the mockups and the
build drift apart. Skip this entirely for designs with no visual surface. Put the mockup in the project's Claude Design design-system project via (PREFERRED). A rendered Artifact, then a self-contained , are fallbacks used ONLY when DesignSync/Artifact are unavailable; never default to a local even if a prior mockup already exists in the repo. Full mechanism (when to render vs not, how, and carrying it to the spec) is in -- read it before the first render.
DesignSync.html.html.html${CLAUDE_PLUGIN_ROOT}/references/ui-mockup.md有些研讨问题涉及UI界面——布局、元素位置、屏幕内容、状态流转。文字表述容易产生误解:你和用户都认为彼此理解,但实际想象的界面完全不同,因为双方都没看到具体界面。当问题只能通过可视化解决时,将原型作为问题呈现——根据已确定的UI决策,使用项目自身的设计语言生成原型,让用户确认或修改,然后循环此过程。若项目没有设计系统,先让用户建立最小化设计基准(你可提出初始方案)——切勿随意制作线框图,否则原型与最终实现会逐渐偏离。纯数据模型或配置设计可跳过此步骤。优先通过将原型放入项目的Claude Design设计系统项目中。仅当DesignSync/Artifact不可用时,才使用渲染后的Artifact或独立文件作为备选;即使仓库中已有原型,也不要默认使用本地文件。完整机制(何时渲染、如何渲染、如何将其纳入规范)详见——首次渲染前请阅读该文档。
DesignSync.html.html.html${CLAUDE_PLUGIN_ROOT}/references/ui-mockup.mdStep 4 — Capture inline as decisions crystallize
步骤4 — 决策明确时实时捕获
- Update CONTEXT.md inline the moment a term resolves — don't batch. Keep it a glossary only; no implementation detail. Create it lazily on the first resolved term if it doesn't exist. Use the format in CONTEXT-FORMAT.md.
- Always create an ADR for every design decision — one ADR per decision, the
moment the decision is made. Do not batch or defer. Create lazily on the first ADR. Use the format in ADR-FORMAT.md. Every ADR opens with a small Mermaid decision diagram (chosen vs rejected paths) — see
docs/adr/, Rule 3. A decision qualifies if the user chose one option over another — architectural shape, technology choice, naming, scope boundary, safety mechanism. When in doubt, write the ADR. A short ADR is better than a missing one.${CLAUDE_PLUGIN_ROOT}/references/diagram-convention.md
- 实时更新CONTEXT.md——术语一确定就更新,不要批量处理。仅保留术语表内容;不包含实现细节。若不存在该文件,在第一个术语确定时创建。遵循CONTEXT-FORMAT.md中的格式。
- 为每个设计决策创建ADR——决策一做出就创建一个ADR,不要批量或延迟处理。若不存在目录,在创建第一个ADR时生成。遵循ADR-FORMAT.md中的格式。每个ADR开头需包含一个小型Mermaid决策图(已选方案vs被拒方案)——详见
docs/adr/规则3。只要用户在多个选项中做出选择,就需要创建ADR——包括架构形态、技术选型、命名、范围边界、安全机制等。若不确定,就创建ADR。简短的ADR比缺失的ADR更好。${CLAUDE_PLUGIN_ROOT}/references/diagram-convention.md
Step 4.5 — Recap & confirm
步骤4.5 — 总结与确认
When grilling converges, before writing the spec, play the design back as a
terminal recap so the user can confirm it is captured correctly. Render it as a
terminal diagram per the Terminal diagrams family in
(Unicode box-drawing,
vertical, ≲ 50 columns, inside a fenced block — never Mermaid, which does not render
live in a terminal):
${CLAUDE_PLUGIN_ROOT}/references/diagram-convention.md- Emit a flowchart of the grilled decisions — mandatory. One box per decision in the order they were resolved, showing the chosen option, connected top-to-bottom. Every grilling session produces decisions, so this diagram always appears.
- Emit a sequence of the runtime interaction — optional. Show it only when the design has a genuine interaction (≥ 2 actors exchanging messages). Omit it for a pure data-model or config design — never force a one-actor diagram.
- Point to the UI mockup if one exists. If Step 3.5 produced a confirmed mockup,
include its artifact URL / path in the recap, so the decision set and the screen are confirmed together.
.html
Then ask: "Does this capture the design?"
- If the user confirms, continue to Step 5.
- If the user corrects anything, return to Step 2, grill the disputed point, then re-run this recap. Loop until confirmed.
This is a cheap checkpoint on the decision set before the spec exists; it is
distinct from Step 5's gate, which approves the written spec. Do not write the spec
until the recap is confirmed.
当研讨达成共识后,在编写规范之前,将设计内容以终端总结图的形式反馈给用户,让用户确认内容是否准确。按照中的"终端图"系列规范渲染(Unicode方框绘制,垂直方向,≤50列,放在围栏块内——切勿使用Mermaid,因为它无法在终端中实时渲染):
${CLAUDE_PLUGIN_ROOT}/references/diagram-convention.md- 必须输出研讨决策的流程图。每个决策对应一个方框,按决策确定的顺序排列,显示已选方案,从上到下连接。每次研讨都会产生决策,因此该图必须存在。
- 可选输出运行时交互序列图。仅当设计包含真实交互(≥2个参与者交换消息)时才显示。纯数据模型或配置设计无需显示——切勿强行绘制单参与者图。
- 若存在UI原型则指向它。若步骤3.5生成了已确认的原型,在总结中包含其Artifact URL / 路径,以便同时确认决策集和界面。
.html
然后询问:"该内容是否准确捕获了设计方案?"
- 若用户确认,继续执行步骤5。
- 若用户提出修改,返回步骤2,针对有争议的点进行研讨,然后重新执行本总结步骤。循环此过程直至用户确认。
这是规范编写前对决策集的低成本检查点,与步骤5中对书面规范的批准环节不同。在总结获得确认前,请勿编写规范。
Step 5 — Write the design spec
步骤5 — 编写设计规范
Once understanding is shared, write the design to
( is a
lowercase-kebab slug). The spec is a Markdown document — follow the diagram
convention in (one
overview Mermaid diagram at the top; type-matched diagrams per section).
If a UI mockup was produced in Step 3.5, reference its final artifact URL /
path in the spec, so the plan and the implementer work from the same screen you
confirmed — one source of truth.
Run a self-review for placeholders, internal consistency,
scope, and ambiguity; fix inline. Ask the user to review the spec and approve
before proceeding. If they do NOT approve, return to Step 2 and grill on the
disputed points, then revise the spec — do not proceed to handoff until approved.
docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md<topic>${CLAUDE_PLUGIN_ROOT}/references/diagram-convention.md.html达成共识后,将设计内容写入(为小写短横线分隔的slug)。规范为Markdown文档——遵循中的图规范(顶部有一个概述Mermaid图;每个章节使用匹配类型的图)。若步骤3.5生成了UI原型,在规范中引用其最终Artifact URL / 路径,以便计划和实现人员基于你确认的同一界面开展工作——确保单一数据源。对占位符、内部一致性、范围和歧义进行自我审查;实时修正。请用户审阅规范并批准后再继续。若用户未批准,返回步骤2,针对有争议的点进行研讨,然后修订规范——获得批准前请勿移交任务。
docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md<topic>${CLAUDE_PLUGIN_ROOT}/references/diagram-convention.md.htmlStep 5a - Verify load-bearing claims before approval
步骤5a — 批准前验证关键假设
If the spec's plan rests on claims about how EXISTING code or a live system
behaves (coupling, dependencies, "X already does Y", "path Z is ungated"),
verify those load-bearing claims against the actual code / live system BEFORE
asking for spec approval - a prose self-review cannot catch a false premise.
Correct the spec with what you find. A wrong assumption about the current
system silently breaks the plan built on it.
若规范中的计划基于对现有代码或实时系统行为的假设(耦合关系、依赖、"X已实现Y"、"路径Z未加限制"),在请求规范批准前,需针对实际代码/实时系统验证这些关键假设——文字自我审查无法发现错误前提。根据验证结果修正规范。对当前系统的错误假设会悄无声息地破坏基于此构建的计划。
Step 6 — Hand off
步骤6 — 移交任务
After the user approves the spec, invoke to produce
the implementation plan. This is the terminal state — do NOT invoke any other
implementation skill.
sp-writing-plans用户批准规范后,调用生成实现计划。这是最终状态——请勿调用任何其他实现类Skill。
sp-writing-plans