upfront-design

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Upfront design

前置设计

The positional argument is the request, or the path of an existing design: a file with
request
and
status
frontmatter and a
# Design:
title.
draft
resumes at the first missing section, or at a phase the user names, deleting later sections;
approved
checks the next open milestone; any other status is
BLOCKED: unknown design status
. Anything else starts a new design.
Resolve
<anchor>
as the absolute directory containing this
SKILL.md
. Write new designs to
<anchor>/designs/<basename>-<slug>-<YYYY-MM-DD-HHmmss>.md
, with
<basename>
the root directory name of the first repo, never inside it.
After a design path exists, record after every step at
<design path>.ledger
through a temp sibling and atomic rename; delete it on any terminal except
AWAITING_USER
:
request | size | design path | phase | approved phases | adr offers | terminal
. Write each approved phase to the document the same way before the next phase starts. Each phase pauses with
AWAITING_USER
until approved or revised.
位置参数是请求,或现有设计的路径:一个带有
request
和
status
frontmatter 以及
# Design:
标题的文件。
draft
从第一个缺失的部分或用户指定的阶段恢复,并删除后续部分;
approved
检查下一个开放的里程碑;任何其他状态为
BLOCKED: unknown design status
。其他任何内容都会开始新的设计。
将
<anchor>
解析为包含此
SKILL.md
的绝对目录。将新设计写入
<anchor>/designs/<basename>-<slug>-<YYYY-MM-DD-HHmmss>.md
,其中
<basename>
是第一个仓库的根目录名称,绝不写入其内部。
设计路径存在后,在每一步之后通过临时同级文件和原子重命名记录到
<design path>.ledger
;在任何非
AWAITING_USER
的终态下删除它:
request | size | design path | phase | approved phases | adr offers | terminal
。在下一阶段开始前,以相同方式将每个已批准阶段写入文档。每个阶段以
AWAITING_USER
暂停,直到批准或修订。

0. Triage

0. 分诊

A request is small when all hold: it changes one module or package, it adds or changes no contract, data model, or public signature, and its desired behavior is one sentence. Small stops with
DIRECT
plus that sentence and no pause; do not write a design-path ledger. Otherwise create the design file from
./REFERENCE.md
, locate an ADR tree (
docs/adr/
,
adr/
,
doc/adr/
,
docs/decisions/
), and note ADRs touching this area; if none exists, proceed silently. Done when size is recorded and, for non-small work, the file has frontmatter.
当以下条件全部满足时,请求是小的:它只更改一个模块或包,不添加或更改任何契约、数据模型或公开签名,并且其期望行为是一句话。小的请求以
DIRECT
加上该句话结束,不暂停;不写设计路径账本。否则,从
./REFERENCE.md
创建设计文件,定位 ADR 树(
docs/adr/
、
adr/
、
doc/adr/
、
docs/decisions/
),并记录涉及此区域的 ADR;如果不存在,则静默继续。当记录大小且对于非小工作,文件具有 frontmatter 时完成。

1. Product review

1. 产品评审

Write Problem to solve with concrete user pain, Success with measurable signals, and Proposed solution with a bold one-line shape, a mockup, and a delivery paragraph. Use supplied mockups; when the work has a user-facing surface and none was supplied, draft a text wireframe or state table labelled as a draft. Ask the whole open-question frontier in one numbered round with a recommended answer per question. Pause. Done when the approved section is written.
写下要解决的具体用户痛点、带有可衡量信号的成功标准,以及带有粗体单行概述、模型和交付段落的提议解决方案。使用提供的模型;当工作具有面向用户的界面且未提供模型时,起草一个标记为草稿的文本线框图或状态表。在一轮编号的问题中询问整个开放问题边界,每个问题给出推荐答案。暂停。当已批准部分写入后完成。

2. System design

2. 系统设计

State the shape in one bold sentence and the pattern it follows. Add a layer map of paths marked NEW or CHANGED with a role each, data sources and constraints with their cost reason, and a sequence diagram with a band per phase. Flag ADR conflicts by number instead of overriding them. Pause. Done when the approved section is written.
用一句粗体句子说明形态及其遵循的模式。添加路径标记为 NEW 或 CHANGED 的分层图,并说明每层角色;数据源和约束及其成本原因;以及每个阶段一个带的序列图。标记 ADR 冲突(按编号)而不是覆盖它们。暂停。当已批准部分写入后完成。

3. Program design

3. 程序设计

For each boundary write its thesis, the pattern it follows, a usage snippet with real signatures, call sites grouped by boundary, a file tree with a role per file, a call-site tree marking added calls, and a call graph from the entry point. Write no bodies. When the layout is uncertain, draft two shapes, pick one, and record the reason. Pause. Done when every Success outcome maps to named symbols and the section is written.
对于每个边界,写出其主题、遵循的模式、带有真实签名的用法片段、按边界分组的调用点、每个文件有角色的文件树、标记新增调用的调用点树,以及从入口点开始的调用图。不写函数体。当布局不确定时,起草两种形态,选择一种,并记录原因。暂停。当每个成功结果都映射到命名符号且部分已写入后完成。

4. Vertical slices

4. 垂直切片

Order milestones so each is one PR that cuts through every layer, stub to mock to wire to logic to error handling, names its automated commands and manual steps, and lists the Phase 3 symbols it lands. The checkbox is the done signal; only the user marks a milestone deferred or skipped. Prefactoring comes first; wide refactors run as expand then contract, so a symbol may appear in two milestones. Multi-repo work names the order across repos. Pause. Done when every Phase 3 symbol is in a milestone, every milestone has a command or step, and the section is written with one open box per milestone.
对里程碑排序,使得每个里程碑是一个贯穿每一层的 PR:从桩到模拟再到真实逻辑再到错误处理,命名其自动化命令和手动步骤,并列出其落地的阶段 3 符号。复选框是完成信号;只有用户可以标记里程碑为推迟或跳过。预重构优先;广泛重构以先扩展后收缩的方式运行,因此符号可能出现在两个里程碑中。多仓库工作需命名跨仓库的顺序。暂停。当每个阶段 3 符号都在里程碑中,每个里程碑都有命令或步骤,并且部分已写入且每个里程碑有一个开放复选框时完成。

5. Finalize

5. 最终化

Set
status: approved
. For each decision recorded in Phases 2 and 3, offer an ADR only when all three hold: hard to reverse, surprising without context, chosen over a real alternative. On confirmation write it with the ADR template in
./REFERENCE.md
into the tree found in Step 0, or
docs/adr/
created lazily, in the repo that owns the decided component. Report the design path, ADR paths, and next steps (
/peer-review
, then pass the design after each milestone; to revise, set
status: draft
, name the phase, pass the path). Done with
DESIGNED
when Product review, System design, Program design, Vertical slices, and Decisions exist and every offer is written or declined.
设置
status: approved
。对于阶段 2 和 3 中记录的每个决策,仅当以下三个条件全部成立时才提供 ADR:难以逆转、无上下文时令人惊讶、且是在真实替代方案中做出的选择。确认后,使用
./REFERENCE.md
中的 ADR 模板写入在步骤 0 中找到的树,或懒创建
docs/adr/
,写入拥有所决策组件的仓库中。报告设计路径、ADR 路径和后续步骤(
/peer-review
,然后在每个里程碑后传递设计;要修订,设置
status: draft
,命名阶段,传递路径)。当产品评审、系统设计、程序设计、垂直切片和决策都存在且每个提议都已写入或拒绝时,以
DESIGNED
完成。

Check

检查

Take the first open milestone that is not deferred or skipped. Show each automated command and run it only after the user approves that exact string; tick each that passes. Compare promised symbols by name and signature. If any manual box is open, report steps and stop with
AWAITING_USER
. When every box is ticked and symbols match, tick the milestone; on mismatch add
promised X; landed Y; reason
and leave it open. Use
./REFERENCE.md
; never edit product files. Done with
CHECKED
when the milestone is ticked or all milestones are complete; with
AWAITING_USER
when manual steps await or a deviation names the still-open milestone.
Terminal values:
DIRECT
(no-op success for routers),
AWAITING_USER
,
DESIGNED
,
CHECKED
,
BLOCKED
.
取第一个未推迟或跳过的开放里程碑。显示每个自动化命令,并仅在用户批准该确切字符串后运行;勾选通过的每个。按名称和签名比较承诺的符号。如果任何手动框开放,报告步骤并以
AWAITING_USER
停止。当每个框都被勾选且符号匹配时,勾选里程碑;不匹配时添加
promised X; landed Y; reason
并保持开放。使用
./REFERENCE.md
;绝不编辑产品文件。当里程碑被勾选或所有里程碑完成时,以
CHECKED
完成;当手动步骤等待或偏差命名仍开放的里程碑时,以
AWAITING_USER
完成。
终态值:
DIRECT
(对路由器为无操作成功)、
AWAITING_USER
、
DESIGNED
、
CHECKED
、
BLOCKED
。