Loading...
Loading...
Compare original and translation side by side
doc-ears-autopilotdoc-earsdoc-ears-autopilotdoc-earsdoc-ears-reviewerdoc-ears-autopilotdoc-bdd-autopilotdoc-earsdoc-ears-autopilotdoc-ears-validatordoc-earsdoc-ears-reviewerdoc-ears-autopilotdoc-bdd-autopilotdoc-earsdoc-ears-autopilotdoc-ears-validatordoc-ears| Aspect | | |
|---|---|---|
| Focus | Schema compliance, BDD-Ready score | Content quality, testability |
| Checks | Required sections, EARS syntax | Threshold quantification, PRD traceability |
| Auto-Fix | Structural issues only | Content issues (syntax, thresholds) |
| Output | BDD-Ready score (numeric) | Review score + issue list |
| Phase | Phase 4 (Validation) | Phase 5 (Final Review) |
| Blocking | BDD-Ready < threshold blocks | Review score < threshold flags |
| 维度 | | |
|---|---|---|
| 关注点 | Schema合规性、BDD就绪评分 | 内容质量、可测试性 |
| 检查内容 | 必填章节、EARS语法 | 阈值量化、PRD可追溯性 |
| 自动修复 | 仅结构问题 | 内容问题(语法、阈值) |
| 输出结果 | BDD就绪评分(数值) | 审核评分 + 问题列表 |
| 阶段 | 第4阶段(验证) | 第5阶段(最终审核) |
| 阻塞规则 | BDD就绪评分低于阈值则阻塞 | 审核评分低于阈值则标记 |
flowchart TD
A[Input: EARS Path] --> B[Load EARS Files]
B --> C{Sectioned or Monolithic?}
C -->|Sectioned| D[Load All Section Files]
C -->|Monolithic| E[Load Single File]
D --> F[Run Review Checks]
E --> F
subgraph Review["Review Checks"]
F --> F0[0. Structure Compliance]
F0 --> G[1. EARS Syntax Compliance]
G --> H[2. Threshold Quantification]
H --> I[3. PRD Alignment]
I --> J[4. Testability Assessment]
J --> K[5. Placeholder Detection]
K --> L[6. Section Completeness]
L --> M[7. Naming Compliance]
M --> M2[8. Upstream Drift Detection]
end
M2 --> N{Issues Found?}
N -->|Yes| O[Categorize Issues]
O --> P{Auto-Fixable?}
P -->|Yes| Q[Apply Auto-Fixes]
Q --> R[Re-run Affected Checks]
P -->|No| S[Flag for Manual Review]
R --> N
S --> T[Generate Report]
N -->|No| T
T --> U[Calculate Review Score]
U --> V{Score >= Threshold?}
V -->|Yes| W[PASS]
V -->|No| X[FAIL with Details]flowchart TD
A[Input: EARS Path] --> B[Load EARS Files]
B --> C{Sectioned or Monolithic?}
C -->|Sectioned| D[Load All Section Files]
C -->|Monolithic| E[Load Single File]
D --> F[Run Review Checks]
E --> F
subgraph Review["Review Checks"]
F --> F0[0. Structure Compliance]
F0 --> G[1. EARS Syntax Compliance]
G --> H[2. Threshold Quantification]
H --> I[3. PRD Alignment]
I --> J[4. Testability Assessment]
J --> K[5. Placeholder Detection]
K --> L[6. Section Completeness]
L --> M[7. Naming Compliance]
M --> M2[8. Upstream Drift Detection]
end
M2 --> N{Issues Found?}
N -->|Yes| O[Categorize Issues]
O --> P{Auto-Fixable?}
P -->|Yes| Q[Apply Auto-Fixes]
Q --> R[Re-run Affected Checks]
P -->|No| S[Flag for Manual Review]
R --> N
S --> T[Generate Report]
N -->|No| T
T --> U[Calculate Review Score]
U --> V{Score >= Threshold?}
V -->|Yes| W[PASS]
V -->|No| X[FAIL with Details]| EARS Type | Required Location |
|---|---|
| Monolithic | |
Validating folder structure...
├── EARS Location: docs/03_EARS/EARS-01_f1_iam/EARS-01_f1_iam.md
├── Expected Folder: EARS-01_f1_iam ✓
├── Parent Path: docs/03_EARS/ ✓
├── Nested Structure: Valid ✓
└── Result: PASS| Code | Severity | Description |
|---|---|---|
| REV-STR001 | Error | EARS not in nested folder (BLOCKING) |
| REV-STR002 | Error | Folder name doesn't match EARS ID |
| REV-STR003 | Warning | File name doesn't match folder name |
| EARS类型 | 必填位置 |
|---|---|
| 单文件版 | |
Validating folder structure...
├── EARS Location: docs/03_EARS/EARS-01_f1_iam/EARS-01_f1_iam.md
├── Expected Folder: EARS-01_f1_iam ✓
├── Parent Path: docs/03_EARS/ ✓
├── Nested Structure: Valid ✓
└── Result: PASS| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-STR001 | 错误 | EARS未存放在嵌套文件夹中(阻塞项) |
| REV-STR002 | 错误 | 文件夹名称与EARS ID不匹配 |
| REV-STR003 | 警告 | 文件名称与文件夹名称不匹配 |
THE {system} SHALL {action}WHEN {event} THE {system} SHALL {action}WHILE {state} THE {system} SHALL {action}WHERE {feature} THE {system} SHALL {action}WHEN {event} WHILE {state} THE {system} SHALL {action}IF {condition} THEN THE {system} SHALL {action} WITHIN {time}| Code | Severity | Description |
|---|---|---|
| REV-ES001 | Error | Requirement missing SHALL keyword |
| REV-ES002 | Error | WHEN clause without condition |
| REV-ES003 | Warning | Ambiguous subject (system not specified) |
| REV-ES004 | Warning | Action verb not quantifiable |
| REV-ES005 | Info | Complex pattern may be split |
THE {system} SHALL {action}WHEN {event} THE {system} SHALL {action}WHILE {state} THE {system} SHALL {action}WHERE {feature} THE {system} SHALL {action}WHEN {event} WHILE {state} THE {system} SHALL {action}IF {condition} THEN THE {system} SHALL {action} WITHIN {time}| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-ES001 | 错误 | 需求缺少SHALL关键字 |
| REV-ES002 | 错误 | WHEN子句无条件内容 |
| REV-ES003 | 警告 | 主体模糊(未指定系统) |
| REV-ES004 | 警告 | 动作动词无法量化 |
| REV-ES005 | 信息 | 复杂模式可拆分为多个需求 |
| Code | Severity | Description |
|---|---|---|
| REV-TQ001 | Error | Missing WITHIN clause for time-bound requirement |
| REV-TQ002 | Error | Threshold uses vague term |
| REV-TQ003 | Warning | Threshold inconsistent with PRD |
| REV-TQ004 | Info | Consider adding failure threshold |
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-TQ001 | 错误 | 时间绑定需求缺少WITHIN子句 |
| REV-TQ002 | 错误 | 阈值使用模糊表述 |
| REV-TQ003 | 警告 | 阈值与PRD不一致 |
| REV-TQ004 | 信息 | 建议添加失败阈值 |
| Code | Severity | Description |
|---|---|---|
| REV-PA001 | Error | EARS requirement without PRD source |
| REV-PA002 | Warning | PRD requirement without EARS mapping |
| REV-PA003 | Warning | Feature ID mismatch |
| REV-PA004 | Info | Requirement correctly marked as deferred |
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-PA001 | 错误 | EARS需求无PRD源文档对应 |
| REV-PA002 | 警告 | PRD需求无EARS映射 |
| REV-PA003 | 警告 | 功能ID不匹配 |
| REV-PA004 | 信息 | 需求已正确标记为延期 |
| Code | Severity | Description |
|---|---|---|
| REV-TA001 | Error | No measurable outcome |
| REV-TA002 | Warning | Pass/fail criteria unclear |
| REV-TA003 | Info | Edge case not covered |
| REV-TA004 | Info | Consider negative test case |
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-TA001 | 错误 | 无可衡量结果 |
| REV-TA002 | 警告 | 通过/失败标准不清晰 |
| REV-TA003 | 信息 | 未覆盖边缘场景 |
| REV-TA004 | 信息 | 建议添加负面测试用例 |
| Code | Severity | Description |
|---|---|---|
| REV-P001 | Error | [TODO] placeholder found |
| REV-P002 | Error | [TBD] placeholder found |
| REV-P003 | Warning | Template value not replaced |
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-P001 | 错误 | 发现[TODO]占位符 |
| REV-P002 | 错误 | 发现[TBD]占位符 |
| REV-P003 | 警告 | 模板值未替换 |
| Code | Severity | Description |
|---|---|---|
| REV-S001 | Error | Required section missing |
| REV-S002 | Warning | Section below minimum content |
| REV-S003 | Warning | Table has no data rows |
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-S001 | 错误 | 必填章节缺失 |
| REV-S002 | 警告 | 章节内容未达最低要求 |
| REV-S003 | 警告 | 表格无数据行 |
doc-namingEARS.NN.TT.SS| Code | Severity | Description |
|---|---|---|
| REV-N001 | Error | Invalid element ID format |
| REV-N002 | Error | Element type code not valid for EARS |
| REV-N003 | Error | Legacy pattern detected |
doc-namingEARS.NN.TT.SS| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-N001 | 错误 | 元素ID格式无效 |
| REV-N002 | 错误 | 元素类型代码不适用于EARS |
| REV-N003 | 错误 | 检测到遗留模式 |
@ref:@prd:@ref:@prd:docs/03_EARS/.drift_cache.json{
"cache_version": "1.0",
"artifact_type": "EARS",
"upstream_type": "PRD",
"last_updated": "2026-02-10T17:00:00Z",
"entries": {
"EARS-01": {
"ears_file": "docs/03_EARS/EARS-01_f1_iam.md",
"ears_hash": "sha256:abc123...",
"ears_mtime": "2026-02-10T15:00:00Z",
"upstream_refs": [
{
"prd_id": "PRD-01",
"prd_file": "docs/02_PRD/PRD-01_f1_iam.md",
"prd_hash": "sha256:def456...",
"prd_mtime": "2026-02-10T14:00:00Z",
"prd_version": "1.2"
}
],
"last_review": "2026-02-10T16:00:00Z",
"drift_status": "clean"
}
}
}docs/03_EARS/.drift_cache.json{
"cache_version": "1.0",
"artifact_type": "EARS",
"upstream_type": "PRD",
"last_updated": "2026-02-10T17:00:00Z",
"entries": {
"EARS-01": {
"ears_file": "docs/03_EARS/EARS-01_f1_iam/EARS-01_f1_iam.md",
"ears_hash": "sha256:abc123...",
"ears_mtime": "2026-02-10T15:00:00Z",
"upstream_refs": [
{
"prd_id": "PRD-01",
"prd_file": "docs/02_PRD/PRD-01_f1_iam.md",
"prd_hash": "sha256:def456...",
"prd_mtime": "2026-02-10T14:00:00Z",
"prd_version": "1.2"
}
],
"last_review": "2026-02-10T16:00:00Z",
"drift_status": "clean"
}
}
}IF cache file exists:
Load existing cache
Validate cache schema
ELSE:
Initialize empty cache
Mark as first review (REV-D006)FOR each EARS document:
Calculate current EARS hash
FOR each upstream PRD reference:
Calculate current PRD hash
IF cache entry exists:
Compare PRD hash with cached hash
IF hashes differ:
Flag drift (REV-D001/D002/D005)
Compare PRD mtime with cached mtime
IF mtime newer:
Flag potential drift (REV-D003)
ELSE:
New reference - no drift comparison possibleFOR each reviewed EARS document:
Update EARS hash and mtime
FOR each upstream PRD reference:
Update PRD hash, mtime, and version
Set drift_status based on review results
Set last_review to current timestamp
Write updated cache to diskIF cache file exists:
Load existing cache
Validate cache schema
ELSE:
Initialize empty cache
Mark as first review (REV-D006)FOR each EARS document:
Calculate current EARS hash
FOR each upstream PRD reference:
Calculate current PRD hash
IF cache entry exists:
Compare PRD hash with cached hash
IF hashes differ:
Flag drift (REV-D001/D002/D005)
Compare PRD mtime with cached mtime
IF mtime newer:
Flag potential drift (REV-D003)
ELSE:
New reference - no drift comparison possibleFOR each reviewed EARS document:
Update EARS hash and mtime
FOR each upstream PRD reference:
Update PRD hash, mtime, and version
Set drift_status based on review results
Set last_review to current timestamp
Write updated cache to diskimport hashlib
def calculate_content_hash(file_path: str) -> str:
"""Calculate SHA-256 hash of file content."""
with open(file_path, 'rb') as f:
content = f.read()
return f"sha256:{hashlib.sha256(content).hexdigest()}"| Code | Severity | Description |
|---|---|---|
| REV-D001 | Warning | Upstream document modified after EARS creation |
| REV-D002 | Warning | Referenced section content changed |
| REV-D003 | Info | Upstream document version incremented |
| REV-D004 | Info | New content added to upstream |
| REV-D005 | Error | Critical upstream modification (>20% change) |
| REV-D006 | Info | Cache created - first review |
import hashlib
def calculate_content_hash(file_path: str) -> str:
"""Calculate SHA-256 hash of file content."""
with open(file_path, 'rb') as f:
content = f.read()
return f"sha256:{hashlib.sha256(content).hexdigest()}"| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-D001 | 警告 | 上游文档在EARS创建后被修改 |
| REV-D002 | 警告 | 引用章节内容已更改 |
| REV-D003 | 信息 | 上游文档版本已升级 |
| REV-D004 | 信息 | 上游文档添加了新内容 |
| REV-D005 | 错误 | 上游文档发生重大修改(变更>20%) |
| REV-D006 | 信息 | 缓存已创建 - 首次审核 |
undefinedundefineddocs/03_EARS/.drift_cache.json| EARS | Upstream PRD | Drift Status | Last Verified |
|---|---|---|---|
| EARS-01 | PRD-01 | Clean | 2026-02-10T17:00:00Z |
| EARS-02 | PRD-02 | Drift Detected (REV-D002) | 2026-02-10T17:00:00Z |
**Configuration**:
| Setting | Default | Description |
|---------|---------|-------------|
| `cache_enabled` | true | Mandatory - cannot be disabled |
| `drift_threshold_days` | 7 | Days before drift becomes Warning |
| `critical_threshold_days` | 30 | Days before drift becomes Error |
| `enable_hash_check` | true | SHA-256 content hashing enabled |
---docs/03_EARS/.drift_cache.json| EARS | Upstream PRD | Drift Status | Last Verified |
|---|---|---|---|
| EARS-01 | PRD-01 | Clean | 2026-02-10T17:00:00Z |
| EARS-02 | PRD-02 | Drift Detected (REV-D002) | 2026-02-10T17:00:00Z |
**配置项**:
| 设置项 | 默认值 | 描述 |
|---------|---------|-------------|
| `cache_enabled` | true | 强制启用 - 无法禁用 |
| `drift_threshold_days` | 7 | 漂移变为警告状态的天数阈值 |
| `critical_threshold_days` | 30 | 漂移变为错误状态的天数阈值 |
| `enable_hash_check` | true | 启用SHA-256内容哈希检查 |
---| Category | Weight | Calculation |
|---|---|---|
| Structure Compliance | 12% | BLOCKING - must pass before other checks |
| EARS Syntax Compliance | 20% | (valid_syntax / total_reqs) × 20 |
| Threshold Quantification | 17% | (quantified / requiring_threshold) × 17 |
| PRD Alignment | 17% | (aligned_reqs / total_reqs) × 17 |
| Testability Assessment | 12% | (testable_reqs / total_reqs) × 12 |
| Placeholder Detection | 5% | (no_placeholders ? 5 : 5 - count) |
| Section Completeness | 8% | (complete / total_sections) × 8 |
| Naming Compliance | 4% | (valid_ids / total_ids) × 4 |
| Upstream Drift | 5% | (fresh_refs / total_refs) × 5 |
| 类别 | 权重 | 计算方式 |
|---|---|---|
| 结构合规性 | 12% | 阻塞项 - 必须通过后才能进行其他检查 |
| EARS语法合规性 | 20% | (有效语法数 / 总需求数) × 20 |
| 阈值量化 | 17% | (已量化数 / 需要阈值的需求数) × 17 |
| PRD一致性 | 17% | (一致需求数 / 总需求数) × 17 |
| 可测试性评估 | 12% | (可测试需求数 / 总需求数) × 12 |
| 占位符检测 | 5% | (无占位符则得5分,否则5 - 占位符数量) |
| 章节完整性 | 8% | (完整章节数 / 总章节数) × 8 |
| 命名合规性 | 4% | (有效ID数 / 总ID数) × 4 |
| 上游漂移 | 5% | (最新引用数 / 总引用数) × 5 |
undefinedundefined
---
---EARS-NN_{slug}/EARS-NN.R_review_report_vNNN.mddocs/03_EARS/EARS-NN_{slug}/EARS-NN_{slug}/EARS-NN.R_review_report_vNNN.mddocs/03_EARS/EARS-NN_{slug}/EARS-NN.R_review_report_v001.mdEARS-NN.R_review_report_v*.mddocs/03_EARS/EARS-01_f1_iam/
├── EARS-01_f1_iam.md
├── EARS-01.R_review_report_v001.md # First review
├── EARS-01.R_review_report_v002.md # After fixes
└── .drift_cache.jsonEARS-NN.R_review_report_v001.mdEARS-NN.R_review_report_v*.mddocs/03_EARS/EARS-01_f1_iam/
├── EARS-01_f1_iam.md
├── EARS-01.R_review_report_v001.md # 首次审核
├── EARS-01.R_review_report_v002.md # 修复后审核
└── .drift_cache.jsonREVIEW_DOCUMENT_STANDARDS.mdREVIEW_DOCUMENT_STANDARDS.mddoc-ears-autopilotflowchart LR
A[Phase 4: Validation] --> B[Phase 5: Final Review]
B --> C{doc-ears-reviewer}
C --> D[Phase 6: Continue]doc-ears-autopilotflowchart LR
A[Phase 4: Validation] --> B[Phase 5: Final Review]
B --> C{doc-ears-reviewer}
C --> D[Phase 6: Continue]| Skill | Relationship |
|---|---|
| Naming standards for Check #7 |
| Invokes this skill in Phase 5 |
| Structural validation (Phase 4) |
| Applies fixes based on review findings |
| EARS creation rules |
| Upstream QA |
| Downstream consumer |
| 技能 | 关系 |
|---|---|
| 检查项7的命名标准来源 |
| 在第5阶段调用该技能 |
| 结构验证(第4阶段) |
| 根据审核结果应用修复 |
| EARS创建规则来源 |
| 上游QA工具 |
| 下游消费工具 |
| Version | Date | Changes |
|---|---|---|
| 1.4 | 2026-02-11 | Structure Compliance: Added Check #0 for nested folder rule enforcement (REV-STR001-STR003); Updated workflow diagram; Structure check is BLOCKING |
| 1.3 | 2026-02-10 | Made drift cache mandatory; Added cache schema and location ( |
| 1.2 | 2026-02-10 | Added Check #8: Upstream Drift Detection - detects when PRD documents modified after EARS creation; REV-D001-D005 error codes; drift configuration; Added doc-ears-fixer to related skills |
| 1.1 | 2026-02-10 | Added review versioning support (_vNNN pattern); Delta reporting for score comparison |
| 1.0 | 2026-02-10 | Initial skill creation with 7 review checks; EARS syntax compliance; Threshold quantification; Testability assessment |
| 版本 | 日期 | 变更 |
|---|---|---|
| 1.4 | 2026-02-11 | 结构合规性: 添加检查项0以强制嵌套文件夹规则(REV-STR001-STR003);更新工作流图;结构检查为阻塞项 |
| 1.3 | 2026-02-10 | 强制启用漂移缓存;添加缓存Schema和位置( |
| 1.2 | 2026-02-10 | 添加检查项8: 上游漂移检测 - 检测PRD文档在EARS创建后是否被修改;新增REV-D001-D005错误代码;漂移配置项;在相关技能中添加doc-ears-fixer |
| 1.1 | 2026-02-10 | 添加审核版本支持(_vNNN模式);评分对比的差异报告 |
| 1.0 | 2026-02-10 | 初始技能创建,包含7个审核检查项;EARS语法合规性;阈值量化;可测试性评估 |