From omni-dsdd
Generates feature specification documents (SDD) from natural language descriptions. Collects context, analyzes requirements, extracts scenarios, and writes spec files to a feature branch.
How this skill is triggered — by the user, by Claude, or both
Slash command
/omni-dsdd:specifyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
以下规则在整个会话期间有效,不因对话长度而放松:
references/template-contract.jsonscripts/bash/specify-finalize.shscripts/bash/specify-gate.shscripts/bash/specify-harness-common.shscripts/bash/specify-init-harness.shscripts/bash/specify-render-checklist.shscripts/bash/specify-render-context.shscripts/bash/specify-render-spec.shscripts/bash/verify-specify-artifacts.shscripts/powershell/Specify-HarnessCommon.ps1scripts/powershell/specify-finalize.ps1scripts/powershell/specify-gate.ps1scripts/powershell/specify-init-harness.ps1scripts/powershell/specify-render-checklist.ps1scripts/powershell/specify-render-context.ps1scripts/powershell/specify-render-spec.ps1scripts/powershell/verify-specify-artifacts.ps1scripts/python/specify_harness.pyscripts/python/specify_template_gate.pyscripts/python/test_specify_template_gate.py以下规则在整个会话期间有效,不因对话长度而放松:
omni-dsdd:create-branch 的参数;后续步骤唯一基准为 omni-dsdd:create-branch 返回的 BRANCH_NAME、FEATURE_DIR、SPEC_FILE;不得跳过 omni-dsdd:create-branchspecify-gate 且 gate_exit=0 后方可勾选 Todo;禁止未跑门禁即标完成本技能所有路径拼接与脚本调用,均依赖以下两个变量。后续步骤不得绕过它们自行推断路径。
| 变量 | 含义 | 用途 |
|---|---|---|
CLAUDE_PLUGIN_ROOT | Omni 插件安装根目录 | 定位本技能脚本、check-prerequisites、插件内模板契约 |
CLAUDE_WORKING_DIR | 用户当前工作区目录(可为 Git 仓库子目录) | 定位 changes/、.omni-infra/、Harness 落盘 |
| 符号 | 展开路径 |
|---|---|
| 特性目录 | ${FEATURE_DIR}(来自 create-branch,应位于 ${CLAUDE_WORKING_DIR}/changes/...) |
| 规范文件 | ${SPEC_FILE} 或 ${FEATURE_DIR}/spec.md |
| 上下文 | ${FEATURE_DIR}/context.md |
| 项目模板 | ${CLAUDE_WORKING_DIR}/.omni-infra/templates/... |
| 项目章程 | ${CLAUDE_WORKING_DIR}/.omni-infra/memory/constitution.md |
| Harness 状态 | ${FEATURE_DIR}/.runs/... |
| 插件脚本(Linux/bash) | ${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/bash/... |
| 插件脚本(Windows/pwsh) | ${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/powershell/... |
| Harness 核心(Python) | ${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/python/specify_harness.py |
| 插件级前置检查 | ${CLAUDE_PLUGIN_ROOT}/scripts/bash/check-prerequisites.sh |
test -n "${CLAUDE_PLUGIN_ROOT:-}" && test -d "${CLAUDE_PLUGIN_ROOT}"
test -n "${CLAUDE_WORKING_DIR:-}" && test -d "${CLAUDE_WORKING_DIR}"
两项均通过 → 进入「执行流程」步骤 0。
任一项失败 → 执行 Step 0.2。
CLAUDE_PLUGIN_ROOT
${路径}/skills/specify/SKILL.md 存在):
${CLAUDE_WORKING_DIR} 或其上级查找含 .claude-plugin/plugin.json 的目录;export CLAUDE_PLUGIN_ROOT="<绝对路径>"CLAUDE_WORKING_DIR
export CLAUDE_WORKING_DIR="$(pwd)"(不用 git rev-parse --show-toplevel,避免子目录工作区被抬到仓库根)test -f "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/python/specify_harness.py"
test -f "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/bash/specify-init-harness.sh"
test -f "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/powershell/specify-init-harness.ps1"
test -d "${CLAUDE_WORKING_DIR}"
mkdir -p "${CLAUDE_WORKING_DIR}/changes"
✅ Checkpoint: CLAUDE_PLUGIN_ROOT=..., CLAUDE_WORKING_DIR=...
scripts/bash/ — specify-init-harness.sh、specify-gate.sh、specify-render-*.sh、specify-finalize.sh、verify-specify-artifacts.sh、specify-harness-common.shscripts/python/ — specify_harness.py、specify_template_gate.pyscripts/powershell/ — 与 bash 同名的 .ps1 封装 + Specify-HarnessCommon.ps1${CLAUDE_WORKING_DIR}/changes/...、.omni-infra/...--plugin-root、--working-dir、--feature-dir${FEATURE_DIR}/.runs/paths.json 读取 working_dir/plugin_root;未 init 时须显式传参pwd、git rev-parse、__file__.parents 推断插件根或工作区根| 平台 | 初始化 | 门禁 | 渲染 / 收尾 |
|---|---|---|---|
| Linux / macOS / Git Bash | scripts/bash/specify-init-harness.sh | scripts/bash/specify-gate.sh | scripts/bash/specify-render-*.sh、specify-finalize.sh |
| Windows (pwsh) | scripts/powershell/specify-init-harness.ps1 | scripts/powershell/specify-gate.ps1 | scripts/powershell/specify-render-*.ps1、specify-finalize.ps1 |
断点续跑、高级子命令可直接调用 scripts/python/specify_harness.py(参数与 bash 封装一致)。
合并规则与 sdd 步骤 1.5 一致(有传参 → 传参 > 无传参 → export > 推导 > allocate)。步骤 1 为 直连 /specify 或 workflow 后的权威预解析入口;物理生效唯一入口为步骤 2 omni-dsdd:create-branch,后续以 omni-dsdd:create-branch 返回值 为真值。
--feature-dir / --branch-name,或 export OMNISPEC_FEATURE_DIR/FEATURE_DIR/BRANCH_NAMEFEATURE_CONTEXT_PRESET=true):步骤 2 显式传 create-branch,禁止 allocate;FEATURE_DIR 须在 changes/ 下false):步骤 2 走 allocate;步骤 3 起只使用 create-branch 返回的路径示例见 sdd SKILL「--feature-dir / --branch-name 与 export 全局变量」一节。
编排 / 落盘 / 校验分离:LLM 产出 payload → Write 文件 → 脚本 gate 判定 → 更新 specify-run.json。
| 文件 | 用途 |
|---|---|
${FEATURE_DIR}/.runs/paths.json | 唯一路径真值源(分支、目录、SPEC_FILE、DOC_DIR、DOC_SPECS_DIR 等、working_dir、plugin_root,均为绝对路径) |
${FEATURE_DIR}/.runs/env.sh | source 后导出 FEATURE_DIR、CLAUDE_WORKING_DIR、CLAUDE_PLUGIN_ROOT、DOC_DIR、KNOWLEDGE_DIR 等 |
${FEATURE_DIR}/.runs/specify-run.json | 分步门禁结果、断点续跑 |
${FEATURE_DIR}/.runs/.omnispec-state.json | SDD 阶段状态(routing 读取 completed_stages) |
${FEATURE_DIR}/.runs/internal/context.payload.json | spec-impact 结构化中间态(可选,推荐) |
| SKILL 步骤 | 目标文件 | 落盘 + 门禁(gate --step 保持脚本既有编号) |
|---|---|---|
| 4 | .runs/paths.json、.runs/env.sh | specify-init-harness.sh → gate --step 1 --record |
| 6 | context.md | 先 Write context.payload.json → specify-render-context.sh(或按模板 Write md)→ gate --step 3 --record(模板契约:5 个 ## 章节) |
| 7→9 | spec.md | 先 specify-render-spec.sh --merge 铺骨架 → 步骤 8 追加需求/场景 → Write/Edit → gate --step 6 --record(模板契约:章节 + REQ/SCN/EARS/GWT) |
| 11 | checklists/requirements.md | 先 specify-render-checklist.sh 从模板生成 → 填写勾选 → gate --step 8 --record(模板契约:3 个 ## + ≥12 检查项) |
| 12 | .runs/evaluations/eval-specify-report.yaml | Write → gate --step 9 --record |
| 15 | .runs/metrics/omni-metrics-log.json | 追加 → gate --step 11 --record |
| 13 | 全部 | verify-specify-artifacts.sh(= gate --step all) |
| 16 | .runs/.omnispec-state.json | specify-finalize.sh → gate --step 11.5 --record |
Linux / bash:
# 初始化(步骤 4 通过后立即执行)
bash "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/bash/specify-init-harness.sh" \
--plugin-root "${CLAUDE_PLUGIN_ROOT}" \
--working-dir "${CLAUDE_WORKING_DIR}" \
--feature-dir "$FEATURE_DIR" \
--branch-name "$BRANCH_NAME" \
--spec-file "$SPEC_FILE" \
--doc-dir "$DOC_DIR" \
--start-time "$start_time"
source "$FEATURE_DIR/.runs/env.sh"
bash "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/bash/specify-gate.sh" \
--feature-dir "$FEATURE_DIR" --step STEP --record
bash "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/bash/verify-specify-artifacts.sh" \
--feature-dir "$FEATURE_DIR"
bash "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/bash/specify-finalize.sh" \
--feature-dir "$FEATURE_DIR" --flow-mode <flow_mode> --next-stage <next_stage>
python3 "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/python/specify_harness.py" resume \
--feature-dir "$FEATURE_DIR"
bash "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/bash/specify-render-spec.sh" \
--feature-dir "$FEATURE_DIR" --user-intent "<业务意图摘要>" --merge
bash "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/bash/specify-render-checklist.sh" \
--feature-dir "$FEATURE_DIR" --feature-name "<功能名>"
Windows / pwsh: 将上述 bash .../scripts/bash/*.sh 换为 pwsh .../scripts/powershell/*.ps1(参数名相同)。
template-contract.json)契约文件:${CLAUDE_PLUGIN_ROOT}/skills/specify/references/template-contract.json(由 specify_template_gate.py 在 gate 步骤 3/6/8/9 执行)。
| 产物 | 模板来源 | 门禁校验要点 |
|---|---|---|
context.md | spec-impact-analyze/templates/context-template.md | 5 个必需 ## 章节;占位内容过多则失败 |
spec.md | ${CLAUDE_WORKING_DIR}/.omni-infra/templates/spec-template.md + 需求/场景子技能 | ## 成功标准、## 与既有架构对齐、## 需求、## 场景;元数据行;REQ-XXX/SCN-XXX/系统 shall/GWT;需求与场景章节最小字数 |
checklists/requirements.md | ${CLAUDE_WORKING_DIR}/.omni-infra/templates/requirements-template.md | ## 内容质量、## 需求完整性、## 功能准备就绪;≥12 条 - [ ] |
eval-specify-report.yaml | omni-dsdd:eval-specify | report_version/metadata/evaluations/stage/overall_score |
gate_exit=0:允许勾选该步 Todo并进入下一步gate_exit=1:不得勾选 Todo;阅读 JSON errors 按模板补齐后重跑 gate(每步最多 2 次);禁止在未通过 gate 时标 Todo 完成gate_exit=1 时推荐修复顺序:① render-* 脚本铺骨架 → ② 按 errors 与对应 SKILL 子技能补内容 → ③ 再 gate --step N --recordgate_exit=0 作为 claim_type: structural 的 evidence✅ Checkpoint 步骤{N}: artifact={路径}, gate_exit=0, bytes={大小}, sections={M}/{M}(如适用)
omni-dsdd:spec-impact-analyze:返回结构 → specify 写入 context.payload.json 并渲染/写入 context.mdomni-dsdd:eval-specify:只定义量规 → specify 步骤 9 必须 Write eval-specify-report.yaml调用方式:使用 Skill 工具加载下列技能(如 /omni-dsdd:create-branch),须完整执行并等待返回后再继续下一步。
| 技能 | 步骤 | 必需/可选 |
|---|---|---|
omni-dsdd:create-branch | 2 | 必需 |
omni-dsdd:spec-impact-analyze | 6 | 必需 |
omni-dsdd:specify-requirement | 8 | 必需 |
omni-dsdd:specify-scenario | 8 | 必需 |
omni-dsdd:e2e-specify | 10 | 可选(ENABLE_E2E=true) |
omni-dsdd:eval-specify | 12 | 必需 |
omni-dsdd:runlog-record | 15 | 必需 |
下文步骤说明保留原
/specify命令逻辑,不做额外拆分。
$ARGUMENTS
在继续之前, 你必须考虑用户输入(如果不为空).
用户在触发消息中 /specify 后输入的文本就是 业务意图. 假设你始终可以在本次对话中访问它, 即使下面字面上显示 $ARGUMENTS. 除非用户提供了空命令, 否则不要要求用户重复.
注意: 此流程会自动执行上下文收集和规范生成:扫描反构文档、计算关联度、构建关联关系图、进行架构分析,生成 context.md,再基于上下文生成功能规范.
开始执行步骤之前,使用 TodoWrite 工具创建本次执行的 TodoList(用于过程可视化与完成确认):
步骤 0:记录 start_time
步骤 1:特性上下文合并解析(传参 + 全局变量)
步骤 2:加载 skill omni-dsdd:create-branch
步骤 3:路径校验
步骤 4:初始化 Harness(paths/env/run)
步骤 5:获取文档目录配置
步骤 6:加载 skill omni-dsdd:spec-impact-analyze 并写入 context.md
步骤 7:加载上下文
步骤 8:按流程生成需求/场景等内容
步骤 9:写入 SPEC_FILE
步骤 10:执行(或跳过)E2E 测试分析与设计
步骤 11:执行规范质量验证
步骤 12:加载 skill omni-dsdd:eval-specify
步骤 13:运行产物完整性校验脚本
步骤 14:输出完成报告
步骤 15:加载 skill omni-dsdd:runlog-record
步骤 16:同步 .omnispec-state.json(completed_stages)
强制要求:每步须在 specify-gate 通过(gate_exit=0)后 才勾选对应 Todo,不得在全部结束后一次性补勾选。
创建 Todo 后立即记录 start_time:
Get-Date -Format "yyyy-MM-dd HH:mm:ss"date +"%Y-%m-%d %H:%M:%S"特性上下文合并解析(传参 + 全局变量):
sdd 步骤 1.5、routing 参数预处理同一规则):
$ARGUMENTS 提取 --feature-dir / --branch-name(支持 --key=value),记为 $PRESET_FEATURE_DIR、$PRESET_BRANCH_NAME;未出现则保持为空,禁止填占位符或臆造值eval "$(bash "${CLAUDE_PLUGIN_ROOT}/scripts/bash/resolve-feature-context.sh" \
--working-dir "${CLAUDE_WORKING_DIR}" \
${PRESET_FEATURE_DIR:+--feature-dir "$PRESET_FEATURE_DIR"} \
${PRESET_BRANCH_NAME:+--branch-name "$PRESET_BRANCH_NAME"} \
--export)"
$ARGUMENTS 剥离 --feature-dir / --branch-name 得 $USER_INTENTFEATURE_CONTEXT_PRESET=true 时步骤 2 显式传 create-branch,禁止 allocate特性上下文预解析: FEATURE_DIR=${FEATURE_DIR:-}, BRANCH_NAME=${BRANCH_NAME:-}, FEATURE_CONTEXT_PRESET=${FEATURE_CONTEXT_PRESET:-}, PRESET_CLI=<dir:${PRESET_FEATURE_DIR:-NONE} branch:${PRESET_BRANCH_NAME:-NONE}>加载 skill omni-dsdd:create-branch,为功能开发准备工作环境(唯一物理生效点):
若 FEATURE_CONTEXT_PRESET=true(步骤 1 已补全):
omni-dsdd:create-branch 时显式透传 --feature-dir "${FEATURE_DIR}" 与 --branch-name "${BRANCH_NAME}"allocate;目录已存在 → resolve + git checkout;目录不存在 → create-new-feature 显式创建若 FEATURE_CONTEXT_PRESET=false:
.runs/paths.json 或 spec.md 或 .runs/branch-naming.json,则不得 allocate 新建另一目录;应先 resolveallocate + create-new-feature通用约束:
omni-dsdd:create-branch 必须被完整调用并等待返回;以返回的 BRANCH_NAME、FEATURE_DIR、SPEC_FILE 作为后续唯一基准FEATURE_DIR 须位于 ${CLAUDE_WORKING_DIR}/changes/ 下,否则重走 omni-dsdd:create-branchomni-dsdd:create-branch(除非第一次明确失败且未创建目录)路径校验(omni-dsdd:create-branch 返回后立即执行):
BRANCH_NAME、FEATURE_DIR 为准(不再使用步骤 1 预解析值)FEATURE_DIR 位于 ${CLAUDE_WORKING_DIR}/changes/ 下FEATURE_CONTEXT_PRESET=true:跳过 001- 序号格式、Git 分支集合比对、受保护分支等 allocate 路径门禁FEATURE_CONTEXT_PRESET=false:omni-dsdd:create-branch / allocate 已产出合规分支名;仍仅额外确认 changes/ 路径FEATURE_DIR 不在 changes/ 下:重走 omni-dsdd:create-branch;连续失败则终止并输出中文错误初始化 Harness(步骤 2/3 通过后立即执行):
specify-init-harness.sh(参数见「Harness 执行契约」,必须含 --plugin-root、--working-dir)specify-gate.sh --feature-dir "$FEATURE_DIR" --step 1 --recordgate_exit=1 时重试 init 最多 2 次;仍失败则终止步骤4: paths.json + env.sh, gate_exit=0source "$FEATURE_DIR/.runs/env.sh"获取文档目录配置:
CLAUDE_WORKING_DIR 下运行插件前置检查脚本获取配置:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/powershell/check-prerequisites.ps1" --json --paths-only → 失败时使用默认 DOC_DIR omni-doc 继续(cd "${CLAUDE_WORKING_DIR}" && bash "${CLAUDE_PLUGIN_ROOT}/scripts/bash/check-prerequisites.sh" --json --paths-only) → 失败时使用默认 DOC_DIR omni-doc 继续omni-doc);步骤 4 init 后须 source env.sh,此时 DOC_DIR 为绝对路径(paths.json 真值源)KNOWLEDGE_DIR(sdd Step1.5 export)回退读取并写入 env.sh/paths.json,无需 CLI 透传;未设置则默认 omni-doc。仿 FLOW_MODE 的 env 回退机制source 后的 DOC_DIR;init 之前可用 check-prerequisites 返回的 DOC_SPECS_DIR(已为绝对路径)需求波及分析:
omni-dsdd:spec-impact-analyze,分析 ${DOC_DIR}/specs 中的已有规格文档以及代码内容,识别可复用的组件和需要变更的范围(须在步骤 4 之后,且已 source env.sh)FEATURE_DIR/.runs/internal/context.payload.json(spec-impact 返回的结构化对象,含 context_mode、sections 或等价字段)specify-render-context.sh --feature-dir "$FEATURE_DIR" --user-intent "<业务意图摘要>"spec-impact-analyze/templates/context-template.md Write context.mdspecify-gate.sh --feature-dir "$FEATURE_DIR" --step 3 --recordcontext.payload.json(degraded: true、reason)→ 仍执行 render → gate;不得跳过context.md 必需章节数 == 5(功能描述、相关反构文档、架构分析与设计参考、术语对齐、约束和假设)gate_exit=0 后输出 Checkpoint 并勾选步骤 6 Todo加载上下文并初始化 spec 骨架:
${CLAUDE_WORKING_DIR}/.omni-infra/templates/spec-template.md 和 ${CLAUDE_WORKING_DIR}/.omni-infra/memory/constitution.mdspecify-render-spec.sh --feature-dir "$FEATURE_DIR" --user-intent "<业务意图>" --merge,确保 spec.md 含模板必需章节后再进入步骤 8FEATURE_DIR/context.md 作为上下文参考context.md 仍不存在:立即回退步骤 6 补写,不得在无 context.md 时将步骤 6 标为完成遵循此执行流程:
业务意图
如果为空: 错误 "未提供业务意图"FEATURE_DIR/context.md) 中的架构分析、可复用模式、术语对齐等信息业务意图和上下文中提取关键概念,识别: 参与者、操作、数据、约束omni-dsdd:specify-requirement,从系统视角分析业务意图对既有需求的影响,并追加到 FEATURE_DIR/spec.md 末尾omni-dsdd:specify-scenario,分析业务意图对既有场景的影响,并追加到 FEATURE_DIR/spec.md 末尾规范 schema 定义: SPEC_FILE 输出须符合 ${CLAUDE_WORKING_DIR}/.omni-infra/templates/spec-template.md 的章节结构,包括:
使用模板结构将规范写入 SPEC_FILE, 用 业务意图和上下文文件派生的具体细节替换占位符, 同时保持章节顺序和标题.
specify-gate.sh --feature-dir "$FEATURE_DIR" --step 6 --recordgate_exit=0 后输出 Checkpoint(含 spec.md 字节数)并勾选步骤 9 Todo执行测试分析与设计(仅当 $ENABLE_E2E=true 时执行)
--e2e 标志传递(如 /specify 功能描述 --e2e)$ENABLE_E2E 参数
$ENABLE_E2E=true:执行本步骤$ENABLE_E2E=false 或未设置:跳过本步骤,直接进入步骤 11omni-dsdd:e2e-specify 技能文件中定义的流程执行,不得跳过或修改任何步骤。omni-dsdd:e2e-specify:传递规范文件与特性目录上下文,按该技能全文执行 MFQ&PPDCS 测试分析与 TCON 黑盒用例设计,并验证 test-analysis.md、e2e-test.mdtest-analysis.md:测试分析报告(包含 KYM、TCO、MFQ 建模、测试点清单、Issues)e2e-test.md:黑盒测试用例文档(包含用例清单、用例详情、测试数据、追溯性矩阵)注意: 如果测试分析与设计验证失败且无法继续(如 agent 执行失败、文档未生成),应记录错误信息并继续执行步骤 11(不阻塞整体流程)。
a. 创建规范质量检查清单: 先执行 specify-render-checklist.sh --feature-dir "$FEATURE_DIR" 从 ${CLAUDE_WORKING_DIR}/.omni-infra/templates/requirements-template.md 落盘骨架,再据规范填写勾选状态(禁止手写与模板结构无关的检查清单)
b. 运行验证检查: 根据每个检查清单项目审查规范:
c. 处理验证结果:
如果所有项目都通过: 标记检查清单完成并继续步骤 12
如果项目失败(不包括 [NEEDS CLARIFICATION]):
如果 [NEEDS CLARIFICATION] 标记仍然存在:
从规范中提取所有 [NEEDS CLARIFICATION: ...] 标记
限制检查: 如果存在超过 3 个标记, 仅保留 3 个最关键的(按范围/安全/用户体验影响)并为其余部分做出有根据的猜测
对于每个需要的澄清(最多 3 个), 以以下格式向用户呈现选项:
## 问题 [N]: [主题]
**上下文**: [引用相关规范章节]
**我们需要了解**: [来自 NEEDS CLARIFICATION 标记的具体问题]
**建议答案**:
| 选项 | 答案 | 含义 |
| ------ | ---------------- | ------------------------ |
| A | [第一个建议答案] | [这对功能意味着什么] |
| B | [第二个建议答案] | [这对功能意味着什么] |
| C | [第三个建议答案] | [这对功能意味着什么] |
| 自定义 | 提供你自己的答案 | [解释如何提供自定义输入] |
**你的选择**: _[等待用户响应]_
关键 - 表格格式: 确保 markdown 表格格式正确:
| 内容 | 而不是 |内容||--------|按顺序编号问题(Q1、Q2、Q3 - 最多 3 个)
在等待响应之前一起呈现所有问题
等待用户响应所有问题的选择(例如, "Q1: A, Q2: 自定义 - [详情], Q3: B")
通过用用户选择或提供的答案替换每个 [NEEDS CLARIFICATION] 标记来更新规范
在所有澄清解决后重新运行验证
d. 更新检查清单: 每次验证迭代后, 使用当前的通过/失败状态更新检查清单文件
e. 强制落盘:步骤 11 结束前必须用 Write 确保 FEATURE_DIR/checklists/requirements.md 存在
f. Harness 门禁:specify-gate.sh --step 8 --record;等式验收:检查项行数(- [ ] / - [x])≥ 3
g. gate_exit=0 后勾选步骤 11 Todo
AI 质量评测: 加载 skill omni-dsdd:eval-specify,对 SPEC_FILE 进行四维量规评测
eval-specify-report.yaml,修复对应维度问题后重新评测(最多 2 轮,复用步骤 11 的迭代逻辑)specify-gate.sh --step 9 --record(yaml 须含 stage:、overall_score)gate_exit=0 后勾选步骤 12 Todo(质量分 < 95 可 warning,但文件必须存在)产物完整性校验(步骤 14 的前置门控):
verify-specify-artifacts.sh --feature-dir "$FEATURE_DIR"(gate --step all)python3 "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/python/specify_harness.py" resume --feature-dir "$FEATURE_DIR" 列出 pending_steps 后逐项补跑gate_exit=0)后方可进入步骤 14;失败则按 errors 回退重做(每类最多 2 次)报告完成情况
gate_exit=0(须在报告中写明 evidence: verify-specify-artifacts.sh exit 0)/clarify 或 /design)的准备就绪状态test-analysis.md、e2e-test.md 路径--e2e):
design 阶段也会相应跳过 e2e-design(因为缺少 e2e-test.md 依赖)/specify --e2e 或在执行 design 前单独加载 skill omni-dsdd:e2e-specify记录运行日志:
source "$FEATURE_DIR/.runs/env.sh"(已含 FEATURE_DIR)omni-dsdd:runlog-record,将前面获取的 start_time 作为参数传入/omni-dsdd:runlog-record [start_time](如 /omni-dsdd:runlog-record "2026-05-15 10:30:00")omni-metrics-log.json 后执行 specify-gate.sh --step 11 --recordomni-dsdd:runlog-record 失败:用 Write 直接向 JSON 追加条目 → 再跑 gate;gate_exit=1 不得勾选步骤 15同步 SDD 状态(routing 闭环,阻塞步骤):
flow_mode(express/standard/deep),禁止写死为 standardspecify-finalize.sh --flow-mode express --next-stage designspecify-finalize.sh --flow-mode standard --next-stage clarifyworkflows/deep.yaml 约定specify-gate.sh --step 11.5 --record;gate_exit=1 时不得标步骤 16 完成,不得输出 specify 完成报告步骤16: omnispec-state updated, completed_stages includes specify流程注意:
FEATURE_DIR/context.md| 步骤 | 错误场景 | 处理方式 |
|---|---|---|
| 步骤1 | 特性上下文合并解析失败(如不在 changes/ 下) | 报错终止 |
| 步骤2 | omni-dsdd:create-branch 执行失败 | 重试或输出中文错误信息 |
| 步骤5 | 脚本执行失败/超时 | 使用默认 DOC_DIR (omni-doc) 继续 |
| 步骤5 | 脚本不存在 | 提示用户检查 ${CLAUDE_PLUGIN_ROOT}/scripts/ 目录配置 |
| 步骤6 | omni-dsdd:spec-impact-analyze 失败 | 写入降级版 context.md,不得跳过落盘 |
| 步骤10 | omni-dsdd:e2e-specify 失败 | 记录错误,继续步骤 11(不阻塞整体流程) |
| 步骤11 | 验证失败(3次迭代后) | 仍须写入 checklists/requirements.md;在清单备注中记录剩余问题并警告用户 |
| 步骤12 | AI评测不通过(2次迭代后) | 仍须写入 eval-specify-report.yaml;在报告中记录未达标状态 |
| 步骤4 | harness init 失败 | 重试 2 次后终止 |
| 步骤6/9/11/12/15 | 分步 gate 失败 | 按 specify-run.json 与 resume 输出回退该步,不得勾选 Todo |
| 步骤13 | 全量 gate 失败 | 回退重做缺失步骤(每类最多 2 次),不得输出完成报告 |
| 步骤15 | omni-dsdd:runlog-record 失败 | Write 追加日志 → 再跑 gate --step 11 |
| 步骤16 | finalize 失败 | 重试;仍失败则警告并手动补写 omnispec-state.json |
${CLAUDE_WORKING_DIR}/.omni-infra/templates/spec-template.md${CLAUDE_WORKING_DIR}/.omni-infra/templates/requirements-template.md${CLAUDE_WORKING_DIR}/.omni-infra/memory/constitution.md${CLAUDE_PLUGIN_ROOT}/scripts/bash/check-prerequisites.sh(须在 CLAUDE_WORKING_DIR 下执行)${CLAUDE_PLUGIN_ROOT}/scripts/powershell/check-prerequisites.ps1scripts/python/specify_harness.py — init / gate / record / render-* / finalize / resumescripts/python/specify_template_gate.py — 模板契约校验scripts/bash/、scripts/powershell/ — 平台封装(与 create-branch 目录布局一致)references/template-contract.json — 产物与模板的机器可读契约当从用户提示创建此规范时:
合理默认值的示例(不要询问这些):
成功标准必须是:
好的示例:
坏的示例(以实现为中心):
FEATURE_DIR / BRANCH_NAME 传入 omni-dsdd:create-branch;步骤 3 起以 omni-dsdd:create-branch 返回值为准paths.json + env.sh 为唯一真值源;禁止用对话记忆替代路径context.md(优先)或 context.payload.jsonspec.md 通过文件传递verify-specify-artifacts.sh 的 gate_exit 作为完成证据.omnispec-state.json 的 completed_stagespython3 "${CLAUDE_PLUGIN_ROOT}/skills/specify/scripts/python/specify_harness.py" resume --feature-dir "$FEATURE_DIR" 获取 pending_stepspending_steps 对应步骤,已 passed 步骤禁止重复生成覆盖omni-doc(步骤 5 例外,不跳过落盘类步骤)npx claudepluginhub zte-aicloud/co-omnispec --plugin omni-dsddCreates or updates feature specifications from natural language descriptions. Useful when starting a new feature or clarifying requirements.
Generates structured specifications with demoable units, functional requirements, and proof artifacts for new features. Use when starting a feature to define what to build before coding.
Produces specification artifacts (intent, architecture notes, acceptance criteria) collaboratively with a human to resolve ambiguity before implementation begins. Use when starting a new feature or behavior change.