生成ExecSpecMasterConstraints_L*.md权威约束文件,定义Phase/SubPlan/Round命名规范、目录结构、环境策略和质量门禁阈值。当需要创建 ExecSpec Master Plan 的约束文档、定义命名规范、定义质量门禁、定义HITL检查点时使用。
Scope: EXECSPEC_COMPILE — Compile ExecSpec(编译 ExecSpec)
版本: 1.0.0 | 创建日期: 2025-02-03
Constraints Generator 生成权威约束文件,定义 ExecSpec 通路(编译 + 落实)的所有规范和阈值。
核心职责:
Why:
对应 Build_Exec_Spec_Plans: Step 5 (约束文件生成)
spec/build/scaffold_analysis_report.md(项目类型、测试框架)spec/build/environment_config_checklist.md(环境策略)_exec_specs/ExecSpecMasterConstraints_L1.md(或L2/L3)文件包含6个核心章节:
Read SPEC level input (L1/L2/L3)
Load level-specific templates:
- L1: STREAMLINED (最小配置)
- L2: BALANCED (标准配置)
- L3: RIGOROUS (完整配置)
Define naming rules:
- Phase: Phase_{{N}}
- SubPlan: {{Phase}}.SubPlan_{{N}}
- Round: Round_{{N}}_{{Stage}}
- Integration: INTEGRATION_PHASE, INTEGRATION_FINAL
Generate examples for each rule
Define _exec_specs/ structure:
- Master-level files (Plan/Constraints/Dashboard)
- SubPlan files (ExecSpecSubPlan_*.md)
Generate directory tree in markdown format
Read environment_config_checklist.md
Extract environment list (dev/test/staging/prod)
For each environment:
- Define purpose
- Define data characteristics
- Define access policy
Based on SPEC level:
L1: Code Coverage ≥70%, Test Pass ≥95%, Lint (optional)
L2: Code Coverage ≥80%, Test Pass ≥98%, Lint (required), Security Scan (optional)
L3: Code Coverage ≥90%, Test Pass ≥100%, Lint (required), Security Scan (required), Performance Benchmark (required)
Format as table with thresholds
Based on SPEC level:
L1: High-risk SubPlan + Integration Phase
L2: L1 + Dependency conflicts + External API integration
L3: L2 + Security-sensitive changes + Performance degradation
Define escalation strategy (E1/E2/E3)
Write `_exec_specs/ExecSpecMasterConstraints_L{level}.md`
Include all 6 sections
Add metadata (creation date, SPEC level, reference links)
开发者需要确定项目使用L1/L2/L3哪个级别。
///constraints-generator
Level: L1
查看 _exec_specs/ExecSpecMasterConstraints_L1.md(或L2/L3)。
所有SubPlan必须在开头引用约束文件:
**约束**: 生成后见 `_exec_specs/ExecSpecMasterConstraints_L1.md`(或 L2/L3)
预计耗时: 2-3分钟
ExecSpecMasterConstraints_L1.md包含以下章节:
不支持:
依赖: