@gordon.gan/specflow 1.8.0-alpha → 1.8.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/cli/commands/document-run.d.ts +14 -1
- package/dist/cli/commands/document-run.js +518 -212
- package/dist/core/document/chapters.js +18 -3
- package/dist/core/document/digests.d.ts +0 -1
- package/dist/core/document/digests.js +18 -10
- package/dist/core/document/engine.d.ts +9 -0
- package/dist/core/document/engine.js +273 -38
- package/dist/core/document/extract.d.ts +61 -0
- package/dist/core/document/extract.js +437 -0
- package/dist/core/document/forbidden-patterns.js +7 -4
- package/dist/core/document/gates.d.ts +13 -1
- package/dist/core/document/gates.js +48 -6
- package/dist/core/document/input-digest.d.ts +8 -0
- package/dist/core/document/input-digest.js +93 -14
- package/dist/core/document/input-features.d.ts +23 -4
- package/dist/core/document/input-features.js +51 -2
- package/dist/core/document/lint.d.ts +17 -0
- package/dist/core/document/lint.js +118 -0
- package/dist/core/document/llm.d.ts +3 -10
- package/dist/core/document/llm.js +3 -8
- package/dist/core/document/map.d.ts +6 -0
- package/dist/core/document/map.js +114 -30
- package/dist/core/document/outline.d.ts +3 -0
- package/dist/core/document/outline.js +52 -9
- package/dist/core/document/paths.d.ts +5 -5
- package/dist/core/document/paths.js +11 -6
- package/dist/core/document/profile-validator.js +33 -5
- package/dist/core/document/profiles.js +5 -0
- package/dist/core/document/render.d.ts +26 -0
- package/dist/core/document/render.js +110 -14
- package/dist/core/document/review.d.ts +19 -4
- package/dist/core/document/review.js +65 -20
- package/dist/core/document/scene-detect.d.ts +10 -3
- package/dist/core/document/scene-detect.js +138 -22
- package/dist/core/document/schemas.d.ts +188 -34
- package/dist/core/document/schemas.js +39 -26
- package/dist/integrations/shared/capability-evidence.js +4 -4
- package/dist/integrations/shared/command-catalog.js +2 -1
- package/dist/integrations/shared/parity-manifest.js +4 -4
- package/package.json +2 -1
- package/prompts/document/map/acceptance.md +1 -0
- package/prompts/document/map/anti-ai.md +29 -0
- package/prompts/document/map/api-design.md +13 -4
- package/prompts/document/map/architecture.md +21 -1
- package/prompts/document/map/benchmark.md +26 -0
- package/prompts/document/map/closed-loop.md +1 -0
- package/prompts/document/map/compat-migration.md +24 -1
- package/prompts/document/map/component-design.md +30 -0
- package/prompts/document/map/config-runtime.md +1 -0
- package/prompts/document/map/core-flow.md +62 -0
- package/prompts/document/map/core-logic.md +1 -0
- package/prompts/document/map/data-model.md +1 -0
- package/prompts/document/map/deploy.md +20 -2
- package/prompts/document/map/fix.md +1 -0
- package/prompts/document/map/frontend-architecture.md +35 -0
- package/prompts/document/map/goal.md +1 -0
- package/prompts/document/map/impact.md +1 -0
- package/prompts/document/map/implementability.md +1 -0
- package/prompts/document/map/migration-guide.md +36 -0
- package/prompts/document/map/mvp-boundary.md +1 -0
- package/prompts/document/map/non-goals.md +1 -0
- package/prompts/document/map/ops.md +33 -0
- package/prompts/document/map/performance.md +32 -0
- package/prompts/document/map/poc-demo.md +25 -0
- package/prompts/document/map/regression.md +1 -0
- package/prompts/document/map/reproduce.md +1 -0
- package/prompts/document/map/requirement.md +1 -0
- package/prompts/document/map/research.md +25 -0
- package/prompts/document/map/root-cause.md +1 -0
- package/prompts/document/map/signoff.md +1 -0
- package/prompts/document/map/state-management.md +23 -0
- package/prompts/document/map/tech-selection.md +13 -1
- package/prompts/document/map/test-strategy.md +18 -1
- package/prompts/document/map/ui-design.md +10 -7
- package/prompts/document/outline/general.md +9 -0
- package/prompts/document/review/ai-review.md +2 -1
- package/prompts/document/shared/grounding.md +84 -0
- package/skills/specflow-techdoc/SKILL.md +143 -0
- package/skills/specflow-techdoc-synth/SKILL.md +99 -0
- package/templates/document/chapters/api-design.yaml +6 -1
- package/templates/document/chapters/architecture.yaml +7 -4
- package/templates/document/chapters/benchmark.yaml +20 -0
- package/templates/document/chapters/compat-migration.yaml +7 -3
- package/templates/document/chapters/component-design.yaml +22 -0
- package/templates/document/chapters/core-flow.yaml +27 -0
- package/templates/document/chapters/core-logic.yaml +1 -1
- package/templates/document/chapters/deploy.yaml +11 -7
- package/templates/document/chapters/frontend-architecture.yaml +22 -0
- package/templates/document/chapters/migration-guide.yaml +21 -0
- package/templates/document/chapters/ops.yaml +25 -0
- package/templates/document/chapters/performance.yaml +21 -0
- package/templates/document/chapters/poc-demo.yaml +22 -0
- package/templates/document/chapters/research.yaml +22 -0
- package/templates/document/chapters/state-management.yaml +22 -0
- package/templates/document/chapters/tech-selection.yaml +6 -3
- package/templates/document/chapters/test-strategy.yaml +5 -2
- package/templates/document/chapters/ui-design.yaml +7 -1
- package/templates/document/profiles/0to1.yaml +41 -9
- package/templates/document/profiles/bugfix.yaml +8 -3
- package/templates/document/profiles/feature.yaml +19 -7
- package/templates/document/profiles/frontend-0to1.yaml +47 -0
- package/templates/document/profiles/migration.yaml +42 -0
- package/templates/document/profiles/poc.yaml +46 -0
- package/dist/core/document/index.d.ts +0 -7
- package/dist/core/document/index.js +0 -7
- package/skills/specflow-document/SKILL.md +0 -124
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# 前端架构设计(frontend-architecture · 0→1 全栈/纯前端场景)
|
|
2
|
+
# 高质量前端架构要点:目录分层 + 模块化/Monorepo 决策 + 工程化配置 + 架构图(图+文字) + 每层「不放什么」
|
|
3
|
+
id: frontend-architecture
|
|
4
|
+
title: 前端架构设计
|
|
5
|
+
when: null
|
|
6
|
+
depends_on: [tech-selection]
|
|
7
|
+
outline_points:
|
|
8
|
+
- { id: FA1, text: 目录分层(pages/components/hooks/services/utils/types),逐层说明职责与边界, required: true, kind: narrative }
|
|
9
|
+
- { id: FA2, text: 模块化与代码组织决策(Monorepo vs 单仓、包划分、共享代码复用), required: true, kind: narrative }
|
|
10
|
+
- { id: FA3, text: 工程化配置(ESLint/Prettier/Husky/TypeScript 等级/CSS 决策树,给出工具与版本), required: true, kind: narrative }
|
|
11
|
+
- { id: FA4, text: 前端架构图(Mermaid 组件/容器图)+ 逐节点文字说明(职责/边界/「不放什么」), required: true, kind: mixed }
|
|
12
|
+
- { id: FA5, text: 数据流与状态归属的总览(配合 state-management 章节细述), required: false, kind: narrative }
|
|
13
|
+
entities: {}
|
|
14
|
+
narratives:
|
|
15
|
+
frontend_architecture: required
|
|
16
|
+
gates:
|
|
17
|
+
- 每个目录层必须写明职责与「不放什么」边界(禁把什么都塞进 components)
|
|
18
|
+
- 工程化配置必须给出工具 + 版本(禁只写「用 ESLint」)
|
|
19
|
+
- 架构图必须 Mermaid 源码 + 文字说明(逐节点职责,禁只有图无文字)
|
|
20
|
+
- Monorepo/模块化决策必须给结论与理由(反AI决策 #1:说明不选什么)
|
|
21
|
+
map_prompt: prompts/document/map/frontend-architecture.md
|
|
22
|
+
output_budget_tokens: 4000
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# 代码迁移指南(migration-guide · F4 全栈技术升级场景)
|
|
2
|
+
# 高质量迁移指南要点:逐模块 checklist + 自动化迁移脚本(codemod) + 常见陷阱与解法 + 培训计划
|
|
3
|
+
id: migration-guide
|
|
4
|
+
title: 代码迁移指南
|
|
5
|
+
when: null
|
|
6
|
+
depends_on: [compat-migration]
|
|
7
|
+
outline_points:
|
|
8
|
+
- { id: MG1, text: 逐模块迁移 checklist(按目录/模块列出可勾选步骤与验收), required: true, kind: narrative }
|
|
9
|
+
- { id: MG2, text: 自动化迁移脚本(codemod/批量替换,给出工具与正则/规则), required: false, kind: narrative }
|
|
10
|
+
- { id: MG3, text: 常见陷阱与解法(现象 + 原因 + 解法,每条完整), required: true, kind: narrative }
|
|
11
|
+
- { id: MG4, text: 团队培训计划(分享/Slide/代码示例对照/最佳实践文档), required: false, kind: narrative }
|
|
12
|
+
- { id: MG5, text: 迁移顺序与依赖(先迁什么后迁什么,如何保证中间态可运行), required: true, kind: narrative }
|
|
13
|
+
entities: {}
|
|
14
|
+
narratives:
|
|
15
|
+
migration_guide: required
|
|
16
|
+
gates:
|
|
17
|
+
- 迁移 checklist 必须可勾选(逐项「已完成/未完成」),禁笼统清单
|
|
18
|
+
- 陷阱必须有「现象 + 原因 + 解法」三段式(禁只写「注意兼容」)
|
|
19
|
+
- 迁移顺序必须保证中间态可运行(双构建/双运行,禁一次大爆炸切换)
|
|
20
|
+
map_prompt: prompts/document/map/migration-guide.md
|
|
21
|
+
output_budget_tokens: 3500
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 运维运营方案(ops · 0→1 全栈场景)
|
|
2
|
+
# 高质量运维要点:监控(四金信号+前端RUM) + 日志 + 告警值班 + 备份恢复 + 安全基线 + 成本 + 上线清单(PRR/Launch) + DORA
|
|
3
|
+
id: ops
|
|
4
|
+
title: 运维运营方案
|
|
5
|
+
when: null
|
|
6
|
+
depends_on: [deploy]
|
|
7
|
+
outline_points:
|
|
8
|
+
- { id: OP1, text: 监控(四金信号:延迟/流量/错误/饱和度 + 前端 RUM + CWV), required: true, kind: narrative }
|
|
9
|
+
- { id: OP2, text: 日志收集与检索(结构化日志/stdout/保留策略), required: false, kind: narrative }
|
|
10
|
+
- { id: OP3, text: 告警与值班(on-call/升级路径/响应时限), required: false, kind: narrative }
|
|
11
|
+
- { id: OP4, text: 备份与恢复(数据备份策略/RTO/RPO/演练), required: false, kind: narrative }
|
|
12
|
+
- { id: OP5, text: 安全基线(密钥管理/CSP/HTTPS 强制/防火墙/审计), required: false, kind: narrative }
|
|
13
|
+
- { id: OP6, text: 成本控制(资源规模/预算告警/用量治理), required: false, kind: narrative }
|
|
14
|
+
- { id: OP7, text: 上线检查清单(PRR/Launch 逐项带证据), required: true, kind: narrative }
|
|
15
|
+
- { id: OP8, text: DORA 度量(部署频率/变更前置时间/MTTR/变更失败率)与持续改进, required: false, kind: narrative }
|
|
16
|
+
entities: {}
|
|
17
|
+
narratives:
|
|
18
|
+
ops: required
|
|
19
|
+
gates:
|
|
20
|
+
- 监控必须覆盖四金信号(SRE:延迟/流量/错误/饱和度),缺一报 warning
|
|
21
|
+
- 上线检查清单逐项给「证据」(PRR 精神),空证据 → error
|
|
22
|
+
- 备份/安全/成本按项目形态取舍(容器化/有无数据库/团队规模),取舍需写明理由
|
|
23
|
+
- DORA 度量必须给目标值并写明度量方式
|
|
24
|
+
map_prompt: prompts/document/map/ops.md
|
|
25
|
+
output_budget_tokens: 3500
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# 性能方案(performance · 0→1 全栈/全栈功能场景)
|
|
2
|
+
# 高质量性能要点:打包/加载/渲染/缓存 + CWV KPI 给目标值 + 优化带数字前后对比(数字门禁)
|
|
3
|
+
id: performance
|
|
4
|
+
title: 性能方案
|
|
5
|
+
when: input.uiInScope || input.hasBackend
|
|
6
|
+
depends_on: [frontend-architecture]
|
|
7
|
+
outline_points:
|
|
8
|
+
- { id: PF1, text: 打包与体积(bundle 分析,JS gzip 目标,代码分割/懒加载), required: true, kind: narrative }
|
|
9
|
+
- { id: PF2, text: 加载性能(LCP/FID/CLS/TTI 目标值,按 README §1.3 KPI 表), required: true, kind: narrative }
|
|
10
|
+
- { id: PF3, text: 渲染性能(列表渲染/重渲染优化/缓存策略,禁只写「用 memo」), required: true, kind: narrative }
|
|
11
|
+
- { id: PF4, text: 资源与接口缓存策略(HTTP 缓存/CDN/请求合并/防重复请求), required: false, kind: narrative }
|
|
12
|
+
- { id: PF5, text: 性能优化前后对比(数字:体积/耗时/评分),给出测量工具与方法, required: true, kind: narrative }
|
|
13
|
+
entities: {}
|
|
14
|
+
narratives:
|
|
15
|
+
performance_notes: required
|
|
16
|
+
gates:
|
|
17
|
+
- 性能优化必须给数字(前后对比),禁止只写「React.memo + useMemo」(反AI决策 #2)
|
|
18
|
+
- CWV 指标必须给目标值(LCP/FID/CLS/TTI,禁「越快越好」)
|
|
19
|
+
- 测量工具与口径必须明确(Lighthouse/Web Vitals/bundle-analyzer)
|
|
20
|
+
map_prompt: prompts/document/map/performance.md
|
|
21
|
+
output_budget_tokens: 3500
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# PoC Demo(poc-demo · fullstack-poc 预研/选型场景)
|
|
2
|
+
# 高质量 PoC 要点:边界 + 最小验证 + 判据可证伪 + 已知限制 + 生产化差距(文档只写设计/结论,代码另行落库)
|
|
3
|
+
id: poc-demo
|
|
4
|
+
title: PoC Demo
|
|
5
|
+
when: null
|
|
6
|
+
depends_on: [research]
|
|
7
|
+
outline_points:
|
|
8
|
+
- { id: PD1, text: PoC 边界与目标(验证什么/不验证什么), required: true, kind: narrative }
|
|
9
|
+
- { id: PD2, text: 最小可行验证范围(MVP 级别,只验证最不确定的风险点), required: true, kind: narrative }
|
|
10
|
+
- { id: PD3, text: 核心功能验证(关键路径/技术难点如何验证), required: true, kind: narrative }
|
|
11
|
+
- { id: PD4, text: 验证判据(如何判定 PoC 成功/失败,可证伪), required: true, kind: narrative }
|
|
12
|
+
- { id: PD5, text: 已知限制与未验证项(≥1 条), required: true, kind: narrative }
|
|
13
|
+
- { id: PD6, text: 落地路径(PoC → 生产化的差距与成本), required: false, kind: narrative }
|
|
14
|
+
entities: {}
|
|
15
|
+
narratives:
|
|
16
|
+
poc_notes: required
|
|
17
|
+
gates:
|
|
18
|
+
- PoC 边界必须明确(验证什么/不验证什么)
|
|
19
|
+
- 已知限制与未验证项 ≥1 条
|
|
20
|
+
- 禁止把 PoC 当生产方案(生产化差距必须写)
|
|
21
|
+
map_prompt: prompts/document/map/poc-demo.md
|
|
22
|
+
output_budget_tokens: 5000
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# 技术调研报告(research · fullstack-poc 预研/选型场景)
|
|
2
|
+
# 高质量调研要点:候选 ≥2 + 对比维度 + 活跃度给数字 + 团队匹配 + 兼容约束 + 喂给后续验证
|
|
3
|
+
id: research
|
|
4
|
+
title: 技术调研报告
|
|
5
|
+
when: null
|
|
6
|
+
depends_on: []
|
|
7
|
+
outline_points:
|
|
8
|
+
- { id: RS1, text: 调研背景与目标(为什么调研/要回答的决策点), required: true, kind: narrative }
|
|
9
|
+
- { id: RS2, text: 候选方案清单(≥2 个)+ 对比维度表, required: true, kind: mixed }
|
|
10
|
+
- { id: RS3, text: 社区活跃度(GitHub Star/Issue 响应/Release 频率,给数字), required: true, kind: narrative }
|
|
11
|
+
- { id: RS4, text: 团队匹配度(技能/学习成本/维护意愿), required: true, kind: narrative }
|
|
12
|
+
- { id: RS5, text: 兼容性与约束(浏览器/Node/现有栈/许可证), required: false, kind: narrative }
|
|
13
|
+
- { id: RS6, text: 调研结论与待验证问题(喂给 PoC/Benchmark), required: true, kind: narrative }
|
|
14
|
+
entities: {}
|
|
15
|
+
narratives:
|
|
16
|
+
research_notes: required
|
|
17
|
+
gates:
|
|
18
|
+
- 候选方案 ≥2 个,禁止只调研一个
|
|
19
|
+
- 社区活跃度必须给数字(Star/Issue/Release)
|
|
20
|
+
- 对比维度表必须同列可比(禁不同维度硬比)
|
|
21
|
+
map_prompt: prompts/document/map/research.md
|
|
22
|
+
output_budget_tokens: 5000
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# 状态管理(state-management · 0→1 全栈/全栈功能场景)
|
|
2
|
+
# 高质量状态管理要点:全局 vs 局部划分 + Store 结构 + 数据流方向 + 状态归属逐条列出 + 持久化
|
|
3
|
+
id: state-management
|
|
4
|
+
title: 状态管理
|
|
5
|
+
when: input.uiInScope
|
|
6
|
+
depends_on: [component-design]
|
|
7
|
+
outline_points:
|
|
8
|
+
- { id: SM1, text: 状态归属划分(局部 state / 全局 store / URL 参数 / 服务端状态),逐条列出字段与来源, required: true, kind: narrative }
|
|
9
|
+
- { id: SM2, text: Store 结构与模块划分(按域拆分,禁止「全部放 store」), required: true, kind: narrative }
|
|
10
|
+
- { id: SM3, text: 数据流方向(单向数据流:action → store → view,异步请求的 loading/error 归属), required: true, kind: narrative }
|
|
11
|
+
- { id: SM4, text: 状态持久化与恢复(localStorage/URL/服务端,SSR/Hydration 一致性), required: false, kind: narrative }
|
|
12
|
+
- { id: SM5, text: 状态更新与消费规范(避免重复请求/缓存策略/竞态处理), required: false, kind: narrative }
|
|
13
|
+
entities: {}
|
|
14
|
+
narratives:
|
|
15
|
+
state_management: required
|
|
16
|
+
gates:
|
|
17
|
+
- 状态归属必须逐条列出(字段 + 存放位置 + 来源),禁止笼统「状态放 store」
|
|
18
|
+
- 必须给出「哪些状态不该进全局 store」(局部即可)的边界
|
|
19
|
+
- 数据流方向必须明确(禁双向/混乱更新路径)
|
|
20
|
+
- 涉及异步数据时,必须写清 loading/error 状态归属
|
|
21
|
+
map_prompt: prompts/document/map/state-management.md
|
|
22
|
+
output_budget_tokens: 3500
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
# 技术选型(0→1
|
|
1
|
+
# 技术选型(0→1 必选;五元组门禁;F5 预研复用 + 评估矩阵模式)
|
|
2
2
|
id: tech-selection
|
|
3
3
|
title: 技术选型
|
|
4
|
-
when:
|
|
4
|
+
when: input.hasBackend || input.containsApiChange
|
|
5
5
|
depends_on: []
|
|
6
6
|
outline_points:
|
|
7
7
|
- { id: TS1, text: 前端五元组(Framework/Styling/State/UI kit/FE testing), required: true, kind: entity }
|
|
8
8
|
- { id: TS2, text: 后端/数据库/基础设施选型与理由, required: true, kind: mixed }
|
|
9
9
|
- { id: TS3, text: 选型理由(为何不用备选), required: true, kind: narrative }
|
|
10
|
+
- { id: TS4, text: 综合评估矩阵(候选方案 × 评估维度 × 得分 × 权重;F5 预研/选型用), required: false, kind: mixed }
|
|
10
11
|
entities:
|
|
11
12
|
decisions:
|
|
12
13
|
required: [id, text]
|
|
@@ -16,5 +17,7 @@ gates:
|
|
|
16
17
|
- 前端必须给出五元组,禁止只写「用 React」
|
|
17
18
|
- 每项选型必须附理由
|
|
18
19
|
- 禁止臆造全栈(绿场需用户确认选型)
|
|
20
|
+
- 有候选方案对比时必须给评估矩阵(得分 × 权重),禁拍脑袋推荐
|
|
21
|
+
- 推荐结论必须有「本项目不适用什么」一句话立场(反AI决策 #1)
|
|
19
22
|
map_prompt: prompts/document/map/tech-selection.md
|
|
20
|
-
output_budget_tokens:
|
|
23
|
+
output_budget_tokens: 4000
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 测试策略(候选;依赖接口 +
|
|
1
|
+
# 测试策略(候选;依赖接口 + 数据;扩展:前端金字塔/组件测试)
|
|
2
2
|
id: test-strategy
|
|
3
3
|
title: 测试策略
|
|
4
4
|
when: input.hasLogic
|
|
@@ -7,6 +7,8 @@ outline_points:
|
|
|
7
7
|
- { id: T1, text: 分层测试矩阵, required: true, kind: entity }
|
|
8
8
|
- { id: T2, text: 测试环境与数据, required: true, kind: narrative }
|
|
9
9
|
- { id: T3, text: 与验收标准的映射, required: true, kind: narrative }
|
|
10
|
+
- { id: T4, text: 前端测试金字塔(单元 60% / 组件 30% / E2E 10%,含组件测试 Snapshot+交互), required: false, kind: narrative }
|
|
11
|
+
- { id: T5, text: 回归测试范围(对应影响面,覆盖受影响功能), required: false, kind: narrative }
|
|
10
12
|
entities:
|
|
11
13
|
decisions:
|
|
12
14
|
required: [id, text]
|
|
@@ -16,5 +18,6 @@ gates:
|
|
|
16
18
|
- 每个测试层级必须映射到具体验收标准/场景
|
|
17
19
|
- 每个层级有工具/框架 + 可验证目标
|
|
18
20
|
- 不涉及测试变更时显式标注
|
|
21
|
+
- 涉及前端时,测试金字塔比例与组件测试方式必须写明(禁「跑单测」空话)
|
|
19
22
|
map_prompt: prompts/document/map/test-strategy.md
|
|
20
|
-
output_budget_tokens:
|
|
23
|
+
output_budget_tokens: 3500
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# UI 设计(feature
|
|
1
|
+
# UI 设计(feature 候选;依赖接口;扩展:交互状态机/路由守卫/埋点/浏览器兼容)
|
|
2
2
|
id: ui-design
|
|
3
3
|
title: 前端/UI 设计
|
|
4
4
|
when: input.uiInScope
|
|
@@ -8,6 +8,10 @@ outline_points:
|
|
|
8
8
|
- { id: UI2, text: 关键页空态/加载/错误三项(G6), required: true, kind: narrative }
|
|
9
9
|
- { id: UI3, text: 状态与数据获取方案, required: true, kind: narrative }
|
|
10
10
|
- { id: UI4, text: 至少 1 条「本迭代不选/不适用」, required: true, kind: narrative }
|
|
11
|
+
- { id: UI5, text: 交互状态机(多步表单/向导/可逆流程,stateDiagram-v2;简单页写「不涉及」), required: false, kind: narrative }
|
|
12
|
+
- { id: UI6, text: 路由守卫/懒加载(权限/登录态/动态 import), required: false, kind: narrative }
|
|
13
|
+
- { id: UI7, text: 埋点(页面曝光/点击事件 + 参数), required: false, kind: narrative }
|
|
14
|
+
- { id: UI8, text: 浏览器兼容策略(版本 + 降级手段,README §1.4), required: false, kind: narrative }
|
|
11
15
|
entities:
|
|
12
16
|
decisions:
|
|
13
17
|
required: [id, text]
|
|
@@ -18,5 +22,7 @@ gates:
|
|
|
18
22
|
- 关键页必须写空态/加载/错误三项(G6)
|
|
19
23
|
- 禁止臆造页面树
|
|
20
24
|
- 性能/XSS/埋点仅 design 点名时才写
|
|
25
|
+
- 有路由权限要求时,路由守卫方案必须写明(禁只说「加守卫」)
|
|
26
|
+
- 兼容结论必须具体到版本与降级手段(禁「支持最新浏览器」式空话,README §1.4)
|
|
21
27
|
map_prompt: prompts/document/map/ui-design.md
|
|
22
28
|
output_budget_tokens: 6000
|
|
@@ -1,12 +1,44 @@
|
|
|
1
|
-
# 0→1
|
|
1
|
+
# 0→1 全栈项目方案(F1 定案 · 升级现有 0to1:4 章 → 15 必选 + 4 可选)
|
|
2
|
+
# 全栈版:前后端架构拆两章(architecture 后端 + frontend-architecture 前端);部署运维拆两章(deploy + ops)
|
|
2
3
|
id: 0to1
|
|
3
|
-
name: 0→1
|
|
4
|
-
required:
|
|
4
|
+
name: 0→1 全栈项目方案
|
|
5
|
+
required: # 15 章 · 声明序=叙事弧(渲染由 depends_on 拓扑保证)
|
|
6
|
+
- goal # A 目标与边界 dep: []
|
|
7
|
+
- mvp-boundary # dep: [goal]
|
|
8
|
+
- non-goals # dep: [mvp-boundary]
|
|
9
|
+
- tech-selection # B 技术选型 dep: []
|
|
10
|
+
- architecture # C 总体架构-后端 dep: [tech-selection]
|
|
11
|
+
- frontend-architecture # C 总体架构-前端 dep: [tech-selection]
|
|
12
|
+
- api-design # D 接口与数据 dep: [architecture, frontend-architecture]
|
|
13
|
+
- core-flow # E 主业务流程 dep: [architecture, api-design]
|
|
14
|
+
- component-design # F 前端设计 dep: [frontend-architecture]
|
|
15
|
+
- state-management # dep: [component-design]
|
|
16
|
+
- ui-design # dep: [api-design, component-design]
|
|
17
|
+
- performance # G 质量 dep: [frontend-architecture]
|
|
18
|
+
- test-strategy # dep: [api-design, data-model, component-design]
|
|
19
|
+
- deploy # H 部署交付 dep: [test-strategy]
|
|
20
|
+
- ops # H 运维运营 dep: [deploy]
|
|
5
21
|
optional_candidates:
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
22
|
+
- research # B 调研(可选;语义上属选型前置,引擎渲染在必选之后)
|
|
23
|
+
- data-model # D 数据模型(when hasPersistence;被 test-strategy 依赖→拓扑置于其前)
|
|
24
|
+
- core-logic # F/G 核心逻辑(可选)
|
|
25
|
+
- signoff # Z 签字栏(when includeSignoff;渲染在末尾为预期)
|
|
26
|
+
forbidden:
|
|
27
|
+
- reproduce # 非 Bug 场景
|
|
28
|
+
- root-cause
|
|
29
|
+
- fix
|
|
30
|
+
- impact
|
|
31
|
+
- regression
|
|
32
|
+
- requirement # 需求分析属 F2
|
|
33
|
+
- compat-migration # 非升级/预研
|
|
34
|
+
- migration-guide
|
|
35
|
+
- poc-demo
|
|
36
|
+
- benchmark
|
|
37
|
+
- closed-loop # 审批专用
|
|
38
|
+
- implementability
|
|
39
|
+
- config-runtime # 已定案砍掉(§2.0-5)
|
|
40
|
+
- acceptance
|
|
12
41
|
shared: []
|
|
42
|
+
appendices:
|
|
43
|
+
- anti-ai # 附录 B · 去AI味自检(五维自检表,≥3 条)
|
|
44
|
+
- handoff # 附录 C · 下游交付衔接(交付矩阵 + 三步)
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
# 修 bug 方案(决策 3)
|
|
1
|
+
# 修 bug 方案(决策 3 · 合并原 bugfix + fullstack-bugfix)
|
|
2
|
+
# 是否含前端/兼容维度由输入特征自动收敛:ui-design when uiInScope、compat-migration when containsApiChange
|
|
2
3
|
id: bugfix
|
|
3
4
|
name: 修 bug 方案
|
|
4
5
|
required: [reproduce, root-cause, fix]
|
|
5
6
|
optional_candidates:
|
|
6
7
|
- impact
|
|
8
|
+
- ui-design # when input.uiInScope(章节自带):UI 维度 Bug 才分析
|
|
7
9
|
- regression
|
|
10
|
+
- compat-migration # when input.containsApiChange(章节自带):涉及契约变更才做兼容
|
|
8
11
|
- signoff
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
shared: # 仅闭合允许、不渲染:ui-design/compat-migration 的依赖闭合用
|
|
13
|
+
- api-design
|
|
14
|
+
- data-model
|
|
15
|
+
forbidden: [tech-selection, mvp-boundary, non-goals, goal, requirement, architecture, frontend-architecture, component-design, state-management, performance, deploy, ops, core-logic, acceptance, research, poc-demo, benchmark, migration-guide]
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
# 功能开发方案(决策 3)
|
|
1
|
+
# 功能开发方案(决策 3 · 合并原 feature + fullstack-feature)
|
|
2
|
+
# 章节量由输入特征自动伸缩:纯逻辑功能 ~3 章;含后端/接口/UI 时自动扩到全栈维度(10 章)
|
|
2
3
|
id: feature
|
|
3
4
|
name: 功能开发方案
|
|
4
5
|
required: [requirement, test-strategy]
|
|
5
6
|
optional_candidates:
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
- impact # 影响面(依赖 root-cause shared 闭合)
|
|
8
|
+
- tech-selection # when input.hasBackend || input.containsApiChange(章节自带)
|
|
9
|
+
- architecture # when input.hasLogic && input.hasBackend(章节自带)
|
|
10
|
+
- api-design # when input.containsApiChange(章节自带)
|
|
11
|
+
- core-flow # when input.hasBackend || input.uiInScope(章节自带)
|
|
12
|
+
- component-design # when input.uiInScope(章节自带)
|
|
13
|
+
- state-management # when input.uiInScope(章节自带)
|
|
14
|
+
- ui-design # when input.uiInScope(章节自带)
|
|
15
|
+
- data-model # when input.hasPersistence(章节自带)
|
|
16
|
+
- core-logic # 核心逻辑(when input.hasLogic,章节自带)
|
|
17
|
+
- performance # when input.uiInScope || input.hasBackend(章节自带)
|
|
18
|
+
- compat-migration # when input.containsApiChange(章节自带)
|
|
19
|
+
- signoff # when input.includeSignoff(章节自带)
|
|
20
|
+
shared: # 仅闭合允许、不渲染:impact 依赖 root-cause;前端链依赖 frontend-architecture
|
|
21
|
+
- root-cause
|
|
22
|
+
- frontend-architecture
|
|
23
|
+
forbidden: [reproduce, root-cause, fix, regression, goal, mvp-boundary, non-goals, research, poc-demo, benchmark, migration-guide, deploy, ops, closed-loop, implementability, config-runtime, acceptance]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 0→1 纯前端项目方案(F1 §2.4 裁剪变体)
|
|
2
|
+
# 无后端范围:去掉 architecture(后端总体架构)与 data-model;api-design(合并章)保留——
|
|
3
|
+
# 前端同样需要「接口契约 + 对接规范」,但以 Mock/契约先行方式呈现
|
|
4
|
+
id: frontend-0to1
|
|
5
|
+
name: 0→1 纯前端项目方案
|
|
6
|
+
required: # 14 章(全栈 15 章去掉 architecture;data-model 本为可选)
|
|
7
|
+
- goal # A 目标与边界
|
|
8
|
+
- mvp-boundary # dep: [goal]
|
|
9
|
+
- non-goals # dep: [mvp-boundary]
|
|
10
|
+
- tech-selection # B 技术选型
|
|
11
|
+
- frontend-architecture # C 前端架构
|
|
12
|
+
- api-design # D 接口契约 + 前端对接(Mock/契约先行)
|
|
13
|
+
- core-flow # E 主业务流程(前端视角时序)
|
|
14
|
+
- component-design # F 前端设计 dep: [frontend-architecture]
|
|
15
|
+
- state-management # dep: [component-design]
|
|
16
|
+
- ui-design # dep: [api-design]
|
|
17
|
+
- performance # G 质量 dep: [frontend-architecture]
|
|
18
|
+
- test-strategy # dep: [api-design, data-model]
|
|
19
|
+
- deploy # H 部署交付 dep: [test-strategy]
|
|
20
|
+
- ops # H 运维运营 dep: [deploy]
|
|
21
|
+
optional_candidates:
|
|
22
|
+
- research # B 调研(可选)
|
|
23
|
+
- signoff # Z 签字栏(when includeSignoff)
|
|
24
|
+
forbidden:
|
|
25
|
+
- architecture # 纯前端不画后端架构
|
|
26
|
+
- data-model # 纯前端不设计数据模型
|
|
27
|
+
- core-logic # 纯前端无复杂后端逻辑
|
|
28
|
+
- reproduce # 非 Bug 场景
|
|
29
|
+
- root-cause
|
|
30
|
+
- fix
|
|
31
|
+
- impact
|
|
32
|
+
- regression
|
|
33
|
+
- requirement # 需求分析属 F2
|
|
34
|
+
- compat-migration # 非升级/预研
|
|
35
|
+
- migration-guide
|
|
36
|
+
- poc-demo
|
|
37
|
+
- benchmark
|
|
38
|
+
- closed-loop # 审批专用
|
|
39
|
+
- implementability
|
|
40
|
+
- config-runtime # 已定案砍掉
|
|
41
|
+
- acceptance
|
|
42
|
+
shared:
|
|
43
|
+
- architecture # 仅闭合允许、不渲染(api-design 依赖,纯前端不画后端架构)
|
|
44
|
+
- data-model # 仅闭合允许、不渲染(test-strategy 依赖)
|
|
45
|
+
appendices:
|
|
46
|
+
- anti-ai
|
|
47
|
+
- handoff
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# 全栈技术升级(F4 · fullstack-migration)
|
|
2
|
+
# 升级评估 → 兼容性分析 → 渐进式迁移 → 迁移指南 → 测试 → 灰度发布/回滚
|
|
3
|
+
id: migration
|
|
4
|
+
name: 技术升级方案
|
|
5
|
+
required:
|
|
6
|
+
- goal # 升级动机/收益/工作量边界
|
|
7
|
+
- impact # Breaking Change 清单/影响范围
|
|
8
|
+
- compat-migration # 兼容性分析 + 渐进式迁移方案 + 新旧 API 对照(扩展)
|
|
9
|
+
- migration-guide # 代码迁移指南(逐模块 checklist/codemod/陷阱/培训)
|
|
10
|
+
- test-strategy # 回归测试(视觉/功能/性能回归)
|
|
11
|
+
- deploy # 灰度发布方案 + 回滚预案
|
|
12
|
+
optional_candidates:
|
|
13
|
+
- performance # 性能基准对比(新旧产物体积/加载/运行时)
|
|
14
|
+
- api-design # API 变化对照表(when: input.containsApiChange)
|
|
15
|
+
- data-model # 数据迁移(when: input.hasPersistence)
|
|
16
|
+
- architecture # 新旧架构对比(后端)
|
|
17
|
+
- ui-design # 样式/UI 迁移范围(when: input.uiInScope)
|
|
18
|
+
- ops # 运维监控(灰度期指标/告警)
|
|
19
|
+
- signoff
|
|
20
|
+
forbidden:
|
|
21
|
+
- reproduce # 非 Bug/功能场景
|
|
22
|
+
- root-cause # (入 shared 闭合,不渲染)
|
|
23
|
+
- fix
|
|
24
|
+
- regression
|
|
25
|
+
- requirement
|
|
26
|
+
- tech-selection # 非 0→1 场景(入 shared 闭合,不渲染)
|
|
27
|
+
- mvp-boundary
|
|
28
|
+
- non-goals
|
|
29
|
+
- research # 非预研(F5 用)
|
|
30
|
+
- poc-demo
|
|
31
|
+
- benchmark
|
|
32
|
+
- frontend-architecture # 迁移不重画前端架构(入 shared 闭合,不渲染)
|
|
33
|
+
- component-design
|
|
34
|
+
- state-management
|
|
35
|
+
- acceptance
|
|
36
|
+
shared:
|
|
37
|
+
- root-cause # 仅闭合允许、不渲染:impact 章节 depends_on [root-cause],但迁移场景不渲染根因章
|
|
38
|
+
- tech-selection # 仅闭合允许、不渲染:architecture(新旧架构对比,可选)依赖
|
|
39
|
+
- frontend-architecture # 仅闭合允许、不渲染:performance 依赖(迁移不重画前端架构)
|
|
40
|
+
appendices:
|
|
41
|
+
- anti-ai
|
|
42
|
+
- handoff
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# 全栈技术预研/选型(F5 · fullstack-poc)
|
|
2
|
+
# 证据链:research(调研)→ poc-demo(验证)→ benchmark(数据)→ tech-selection(综合推荐)
|
|
3
|
+
# forbidden 已含全部全栈实现章节(frontend-architecture/component-design/state-management/
|
|
4
|
+
# performance/ops/migration-guide/a11y,见 docs/scenario-templates/f5-poc.md §6.4)
|
|
5
|
+
id: poc
|
|
6
|
+
name: 技术预研/选型
|
|
7
|
+
required:
|
|
8
|
+
- research # A 调研:候选 ≥2 + 社区活跃度 + 团队匹配
|
|
9
|
+
- poc-demo # B 验证:最小验证 + 判据 + 已知限制
|
|
10
|
+
- benchmark # B 数据:同条件同设备 + 原始测量值
|
|
11
|
+
- tech-selection # C 综合推荐:评估矩阵 + 一句话立场(声明序渲染在证据链末尾)
|
|
12
|
+
optional_candidates:
|
|
13
|
+
- goal # A 预研背景与边界
|
|
14
|
+
- impact # D 采用后影响范围(dep: root-cause → shared 闭合)
|
|
15
|
+
- signoff # Z 签字栏(when: input.includeSignoff)
|
|
16
|
+
shared:
|
|
17
|
+
- root-cause # 仅闭合允许、不渲染(impact 依赖)
|
|
18
|
+
forbidden:
|
|
19
|
+
- reproduce # 非 Bug
|
|
20
|
+
- root-cause # 非 Bug
|
|
21
|
+
- fix # 非 Bug
|
|
22
|
+
- regression # 非 Bug
|
|
23
|
+
- requirement # 非功能开发
|
|
24
|
+
- api-design # 无实现设计(无契约可冻结)
|
|
25
|
+
- data-model # 无实现设计(无表可建)
|
|
26
|
+
- ui-design # 无实现设计(无页面可画)
|
|
27
|
+
- architecture # 预研不设计架构
|
|
28
|
+
- frontend-architecture # 预研不设计前端架构
|
|
29
|
+
- component-design # 预研不设计组件
|
|
30
|
+
- state-management # 预研不设计状态
|
|
31
|
+
- performance # 预研不写实现性能方案(benchmark 已覆盖测量)
|
|
32
|
+
- ops # 预研不写运维运营
|
|
33
|
+
- migration-guide # 预研不做代码迁移
|
|
34
|
+
- deploy # 无部署交付
|
|
35
|
+
- test-strategy # 无测试策略
|
|
36
|
+
- config-runtime # 无配置实现
|
|
37
|
+
- acceptance # 无验收标准
|
|
38
|
+
- core-logic # 无核心逻辑实现
|
|
39
|
+
- mvp-boundary # 非 0→1
|
|
40
|
+
- non-goals # 非 0→1(一句话立场覆盖)
|
|
41
|
+
- compat-migration # 非迁移(F4)
|
|
42
|
+
- closed-loop # 审批专用
|
|
43
|
+
- implementability # 审批专用
|
|
44
|
+
appendices:
|
|
45
|
+
- anti-ai # 附录 B · 去AI味自检(五维自检表,≥3 条)
|
|
46
|
+
- handoff # 附录 C · 下游交付衔接(交付矩阵 + 三步)
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: specflow-document
|
|
3
|
-
description: "One-command scenario-based technical document generation (0→1 / bugfix / feature) using the IDE's model — run → Agent auto-generates → validate"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# SpecFlow: Document
|
|
7
|
-
|
|
8
|
-
> **一键生成技术文档**:输入 `/specflow:document run <profile> --text "..."`,你用当前 IDE 模型自动完成全部生成,用户拿到 `document.md`。
|
|
9
|
-
> 引擎不调用第三方 LLM API——由你(Agent,运行在 IDE 模型上)完成需要 LLM 的步骤,`specflow document` 只做确定性校验与渲染。
|
|
10
|
-
|
|
11
|
-
## Invocation(一键入口)
|
|
12
|
-
|
|
13
|
-
```text
|
|
14
|
-
/specflow:document run [<0to1|bugfix|feature>] [--text "..."] [--design <file>] [--specs <file>] [--work-root <path>]
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Cursor: `specflow:document run <profile>`; Codex: `$specflow-document run <profile>`.
|
|
18
|
-
|
|
19
|
-
**收到 `run` 命令后,你必须自动完成全流程,不得中途停下来要求用户分步确认**(除非产物校验失败需要修正)。
|
|
20
|
-
|
|
21
|
-
## 双模式
|
|
22
|
-
|
|
23
|
-
document 同时支持两种用法:
|
|
24
|
-
|
|
25
|
-
1. **通用模式(现状)**:`run <0to1|bugfix|feature>` 从自然语言/素材生成方案文档。
|
|
26
|
-
2. **审批模式(approval 能力)**:`document approve` 从**四件套**(proposal / specs / design / tasks)生成审批文档——含闭环性检查(7 Pass)、可实施性评估(7 维)、质量红线(G1-G6)、可选签字栏(`--signoff`)。多仓:`--workspace-root <root>` 扫描各仓四件套,每仓生成后主仓合订。
|
|
27
|
-
|
|
28
|
-
```text
|
|
29
|
-
# 审批模式(单仓)
|
|
30
|
-
specflow document approve --change <name> --signoff
|
|
31
|
-
# 审批模式(多仓:各仓四件套 → 各自生成 → 主仓合订)
|
|
32
|
-
specflow document approve --workspace-root <root> --changes "platform:ch1,web:ch2"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## 场景自动识别(省略 profile 时)
|
|
36
|
-
|
|
37
|
-
当用户 **未指定** `<profile>` 时:
|
|
38
|
-
|
|
39
|
-
1. 先用你的模型理解自然语言,判断场景:
|
|
40
|
-
- **0to1**:从零做一个产品/项目("想做/做一个/新产品")
|
|
41
|
-
- **bugfix**:排查修复问题("报错/500/崩溃/挂了/异常")
|
|
42
|
-
- **feature**:给已有系统加功能("新增/加个/扩展")
|
|
43
|
-
2. 若判断明确 → 直接使用该场景。
|
|
44
|
-
3. 若**不确定**或信号冲突 → **向用户确认**(列出 0to1 / bugfix / feature 三个选项及含义),等待用户选择后再继续。
|
|
45
|
-
4. 可选:`specflow document detect --text "..."` 查看确定性关键词识别的结果作为参考。
|
|
46
|
-
|
|
47
|
-
> 确定性规则(`detect`)是初判参考;你的模型理解更准。以模型判断 + 用户确认为准。
|
|
48
|
-
|
|
49
|
-
## 一键执行流程(Agent 自动完成)
|
|
50
|
-
|
|
51
|
-
```text
|
|
52
|
-
run [<profile>]
|
|
53
|
-
├─ ① 规划 specflow document plan <profile> ... → 得到步骤清单 + workRoot
|
|
54
|
-
├─ ② 生成 你(Agent)用当前模型按步骤逐项执行:
|
|
55
|
-
│ ├─ input-summary(多输入时)→ digests/input-summary.md
|
|
56
|
-
│ ├─ outline → outline.yaml(参考 prompts/document/outline/general.md)
|
|
57
|
-
│ ├─ 逐章填空 → chapters/<id>.md + entities.json(参考 prompts/document/map/<id>.md)
|
|
58
|
-
│ └─ review(可选)→ review-result.json(参考 prompts/document/review/ai-review.md)
|
|
59
|
-
└─ ③ 校验 specflow document validate --work-root <path>
|
|
60
|
-
└─ 通过 → 输出 document.md;失败 → 修正产物后重跑 validate
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## ① 规划(plan)
|
|
64
|
-
|
|
65
|
-
```text
|
|
66
|
-
specflow document plan <profile> [--text "..."] [--design <file>] [--specs <file>] [--work-root <path>]
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
引擎输出每个 Agent 步骤(id / 做什么 / 参考提示词 / 输入 / 输出 / 必做)。你按此清单执行即可。
|
|
70
|
-
|
|
71
|
-
## ② 生成(你,用 IDE 模型执行)
|
|
72
|
-
|
|
73
|
-
0. **读取项目规约(必须先做)**:生成任何章节前,先扫描项目规约与 IDE 规则——
|
|
74
|
-
- 配置:`specflow/config.yaml` 的 `conventions.<topic>`(architecture / database / api / frontend)
|
|
75
|
-
- 中立文档:`docs/db/conventions.md`、`docs/api/guidelines.md`、`docs/engineering/*` 等
|
|
76
|
-
- IDE 规则:`.cursor` / `.claude` / `.agents` 下的 skills 与 rules
|
|
77
|
-
- guidance packs:`skills/guidance-packs.yaml` 声明的私有知识包(如 database)
|
|
78
|
-
- **优先级:项目约定 > SpecFlow guidance > LLM**。未发现时显式标注「未发现项目规约」。
|
|
79
|
-
- 将数据库 DDL 约定、API 规范、前端规约、架构禁令落实到后续章节。
|
|
80
|
-
1. **input-summary**(多输入或长输入时):读全部输入,产出紧凑摘要 → `digests/input-summary.md`。
|
|
81
|
-
2. **outline**:按场景 Profile 生成 `outline.yaml`——章节序 + 每章要点(kind / references / source_segments)+ 实体注册表 + 决策。参考 `.claude/specflow/prompts/document/outline/general.md`。
|
|
82
|
-
3. **逐章填空**:每章一个步骤 → `chapters/<id>.md`(叙述)+ 契约实体进 `entities.json`。参考 `.claude/specflow/prompts/document/map/goal.md` 等(如 `map/api-design.md`、`map/root-cause.md`)。
|
|
83
|
-
4. **review**(可选):独立审查全部章节 → `review-result.json`(findings + part_hashes)。参考 `.claude/specflow/prompts/document/review/ai-review.md`。
|
|
84
|
-
|
|
85
|
-
## ③ 校验(validate,引擎确定性执行)
|
|
86
|
-
|
|
87
|
-
```text
|
|
88
|
-
specflow document validate --work-root <path>
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
引擎校验:
|
|
92
|
-
- outline 必选章 / references / kind 一致性
|
|
93
|
-
- 每章叙述过反偷懒 lint(禁 TODO/待补充/同上/含糊词)
|
|
94
|
-
- 契约实体 zod + 结构化覆盖(引用的实体必须被填充)
|
|
95
|
-
- 通过后渲染 `document.md`(+ `document.html`)
|
|
96
|
-
|
|
97
|
-
**若 validate 失败**:读取 diagnostics,修正对应产物,重跑 validate,直到通过。
|
|
98
|
-
|
|
99
|
-
## 内置场景 Profile
|
|
100
|
-
|
|
101
|
-
| Profile | 必选章 | 候选章 |
|
|
102
|
-
|---------|--------|--------|
|
|
103
|
-
| `0to1` | goal / tech-selection / mvp-boundary / non-goals | architecture / api-design / data-model / test-strategy |
|
|
104
|
-
| `bugfix` | reproduce / root-cause / fix | impact / regression |
|
|
105
|
-
| `feature` | requirement / test-strategy | api-design / data-model / ui-design |
|
|
106
|
-
|
|
107
|
-
## 质量红线(生成时必须满足)
|
|
108
|
-
|
|
109
|
-
- 契约实体:接口须含 ≥1 失败示例(G2);表须含完整 DDL。
|
|
110
|
-
- 覆盖:每个大纲要点必须有填充落点。
|
|
111
|
-
- 反偷懒:禁止 TODO/待补充/同上/含糊词。
|
|
112
|
-
- 一致性:跨章实体名/路径与 outline.yaml 冻结名一致,不靠记忆。
|
|
113
|
-
|
|
114
|
-
## 说明
|
|
115
|
-
|
|
116
|
-
- `run` 是一键入口(Agent 自动执行)。`plan` / `validate` 是分步/高级用法。
|
|
117
|
-
- 本命令不改 phase,不阻塞 apply。
|
|
118
|
-
|
|
119
|
-
## 实现能力标记(parity 校验用)
|
|
120
|
-
|
|
121
|
-
- **两遍扫描(two-pass outline)**:Pass 1 生成 outline(大纲),Pass 2 逐章填空。
|
|
122
|
-
- **按要点填空(fill-in by points)**:每章对着要点清单填空。
|
|
123
|
-
- **契约注入(contract injection)**:上游契约实体按 references 确定性注入。
|
|
124
|
-
- **覆盖校验(coverage check)**:结构化通道 + 语义通道校验覆盖。
|