productspec-authoring
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAuthoring ProductSpec Files
编写ProductSpec文件
ProductSpec is a Markdown format for the product decision that comes before tickets, engineering plans, and code. One file per feature holds the committed intent.
This skill covers producing that file. Reading a finished spec and building against it is a different job, and the skill covers it. This skill ends when the file validates.
productspecProductSpec是一种Markdown格式,用于记录在工单、工程计划和代码之前的产品决策。每个功能对应一个文件,记录确定的产品意图。
本技能负责生成该文件。读取已完成的规范并基于其进行开发是另一项工作,由技能负责。本技能的流程在文件验证通过后结束。
productspecAlways true
通用规则
- Files use the extension : YAML frontmatter between
.product-spec.mdmarkers, then---headings.## Section - Six sections are mandatory, in order: ,
problem,hypothesis,product_summary,scope,acceptance_criteria.success_metrics - Headings match case- and separator-insensitively. and
## Acceptance Criteriaare the same section. Title case is the convention.## acceptance_criteria - Frontmatter requires ,
spec_format_version: "0.1",title(artifact_type|hypothesis|prd),openspec_proposal,author,created_at. Optional:updated_at,spec_revision,linked_github_repo,applies_to,custom_sections.tool_metadata - and
acceptance_criteriaeach carry a required fenced block. Prose alone fails validation. Structured scope, AI evals, and related artifacts are optional.success_metrics - Structured items carry durable ids: ,
AC-<number>,SM-<number>. Other documents cite them.EVAL-<number> - AI evals live inside , never in a section of their own. Related artifacts live inside
## Acceptance Criteria.## Related Artifacts - Validate any file with: (
npm exec --yes --package @productspec/parser -- productspec validate <file>suppresses npm's interactive install prompt, which hangs CI and non-interactive agents).--yes - The full normative definition is SPEC.md in the ProductSpec repository: https://github.com/gokulrajaram/ProductSpec/blob/main/SPEC.md. When this skill and SPEC.md disagree, SPEC.md wins.
- 文件使用扩展名:在
.product-spec.md标记之间是YAML前置元数据,之后是---格式的标题。## Section - 必须包含六个固定顺序的章节:(问题)、
problem(假设)、hypothesis(产品概述)、product_summary(范围)、scope(验收标准)、acceptance_criteria(成功指标)。success_metrics - 标题的匹配不区分大小写和分隔符。和
## Acceptance Criteria视为同一章节。惯例是使用标题大小写格式。## acceptance_criteria - 前置元数据必须包含、
spec_format_version: "0.1"(标题)、title(工件类型,可选值:artifact_type|hypothesis|prd)、openspec_proposal(作者)、author(创建时间)、created_at(更新时间)。可选字段:updated_at(规范版本)、spec_revision(关联GitHub仓库)、linked_github_repo(适用范围)、applies_to(自定义章节)、custom_sections(工具元数据)。tool_metadata - 和
acceptance_criteria章节各自必须包含一个代码块(fenced block)。仅使用普通文本会验证失败。结构化范围、AI评估和相关工件为可选内容。success_metrics - 结构化条目带有持久ID:、
AC-<number>、SM-<number>。其他文档会引用这些ID。EVAL-<number> - AI评估内容需放在章节内,不得单独作为一个章节。相关工件需放在
## Acceptance Criteria章节内。## Related Artifacts - 验证文件的命令:(
npm exec --yes --package @productspec/parser -- productspec validate <file>参数用于抑制npm的交互式安装提示,避免在CI和非交互式Agent中出现卡顿)。--yes - 完整的规范性定义可参考ProductSpec仓库中的SPEC.md文件:https://github.com/gokulrajaram/ProductSpec/blob/main/SPEC.md。当本技能与SPEC.md内容冲突时,以SPEC.md为准。
Pick the task, read one reference
选择任务,阅读对应参考文档
| Task | Read |
|---|---|
| Write a new spec from scratch | references/authoring.md |
| Validate files and fix errors | references/validating.md |
| Convert an existing PRD or feature doc | references/converting.md |
| Record drift, revisions, and outcomes | references/decision-trace.md |
Read only the reference the task needs.
| 任务 | 参考文档 |
|---|---|
| 从零开始编写新规范 | references/authoring.md |
| 验证文件并修复错误 | references/validating.md |
| 转换现有PRD或功能文档 | references/converting.md |
| 记录偏差、版本和结果 | references/decision-trace.md |
仅阅读当前任务所需的参考文档。
Ground rules
基本原则
- Never renumber a durable id. means the same criterion tomorrow as it does today, because a ticket, an engineering spec, or another agent may cite it. Add new ids at the end.
AC-2 - A success metric needs a target and a window, and the block is required. When the number depends on a baseline that only exists after launch, write with
target: tbdand a namedtarget_status: provisional. Never invent a number to clear the validator.target_owner - Preserve the author's Markdown inside sections. Tables, lists, and links survive the format. Do not flatten them.
- Write Scope items as complete sentences or imperative statements. Avoid terse tags like or
search.storage - increments only when product intent materially changes, never for typo or formatting edits.
spec_revision
- 切勿重新编号持久ID。在未来指代的验收标准应与现在一致,因为工单、工程规范或其他Agent可能会引用它。新增ID需添加在末尾。
AC-2 - 成功指标需要包含目标值和时间窗口,且代码块为必填项。如果目标值依赖于上线后的基准数据,请填写并标注
target: tbd(临时)以及指定target_status: provisional(目标负责人)。切勿为了通过验证而编造数值。target_owner - 保留章节内作者编写的Markdown格式。表格、列表和链接应保留原样,不得扁平化处理。
- 范围条目需写成完整句子或祈使句。避免使用(搜索)或
search(存储)这类简洁标签。storage - 仅当产品意图发生实质性变化时才递增,拼写错误或格式修改无需更新版本号。
spec_revision