doc-sys-autopilot
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedoc-sys-autopilot
doc-sys-autopilot
Purpose
目的
Automated System Requirements (SYS) generation pipeline that processes ADR architecture decisions to generate comprehensive system requirements documents with functional requirements, quality attributes, and REQ-Ready scoring.
Layer: 6 (System Requirements)
Upstream: BRD (Layer 1), PRD (Layer 2), EARS (Layer 3), BDD (Layer 4), ADR (Layer 5)
Downstream Artifacts: REQ (Layer 7)
自动化 系统需求(SYS) 生成流水线:处理 ADR 架构决策,生成包含功能需求、质量属性和 REQ-Ready 评分的综合系统需求文档。
层级:6(系统需求)
上游:BRD(第 1 层)、PRD(第 2 层)、EARS(第 3 层)、BDD(第 4 层)、ADR(第 5 层)
下游产物:REQ(第 7 层)
Input Contract (IPLAN-004 Standard)
输入契约(IPLAN-004 标准)
- Supported modes:
--ref <path>--prompt "<text>"--iplan <path|IPLAN-NNN>
- Precedence:
--iplan > --ref > --prompt - IPLAN resolution order:
- Use explicit file path when it exists
- Resolve
work_plans/IPLAN-NNN*.md - Resolve
governance/plans/IPLAN-NNN*.md - If multiple matches exist, fail with disambiguation request
- Merge conflict rule:
- Objective/scope conflicts between primary and supplemental sources are blocking and require user clarification.
- 支持的模式:
--ref <path>--prompt "<text>"--iplan <path|IPLAN-NNN>
- 优先级:
--iplan > --ref > --prompt - IPLAN 解析顺序:
- 当显式文件路径存在时使用该路径
- 解析
work_plans/IPLAN-NNN*.md - 解析
governance/plans/IPLAN-NNN*.md - 如果存在多个匹配项,则失败并请求消除歧义
- 合并冲突规则:
- 主来源与补充来源之间的目标/范围冲突属于阻断性问题,需要用户澄清。
Input Contract (IPLAN-004 Standard)
输入契约(IPLAN-004 标准)
- Supported modes:
--ref <path>--prompt "<text>"--iplan <path|IPLAN-NNN>
- Precedence:
--iplan > --ref > --prompt - IPLAN resolution order:
- Use explicit file path when it exists
- Resolve
work_plans/IPLAN-NNN*.md - Resolve
governance/plans/IPLAN-NNN*.md - If multiple matches exist, fail with disambiguation request
- Merge conflict rule:
- Objective/scope conflicts between primary and supplemental sources are blocking and require user clarification.
- 支持的模式:
--ref <path>--prompt "<text>"--iplan <path|IPLAN-NNN>
- 优先级:
--iplan > --ref > --prompt - IPLAN 解析顺序:
- 当显式文件路径存在时使用该路径
- 解析
work_plans/IPLAN-NNN*.md - 解析
governance/plans/IPLAN-NNN*.md - 如果存在多个匹配项,则失败并请求消除歧义
- 合并冲突规则:
- 主来源与补充来源之间的目标/范围冲突属于阻断性问题,需要用户澄清。
Skill Dependencies
Skill 依赖
This autopilot orchestrates the following skills:
| Skill | Purpose | Phase |
|---|---|---|
| Element ID format (SYS.NN.TT.SS), threshold tags, legacy pattern detection | All Phases |
| SYS creation rules, 5-part structure, quality attribute categories | Phase 3: SYS Generation |
| Real-time quality feedback during SYS generation | Phase 3: SYS Generation |
| Validate SYS structure, content, REQ-Ready score | Phase 4: SYS Validation |
| Content review, link validation, quality scoring | Phase 5: Review |
| Apply fixes from review report, create missing files | Phase 5: Fix |
Delegation Principle: The autopilot orchestrates workflow but delegates:
- SYS structure/content rules -> skill
doc-sys - Real-time quality feedback -> skill
quality-advisor - SYS validation logic -> skill
doc-sys-validator - Content review and scoring -> skill
doc-sys-reviewer - Issue resolution and fixes -> skill
doc-sys-fixer - Element ID standards -> skill
doc-naming
此 autopilot 编排以下 skills:
| Skill | 用途 | 阶段 |
|---|---|---|
| 元素 ID 格式(SYS.NN.TT.SS)、阈值标签、旧版模式检测 | 所有阶段 |
| SYS 创建规则、5 部分结构、质量属性类别 | 阶段 3:SYS 生成 |
| SYS 生成期间的实时质量反馈 | 阶段 3:SYS 生成 |
| 验证 SYS 结构、内容和 REQ-Ready 分数 | 阶段 4:SYS 验证 |
| 内容审查、链接验证、质量评分 | 阶段 5:审查 |
| 应用审查报告中的修复、创建缺失文件 | 阶段 5:修复 |
委派原则:autopilot 负责编排工作流,但将具体职责委托给各 skill:
- SYS 结构/内容规则 -> skill
doc-sys - 实时质量反馈 -> skill
quality-advisor - SYS 验证逻辑 -> skill
doc-sys-validator - 内容审查和评分 -> skill
doc-sys-reviewer - 问题解决和修复 -> skill
doc-sys-fixer - 元素 ID 标准 -> skill
doc-naming
Document Type Contract (MANDATORY)
文档类型契约(强制)
When generating SYS document instances, the autopilot MUST:
-
Readfrom template:
instance_document_type- Source:
ai_dev_ssd_flow/06_SYS/SYS-MVP-TEMPLATE.yaml - Field:
metadata.instance_document_type: "sys-document"
- Source:
-
Setin generated document frontmatter:
document_typeyamlcustom_fields: document_type: sys-document # NOT "template" artifact_type: SYS layer: 6 -
Validation: Generated documents MUST have
document_type: sys-document- Templates have
document_type: template - Instances have
document_type: sys-document - Schema validates both values
- Templates have
Error Handling: If is missing from template, default to .
instance_document_typesys-document生成 SYS 文档实例时,autopilot 必须:
-
从模板中读取:
instance_document_type- 来源:
ai_dev_ssd_flow/06_SYS/SYS-MVP-TEMPLATE.yaml - 字段:
metadata.instance_document_type: "sys-document"
- 来源:
-
在生成文档的 frontmatter 中设置:
document_typeyamlcustom_fields: document_type: sys-document # NOT "template" artifact_type: SYS layer: 6 -
验证:生成的文档必须具有
document_type: sys-document- 模板的 为
document_typetemplate - 实例的 为
document_typesys-document - Schema 验证这两个值
- 模板的
错误处理:如果模板缺少 ,则默认为 。
instance_document_typesys-documentSmart Document Detection
智能文档检测
The autopilot automatically determines the action based on the input document type.
autopilot 根据输入文档类型自动确定要执行的操作。
Input Type Recognition
输入类型识别
| Input | Detected As | Action |
|---|---|---|
| Self type | Review existing SYS document |
| Upstream type | Generate if missing, review if exists |
| 输入 | 识别结果 | 操作 |
|---|---|---|
| 自身类型 | 审查现有 SYS 文档 |
| 上游类型 | 缺失时生成,存在时审查 |
Detection Algorithm
检测算法
1. Parse input: Extract TYPE and NN from "{TYPE}-{NN}"
2. Determine action:
- IF TYPE == "SYS": Review Mode
- ELSE IF TYPE == "ADR": Generate/Find Mode
- ELSE: Error (invalid type for this autopilot)
3. For Generate/Find Mode:
- Check: Does SYS-{NN} exist in docs/06_SYS/?
- IF exists: Switch to Review Mode for SYS-{NN}
- ELSE: Proceed with Generation from ADR-{NN}1. Parse input: Extract TYPE and NN from "{TYPE}-{NN}"
2. Determine action:
- IF TYPE == "SYS": Review Mode
- ELSE IF TYPE == "ADR": Generate/Find Mode
- ELSE: Error (invalid type for this autopilot)
3. For Generate/Find Mode:
- Check: Does SYS-{NN} exist in docs/06_SYS/?
- IF exists: Switch to Review Mode for SYS-{NN}
- ELSE: Proceed with Generation from ADR-{NN}File Existence Check
文件存在性检查
bash
undefinedbash
undefinedCheck for nested folder structure (mandatory)
Check for nested folder structure (mandatory)
ls docs/06_SYS/SYS-{NN}_*/
undefinedls docs/06_SYS/SYS-{NN}_*/
undefinedExamples
示例
bash
undefinedbash
undefinedReview mode (same type - SYS input)
Review mode (same type - SYS input)
/doc-sys-autopilot SYS-01 # Reviews existing SYS-01
/doc-sys-autopilot SYS-01 # Reviews existing SYS-01
Generate/Find mode (upstream type - ADR input)
Generate/Find mode (upstream type - ADR input)
/doc-sys-autopilot ADR-01 # Generates SYS-01 if missing, or reviews existing SYS-01
/doc-sys-autopilot ADR-01 # Generates SYS-01 if missing, or reviews existing SYS-01
Multiple inputs
Multiple inputs
/doc-sys-autopilot ADR-01,ADR-02 # Generates/reviews SYS-01 and SYS-02
/doc-sys-autopilot SYS-01,SYS-02 # Reviews SYS-01 and SYS-02
undefined/doc-sys-autopilot ADR-01,ADR-02 # Generates/reviews SYS-01 and SYS-02
/doc-sys-autopilot SYS-01,SYS-02 # Reviews SYS-01 and SYS-02
undefinedAction Determination Output
操作判定输出
Input: ADR-01
├── Detected Type: ADR (upstream)
├── Expected SYS: SYS-01
├── SYS Exists: Yes → docs/06_SYS/SYS-01_f1_iam/
└── Action: REVIEW MODE - Running doc-sys-reviewer on SYS-01
Input: ADR-05
├── Detected Type: ADR (upstream)
├── Expected SYS: SYS-05
├── SYS Exists: No
└── Action: GENERATE MODE - Creating SYS-05 from ADR-05
Input: SYS-03
├── Detected Type: SYS (self)
└── Action: REVIEW MODE - Running doc-sys-reviewer on SYS-03Input: ADR-01
├── Detected Type: ADR (upstream)
├── Expected SYS: SYS-01
├── SYS Exists: Yes → docs/06_SYS/SYS-01_f1_iam/
└── Action: REVIEW MODE - Running doc-sys-reviewer on SYS-01
Input: ADR-05
├── Detected Type: ADR (upstream)
├── Expected SYS: SYS-05
├── SYS Exists: No
└── Action: GENERATE MODE - Creating SYS-05 from ADR-05
Input: SYS-03
├── Detected Type: SYS (self)
└── Action: REVIEW MODE - Running doc-sys-reviewer on SYS-03When to Use This Skill
何时使用此 Skill
Use when:
doc-sys-autopilot- ADR documents are complete with SYS-Ready score >= 90%
- Need to generate system requirements from architecture decisions
- Want automated functional requirement and quality attribute generation
- Ensuring consistent SYS quality across the project
- Automating SYS generation in CI/CD pipelines
Do NOT use when:
- Manually creating a single SYS with extensive customization (use directly)
doc-sys - ADR documents are incomplete or have SYS-Ready score < 90%
- Editing specific SYS sections (use for guidance)
doc-sys - Validating existing SYS only (use )
doc-sys-validator
在以下情况下使用 :
doc-sys-autopilot- ADR 文档已完成,且 SYS-Ready 分数 >= 90%
- 需要根据架构决策生成系统需求
- 希望自动生成功能需求和质量属性
- 需要确保项目中的 SYS 质量保持一致
- 需要在 CI/CD 流水线中自动化 SYS 生成
以下情况不要使用:
- 需要大量自定义并手动创建单个 SYS(直接使用 )
doc-sys - ADR 文档不完整或 SYS-Ready 分数 < 90%
- 需要编辑 SYS 的特定章节(使用 获取指导)
doc-sys - 只需验证现有 SYS(使用 )
doc-sys-validator
Workflow Overview
工作流概览
mermaid
flowchart TD
subgraph Phase1["Phase 1: ADR Analysis"]
A[Start] --> B[Read ADR Documents]
B --> C[Extract Architecture Decisions]
C --> D[Identify System Constraints]
D --> E[Catalog Technical Requirements]
end
subgraph Phase2["Phase 2: SYS Readiness Check"]
E --> F[Check ADR SYS-Ready Scores]
F --> G{All ADRs >= 90%?}
G -->|No| H[Flag ADRs Below Threshold]
H --> I[Report Missing Elements]
I --> J[Abort or Continue with Warnings]
G -->|Yes| K[Mark ADRs Ready for SYS]
end
subgraph Phase3["Phase 3: SYS Generation"]
K --> L{Next ADR Topic}
L --> M[Load SYS Template]
M --> N[Generate Document Control]
N --> O[Generate Functional Requirements]
O --> P[Generate Quality Attributes]
P --> Q[Generate Interface Specifications]
Q --> R[quality-advisor: Real-time Feedback]
R --> S[Generate Remaining Sections]
S --> T[Add Cumulative Tags]
T --> U[Write SYS Files]
end
subgraph Phase4["Phase 4: SYS Validation"]
U --> V[Run doc-sys-validator]
V --> W{REQ-Ready >= 90%?}
W -->|No| X[Auto-Fix SYS Issues]
X --> Y[Re-validate SYS]
Y --> W
W -->|Yes| Z[Mark SYS Validated]
end
subgraph Phase5["Phase 5: Review & Fix Cycle"]
Z --> ZA[Run doc-sys-reviewer]
ZA --> ZB{Score >= 90?}
ZB -->|No| ZC[Run doc-sys-fixer]
ZC --> ZD{Iteration < Max?}
ZD -->|Yes| ZA
ZD -->|No| ZE[Flag Manual Review]
ZB -->|Yes| ZF[Verify Quality Checks]
ZE --> ZF
ZF --> AA{More ADR Topics?}
AA -->|Yes| L
AA -->|No| AB[Check All SYS Complete]
AB --> AC[Verify Cross-SYS Consistency]
AC --> AD[Update Traceability Matrix]
AD --> AE[Generate Summary Report]
end
AE --> AF[Complete]mermaid
flowchart TD
subgraph Phase1["Phase 1: ADR Analysis"]
A[Start] --> B[Read ADR Documents]
B --> C[Extract Architecture Decisions]
C --> D[Identify System Constraints]
D --> E[Catalog Technical Requirements]
end
subgraph Phase2["Phase 2: SYS Readiness Check"]
E --> F[Check ADR SYS-Ready Scores]
F --> G{All ADRs >= 90%?}
G -->|No| H[Flag ADRs Below Threshold]
H --> I[Report Missing Elements]
I --> J[Abort or Continue with Warnings]
G -->|Yes| K[Mark ADRs Ready for SYS]
end
subgraph Phase3["Phase 3: SYS Generation"]
K --> L{Next ADR Topic}
L --> M[Load SYS Template]
M --> N[Generate Document Control]
N --> O[Generate Functional Requirements]
O --> P[Generate Quality Attributes]
P --> Q[Generate Interface Specifications]
Q --> R[quality-advisor: Real-time Feedback]
R --> S[Generate Remaining Sections]
S --> T[Add Cumulative Tags]
T --> U[Write SYS Files]
end
subgraph Phase4["Phase 4: SYS Validation"]
U --> V[Run doc-sys-validator]
V --> W{REQ-Ready >= 90%?}
W -->|No| X[Auto-Fix SYS Issues]
X --> Y[Re-validate SYS]
Y --> W
W -->|Yes| Z[Mark SYS Validated]
end
subgraph Phase5["Phase 5: Review & Fix Cycle"]
Z --> ZA[Run doc-sys-reviewer]
ZA --> ZB{Score >= 90?}
ZB -->|No| ZC[Run doc-sys-fixer]
ZC --> ZD{Iteration < Max?}
ZD -->|Yes| ZA
ZD -->|No| ZE[Flag Manual Review]
ZB -->|Yes| ZF[Verify Quality Checks]
ZE --> ZF
ZF --> AA{More ADR Topics?}
AA -->|Yes| L
AA -->|No| AB[Check All SYS Complete]
AB --> AC[Verify Cross-SYS Consistency]
AC --> AD[Update Traceability Matrix]
AD --> AE[Generate Summary Report]
end
AE --> AF[Complete]Detailed Workflow
详细工作流
Phase 1: ADR Analysis
阶段 1:ADR 分析
Analyze ADR documents to extract architecture decisions and system constraints.
Input Sources:
| Priority | Source | Location | Content Type |
|---|---|---|---|
| 1 | ADR Documents | | Architecture Decisions |
| 2 | ADR-00 Technology Stack | | Approved Technologies |
| 3 | BRD Section 7.2 | | Architecture Decision Requirements |
| 4 | PRD Section 18 | | Architecture Decision Requirements |
Analysis Process:
bash
undefined分析 ADR 文档,提取架构决策和系统约束。
输入来源:
| 优先级 | 来源 | 位置 | 内容类型 |
|---|---|---|---|
| 1 | ADR 文档 | | 架构决策 |
| 2 | ADR-00 技术栈 | | 已批准的技术 |
| 3 | BRD 第 7.2 节 | | 架构决策需求 |
| 4 | PRD 第 18 节 | | 架构决策需求 |
分析过程:
bash
undefinedLocate ADR documents
Locate ADR documents
find docs/05_ADR/ -name "ADR-*.md" -type f | sort
find docs/05_ADR/ -name "ADR-*.md" -type f | sort
Check for SYS-Ready scores in ADRs
Check for SYS-Ready scores in ADRs
grep -E "SYS-Ready.Score" docs/05_ADR/ADR-.md
**Required ADR Content per Topic**:
| ADR | Topic Category | Key Content for SYS |
|-----|----------------|---------------------|
| ADR-01 | Infrastructure | Compute, networking, scaling constraints |
| ADR-02 | Data Architecture | Storage, data flow, persistence requirements |
| ADR-03 | Integration | API patterns, messaging, protocol requirements |
| ADR-04 | Security | Authentication, authorization, encryption requirements |
| ADR-05 | Observability | Logging, monitoring, alerting requirements |
| ADR-06 | AI/ML | Model requirements, inference constraints |
| ADR-07 | Technology Selection | Framework, language, tool constraints |
**Output**: System requirements catalog with ADR-derived constraints and technical requirements.grep -E "SYS-Ready.Score" docs/05_ADR/ADR-.md
**各主题的 ADR 必需内容**:
| ADR | 主题类别 | 用于 SYS 的关键内容 |
|-----|----------------|---------------------|
| ADR-01 | 基础设施 | 计算、网络、扩缩容约束 |
| ADR-02 | 数据架构 | 存储、数据流、持久化需求 |
| ADR-03 | 集成 | API 模式、消息传递、协议需求 |
| ADR-04 | 安全 | 身份认证、授权、加密需求 |
| ADR-05 | 可观测性 | 日志、监控、告警需求 |
| ADR-06 | AI/ML | 模型需求、推理约束 |
| ADR-07 | 技术选型 | 框架、语言、工具约束 |
**输出**:包含 ADR 衍生约束和技术需求的系统需求目录。Phase 2: SYS Readiness Check
阶段 2:SYS 就绪检查
Validate that all ADR documents meet the SYS-Ready threshold before proceeding.
Skill Delegation: Element ID validation follows rules inskill. See:doc-namingfor element type codes..claude/skills/doc-naming/SKILL.md
SYS-Ready Score Requirements:
| Criteria | Weight | Description |
|---|---|---|
| Decision Completeness | 30% | Context/Decision/Consequences/Alternatives documented |
| Architecture Clarity | 35% | Mermaid diagrams, component responsibilities |
| Implementation Readiness | 20% | Complexity assessment, dependencies, rollback strategies |
| Verification Approach | 15% | Testing strategy, success metrics, operational readiness |
Minimum Score: 90%
ADR to SYS Mapping:
| ADR Document | SYS Document | System Domain |
|---|---|---|
| ADR-01 | SYS-01 | Infrastructure System |
| ADR-02 | SYS-02 | Data Management System |
| ADR-03 | SYS-03 | Integration System |
| ADR-04 | SYS-04 | Security System |
| ADR-05 | SYS-05 | Observability System |
| ADR-06 | SYS-06 | AI/ML System |
| ADR-07 | SYS-07 | Technology Platform |
Readiness Check Process:
python
def check_adr_readiness(adr_list: list) -> dict:
"""
Check SYS-Ready scores for all ADR documents.
Returns:
dict with 'ready' (list of ADRs >= 90%)
and 'not_ready' (list of ADRs < 90% with issues)
"""
ready = []
not_ready = []
for adr in adr_list:
score = extract_sys_ready_score(adr)
if score >= 90:
ready.append(adr)
else:
not_ready.append({
'adr': adr,
'score': score,
'issues': identify_missing_elements(adr)
})
return {'ready': ready, 'not_ready': not_ready}在继续之前,验证所有 ADR 文档是否达到 SYS-Ready 阈值。
Skill 委派:元素 ID 验证遵循skill 中的规则。 参见:doc-naming中的元素类型代码。.claude/skills/doc-naming/SKILL.md
SYS-Ready 分数要求:
| 标准 | 权重 | 说明 |
|---|---|---|
| 决策完整性 | 30% | 已记录上下文/决策/后果/备选方案 |
| 架构清晰度 | 35% | Mermaid 图、组件职责 |
| 实现就绪度 | 20% | 复杂度评估、依赖关系、回滚策略 |
| 验证方法 | 15% | 测试策略、成功指标、运行就绪度 |
最低分数:90%
ADR 到 SYS 的映射:
| ADR 文档 | SYS 文档 | 系统领域 |
|---|---|---|
| ADR-01 | SYS-01 | 基础设施系统 |
| ADR-02 | SYS-02 | 数据管理系统 |
| ADR-03 | SYS-03 | 集成系统 |
| ADR-04 | SYS-04 | 安全系统 |
| ADR-05 | SYS-05 | 可观测性系统 |
| ADR-06 | SYS-06 | AI/ML 系统 |
| ADR-07 | SYS-07 | 技术平台 |
就绪检查流程:
python
def check_adr_readiness(adr_list: list) -> dict:
"""
Check SYS-Ready scores for all ADR documents.
Returns:
dict with 'ready' (list of ADRs >= 90%)
and 'not_ready' (list of ADRs < 90% with issues)
"""
ready = []
not_ready = []
for adr in adr_list:
score = extract_sys_ready_score(adr)
if score >= 90:
ready.append(adr)
else:
not_ready.append({
'adr': adr,
'score': score,
'issues': identify_missing_elements(adr)
})
return {'ready': ready, 'not_ready': not_ready}Phase 3: SYS Generation
阶段 3:SYS 生成
Generate SYS documents with functional requirements and quality attributes.
Skill Delegation: This phase follows rules defined inskill. See:doc-sysfor complete SYS creation guidance..claude/skills/doc-sys/SKILL.mdQuality Guidance: Usesskill for real-time feedback during generation. See:quality-advisorfor quality monitoring..claude/skills/quality-advisor/SKILL.md
Generation Process:
-
Reserve SYS ID:bash
# Check for next available ID ls docs/06_SYS/SYS-*.md 2>/dev/null | \ grep -oP 'SYS-\K\d+' | sort -n | tail -1 # Increment for new SYS -
Load SYS Template:
- Primary:
ai_dev_ssd_flow/06_SYS/SYS-MVP-TEMPLATE.md - Rules:
ai_dev_ssd_flow/06_SYS/SYS_MVP_CREATION_RULES.md
-
Generate Document Control Section:
Field Value Project Name From BRD Document Version 0.1.0 Date Created Current date (YYYY-MM-DD) Last Updated Current date (YYYY-MM-DD) Document Owner From ADR stakeholder analysis Prepared By AI Assistant Status Draft (or In Review if ADR Accepted) EARS-Ready Score From upstream EARS REQ-Ready Score Calculated after generation -
Generate Functional Requirements (Part 2 - Section 4):From ADR Decision and Implementation sections:
Element ID Requirement Priority Source Verification SYS.01.01.01 The system shall... Must Have ADR-01.Decision Integration Test SYS.01.01.02 The system shall... Should Have ADR-01.Impl Unit Test Element Type Codes (perskill):doc-namingElement Type Code Example Functional Requirement 01 SYS.02.01.01 Quality Attribute 02 SYS.02.02.01 Use Case 11 SYS.02.11.01 System Requirement 26 SYS.02.26.01 -
Generate Quality Attributes (Part 2 - Section 5):From ADR Consequences and Implementation sections:Required Categories:
Category Source Metrics Performance ADR latency/throughput targets p50/p95/p99, TPS Reliability ADR availability/recovery Uptime %, MTBF, MTTR Scalability ADR scaling decisions Concurrent users, data volume Security ADR-04 Security ADR Auth latency, encryption Observability ADR-05 Observability ADR Log retention, alert thresholds Maintainability ADR deployment decisions Deploy frequency, coverage Quality Attribute Format:markdown| ID | Category | Attribute | Target | Measurement | Source | |----|----------|-----------|--------|-------------|--------| | SYS.01.02.01 | Performance | API Response Time | p95 < 100ms | APM Monitoring | @threshold: PRD.01.perf.api.p95_latency | | SYS.01.02.02 | Reliability | Availability | 99.9% | Uptime Monitoring | @threshold: PRD.01.sla.uptime.target | -
Generate Interface Specifications (Part 3 - Section 6):From ADR Integration decisions:
- External APIs (CTR-ready)
- Internal interfaces
- Data exchange protocols
- Message formats
-
Real-Time Quality Feedback (viaskill):
quality-advisor- Monitor section completion as content is generated
- Detect anti-patterns (AP-001 to AP-017) during creation
- Validate element ID format compliance (SYS.NN.TT.SS)
- Check for placeholder text ([TBD], TODO, XXX)
- Verify Mermaid diagram presence (recommended for SYS)
- Validate @threshold tag usage for quantitative values
- Flag issues early to reduce post-generation rework
-
Generate Remaining Sections:
- Section 7: Data Management Requirements
- Section 8: Testing and Validation Requirements
- Section 9: Deployment and Operations Requirements
- Section 10: Compliance and Regulatory Requirements
- Section 11: Acceptance Criteria
- Section 12: Risk Assessment
- Section 13: Traceability
- Section 14: Implementation Notes
-
Add Cumulative Tags (Section 13):Layer 6 Required Tags (5 tags):markdown
## Traceability **Required Tags** (Cumulative Tagging Hierarchy - Layer 6): @brd: BRD.01.01.03 @prd: PRD.01.07.02, PRD.01.07.15 @ears: EARS.01.25.01, EARS.01.25.02 @bdd: BDD.01.14.01 @adr: ADR-01, ADR-04 -
File Output (ALWAYS use nested folder):
- Monolithic (<20k tokens):
docs/06_SYS/SYS-NN_{slug}/SYS-NN_{slug}.md - Sectioned (≥20k tokens): ,
docs/06_SYS/SYS-NN_{slug}/SYS-NN.0_index.md, etc.SYS-NN.1_core.md - Modular (v2.0):
docs/06_SYS/SYS-NN_{slug}/SYS-NN.MM_{capability}.md - Master Index (always): (create or update)
docs/06_SYS/SYS-00_index.md
Nested Folder Rule: ALL SYS use nested folders () regardless of size. This keeps companion files (review reports, fix reports, drift cache) organized with their parent document.SYS-NN_{slug}/ - Monolithic (<20k tokens):
生成包含功能需求和质量属性的 SYS 文档。
Skill 委派:此阶段遵循skill 中定义的规则。 参见:doc-sys,了解完整的 SYS 创建指导。.claude/skills/doc-sys/SKILL.md质量指导:生成期间使用skill 提供实时反馈。 参见:quality-advisor,了解质量监控机制。.claude/skills/quality-advisor/SKILL.md
生成过程:
-
预留 SYS ID:bash
# Check for next available ID ls docs/06_SYS/SYS-*.md 2>/dev/null | \ grep -oP 'SYS-\K\d+' | sort -n | tail -1 # Increment for new SYS -
加载 SYS 模板:
- 主要模板:
ai_dev_ssd_flow/06_SYS/SYS-MVP-TEMPLATE.md - 规则:
ai_dev_ssd_flow/06_SYS/SYS_MVP_CREATION_RULES.md
-
生成文档控制部分:
字段 值 项目名称 来自 BRD 文档版本 0.1.0 创建日期 当前日期(YYYY-MM-DD) 最后更新 当前日期(YYYY-MM-DD) 文档负责人 来自 ADR 利益相关者分析 编制人 AI Assistant 状态 草稿(如果 ADR 已接受,则为审查中) EARS-Ready 分数 来自上游 EARS REQ-Ready 分数 生成后计算 -
生成功能需求(第 2 部分 - 第 4 节):根据 ADR 的 Decision 和 Implementation 部分生成:
元素 ID 需求 优先级 来源 验证方式 SYS.01.01.01 系统应... 必须具备 ADR-01.Decision 集成测试 SYS.01.01.02 系统应... 应当具备 ADR-01.Impl 单元测试 元素类型代码(依据skill):doc-naming元素类型 代码 示例 功能需求 01 SYS.02.01.01 质量属性 02 SYS.02.02.01 用例 11 SYS.02.11.01 系统需求 26 SYS.02.26.01 -
生成质量属性(第 2 部分 - 第 5 节):根据 ADR 的 Consequences 和 Implementation 部分生成:必需类别:
类别 来源 指标 性能 ADR 延迟/吞吐量目标 p50/p95/p99、TPS 可靠性 ADR 可用性/恢复 正常运行时间百分比、MTBF、MTTR 可扩展性 ADR 扩缩容决策 并发用户数、数据量 安全 ADR-04 安全 ADR 身份认证延迟、加密 可观测性 ADR-05 可观测性 ADR 日志保留期、告警阈值 可维护性 ADR 部署决策 部署频率、覆盖率 质量属性格式:markdown| ID | Category | Attribute | Target | Measurement | Source | |----|----------|-----------|--------|-------------|--------| | SYS.01.02.01 | Performance | API Response Time | p95 < 100ms | APM Monitoring | @threshold: PRD.01.perf.api.p95_latency | | SYS.01.02.02 | Reliability | Availability | 99.9% | Uptime Monitoring | @threshold: PRD.01.sla.uptime.target | -
生成接口规范(第 3 部分 - 第 6 节):根据 ADR 集成决策生成:
- 外部 API(CTR-ready)
- 内部接口
- 数据交换协议
- 消息格式
-
实时质量反馈(通过skill):
quality-advisor- 在生成内容时监控各章节的完成情况
- 在创建过程中检测反模式(AP-001 至 AP-017)
- 验证元素 ID 格式是否符合规范(SYS.NN.TT.SS)
- 检查占位文本([TBD]、TODO、XXX)
- 验证是否存在 Mermaid 图(建议 SYS 包含)
- 验证量化值的 @threshold 标签使用情况
- 尽早标记问题,减少生成后的返工
-
生成其余章节:
- 第 7 节:数据管理需求
- 第 8 节:测试与验证需求
- 第 9 节:部署与运维需求
- 第 10 节:合规与监管需求
- 第 11 节:验收标准
- 第 12 节:风险评估
- 第 13 节:可追踪性
- 第 14 节:实施说明
-
添加累计标签(第 13 节):第 6 层必需标签(累计标签层级 - 第 6 层):markdown
## Traceability **Required Tags** (Cumulative Tagging Hierarchy - Layer 6): @brd: BRD.01.01.03 @prd: PRD.01.07.02, PRD.01.07.15 @ears: EARS.01.25.01, EARS.01.25.02 @bdd: BDD.01.14.01 @adr: ADR-01, ADR-04 -
文件输出(始终使用嵌套文件夹):
- 单体式(<20k tokens):
docs/06_SYS/SYS-NN_{slug}/SYS-NN_{slug}.md - 分节式(≥20k tokens):、
docs/06_SYS/SYS-NN_{slug}/SYS-NN.0_index.md等SYS-NN.1_core.md - 模块化(v2.0):
docs/06_SYS/SYS-NN_{slug}/SYS-NN.MM_{capability}.md - 主索引(始终生成):(创建或更新)
docs/06_SYS/SYS-00_index.md
嵌套文件夹规则:无论大小,所有 SYS 都使用嵌套文件夹()。这样可以将配套文件(审查报告、修复报告、漂移缓存)与其父文档集中组织在一起。SYS-NN_{slug}/ - 单体式(<20k tokens):
Modular Splitting Pattern (v2.0)
模块化拆分模式(v2.0)
Per-Capability Decomposition
按能力分解
For complex SYS documents, split into atomic files per functional capability:
docs/06_SYS/SYS-01_f1_iam/
├── SYS-01.00_index.md # Index with REQ-Ready score
├── SYS-01.01_authentication.md # Auth capabilities
├── SYS-01.02_authorization.md # Authz capabilities
├── SYS-01.03_session_management.md # Session handling
├── SYS-01.04_audit_logging.md # Audit requirements
└── SYS-01.05_mfa_integration.md # MFA requirements对于复杂的 SYS 文档,按功能能力拆分为原子文件:
docs/06_SYS/SYS-01_f1_iam/
├── SYS-01.00_index.md # Index with REQ-Ready score
├── SYS-01.01_authentication.md # Auth capabilities
├── SYS-01.02_authorization.md # Authz capabilities
├── SYS-01.03_session_management.md # Session handling
├── SYS-01.04_audit_logging.md # Audit requirements
└── SYS-01.05_mfa_integration.md # MFA requirementsModular File Structure
模块化文件结构
Each modular SYS file contains:
| Section | Content |
|---|---|
| Header | YAML frontmatter with parent reference |
| Functional Requirements | Capability-specific FRs (SYS.NN.01.SS) |
| Quality Attributes | Capability-specific QAs (SYS.NN.02.SS) |
| Interface Specifications | APIs for this capability |
| External Dependencies | Capability-specific dependencies |
| Traceability | Capability-level tags |
每个模块化 SYS 文件包含:
| 章节 | 内容 |
|---|---|
| 头部 | 带父级引用的 YAML frontmatter |
| 功能需求 | 特定能力的 FR(SYS.NN.01.SS) |
| 质量属性 | 特定能力的 QA(SYS.NN.02.SS) |
| 接口规范 | 此能力的 API |
| 外部依赖 | 特定能力的依赖项 |
| 可追踪性 | 能力级标签 |
Modular SYS Template
模块化 SYS 模板
markdown
---
parent_doc: SYS-01
capability_id: SYS-01.01
capability_name: Authentication
version: 1.0.0
status: Draft
---markdown
---
parent_doc: SYS-01
capability_id: SYS-01.01
capability_name: Authentication
version: 1.0.0
status: Draft
---SYS-01.01: Authentication
SYS-01.01: Authentication
Functional Requirements
Functional Requirements
| ID | Requirement | Priority | Source | Verification |
|---|---|---|---|---|
| SYS.01.01.01 | The system SHALL authenticate users via JWT | Must Have | ADR-01 | Integration Test |
| SYS.01.01.02 | The system SHALL validate tokens within @threshold:PRD.01.perf.auth.p95_latency | Must Have | ADR-01 | Performance Test |
| ID | Requirement | Priority | Source | Verification |
|---|---|---|---|---|
| SYS.01.01.01 | The system SHALL authenticate users via JWT | Must Have | ADR-01 | Integration Test |
| SYS.01.01.02 | The system SHALL validate tokens within @threshold:PRD.01.perf.auth.p95_latency | Must Have | ADR-01 | Performance Test |
Quality Attributes
Quality Attributes
| ID | Category | Attribute | Target | Measurement |
|---|---|---|---|---|
| SYS.01.02.01 | Performance | Auth latency | p95 < @threshold:PRD.01.perf.auth.p95_latency | APM |
| SYS.01.02.02 | Reliability | Auth availability | @threshold:PRD.01.sla.auth.uptime | Uptime Monitor |
| ID | Category | Attribute | Target | Measurement |
|---|---|---|---|---|
| SYS.01.02.01 | Performance | Auth latency | p95 < @threshold:PRD.01.perf.auth.p95_latency | APM |
| SYS.01.02.02 | Reliability | Auth availability | @threshold:PRD.01.sla.auth.uptime | Uptime Monitor |
External Dependencies
External Dependencies
| Dependency | Type | Fallback Strategy | Timeout |
|---|---|---|---|
| GCP Identity Platform | Infrastructure | Local JWT validation cache | @threshold:PRD.01.timeout.idp.max |
| Redis Session Store | Data | In-memory session cache | @threshold:PRD.01.timeout.redis.max |
| Dependency | Type | Fallback Strategy | Timeout |
|---|---|---|---|
| GCP Identity Platform | Infrastructure | Local JWT validation cache | @threshold:PRD.01.timeout.idp.max |
| Redis Session Store | Data | In-memory session cache | @threshold:PRD.01.timeout.redis.max |
Traceability
Traceability
@brd: BRD.01.02.01
@prd: PRD.01.07.01
@ears: EARS.01.25.01
@bdd: BDD.01.14.01
@adr: ADR-01
---@brd: BRD.01.02.01
@prd: PRD.01.07.01
@ears: EARS.01.25.01
@bdd: BDD.01.14.01
@adr: ADR-01
---External Dependencies Table (v2.0)
外部依赖表(v2.0)
Required Format
必需格式
All SYS documents MUST include an External Dependencies table with fallback strategy:
| Column | Required | Description |
|---|---|---|
| Dependency | Yes | Service/system name |
| Type | Yes | infrastructure/data/integration/security/observability |
| Fallback Strategy | Yes | What happens when dependency fails |
| Timeout | Yes | @threshold reference for timeout value |
| Health Check | No | Health check endpoint/method |
| Circuit Breaker | No | Circuit breaker configuration |
所有 SYS 文档都必须包含带有回退策略的外部依赖表:
| 列 | 是否必需 | 说明 |
|---|---|---|
| Dependency | 是 | 服务/系统名称 |
| Type | 是 | infrastructure/data/integration/security/observability |
| Fallback Strategy | 是 | 依赖项发生故障时的处理方式 |
| Timeout | 是 | 超时值的 @threshold 引用 |
| Health Check | 否 | 健康检查端点/方法 |
| Circuit Breaker | 否 | 熔断器配置 |
Example External Dependencies Table
外部依赖表示例
markdown
undefinedmarkdown
undefinedExternal Dependencies
External Dependencies
| Dependency | Type | Fallback Strategy | Timeout | Health Check |
|---|---|---|---|---|
| GCP Identity Platform | infrastructure | JWT validation cache; fallback to local auth | @threshold:PRD.01.timeout.idp.max | /health/ready |
| Cloud SQL (PostgreSQL) | data | Read replica; local cache | @threshold:PRD.01.timeout.db.max | TCP check |
| Redis Cache | data | In-memory cache; proceed without | @threshold:PRD.01.timeout.cache.max | PING |
| Cloud Pub/Sub | integration | Retry with backoff; local queue | @threshold:PRD.01.timeout.pubsub.max | List topics |
| Cloud Secret Manager | security | Cached secrets; fail-safe defaults | @threshold:PRD.01.timeout.secrets.max | Access check |
| Cloud Monitoring | observability | Local metrics buffer; log to stdout | @threshold:PRD.01.timeout.monitoring.max | Write test |
undefined| Dependency | Type | Fallback Strategy | Timeout | Health Check |
|---|---|---|---|---|
| GCP Identity Platform | infrastructure | JWT validation cache; fallback to local auth | @threshold:PRD.01.timeout.idp.max | /health/ready |
| Cloud SQL (PostgreSQL) | data | Read replica; local cache | @threshold:PRD.01.timeout.db.max | TCP check |
| Redis Cache | data | In-memory cache; proceed without | @threshold:PRD.01.timeout.cache.max | PING |
| Cloud Pub/Sub | integration | Retry with backoff; local queue | @threshold:PRD.01.timeout.pubsub.max | List topics |
| Cloud Secret Manager | security | Cached secrets; fail-safe defaults | @threshold:PRD.01.timeout.secrets.max | Access check |
| Cloud Monitoring | observability | Local metrics buffer; log to stdout | @threshold:PRD.01.timeout.monitoring.max | Write test |
undefinedFallback Strategy Guidelines
回退策略指导原则
| Dependency Type | Recommended Fallback Patterns |
|---|---|
| Authentication Provider | JWT cache, local validation, graceful degradation |
| Database | Read replica, cache, retry with backoff |
| Cache | In-memory cache, proceed without cache |
| Message Queue | Local queue, retry with backoff, dead letter |
| Secrets Manager | Cached secrets, environment variables |
| Monitoring | Local buffer, stdout logging, fire-and-forget |
| 依赖类型 | 推荐回退模式 |
|---|---|
| 身份认证提供商 | JWT 缓存、本地验证、优雅降级 |
| 数据库 | 只读副本、缓存、带退避的重试 |
| 缓存 | 内存缓存、无缓存时继续运行 |
| 消息队列 | 本地队列、带退避的重试、死信队列 |
| Secrets Manager | 缓存的密钥、环境变量 |
| 监控 | 本地缓冲区、stdout 日志、fire-and-forget |
6-Category REQ-Ready Scoring (v2.0)
6 类 REQ-Ready 评分(v2.0)
Scoring Breakdown
评分明细
| Category | Weight | Criteria |
|---|---|---|
| Functional Decomposition | 25% | System boundaries, FR categories, dependencies |
| Quality Attributes | 20% | All 6 QA categories with @threshold references |
| Interface Specifications | 20% | External APIs, internal interfaces, protocols |
| Data Management | 15% | Data schemas, storage requirements, migrations |
| Testing Requirements | 10% | Test categories, coverage targets, test data |
| Traceability | 10% | All 5 cumulative tags, ADR alignment |
| 类别 | 权重 | 标准 |
|---|---|---|
| 功能分解 | 25% | 系统边界、FR 类别、依赖项 |
| 质量属性 | 20% | 全部 6 类 QA 及 @threshold 引用 |
| 接口规范 | 20% | 外部 API、内部接口、协议 |
| 数据管理 | 15% | 数据 Schema、存储需求、迁移 |
| 测试需求 | 10% | 测试类别、覆盖率目标、测试数据 |
| 可追踪性 | 10% | 全部 5 个累计标签、ADR 对齐情况 |
Score Display Format
分数显示格式
REQ-Ready Score: ✅ 94% (Target: ≥90%)
Category Breakdown:
├── Functional Decomposition: 24/25 ✅
├── Quality Attributes: 20/20 ✅
├── Interface Specifications: 18/20 🟡
├── Data Management: 14/15 ✅
├── Testing Requirements: 9/10 ✅
└── Traceability: 10/10 ✅
External Dependencies:
├── Dependencies Documented: ✅ 6/6
├── Fallback Strategies: ✅ 6/6
└── Threshold References: ✅ 12/12REQ-Ready Score: ✅ 94% (Target: ≥90%)
Category Breakdown:
├── Functional Decomposition: 24/25 ✅
├── Quality Attributes: 20/20 ✅
├── Interface Specifications: 18/20 🟡
├── Data Management: 14/15 ✅
├── Testing Requirements: 9/10 ✅
└── Traceability: 10/10 ✅
External Dependencies:
├── Dependencies Documented: ✅ 6/6
├── Fallback Strategies: ✅ 6/6
└── Threshold References: ✅ 12/12Visual Indicators
可视化指示符
| Icon | Score Range | Meaning |
|---|---|---|
| ✅ | >= 90% | Target met |
| 🟡 | 85-89% | Near threshold, review recommended |
| ❌ | < 85% | Below threshold, must improve |
| 图标 | 分数范围 | 含义 |
|---|---|---|
| ✅ | >= 90% | 已达到目标 |
| 🟡 | 85-89% | 接近阈值,建议审查 |
| ❌ | < 85% | 低于阈值,必须改进 |
Phase 4: SYS Validation
阶段 4:SYS 验证
After SYS generation, validate structure and REQ-Ready score.
Skill Delegation: This phase uses validation rules fromskill. See:doc-sys-validatorfor complete validation rules..claude/skills/doc-sys-validator/SKILL.md
Validation Command:
bash
python ai_dev_ssd_flow/06_SYS/scripts/validate_sys.py docs/06_SYS/SYS-NN_{slug}/SYS-NN_{slug}.md --verboseValidation Checks (14 Total for v2.0):
| Check | Type | Description |
|---|---|---|
| CHECK 1 | Error | Required Document Control Fields (9 fields) |
| CHECK 2 | Error | ADR Compliance Validation |
| CHECK 3 | Error | REQ-Ready Score Validation (format, threshold) |
| CHECK 4 | Error | Quality Attribute Quantification |
| CHECK 5 | Warning | System Boundaries |
| CHECK 6 | Warning | Interface Specifications (CTR-ready) |
| CHECK 7 | Warning | Upstream Traceability |
| CHECK 8 | Error | Element ID Format Compliance (unified 4-segment) |
| SYS-E040 | Error | External Dependencies table present |
| SYS-E041 | Error | Fallback Strategy column in dependencies |
| SYS-E042 | Error | 6-Category REQ-Ready scoring breakdown |
| SYS-E043 | Warning | Modular file structure (if >25KB) |
| SYS-E044 | Error | @threshold references for all numeric values |
| SYS-E045 | Warning | Health Check endpoints documented |
REQ-Ready Scoring Criteria (100%):
| Category | Weight | Criteria |
|---|---|---|
| Requirements Decomposition Clarity | 35% | System boundaries, functional decomposition, dependencies, ADR alignment |
| Quality Attributes Quantification | 30% | Performance percentiles, reliability SLAs, security compliance, scalability metrics |
| Interface Specifications | 20% | External APIs (CTR-ready), internal interfaces, data exchange protocols |
| Implementation Readiness | 15% | Testing requirements, deployment/ops, monitoring/observability |
Minimum Score: 90%
Auto-Fix Actions:
| Issue | Auto-Fix Action |
|---|---|
| Invalid element ID format | Convert to SYS.NN.TT.SS format |
| Missing traceability section | Insert from template |
| Missing Document Control fields | Add placeholder fields |
| Legacy patterns (FR-XXX, QA-XXX, SR-XXX) | Convert to unified format |
| Missing REQ-Ready Score | Calculate and insert |
| Missing @threshold tags | Add template references |
| Hardcoded numeric values | Replace with @threshold references |
Validation Loop:
LOOP (max 3 iterations):
1. Run doc-sys-validator
2. IF errors found: Apply auto-fixes
3. IF warnings found: Review and address if critical
4. IF REQ-Ready Score < 90%: Enhance sections
5. IF clean: Mark VALIDATED, proceed
6. IF max iterations: Log issues, flag for manual reviewSYS 生成后,验证其结构和 REQ-Ready 分数。
Skill 委派:此阶段使用skill 中的验证规则。 参见:doc-sys-validator,了解完整的验证规则。.claude/skills/doc-sys-validator/SKILL.md
验证命令:
bash
python ai_dev_ssd_flow/06_SYS/scripts/validate_sys.py docs/06_SYS/SYS-NN_{slug}/SYS-NN_{slug}.md --verbose验证检查(v2.0 共 14 项):
| 检查 | 类型 | 说明 |
|---|---|---|
| CHECK 1 | 错误 | 必需文档控制字段(9 个字段) |
| CHECK 2 | 错误 | ADR 符合性验证 |
| CHECK 3 | 错误 | REQ-Ready 分数验证(格式、阈值) |
| CHECK 4 | 错误 | 质量属性量化 |
| CHECK 5 | 警告 | 系统边界 |
| CHECK 6 | 警告 | 接口规范(CTR-ready) |
| CHECK 7 | 警告 | 上游可追踪性 |
| CHECK 8 | 错误 | 元素 ID 格式符合性(统一的 4 段格式) |
| SYS-E040 | 错误 | 存在外部依赖表 |
| SYS-E041 | 错误 | 依赖项中包含回退策略列 |
| SYS-E042 | 错误 | 6 类 REQ-Ready 评分明细 |
| SYS-E043 | 警告 | 模块化文件结构(如果 >25KB) |
| SYS-E044 | 错误 | 所有数值均使用 @threshold 引用 |
| SYS-E045 | 警告 | 已记录健康检查端点 |
REQ-Ready 评分标准(100%):
| 类别 | 权重 | 标准 |
|---|---|---|
| 需求分解清晰度 | 35% | 系统边界、功能分解、依赖项、ADR 对齐情况 |
| 质量属性量化 | 30% | 性能百分位数、可靠性 SLA、安全合规性、可扩展性指标 |
| 接口规范 | 20% | 外部 API(CTR-ready)、内部接口、数据交换协议 |
| 实现就绪度 | 15% | 测试需求、部署/运维、监控/可观测性 |
最低分数:90%
自动修复操作:
| 问题 | 自动修复操作 |
|---|---|
| 无效的元素 ID 格式 | 转换为 SYS.NN.TT.SS 格式 |
| 缺少可追踪性章节 | 从模板插入 |
| 缺少文档控制字段 | 添加占位字段 |
| 旧版模式(FR-XXX、QA-XXX、SR-XXX) | 转换为统一格式 |
| 缺少 REQ-Ready 分数 | 计算并插入 |
| 缺少 @threshold 标签 | 添加模板引用 |
| 硬编码数值 | 替换为 @threshold 引用 |
验证循环:
LOOP (max 3 iterations):
1. Run doc-sys-validator
2. IF errors found: Apply auto-fixes
3. IF warnings found: Review and address if critical
4. IF REQ-Ready Score < 90%: Enhance sections
5. IF clean: Mark VALIDATED, proceed
6. IF max iterations: Log issues, flag for manual reviewPhase 5: Audit & Fix Cycle (v2.1)
阶段 5:审查与修复循环(v2.1)
Iterative review and fix cycle to ensure SYS quality before completion.
mermaid
flowchart TD
A[Phase 5 Start] --> B[Run doc-sys-audit]
B --> C[Generate Combined Audit Report]
C --> D{Review Score >= 90?}
D -->|Yes| E[PASS - Proceed to Final Checks]
D -->|No| F{Iteration < Max?}
F -->|Yes| G[Run doc-sys-fixer]
G --> H[Apply Fixes]
H --> I[Generate Fix Report]
I --> J[Increment Iteration]
J --> B
F -->|No| K[Flag for Manual Review]
K --> L[Generate Final Report with Remaining Issues]
L --> E通过迭代式审查和修复循环,确保完成前 SYS 质量达标。
mermaid
flowchart TD
A[Phase 5 Start] --> B[Run doc-sys-audit]
B --> C[Generate Combined Audit Report]
C --> D{Review Score >= 90?}
D -->|Yes| E[PASS - Proceed to Final Checks]
D -->|No| F{Iteration < Max?}
F -->|Yes| G[Run doc-sys-fixer]
G --> H[Apply Fixes]
H --> I[Generate Fix Report]
I --> J[Increment Iteration]
J --> B
F -->|No| K[Flag for Manual Review]
K --> L[Generate Final Report with Remaining Issues]
L --> E5.1 Initial Audit
5.1 初始审查
Run to identify issues.
doc-sys-auditbash
/doc-sys-audit SYS-NNOutput: (legacy-compatible reviewer report may still exist)
SYS-NN.A_audit_report_v001.md运行 识别问题。
doc-sys-auditbash
/doc-sys-audit SYS-NN输出:(仍可能存在兼容旧版的 reviewer 报告)
SYS-NN.A_audit_report_v001.md5.2 Fix Cycle
5.2 修复周期
If review score < 90%, invoke .
doc-sys-fixerbash
/doc-sys-fixer SYS-NN --revalidateFix Categories:
| Category | Fixes Applied |
|---|---|
| Missing Files | Create glossary, reference docs |
| Broken Links | Update paths, create targets |
| Element IDs | Convert legacy patterns (FR-XXX, QA-XXX, SR-XXX), fix invalid type codes |
| Content | Replace template placeholders, update dates |
| References | Update traceability tags, @threshold references |
| Dependencies | Add missing fallback strategies, timeout values |
Output:
SYS-NN.F_fix_report_v001.md如果审查分数 < 90%,调用 。
doc-sys-fixerbash
/doc-sys-fixer SYS-NN --revalidate修复类别:
| 类别 | 已应用的修复 |
|---|---|
| 缺失文件 | 创建术语表、参考文档 |
| 损坏链接 | 更新路径、创建目标 |
| 元素 ID | 转换旧版模式(FR-XXX、QA-XXX、SR-XXX)、修复无效类型代码 |
| 内容 | 替换模板占位符、更新日期 |
| 引用 | 更新可追踪性标签、@threshold 引用 |
| 依赖项 | 添加缺失的回退策略、超时值 |
输出:
SYS-NN.F_fix_report_v001.md5.3 Re-Audit
5.3 重新审查
After fixes, automatically re-run audit.
bash
/doc-sys-audit SYS-NNOutput:
SYS-NN.A_audit_report_v002.md修复后,自动重新运行审查。
bash
/doc-sys-audit SYS-NN输出:
SYS-NN.A_audit_report_v002.md5.4 Iteration Control
5.4 迭代控制
| Parameter | Default | Description |
|---|---|---|
| 3 | Maximum fix-review cycles |
| 90 | Minimum passing score |
| false | Stop if only manual issues remain |
Iteration Example:
Iteration 1:
Review v001: Score 86 (3 errors, 5 warnings)
Fix v001: Fixed 6 issues, updated 2 tables
Iteration 2:
Review v002: Score 93 (0 errors, 3 warnings)
Status: PASS (score >= 90)| 参数 | 默认值 | 说明 |
|---|---|---|
| 3 | 最大修复-审查循环次数 |
| 90 | 最低通过分数 |
| false | 如果仅剩手动问题则停止 |
迭代示例:
Iteration 1:
Review v001: Score 86 (3 errors, 5 warnings)
Fix v001: Fixed 6 issues, updated 2 tables
Iteration 2:
Review v002: Score 93 (0 errors, 3 warnings)
Status: PASS (score >= 90)5.5 Quality Checks (Post-Fix)
5.5 质量检查(修复后)
After passing the fix cycle:
-
All SYS Complete:
- All ADR-derived system domains addressed
- Each SYS has REQ-Ready score >= 90%
- No placeholder text remaining
- All @threshold tags reference valid registry entries
-
Cross-SYS Consistency:
- No conflicting requirements between SYS documents
- Quality attribute targets align across systems
- Interface specifications are compatible
- Dependencies between SYS documented
-
Traceability Matrix Update:bash
# Update SYS-00_TRACEABILITY_MATRIX.md
python ai_dev_ssd_flow/scripts/update_traceability_matrix.py
--type SYS
--matrix docs/06_SYS/SYS-00_TRACEABILITY_MATRIX.md
--type SYS
--matrix docs/06_SYS/SYS-00_TRACEABILITY_MATRIX.md
4. **REQ-Ready Report**:REQ-Ready Score Breakdown
Functional Decomposition: 24/25 (System boundaries clear) Quality Attributes: 20/20 (All 6 categories present) Interface Specifications: 19/20 (CTR-ready) Data Management: 14/15 (Schemas documented) Testing Requirements: 9/10 (Coverage targets) Traceability: 10/10 (All 5 tags present)
Total REQ-Ready Score: 96/100 (Target: >= 90)
Status: READY FOR REQ GENERATION
5. **Summary Report Generation**:SYS Generation Summary
Total SYS Generated: 7
Status Distribution:
Approved: 5
In Review: 2
Draft: 0
REQ-Ready Scores:
SYS-01 (Infrastructure): 95%
SYS-02 (Data Architecture): 92%
SYS-03 (Integration): 94%
SYS-04 (Security): 96%
SYS-05 (Observability): 91%
SYS-06 (AI/ML): 90%
SYS-07 (Technology): 93%
Average REQ-Ready Score: 93%
Next Steps:
1. Review In Review SYS documents for stakeholder approval
2. Run doc-req-autopilot to decompose SYS into atomic REQ
---通过修复循环后:
-
所有 SYS 均已完成:
- 已涵盖所有 ADR 衍生的系统领域
- 每个 SYS 的 REQ-Ready 分数均 >= 90%
- 不存在占位文本
- 所有 @threshold 标签均引用有效的注册表条目
-
跨 SYS 一致性:
- SYS 文档之间不存在冲突需求
- 质量属性目标在各系统间保持一致
- 接口规范彼此兼容
- 已记录 SYS 之间的依赖关系
-
更新可追踪性矩阵:bash
# Update SYS-00_TRACEABILITY_MATRIX.md
python ai_dev_ssd_flow/scripts/update_traceability_matrix.py
--type SYS
--matrix docs/06_SYS/SYS-00_TRACEABILITY_MATRIX.md
--type SYS
--matrix docs/06_SYS/SYS-00_TRACEABILITY_MATRIX.md
4. **REQ-Ready 报告**:REQ-Ready Score Breakdown
Functional Decomposition: 24/25 (System boundaries clear) Quality Attributes: 20/20 (All 6 categories present) Interface Specifications: 19/20 (CTR-ready) Data Management: 14/15 (Schemas documented) Testing Requirements: 9/10 (Coverage targets) Traceability: 10/10 (All 5 tags present)
Total REQ-Ready Score: 96/100 (Target: >= 90)
Status: READY FOR REQ GENERATION
5. **生成汇总报告**:SYS Generation Summary
Total SYS Generated: 7
Status Distribution:
Approved: 5
In Review: 2
Draft: 0
REQ-Ready Scores:
SYS-01 (Infrastructure): 95%
SYS-02 (Data Architecture): 92%
SYS-03 (Integration): 94%
SYS-04 (Security): 96%
SYS-05 (Observability): 91%
SYS-06 (AI/ML): 90%
SYS-07 (Technology): 93%
Average REQ-Ready Score: 93%
Next Steps:
1. Review In Review SYS documents for stakeholder approval
2. Run doc-req-autopilot to decompose SYS into atomic REQ
---Execution Modes
执行模式
Single SYS Mode
单个 SYS 模式
Generate one SYS from a specific ADR.
bash
undefined根据特定 ADR 生成一个 SYS。
bash
undefinedExample: Generate SYS-01 from ADR-01
Example: Generate SYS-01 from ADR-01
/doc-sys-autopilot ADR-01
/doc-sys-autopilot ADR-01
Output:
Output:
Analyzing ADR-01 (Infrastructure)...
Analyzing ADR-01 (Infrastructure)...
SYS-Ready Score: 94% (PASS)
SYS-Ready Score: 94% (PASS)
Generating SYS-01_infrastructure.md...
Generating SYS-01_infrastructure.md...
REQ-Ready Score: 92%
REQ-Ready Score: 92%
Complete.
Complete.
undefinedundefinedBatch Mode (All ADRs)
批处理模式(全部 ADR)
Generate all SYS from ADR documents.
bash
undefined根据 ADR 文档生成所有 SYS。
bash
undefinedExample: Generate all SYS from ADR directory
Example: Generate all SYS from ADR directory
/doc-sys-autopilot all
/doc-sys-autopilot all
Output:
Output:
Scanning ADR directory...
Scanning ADR directory...
Found 7 ADR documents:
Found 7 ADR documents:
ADR-01 (Infrastructure) - SYS-Ready: 94%
ADR-01 (Infrastructure) - SYS-Ready: 94%
ADR-02 (Data Architecture) - SYS-Ready: 92%
ADR-02 (Data Architecture) - SYS-Ready: 92%
ADR-03 (Integration) - SYS-Ready: 91%
ADR-03 (Integration) - SYS-Ready: 91%
ADR-04 (Security) - SYS-Ready: 95%
ADR-04 (Security) - SYS-Ready: 95%
ADR-05 (Observability) - SYS-Ready: 90%
ADR-05 (Observability) - SYS-Ready: 90%
ADR-06 (AI/ML) - SYS-Ready: 91%
ADR-06 (AI/ML) - SYS-Ready: 91%
ADR-07 (Technology) - SYS-Ready: 93%
ADR-07 (Technology) - SYS-Ready: 93%
Generating SYS documents...
Generating SYS documents...
[================> ] 5/7 Complete
[================> ] 5/7 Complete
undefinedundefinedDry Run Mode
试运行模式
Preview SYS generation plan without creating files.
bash
/doc-sys-autopilot all --dry-run在不创建文件的情况下预览 SYS 生成计划。
bash
/doc-sys-autopilot all --dry-runOutput:
Output:
SYS Generation Plan (Dry Run)
SYS Generation Plan (Dry Run)
============================
============================
Source: ADR documents
Source: ADR documents
Planned SYS:
Planned SYS:
1. SYS-01 (Infrastructure) - Full generation
1. SYS-01 (Infrastructure) - Full generation
2. SYS-02 (Data Architecture) - Full generation
2. SYS-02 (Data Architecture) - Full generation
3. SYS-03 (Integration) - Full generation
3. SYS-03 (Integration) - Full generation
4. SYS-04 (Security) - Full generation
4. SYS-04 (Security) - Full generation
5. SYS-05 (Observability) - Full generation
5. SYS-05 (Observability) - Full generation
6. SYS-06 (AI/ML) - Full generation
6. SYS-06 (AI/ML) - Full generation
7. SYS-07 (Technology) - Full generation
7. SYS-07 (Technology) - Full generation
No files will be created in dry-run mode.
No files will be created in dry-run mode.
undefinedundefinedReview Mode (v2.1)
审查模式(v2.1)
Validate existing SYS documents and generate a quality report without modification.
Purpose: Audit existing SYS documents for compliance, quality scores, and identify issues.
Command:
bash
undefined验证现有 SYS 文档并生成质量报告,不修改文档。
目的:审查现有 SYS 文档的合规性、质量分数并识别问题。
命令:
bash
undefinedReview single SYS document
Review single SYS document
/doc-sys-audit SYS-01
/doc-sys-audit SYS-01
Review all SYS documents (run per document in docs/06_SYS/)
Review all SYS documents (run per document in docs/06_SYS/)
/doc-sys-audit SYS-NN
**Review Process**:
```mermaid
flowchart TD
A[Input: Existing SYS] --> B[Load SYS Documents]
B --> C[Run Validation Checks]
C --> D[Calculate REQ-Ready Score]
D --> E[Check 6-Category Breakdown]
E --> F[Validate External Dependencies]
F --> G[Identify Issues]
G --> H{Generate Report}
H --> I[Fixable Issues List]
H --> J[Manual Review Items]
H --> K[Score Breakdown]
I --> L[Output: Review Report]
J --> L
K --> LReview Report Structure:
markdown
undefined/doc-sys-audit SYS-NN
**审查过程**:
```mermaid
flowchart TD
A[Input: Existing SYS] --> B[Load SYS Documents]
B --> C[Run Validation Checks]
C --> D[Calculate REQ-Ready Score]
D --> E[Check 6-Category Breakdown]
E --> F[Validate External Dependencies]
F --> G[Identify Issues]
G --> H{Generate Report}
H --> I[Fixable Issues List]
H --> J[Manual Review Items]
H --> K[Score Breakdown]
I --> L[Output: Review Report]
J --> L
K --> L审查报告结构:
markdown
undefinedSYS Review Report: SYS-01_f1_iam
SYS Review Report: SYS-01_f1_iam
Summary
Summary
- REQ-Ready Score: 87% 🟡
- Total Issues: 14
- Auto-Fixable: 10
- Manual Review: 4
- REQ-Ready Score: 87% 🟡
- Total Issues: 14
- Auto-Fixable: 10
- Manual Review: 4
6-Category Score Breakdown
6-Category Score Breakdown
| Category | Score | Status |
|---|---|---|
| Functional Decomposition | 23/25 | 🟡 |
| Quality Attributes | 18/20 | 🟡 |
| Interface Specifications | 18/20 | 🟡 |
| Data Management | 14/15 | ✅ |
| Testing Requirements | 8/10 | 🟡 |
| Traceability | 10/10 | ✅ |
| Category | Score | Status |
|---|---|---|
| Functional Decomposition | 23/25 | 🟡 |
| Quality Attributes | 18/20 | 🟡 |
| Interface Specifications | 18/20 | 🟡 |
| Data Management | 14/15 | ✅ |
| Testing Requirements | 8/10 | 🟡 |
| Traceability | 10/10 | ✅ |
External Dependencies Check
External Dependencies Check
| Check | Status | Details |
|---|---|---|
| Dependencies Table Present | ✅ | 6 dependencies documented |
| Fallback Strategies | ❌ | 2 dependencies missing fallback |
| Timeout Thresholds | 🟡 | 4 hardcoded values found |
| Health Check Endpoints | ❌ | 3 dependencies missing health check |
| Check | Status | Details |
|---|---|---|
| Dependencies Table Present | ✅ | 6 dependencies documented |
| Fallback Strategies | ❌ | 2 dependencies missing fallback |
| Timeout Thresholds | 🟡 | 4 hardcoded values found |
| Health Check Endpoints | ❌ | 3 dependencies missing health check |
v2.0 Compliance
v2.0 Compliance
| Check | Status | Details |
|---|---|---|
| Modular Structure | ✅ | Per-capability split (5 files) |
| 6-Category Scoring | 🟡 | Missing testing requirements detail |
| @threshold References | ❌ | 8 hardcoded numeric values |
| Fallback Strategy Column | ❌ | Missing in 2 dependencies |
| Visual Score Indicators | ✅ | Present in index |
| Check | Status | Details |
|---|---|---|
| Modular Structure | ✅ | Per-capability split (5 files) |
| 6-Category Scoring | 🟡 | Missing testing requirements detail |
| @threshold References | ❌ | 8 hardcoded numeric values |
| Fallback Strategy Column | ❌ | Missing in 2 dependencies |
| Visual Score Indicators | ✅ | Present in index |
Auto-Fixable Issues
Auto-Fixable Issues
| # | Issue | Location | Fix Action |
|---|---|---|---|
| 1 | Hardcoded timeout value | SYS-01.01:L45 | Replace with @threshold:PRD.01.timeout.auth |
| 2 | Missing fallback strategy | SYS-01.03:L78 | Add fallback column |
| 3 | Legacy element ID | SYS-01.02:L23 | Convert FR-001 to SYS.01.01.01 |
| ... | ... | ... | ... |
| # | Issue | Location | Fix Action |
|---|---|---|---|
| 1 | Hardcoded timeout value | SYS-01.01:L45 | Replace with @threshold:PRD.01.timeout.auth |
| 2 | Missing fallback strategy | SYS-01.03:L78 | Add fallback column |
| 3 | Legacy element ID | SYS-01.02:L23 | Convert FR-001 to SYS.01.01.01 |
| ... | ... | ... | ... |
Manual Review Required
Manual Review Required
| # | Issue | Location | Reason |
|---|---|---|---|
| 1 | Incomplete quality attribute | SYS-01.02:L102 | Domain knowledge needed |
| 2 | Missing interface specification | SYS-01.03 | API design decision required |
| ... | ... | ... | ... |
| # | Issue | Location | Reason |
|---|---|---|---|
| 1 | Incomplete quality attribute | SYS-01.02:L102 | Domain knowledge needed |
| 2 | Missing interface specification | SYS-01.03 | API design decision required |
| ... | ... | ... | ... |
Recommendations
Recommendations
- Run fix mode to address 10 auto-fixable issues
- Review 4 items requiring manual attention
- Add missing external dependency fallback strategies
**Review Configuration**:
```yaml
review_mode:
enabled: true
checks:
- structure_validation # Document control, sections
- element_id_compliance # SYS.NN.TT.SS format
- threshold_references # @threshold format and validity
- external_dependencies # Table, fallback, timeouts
- quality_attributes # 6 categories present
- cumulative_tags # 5 upstream tags
- score_calculation # REQ-Ready score
- modular_structure # If >25KB
output:
format: markdown # markdown, json, html
include_line_numbers: true
include_fix_suggestions: true
thresholds:
pass: 90
warning: 85
fail: 0- Run fix mode to address 10 auto-fixable issues
- Review 4 items requiring manual attention
- Add missing external dependency fallback strategies
**审查配置**:
```yaml
review_mode:
enabled: true
checks:
- structure_validation # Document control, sections
- element_id_compliance # SYS.NN.TT.SS format
- threshold_references # @threshold format and validity
- external_dependencies # Table, fallback, timeouts
- quality_attributes # 6 categories present
- cumulative_tags # 5 upstream tags
- score_calculation # REQ-Ready score
- modular_structure # If >25KB
output:
format: markdown # markdown, json, html
include_line_numbers: true
include_fix_suggestions: true
thresholds:
pass: 90
warning: 85
fail: 0Fix Mode (v2.1)
修复模式(v2.1)
Auto-repair existing SYS documents while preserving manual content.
Purpose: Apply automated fixes to SYS documents to improve quality scores and compliance.
Command:
bash
undefined在保留手动内容的同时自动修复现有 SYS 文档。
目的:应用自动化修复,提高 SYS 文档的质量分数和合规性。
命令:
bash
undefinedFix single SYS document
Fix single SYS document
/doc-sys-fixer SYS-01
/doc-sys-fixer SYS-01
Fix with revalidation
Fix with revalidation
/doc-sys-fixer SYS-01 --revalidate
/doc-sys-fixer SYS-01 --revalidate
Fix specific issue types only
Fix specific issue types only
/doc-sys-fixer SYS-01 --fix-types "element_ids,references,content"
/doc-sys-fixer SYS-01 --fix-types "element_ids,references,content"
Dry-run fix (preview changes)
Dry-run fix (preview changes)
/doc-sys-fixer SYS-01 --dry-run
**Fix Process**:
```mermaid
flowchart TD
A[Input: Existing SYS] --> B[Run Review Mode]
B --> C[Identify Fixable Issues]
C --> D{Backup Enabled?}
D -->|Yes| E[Create Backup]
D -->|No| F[Skip Backup]
E --> G[Apply Fixes by Category]
F --> G
subgraph FixCategories["Fix Categories"]
G --> H[Element ID Fixes]
G --> I[Threshold Fixes]
G --> J[Dependencies Fixes]
G --> K[Structure Fixes]
G --> L[Traceability Fixes]
end
H --> M[Preserve Manual Content]
I --> M
J --> M
K --> M
L --> M
M --> N[Re-validate]
N --> O{Score Improved?}
O -->|Yes| P[Generate Fix Report]
O -->|No| Q[Log Warnings]
Q --> P
P --> R[Output: Fixed SYS + Report]Fix Categories and Actions:
| Category | Issue | Auto-Fix Action | Preserves Content |
|---|---|---|---|
| Element IDs | Legacy FR-XXX format | Convert to SYS.NN.01.SS | ✅ |
| Element IDs | Legacy QA-XXX format | Convert to SYS.NN.02.SS | ✅ |
| Element IDs | Invalid segment count | Restructure to 4-segment | ✅ |
| Thresholds | Hardcoded numeric values | Replace with @threshold:PRD.NN.xxx | ✅ |
| Thresholds | Invalid threshold format | Convert to @threshold:PRD.NN.category.field | ✅ |
| Dependencies | Missing fallback column | Add Fallback Strategy column | ✅ |
| Dependencies | Missing timeout @threshold | Add @threshold reference | ✅ |
| Dependencies | Missing health check | Add placeholder health check | ✅ |
| Structure | Missing REQ-Ready score | Calculate and insert | ✅ |
| Structure | Missing 6-category breakdown | Add breakdown table | ✅ |
| Structure | Missing traceability section | Insert from template | ✅ |
| Traceability | Missing cumulative tags | Add with placeholder references | ✅ |
| Traceability | Incomplete @adr reference | Link to source ADR | ✅ |
Content Preservation Rules:
- Never delete existing functional requirements
- Never modify quality attribute targets
- Never change interface specification content
- Only add missing columns and metadata
- Only replace hardcoded values with threshold references
- Backup first if flag is set
--backup
Fix Report Structure:
markdown
undefined/doc-sys-fixer SYS-01 --dry-run
**修复过程**:
```mermaid
flowchart TD
A[Input: Existing SYS] --> B[Run Review Mode]
B --> C[Identify Fixable Issues]
C --> D{Backup Enabled?}
D -->|Yes| E[Create Backup]
D -->|No| F[Skip Backup]
E --> G[Apply Fixes by Category]
F --> G
subgraph FixCategories["Fix Categories"]
G --> H[Element ID Fixes]
G --> I[Threshold Fixes]
G --> J[Dependencies Fixes]
G --> K[Structure Fixes]
G --> L[Traceability Fixes]
end
H --> M[Preserve Manual Content]
I --> M
J --> M
K --> M
L --> M
M --> N[Re-validate]
N --> O{Score Improved?}
O -->|Yes| P[Generate Fix Report]
O -->|No| Q[Log Warnings]
Q --> P
P --> R[Output: Fixed SYS + Report]修复类别和操作:
| 类别 | 问题 | 自动修复操作 | 保留内容 |
|---|---|---|---|
| 元素 ID | 旧版 FR-XXX 格式 | 转换为 SYS.NN.01.SS | ✅ |
| 元素 ID | 旧版 QA-XXX 格式 | 转换为 SYS.NN.02.SS | ✅ |
| 元素 ID | 段数无效 | 重构为 4 段格式 | ✅ |
| 阈值 | 硬编码数值 | 替换为 @threshold:PRD.NN.xxx | ✅ |
| 阈值 | 阈值格式无效 | 转换为 @threshold:PRD.NN.category.field | ✅ |
| 依赖项 | 缺少回退策略列 | 添加 Fallback Strategy 列 | ✅ |
| 依赖项 | 缺少超时 @threshold | 添加 @threshold 引用 | ✅ |
| 依赖项 | 缺少健康检查 | 添加健康检查占位符 | ✅ |
| 结构 | 缺少 REQ-Ready 分数 | 计算并插入 | ✅ |
| 结构 | 缺少 6 类评分明细 | 添加明细表 | ✅ |
| 结构 | 缺少可追踪性章节 | 从模板插入 | ✅ |
| 可追踪性 | 缺少累计标签 | 使用占位引用添加 | ✅ |
| 可追踪性 | @adr 引用不完整 | 链接到源 ADR | ✅ |
内容保留规则:
- 绝不删除现有功能需求
- 绝不修改质量属性目标
- 绝不更改接口规范内容
- 仅添加缺失的列和元数据
- 仅将硬编码值替换为阈值引用
- 如果设置了 标志,则先执行备份
--backup
修复报告结构:
markdown
undefinedSYS Fix Report: SYS-01_f1_iam
SYS Fix Report: SYS-01_f1_iam
Summary
Summary
- Before REQ-Ready Score: 87% 🟡
- After REQ-Ready Score: 94% ✅
- Issues Fixed: 10
- Issues Remaining: 4 (manual review required)
- Before REQ-Ready Score: 87% 🟡
- After REQ-Ready Score: 94% ✅
- Issues Fixed: 10
- Issues Remaining: 4 (manual review required)
Fixes Applied
Fixes Applied
| # | Issue | Location | Fix Applied |
|---|---|---|---|
| 1 | Legacy element ID | SYS-01.01:L23 | Converted FR-001 → SYS.01.01.01 |
| 2 | Hardcoded timeout | SYS-01.02:L45 | Replaced with @threshold:PRD.01.timeout.auth |
| 3 | Missing fallback | SYS-01.03:L78 | Added "JWT cache; local validation" |
| ... | ... | ... | ... |
| # | Issue | Location | Fix Applied |
|---|---|---|---|
| 1 | Legacy element ID | SYS-01.01:L23 | Converted FR-001 → SYS.01.01.01 |
| 2 | Hardcoded timeout | SYS-01.02:L45 | Replaced with @threshold:PRD.01.timeout.auth |
| 3 | Missing fallback | SYS-01.03:L78 | Added "JWT cache; local validation" |
| ... | ... | ... | ... |
Files Modified
Files Modified
- docs/06_SYS/SYS-01_f1_iam/SYS-01.00_index.md
- docs/06_SYS/SYS-01_f1_iam/SYS-01.01_authentication.md
- docs/06_SYS/SYS-01_f1_iam/SYS-01.02_authorization.md
- docs/06_SYS/SYS-01_f1_iam/SYS-01.03_session_management.md
- docs/06_SYS/SYS-01_f1_iam/SYS-01.00_index.md
- docs/06_SYS/SYS-01_f1_iam/SYS-01.01_authentication.md
- docs/06_SYS/SYS-01_f1_iam/SYS-01.02_authorization.md
- docs/06_SYS/SYS-01_f1_iam/SYS-01.03_session_management.md
Backup Location
Backup Location
- tmp/backup/SYS-01_f1_iam_20260209_143022/
- tmp/backup/SYS-01_f1_iam_20260209_143022/
Remaining Issues (Manual Review)
Remaining Issues (Manual Review)
| # | Issue | Location | Reason |
|---|---|---|---|
| 1 | Incomplete QA target | SYS-01.02:L102 | Domain expertise needed |
| 2 | Missing interface spec | SYS-01.03 | API design decision |
| ... | ... | ... | ... |
| # | Issue | Location | Reason |
|---|---|---|---|
| 1 | Incomplete QA target | SYS-01.02:L102 | Domain expertise needed |
| 2 | Missing interface spec | SYS-01.03 | API design decision |
| ... | ... | ... | ... |
6-Category Score Impact
6-Category Score Impact
| Category | Before | After | Delta |
|---|---|---|---|
| Functional Decomposition | 23/25 | 25/25 | +2 |
| Quality Attributes | 18/20 | 19/20 | +1 |
| Interface Specifications | 18/20 | 19/20 | +1 |
| Data Management | 14/15 | 14/15 | 0 |
| Testing Requirements | 8/10 | 9/10 | +1 |
| Traceability | 10/10 | 10/10 | 0 |
| Category | Before | After | Delta |
|---|---|---|---|
| Functional Decomposition | 23/25 | 25/25 | +2 |
| Quality Attributes | 18/20 | 19/20 | +1 |
| Interface Specifications | 18/20 | 19/20 | +1 |
| Data Management | 14/15 | 14/15 | 0 |
| Testing Requirements | 8/10 | 9/10 | +1 |
| Traceability | 10/10 | 10/10 | 0 |
Next Steps
Next Steps
- Review manually flagged items
- Re-run validation to confirm score
- Commit changes if satisfied
**Fix Configuration**:
```yaml
fix_mode:
enabled: true
backup:
enabled: true
location: "tmp/backup/"
retention_days: 7
fix_categories:
element_ids: true # Legacy ID conversion
thresholds: true # @threshold references
dependencies: true # External dependencies table
structure: true # Document sections
traceability: true # Cumulative tags
preservation:
functional_requirements: true # Never modify FR content
quality_attributes: true # Never modify QA targets
interface_specs: true # Never modify interface content
comments: true # Preserve user comments
validation:
re_validate_after_fix: true
require_score_improvement: false
max_fix_iterations: 3
element_id_migration:
FR_XXX_to_SYS_NN_01_SS: true # FR-001 → SYS.01.01.01
QA_XXX_to_SYS_NN_02_SS: true # QA-001 → SYS.01.02.01
SR_XXX_to_SYS_NN_26_SS: true # SR-001 → SYS.01.26.01Command Line Options (Review/Fix):
| Option | Mode | Default | Description |
|---|---|---|---|
| Review | - | Run review mode only |
| Fix | - | Run fix mode |
| Both | auto | Report output path |
| Fix | true | Create backup before fixing |
| Fix | all | Comma-separated fix categories |
| Fix | false | Preview fixes without applying |
| Fix | false | Extra cautious preservation |
| Fix | 0 | Minimum score improvement required |
- Review manually flagged items
- Re-run validation to confirm score
- Commit changes if satisfied
**修复配置**:
```yaml
fix_mode:
enabled: true
backup:
enabled: true
location: "tmp/backup/"
retention_days: 7
fix_categories:
element_ids: true # Legacy ID conversion
thresholds: true # @threshold references
dependencies: true # External dependencies table
structure: true # Document sections
traceability: true # Cumulative tags
preservation:
functional_requirements: true # Never modify FR content
quality_attributes: true # Never modify QA targets
interface_specs: true # Never modify interface content
comments: true # Preserve user comments
validation:
re_validate_after_fix: true
require_score_improvement: false
max_fix_iterations: 3
element_id_migration:
FR_XXX_to_SYS_NN_01_SS: true # FR-001 → SYS.01.01.01
QA_XXX_to_SYS_NN_02_SS: true # QA-001 → SYS.01.02.01
SR_XXX_to_SYS_NN_26_SS: true # SR-001 → SYS.01.26.01命令行选项(审查/修复):
| 选项 | 模式 | 默认值 | 说明 |
|---|---|---|---|
| 审查 | - | 仅运行审查模式 |
| 修复 | - | 运行修复模式 |
| 两者 | auto | 报告输出路径 |
| 修复 | true | 修复前创建备份 |
| 修复 | all | 以逗号分隔的修复类别 |
| 修复 | false | 预览修复但不应用 |
| 修复 | false | 额外谨慎地保留内容 |
| 修复 | 0 | 最低分数提升要求 |
Output Artifacts
输出产物
Generated Files
生成的文件
All SYS use nested folders () regardless of size. Document sectioning (monolithic vs sectioned) depends only on document size (>20k tokens = sectioned).
SYS-NN_{slug}/| File | Purpose | Location |
|---|---|---|
| SYS-NN_{slug}/ | SYS folder (ALWAYS created) | |
| SYS-NN_{slug}.md | Main SYS document (monolithic <20k tokens) | |
| SYS-NN.0_index.md | Section index (sectioned ≥20k tokens) | |
| SYS-NN.S_{section}.md | Section files (sectioned ≥20k tokens) | |
| SYS-NN.A_audit_report_v{VVV}.md | Combined audit report (preferred) | |
| SYS-NN.R_review_report_v{VVV}.md | Review report | |
| SYS-NN.F_fix_report_v{VVV}.md | Fix report | |
| .drift_cache.json | Drift detection cache | |
无论大小,所有 SYS 都使用嵌套文件夹()。文档分节方式(单体式或分节式)仅取决于文档大小(>20k tokens 时使用分节式)。
SYS-NN_{slug}/| 文件 | 用途 | 位置 |
|---|---|---|
| SYS-NN_{slug}/ | SYS 文件夹(始终创建) | |
| SYS-NN_{slug}.md | 主 SYS 文档(单体式 <20k tokens) | |
| SYS-NN.0_index.md | 章节索引(分节式 ≥20k tokens) | |
| SYS-NN.S_{section}.md | 章节文件(分节式 ≥20k tokens) | |
| SYS-NN.A_audit_report_v{VVV}.md | 综合审查报告(首选) | |
| SYS-NN.R_review_report_v{VVV}.md | 审查报告 | |
| SYS-NN.F_fix_report_v{VVV}.md | 修复报告 | |
| .drift_cache.json | 漂移检测缓存 | |
Validation Reports
验证报告
| Report | Purpose | Location |
|---|---|---|
| sys_validation_report.json | Validation results | |
| req_ready_scores.json | REQ-Ready breakdown | |
| sys_autopilot_log.md | Execution log | |
| 报告 | 用途 | 位置 |
|---|---|---|
| sys_validation_report.json | 验证结果 | |
| req_ready_scores.json | REQ-Ready 明细 | |
| sys_autopilot_log.md | 执行日志 | |
Error Handling
错误处理
Error Categories
错误类别
| Category | Handling | Example |
|---|---|---|
| ADR SYS-Ready < 90% | Abort with message | ADR-01 score at 85% |
| ADR Not Found | Skip or abort | ADR-08 does not exist |
| Validation Failure | Auto-fix, retry | Missing required section |
| REQ-Ready Below 90% | Enhance sections, retry | Score at 88% |
| Max Retries Exceeded | Flag for manual review | Persistent validation errors |
| 类别 | 处理方式 | 示例 |
|---|---|---|
| ADR SYS-Ready < 90% | 中止并显示消息 | ADR-01 分数为 85% |
| 未找到 ADR | 跳过或中止 | ADR-08 不存在 |
| 验证失败 | 自动修复后重试 | 缺少必需章节 |
| REQ-Ready < 90% | 增强章节后重试 | 分数为 88% |
| 超过最大重试次数 | 标记为需要手动审查 | 持续出现验证错误 |
Recovery Actions
恢复操作
python
def handle_error(error_type: str, context: dict) -> Action:
match error_type:
case "ADR_SYS_READY_LOW":
return Action.ABORT_WITH_MESSAGE
case "ADR_NOT_FOUND":
return Action.SKIP_OR_ABORT
case "VALIDATION_FAILURE":
if context["retry_count"] < 3:
return Action.AUTO_FIX_RETRY
return Action.FLAG_MANUAL_REVIEW
case "REQ_READY_LOW":
return Action.ENHANCE_SECTIONS
case _:
return Action.FLAG_MANUAL_REVIEWpython
def handle_error(error_type: str, context: dict) -> Action:
match error_type:
case "ADR_SYS_READY_LOW":
return Action.ABORT_WITH_MESSAGE
case "ADR_NOT_FOUND":
return Action.SKIP_OR_ABORT
case "VALIDATION_FAILURE":
if context["retry_count"] < 3:
return Action.AUTO_FIX_RETRY
return Action.FLAG_MANUAL_REVIEW
case "REQ_READY_LOW":
return Action.ENHANCE_SECTIONS
case _:
return Action.FLAG_MANUAL_REVIEWConfiguration
配置
Default Configuration
默认配置
yaml
undefinedyaml
undefinedconfig/sys_autopilot.yaml
config/sys_autopilot.yaml
sys_autopilot:
version: "2.0"
scoring:
sys_ready_min: 90 # ADR threshold
req_ready_min: 90 # SYS output threshold
strict_mode: false
# NEW: Visual score indicators
score_display:
pass_icon: "✅" # >= 90%
warning_icon: "🟡" # 85-89%
fail_icon: "❌" # < 85%
# NEW: 6-category scoring weights
scoring_weights:
functional_decomposition: 25
quality_attributes: 20
interface_specifications: 20
data_management: 15
testing_requirements: 10
traceability: 10
execution:
max_parallel: 3 # HARD LIMIT - do not exceed
chunk_size: 3 # Documents per chunk
pause_between_chunks: true
auto_fix: true
continue_on_error: false
timeout_per_adr: 180 # seconds
output:
structure: auto # auto, monolithic, sectioned, modular
size_threshold_kb: 25
report_format: markdown
# NEW: Modular splitting options
modular_splitting:
enabled: true
strategy: per_capability # per_capability, per_section
max_file_size_kb: 50
validation:
skip_validation: false
fix_iterations_max: 3
require_threshold_tags: true
# NEW: Enhanced validation checks
require_external_dependencies: true
require_fallback_strategy: true
require_6_category_coverage: true
quality_attributes:
require_performance: true
require_reliability: true
require_security: true
require_scalability: false
require_observability: true
require_maintainability: false
NEW: External Dependencies Configuration
external_dependencies:
require_table: true
require_fallback: true
categories:
- infrastructure # GCP, AWS, Azure
- data # Databases, caches
- integration # APIs, message queues
- security # Identity providers
- observability # Monitoring, logging
undefinedsys_autopilot:
version: "2.0"
scoring:
sys_ready_min: 90 # ADR threshold
req_ready_min: 90 # SYS output threshold
strict_mode: false
# NEW: Visual score indicators
score_display:
pass_icon: "✅" # >= 90%
warning_icon: "🟡" # 85-89%
fail_icon: "❌" # < 85%
# NEW: 6-category scoring weights
scoring_weights:
functional_decomposition: 25
quality_attributes: 20
interface_specifications: 20
data_management: 15
testing_requirements: 10
traceability: 10
execution:
max_parallel: 3 # HARD LIMIT - do not exceed
chunk_size: 3 # Documents per chunk
pause_between_chunks: true
auto_fix: true
continue_on_error: false
timeout_per_adr: 180 # seconds
output:
structure: auto # auto, monolithic, sectioned, modular
size_threshold_kb: 25
report_format: markdown
# NEW: Modular splitting options
modular_splitting:
enabled: true
strategy: per_capability # per_capability, per_section
max_file_size_kb: 50
validation:
skip_validation: false
fix_iterations_max: 3
require_threshold_tags: true
# NEW: Enhanced validation checks
require_external_dependencies: true
require_fallback_strategy: true
require_6_category_coverage: true
quality_attributes:
require_performance: true
require_reliability: true
require_security: true
require_scalability: false
require_observability: true
require_maintainability: false
NEW: External Dependencies Configuration
external_dependencies:
require_table: true
require_fallback: true
categories:
- infrastructure # GCP, AWS, Azure
- data # Databases, caches
- integration # APIs, message queues
- security # Identity providers
- observability # Monitoring, logging
undefinedCommand Line Options
命令行选项
| Option | Default | Description |
|---|---|---|
| 90 | Minimum ADR SYS-Ready score |
| 90 | Minimum SYS REQ-Ready score |
| false | Disable auto-fix (manual only) |
| false | Continue if one ADR fails |
| false | Preview execution plan only |
| auto | Force monolithic or sectioned output |
| false | Skip validation phase |
| 选项 | 默认值 | 说明 |
|---|---|---|
| 90 | 最低 ADR SYS-Ready 分数 |
| 90 | 最低 SYS REQ-Ready 分数 |
| false | 禁用自动修复(仅手动处理) |
| false | 某个 ADR 失败后继续执行 |
| false | 仅预览执行计划 |
| auto | 强制使用单体式或分节式输出 |
| false | 跳过验证阶段 |
Context Management
上下文管理
Chunked Parallel Execution (MANDATORY)
分块并行执行(强制)
CRITICAL: To prevent conversation context overflow errors ("Prompt is too long", "Conversation too long"), all autopilot operations MUST follow chunked execution rules:
Chunk Size Limit: Maximum 3 documents per chunk
Chunking Rules:
- Chunk Formation: Group ADR-derived SYS documents into chunks of maximum 3 at a time
- Sequential Chunk Processing: Process one chunk at a time, completing all documents in a chunk before starting the next
- Context Pause: After completing each chunk, provide a summary and pause for user acknowledgment
- Progress Tracking: Display chunk progress (e.g., "Chunk 2/3: Processing SYS-04, SYS-05, SYS-06...")
Why Chunking is Required:
- Prevents "Conversation too long" errors during batch processing
- Allows context compaction between chunks
- Enables recovery from failures without losing all progress
- Provides natural checkpoints for user review
Execution Pattern:
For SYS batch of 7 ADR-derived documents:
Chunk 1: SYS-01, SYS-02, SYS-03 → Complete → Summary
[Context compaction opportunity]
Chunk 2: SYS-04, SYS-05, SYS-06 → Complete → Summary
[Context compaction opportunity]
Chunk 3: SYS-07 → Complete → SummaryChunk Completion Template:
markdown
undefined关键要求:为防止上下文溢出错误(“Prompt is too long”、“Conversation too long”),所有 autopilot 操作都必须遵循分块执行规则:
分块大小限制:每个块最多处理 3 个文档
分块规则:
- 分块形成:将 ADR 衍生的 SYS 文档分组,每组最多 3 个
- 顺序处理分块:一次处理一个块,完成该块中的所有文档后再开始下一个块
- 上下文暂停:每完成一个块,提供摘要并等待用户确认
- 进度跟踪:显示分块进度(例如“Chunk 2/3: Processing SYS-04, SYS-05, SYS-06...”)
必须分块的原因:
- 防止批处理期间出现“Conversation too long”错误
- 支持在块之间压缩上下文
- 发生故障时能够恢复,而不会丢失全部进度
- 为用户提供自然的审查检查点
执行模式:
For SYS batch of 7 ADR-derived documents:
Chunk 1: SYS-01, SYS-02, SYS-03 → Complete → Summary
[Context compaction opportunity]
Chunk 2: SYS-04, SYS-05, SYS-06 → Complete → Summary
[Context compaction opportunity]
Chunk 3: SYS-07 → Complete → Summary分块完成模板:
markdown
undefinedChunk N/M Complete
Chunk N/M Complete
Generated:
- SYS-XX (Infrastructure): REQ-Ready Score 94%
- SYS-YY (Data Architecture): REQ-Ready Score 92%
- SYS-ZZ (Integration): REQ-Ready Score 95%
Proceeding to next chunk...
---Generated:
- SYS-XX (Infrastructure): REQ-Ready Score 94%
- SYS-YY (Data Architecture): REQ-Ready Score 92%
- SYS-ZZ (Integration): REQ-Ready Score 95%
Proceeding to next chunk...
---Integration Points
集成点
Pre-Execution Hooks
执行前 Hooks
bash
undefinedbash
undefinedHook: pre_sys_generation
Hook: pre_sys_generation
Runs before SYS generation starts
Runs before SYS generation starts
./hooks/pre_sys_generation.sh
./hooks/pre_sys_generation.sh
Example: Verify ADR SYS-Ready scores
Example: Verify ADR SYS-Ready scores
for adr in docs/05_ADR/ADR-.md; do
score=$(grep -oP 'SYS-Ready.\K\d+' "$adr")
if [ "$score" -lt 90 ]; then
echo "ERROR: $adr SYS-Ready score below 90%"
exit 1
fi
done
undefinedfor adr in docs/05_ADR/ADR-.md; do
score=$(grep -oP 'SYS-Ready.\K\d+' "$adr")
if [ "$score" -lt 90 ]; then
echo "ERROR: $adr SYS-Ready score below 90%"
exit 1
fi
done
undefinedPost-Execution Hooks
执行后 Hooks
bash
undefinedbash
undefinedHook: post_sys_generation
Hook: post_sys_generation
Runs after SYS generation completes
Runs after SYS generation completes
./hooks/post_sys_generation.sh
./hooks/post_sys_generation.sh
Example: Trigger REQ autopilot for validated SYS
Example: Trigger REQ autopilot for validated SYS
if [ "$ALL_SYS_VALIDATED" = "true" ]; then
/doc-req-autopilot all
fi
undefinedif [ "$ALL_SYS_VALIDATED" = "true" ]; then
/doc-req-autopilot all
fi
undefinedCI/CD Integration
CI/CD 集成
yaml
undefinedyaml
undefined.github/workflows/sys_autopilot.yml
.github/workflows/sys_autopilot.yml
name: SYS Autopilot
on:
push:
paths:
- 'docs/05_ADR/**/ADR-*.md'
jobs:
generate-sys:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run SYS Autopilot
run: |
/doc-sys-autopilot all
- name: Upload Validation Report
uses: actions/upload-artifact@v4
with:
name: sys-validation
path: tmp/sys_validation_report.json
---name: SYS Autopilot
on:
push:
paths:
- 'docs/05_ADR/**/ADR-*.md'
jobs:
generate-sys:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run SYS Autopilot
run: |
/doc-sys-autopilot all
- name: Upload Validation Report
uses: actions/upload-artifact@v4
with:
name: sys-validation
path: tmp/sys_validation_report.json
---Quality Gates
质量门禁
Phase Gates
阶段门禁
| Phase | Gate | Criteria |
|---|---|---|
| Phase 1 | ADR Gate | ADR documents exist with architecture decisions |
| Phase 2 | Readiness Gate | All ADRs have SYS-Ready score >= 90% |
| Phase 3 | Generation Gate | All 5 parts generated per system |
| Phase 4 | Validation Gate | REQ-Ready Score >= 90% |
| Phase 5 | Review Gate | No blocking issues remaining |
| 阶段 | 门禁 | 标准 |
|---|---|---|
| 阶段 1 | ADR 门禁 | ADR 文档存在且包含架构决策 |
| 阶段 2 | 就绪门禁 | 所有 ADR 的 SYS-Ready 分数均 >= 90% |
| 阶段 3 | 生成门禁 | 每个系统均已生成 5 个部分 |
| 阶段 4 | 验证门禁 | REQ-Ready 分数 >= 90% |
| 阶段 5 | 审查门禁 | 不存在尚未解决的阻断性问题 |
Blocking vs Non-Blocking
阻断性与非阻断性问题
| Issue Type | Blocking | Action |
|---|---|---|
| Missing Functional Requirements | Yes | Must fix before proceeding |
| Missing Quality Attributes | Yes | Must fix before proceeding |
| REQ-Ready Score < 90% | Yes | Must enhance sections |
| Invalid element ID format | Yes | Must convert to unified format |
| Missing @threshold tags | Yes | Must add registry references |
| Hardcoded numeric values | Yes | Must replace with @threshold |
| Missing optional section | No | Log warning, continue |
| Style/formatting issues | No | Auto-fix, continue |
| 问题类型 | 是否阻断 | 操作 |
|---|---|---|
| 缺少功能需求 | 是 | 继续前必须修复 |
| 缺少质量属性 | 是 | 继续前必须修复 |
| REQ-Ready 分数 < 90% | 是 | 必须增强章节 |
| 元素 ID 格式无效 | 是 | 必须转换为统一格式 |
| 缺少 @threshold 标签 | 是 | 必须添加注册表引用 |
| 硬编码数值 | 是 | 必须替换为 @threshold |
| 缺少可选章节 | 否 | 记录警告并继续 |
| 样式/格式问题 | 否 | 自动修复并继续 |
Related Resources
相关资源
- SYS Creation Skill:
.claude/skills/doc-sys/SKILL.md - SYS Validator Skill:
.claude/skills/doc-sys-validator/SKILL.md - Quality Advisor Skill:
.claude/skills/quality-advisor/SKILL.md - Naming Standards Skill:
.claude/skills/doc-naming/SKILL.md - SYS Audit Skill:
.claude/skills/doc-sys-audit/SKILL.md - SYS Template:
ai_dev_ssd_flow/06_SYS/SYS-MVP-TEMPLATE.md - SYS Creation Rules:
ai_dev_ssd_flow/06_SYS/SYS_MVP_CREATION_RULES.md - SYS Validation Rules:
ai_dev_ssd_flow/06_SYS/SYS_MVP_VALIDATION_RULES.md - ADR Autopilot Skill:
.claude/skills/doc-adr-autopilot/SKILL.md
- SYS 创建 skill:
.claude/skills/doc-sys/SKILL.md - SYS 验证器 skill:
.claude/skills/doc-sys-validator/SKILL.md - 质量顾问 skill:
.claude/skills/quality-advisor/SKILL.md - 命名标准 skill:
.claude/skills/doc-naming/SKILL.md - SYS 审查 skill:
.claude/skills/doc-sys-audit/SKILL.md - SYS 模板:
ai_dev_ssd_flow/06_SYS/SYS-MVP-TEMPLATE.md - SYS 创建规则:
ai_dev_ssd_flow/06_SYS/SYS_MVP_CREATION_RULES.md - SYS 验证规则:
ai_dev_ssd_flow/06_SYS/SYS_MVP_VALIDATION_RULES.md - ADR Autopilot skill:
.claude/skills/doc-adr-autopilot/SKILL.md
Quick Reference
快速参考
| Input | Output | Key Metric |
|---|---|---|
| ADR Documents | SYS-01 to SYS-07 | REQ-Ready >= 90% |
Usage:
/doc-sys-autopilot <ADR-ID|all> [OPTIONS]Common Commands:
bash
undefined| 输入 | 输出 | 关键指标 |
|---|---|---|
| ADR 文档 | SYS-01 至 SYS-07 | REQ-Ready >= 90% |
用法:
/doc-sys-autopilot <ADR-ID|all> [OPTIONS]常用命令:
bash
undefinedGenerate all SYS from ADRs
Generate all SYS from ADRs
/doc-sys-autopilot all
/doc-sys-autopilot all
Generate single SYS from specific ADR
Generate single SYS from specific ADR
/doc-sys-autopilot ADR-01
/doc-sys-autopilot ADR-01
Preview only
Preview only
/doc-sys-autopilot all --dry-run
/doc-sys-autopilot all --dry-run
Resume after failure
Resume after failure
/doc-sys-autopilot resume
**ADR to SYS Mapping**:
| ADR | SYS | System Domain |
|-----|-----|---------------|
| ADR-01 | SYS-01 | Infrastructure |
| ADR-02 | SYS-02 | Data Architecture |
| ADR-03 | SYS-03 | Integration |
| ADR-04 | SYS-04 | Security |
| ADR-05 | SYS-05 | Observability |
| ADR-06 | SYS-06 | AI/ML |
| ADR-07 | SYS-07 | Technology Selection |
**Element ID Codes (SYS.NN.TT.SS)**:
| Type | Code | Example |
|------|------|---------|
| Functional Requirement | 01 | SYS.02.01.01 |
| Quality Attribute | 02 | SYS.02.02.01 |
| Use Case | 11 | SYS.02.11.01 |
| System Requirement | 26 | SYS.02.26.01 |
**Cumulative Tags Required** (Layer 6 - 5 tags):
```markdown
@brd: BRD.NN.TT.SS
@prd: PRD.NN.TT.SS
@ears: EARS.NN.TT.SS
@bdd: BDD.NN.TT.SS
@adr: ADR-NN/doc-sys-autopilot resume
**ADR 到 SYS 的映射**:
| ADR | SYS | 系统领域 |
|-----|-----|---------------|
| ADR-01 | SYS-01 | 基础设施 |
| ADR-02 | SYS-02 | 数据架构 |
| ADR-03 | SYS-03 | 集成 |
| ADR-04 | SYS-04 | 安全 |
| ADR-05 | SYS-05 | 可观测性 |
| ADR-06 | SYS-06 | AI/ML |
| ADR-07 | SYS-07 | 技术选型 |
**元素 ID 代码(SYS.NN.TT.SS)**:
| 类型 | 代码 | 示例 |
|------|------|---------|
| 功能需求 | 01 | SYS.02.01.01 |
| 质量属性 | 02 | SYS.02.02.01 |
| 用例 | 11 | SYS.02.11.01 |
| 系统需求 | 26 | SYS.02.26.01 |
**必需累计标签**(第 6 层 - 5 个标签):
```markdown
@brd: BRD.NN.TT.SS
@prd: PRD.NN.TT.SS
@ears: EARS.NN.TT.SS
@bdd: BDD.NN.TT.SS
@adr: ADR-NNReview Document Standards (v2.2)
审查文档标准(v2.2)
IMPORTANT: Review reports generated by this autopilot are formal project documents.
See: for complete standards.
.claude/skills/REVIEW_DOCUMENT_STANDARDS.md重要说明:此 autopilot 生成的审查报告属于正式项目文档。
完整标准参见:。
.claude/skills/REVIEW_DOCUMENT_STANDARDS.mdQuick Reference
快速参考
| Requirement | Value |
|---|---|
| Storage Location | Same folder as reviewed SYS |
| File Name | |
| YAML Frontmatter | MANDATORY - see shared standards |
| Parent Reference | MANDATORY - link to SYS document |
Example Location:
docs/06_SYS/
├── SYS-03_f3_observability/
│ ├── SYS-03_f3_observability.md
│ ├── SYS-03.A_audit_report_v001.md # ← Preferred report stored here
│ └── SYS-03.R_review_report_v001.md # ← Legacy-compatible reviewer report| 要求 | 值 |
|---|---|
| 存储位置 | 与被审查的 SYS 位于同一文件夹 |
| 文件名 | |
| YAML Frontmatter | 强制要求 - 参见共享标准 |
| 父级引用 | 强制要求 - 链接到 SYS 文档 |
位置示例:
docs/06_SYS/
├── SYS-03_f3_observability/
│ ├── SYS-03_f3_observability.md
│ ├── SYS-03.A_audit_report_v001.md # ← Preferred report stored here
│ └── SYS-03.R_review_report_v001.md # ← Legacy-compatible reviewer reportVersion History
版本历史
| Version | Date | Changes |
|---|---|---|
| 2.5 | 2026-02-27 | Migrated frontmatter to |
| 2.4 | 2026-02-11 | Smart Document Detection: Added automatic document type recognition; Self-type input (SYS-NN) triggers review mode; Upstream-type input (ADR-NN) triggers generate-if-missing or find-and-review; Updated input patterns table with type-based actions |
| 2.3 | 2026-02-10 | Review & Fix Cycle: Replaced Phase 5 with iterative Review -> Fix cycle using |
| 2.2 | 2026-02-10 | Added Review Document Standards: review reports stored alongside reviewed documents with YAML frontmatter and parent references |
| 2.1 | 2026-02-09 | Added Review Mode for validating existing SYS documents without modification; Added Fix Mode for auto-repairing SYS documents while preserving manual content; Added fix categories (element_ids, thresholds, dependencies, structure, traceability); Added content preservation rules; Added backup functionality for fix operations; Added review/fix report generation with 6-category score impact; Added element ID migration support (FR_XXX, QA_XXX, SR_XXX to unified format) |
| 2.0 | 2026-02-09 | Added modular splitting pattern with per-capability decomposition; Added External Dependencies table with fallback strategy requirement; Added 6-category REQ-Ready scoring with weighted breakdown; Added visual score indicators (✅/🟡/❌); Added validation rules SYS-E040 to SYS-E045 for new features; Added modular SYS template for atomic files; Added fallback strategy guidelines by dependency type |
| 1.0 | 2026-02-08 | Initial skill creation with 5-phase workflow; Integrated doc-naming, doc-sys, doc-sys-validator, quality-advisor skills; Added ADR to SYS mapping; Functional requirements and quality attributes generation; REQ-Ready scoring |
| 版本 | 日期 | 变更 |
|---|---|---|
| 2.5 | 2026-02-27 | 将 frontmatter 迁移到 |
| 2.4 | 2026-02-11 | 智能文档检测:增加自动文档类型识别;自身类型输入(SYS-NN)触发审查模式;上游类型输入(ADR-NN)触发缺失时生成或查找后审查;更新基于类型的操作表 |
| 2.3 | 2026-02-10 | 审查与修复循环:使用 |
| 2.2 | 2026-02-10 | 增加审查文档标准:审查报告与被审查文档一同存储,并包含 YAML frontmatter 和父级引用 |
| 2.1 | 2026-02-09 | 增加审查模式,用于在不修改文档的情况下验证现有 SYS 文档;增加修复模式,用于在保留手动内容的同时自动修复 SYS 文档;增加修复类别(element_ids、thresholds、dependencies、structure、traceability);增加内容保留规则;增加备份功能;增加审查/修复报告生成及 6 类分数变化;增加元素 ID 迁移支持(FR_XXX、QA_XXX、SR_XXX 转换为统一格式) |
| 2.0 | 2026-02-09 | 增加按能力分解的模块化拆分模式;增加包含回退策略要求的外部依赖表;增加带加权明细的 6 类 REQ-Ready 评分;增加可视分数指示符(✅/🟡/❌);为新功能增加 SYS-E040 至 SYS-E045 验证规则;增加模块化 SYS 模板以支持原子文件;增加按依赖类型划分的回退策略指导原则 |
| 1.0 | 2026-02-08 | 初始创建 skill,包含 5 阶段工作流;集成 doc-naming、doc-sys、doc-sys-validator、quality-advisor skills;增加 ADR 到 SYS 映射;增加功能需求和质量属性生成;增加 REQ-Ready 评分 |