doc-prd-reviewer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

doc-prd-reviewer

doc-prd-reviewer

Purpose

用途

Comprehensive content review and quality assurance for Product Requirements Documents (PRD). This skill performs deep content analysis beyond structural validation, checking link integrity, threshold consistency, BRD alignment, and identifying issues that require manual business review.
Layer: 2 (PRD Quality Assurance)
Upstream: PRD (from
doc-prd-autopilot
or
doc-prd
)
Downstream: None (final QA gate before EARS generation)

为产品需求文档(PRD)提供全方位的内容审核与质量保障。本工具可执行超出结构校验的深度内容分析,检查链接完整性、阈值一致性、与BRD的对齐度,并识别需要人工业务审核的问题。
层级:2(PRD质量保障)
上游:PRD(来自
doc-prd-autopilot
doc-prd
下游:无(生成EARS前的最终质量关)

When to Use This Skill

何时使用此工具

Use
doc-prd-reviewer
when:
  • After PRD Generation: Run immediately after
    doc-prd-autopilot
    completes
  • Manual PRD Edits: After making manual changes to a PRD
  • Pre-EARS Check: Before running
    doc-ears-autopilot
  • Periodic Review: Regular quality checks on existing PRDs
  • CI/CD Integration: Automated review gate in documentation pipelines
Do NOT use when:
  • PRD does not exist yet (use
    doc-prd
    or
    doc-prd-autopilot
    first)
  • Need structural/schema validation only (use
    doc-prd-validator
    )
  • Generating new PRD content (use
    doc-prd
    )

当出现以下场景时使用
doc-prd-reviewer
  • PRD生成后:在
    doc-prd-autopilot
    运行完成后立即执行
  • 手动编辑PRD后:对PRD进行手动修改后
  • EARS生成前检查:运行
    doc-ears-autopilot
    之前
  • 定期审核:对存量PRD进行常规质量检查
  • CI/CD集成:作为文档流水线中的自动化审核关口
禁止使用场景
  • PRD还未生成(请先使用
    doc-prd
    doc-prd-autopilot
  • 仅需要结构/ schema校验(请使用
    doc-prd-validator
  • 生成新的PRD内容(请使用
    doc-prd

Skill vs Validator: Key Differences

本工具与校验器的核心差异

Aspect
doc-prd-validator
doc-prd-reviewer
FocusSchema compliance, EARS-Ready scoreContent quality, cross-document consistency
ChecksRequired sections, field formatsLink integrity, threshold alignment, placeholders
Auto-FixStructural issues onlyContent issues (links, dates, placeholders)
OutputEARS-Ready score (numeric)Review score + issue list
PhasePhase 4 (Validation)Phase 5 (Final Review)
BlockingEARS-Ready < threshold blocksReview score < threshold flags

维度
doc-prd-validator
doc-prd-reviewer
核心关注点Schema合规性、EARS就绪评分内容质量、跨文档一致性
检查项必填章节、字段格式链接完整性、阈值对齐性、占位符
自动修复仅结构性问题内容问题(链接、日期、占位符)
输出EARS就绪评分(数值)审核评分 + 问题清单
阶段第4阶段(校验)第5阶段(最终审核)
阻断性EARS就绪评分低于阈值则阻断流程审核评分低于阈值则标记风险

Review Workflow

审核工作流

mermaid
flowchart TD
    A[Input: PRD Path] --> B[Load PRD 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 --> G[1. Link Integrity]
        G --> H[2. Threshold Consistency]
        H --> I[3. BRD Alignment]
        I --> J[4. Placeholder Detection]
        J --> K[5. Traceability Tags]
        K --> L[6. Section Completeness]
        L --> M[7. Customer Content]
        M --> M2[8. Naming Compliance]
        M2 --> M3[9. Structure Compliance]
        M3 --> M4[10. Upstream Drift Detection]
    end

    M4 --> 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]

mermaid
flowchart TD
    A[输入: PRD路径] --> B[加载PRD文件]
    B --> C{是分章节版还是单文件版?}

    C -->|分章节版| D[加载所有章节文件]
    C -->|单文件版| E[加载单个文件]

    D --> F[执行审核检查]
    E --> F

    subgraph 审核检查项["审核检查项"]
        F --> G[1. 链接完整性]
        G --> H[2. 阈值一致性]
        H --> I[3. BRD对齐度]
        I --> J[4. 占位符检测]
        J --> K[5. 可追溯标签]
        K --> L[6. 章节完整性]
        L --> M[7. 客户端内容]
        M --> M2[8. 命名合规性]
        M2 --> M3[9. 结构合规性]
        M3 --> M4[10. 上游文档漂移检测]
    end

    M4 --> N{发现问题?}
    N -->|是| O[问题分类]
    O --> P{可自动修复?}
    P -->|是| Q[执行自动修复]
    Q --> R[重新运行受影响的检查项]
    P -->|否| S[标记为需人工审核]
    R --> N
    S --> T[生成报告]
    N -->|否| T
    T --> U[计算审核评分]
    U --> V{评分 >= 阈值?}
    V -->|是| W[通过]
    V -->|否| X[不通过,附详细说明]

Review Checks

审核检查项

1. Link Integrity

1. 链接完整性

Validates all internal document links resolve correctly.
Scope:
  • Navigation links (
    [Previous: ...]
    ,
    [Next: ...]
    )
  • Section cross-references (
    [See Section 8.2](...)
    )
  • Index to section links
  • External documentation links (warns if unreachable)
Detection:
Scanning PRD-01 for internal links...
├── PRD-01.0_index.md: 17 links found
│   ├── PRD-01.1_document_control.md ✓
│   ├── PRD-01.2_executive_summary.md ✓
│   ├── PRD-01.18_missing_section.md ✗ NOT FOUND
│   └── ...
└── Result: 1 broken link found
Auto-Fix:
  • Remove broken links to non-existent sections
  • Correct path typos if target exists with similar name
  • Update relative paths if file was moved
Error Codes:
CodeSeverityDescription
REV-L001ErrorBroken internal link
REV-L002WarningExternal link unreachable
REV-L003InfoLink path uses absolute instead of relative

校验所有内部文档链接可正常跳转。
检查范围:
  • 导航链接(
    [上一篇: ...]
    [下一篇: ...]
  • 章节交叉引用(
    [参见第8.2节](...)
  • 索引指向章节的链接
  • 外部文档链接(不可达时给出警告)
检测示例:
Scanning PRD-01 for internal links...
├── PRD-01.0_index.md: 17 links found
│   ├── PRD-01.1_document_control.md ✓
│   ├── PRD-01.2_executive_summary.md ✓
│   ├── PRD-01.18_missing_section.md ✗ NOT FOUND
│   └── ...
└── Result: 1 broken link found
自动修复:
  • 移除指向不存在章节的无效链接
  • 如果存在名称相似的目标文件,修正路径拼写错误
  • 如果文件被移动,更新相对路径
错误码:
错误码严重级别描述
REV-L001错误内部链接损坏
REV-L002警告外部链接不可达
REV-L003提示链接使用绝对路径而非相对路径

2. Threshold Consistency

2. 阈值一致性

Verifies performance metrics match across all sections.
Scope:
  • Section 5 (Success Metrics) thresholds
  • Section 9 (Quality Attributes) performance targets
  • Section 17/20 (Appendix B.1) timing profile matrix
  • Cross-references to BRD thresholds
Detection:
Comparing thresholds across sections...
├── Operation: auth.p99
│   ├── Section 5 (Success Metrics): 100ms ✓
│   ├── Section 9 (Quality Attributes): 100ms ✓
│   ├── Section 17 (Timing Matrix): 100ms ✓
│   └── BRD-01 (Source): 100ms ✓
├── Operation: authz.p99
│   ├── Section 5: 10ms ✓
│   ├── Section 9: 15ms ✗ MISMATCH
│   ├── Section 17: 10ms ✓
│   └── BRD-01: 10ms ✓
└── Result: 1 inconsistency found
Auto-Fix:
  • Align PRD values to BRD source (authoritative)
  • Update all sections to use consistent value
  • Add comment noting auto-fix with timestamp
Error Codes:
CodeSeverityDescription
REV-T001ErrorThreshold mismatch across PRD sections
REV-T002ErrorThreshold differs from BRD source
REV-T003WarningThreshold unit inconsistency (ms vs s)
REV-T004InfoThreshold stricter than BRD (acceptable)

验证所有章节的性能指标保持一致。
检查范围:
  • 第5节(成功指标)的阈值
  • 第9节(质量属性)的性能目标
  • 第17/20节(附录B.1)的时序配置矩阵
  • 对BRD阈值的交叉引用
检测示例:
Comparing thresholds across sections...
├── Operation: auth.p99
│   ├── Section 5 (Success Metrics): 100ms ✓
│   ├── Section 9 (Quality Attributes): 100ms ✓
│   ├── Section 17 (Timing Matrix): 100ms ✓
│   └── BRD-01 (Source): 100ms ✓
├── Operation: authz.p99
│   ├── Section 5: 10ms ✓
│   ├── Section 9: 15ms ✗ MISMATCH
│   ├── Section 17: 10ms ✓
│   └── BRD-01: 10ms ✓
└── Result: 1 inconsistency found
自动修复:
  • 将PRD中的值与权威的BRD源对齐
  • 更新所有章节使用统一的数值
  • 添加注释标注自动修复操作与时间戳
错误码:
错误码严重级别描述
REV-T001错误PRD各章节阈值不一致
REV-T002错误阈值与BRD源不一致
REV-T003警告阈值单位不一致(ms与s混用)
REV-T004提示阈值比BRD要求更严格(可接受)

3. BRD Alignment

3. BRD对齐度

Validates PRD requirements accurately reflect BRD source.
Scope:
  • Every PRD requirement maps to a BRD requirement
  • No orphaned requirements (PRD without BRD source)
  • No missing requirements (BRD without PRD mapping)
  • Scope boundaries match
Detection:
Verifying PRD requirements map to BRD source...
├── PRD.01.01.01 → BRD.01.01.01 (Multi-Provider Auth) ✓
├── PRD.01.01.02 → BRD.01.01.02 (4D Authorization) ✓
├── PRD.01.01.03 → BRD.01.01.03 (Trust Levels) ✓
├── PRD.01.01.09 → ??? ✗ NO BRD MAPPING
├── BRD.01.01.10 → ??? ✗ NO PRD MAPPING (deferred)
└── Result: 11/12 aligned, 1 orphan, 1 missing

Scope Alignment:
├── PRD In-Scope vs BRD In-Scope: MATCH ✓
├── PRD Out-Scope vs BRD Out-Scope: MATCH ✓
└── Deferred items: 2 (correctly marked)
Manual Review Required:
  • Orphaned requirements need justification
  • Missing requirements need explicit deferral note
  • Scope mismatches need business decision
Error Codes:
CodeSeverityDescription
REV-A001ErrorPRD requirement without BRD source
REV-A002WarningBRD requirement without PRD mapping
REV-A003ErrorScope mismatch (PRD vs BRD)
REV-A004InfoRequirement correctly marked as deferred

校验PRD需求准确反映BRD源内容。
检查范围:
  • 每个PRD需求都对应一个BRD需求
  • 无孤立需求(PRD需求无对应BRD源)
  • 无缺失需求(BRD需求未映射到PRD)
  • 范围边界保持一致
检测示例:
Verifying PRD requirements map to BRD source...
├── PRD.01.01.01 → BRD.01.01.01 (Multi-Provider Auth) ✓
├── PRD.01.01.02 → BRD.01.01.02 (4D Authorization) ✓
├── PRD.01.01.03 → BRD.01.01.03 (Trust Levels) ✓
├── PRD.01.01.09 → ??? ✗ NO BRD MAPPING
├── BRD.01.01.10 → ??? ✗ NO PRD MAPPING (deferred)
└── Result: 11/12 aligned, 1 orphan, 1 missing

Scope Alignment:
├── PRD In-Scope vs BRD In-Scope: MATCH ✓
├── PRD Out-Scope vs BRD Out-Scope: MATCH ✓
└── Deferred items: 2 (correctly marked)
需要人工审核:
  • 孤立需求需要提供合理性说明
  • 缺失需求需要明确标注延期说明
  • 范围不匹配需要业务方决策
错误码:
错误码严重级别描述
REV-A001错误PRD需求无对应BRD源
REV-A002警告BRD需求未映射到PRD
REV-A003错误范围不匹配(PRD与BRD不一致)
REV-A004提示需求已正确标记为延期

4. Placeholder Detection

4. 占位符检测

Identifies incomplete content requiring replacement.
Scope:
  • [TODO]
    ,
    [TBD]
    ,
    [PLACEHOLDER]
    text
  • Template dates:
    YYYY-MM-DDTHH:MM:SS
    ,
    MM/DD/YYYY
  • Template names:
    [Name]
    ,
    [Author]
    ,
    [Reviewer]
  • Empty sections:
    <!-- Content here -->
  • Lorem ipsum or sample text
Detection:
Scanning for placeholder text...
├── [TODO]: 0 found ✓
├── [TBD]: 1 found
│   └── PRD-01.10_customer_content.md:42: "[TBD: Marketing copy]"
├── YYYY-MM-DDTHH:MM:SS: 0 found ✓
├── [Name]: 0 found ✓
├── Empty sections: 0 found ✓
└── Result: 1 placeholder found
Auto-Fix:
  • Replace
    YYYY-MM-DDTHH:MM:SS
    with current datetime
  • Replace
    [Name]
    with document author from metadata
  • Remove empty comment placeholders
  • Flag
    [TODO]
    /
    [TBD]
    for manual completion
Error Codes:
CodeSeverityDescription
REV-P001Error[TODO] placeholder found
REV-P002Error[TBD] placeholder found
REV-P003WarningTemplate date not replaced
REV-P004WarningTemplate name not replaced
REV-P005WarningEmpty section content

识别需要替换的不完整内容。
检查范围:
  • [TODO]
    [TBD]
    [PLACEHOLDER]
    文本
  • 模板日期:
    YYYY-MM-DDTHH:MM:SS
    MM/DD/YYYY
  • 模板名称:
    [Name]
    [Author]
    [Reviewer]
  • 空章节:
    <!-- Content here -->
  • Lorem ipsum或示例文本
检测示例:
Scanning for placeholder text...
├── [TODO]: 0 found ✓
├── [TBD]: 1 found
│   └── PRD-01.10_customer_content.md:42: "[TBD: Marketing copy]"
├── YYYY-MM-DDTHH:MM:SS: 0 found ✓
├── [Name]: 0 found ✓
├── Empty sections: 0 found ✓
└── Result: 1 placeholder found
自动修复:
  • YYYY-MM-DDTHH:MM:SS
    替换为当前日期时间
  • [Name]
    替换为元数据中的文档作者
  • 移除空的注释占位符
  • 标记
    [TODO]
    /
    [TBD]
    待人工补全
错误码:
错误码严重级别描述
REV-P001错误发现[TODO]占位符
REV-P002错误发现[TBD]占位符
REV-P003警告模板日期未替换
REV-P004警告模板名称未替换
REV-P005警告章节内容为空

5. Traceability Tags

5. 可追溯标签

Validates
@brd:
,
@depends:
, and
@discoverability:
tags.
Scope:
  • All
    @brd: BRD.XX.XX.XX
    tags reference valid BRD IDs
  • @depends: PRD-XX
    references exist
  • @discoverability: PRD-XX
    references exist
  • Tag format follows convention
Detection:
Validating traceability tags...
├── @brd tags: 15 found
│   ├── BRD.01.01.01 ✓ (exists in BRD-01)
│   ├── BRD.01.01.02 ✓
│   ├── BRD.01.99.01 ✗ NOT FOUND in BRD
│   └── ...
├── @depends tags: 2 found
│   ├── PRD-06 ✓ (exists)
│   └── PRD-07 ✓ (exists)
├── @discoverability tags: 2 found
│   ├── PRD-02 ✗ (planned, not yet created)
│   └── PRD-03 ✗ (planned, not yet created)
└── Result: 1 invalid @brd, 2 forward references (acceptable)
Auto-Fix:
  • Remove invalid
    @brd
    tags
  • Correct typos in tag IDs if close match exists
  • Add
    (planned)
    suffix to forward references
Error Codes:
CodeSeverityDescription
REV-TR001Error@brd tag references non-existent BRD ID
REV-TR002Warning@depends references non-existent PRD
REV-TR003Info@discoverability is forward reference
REV-TR004WarningTag format malformed

校验
@brd:
@depends:
@discoverability:
标签有效性。
检查范围:
  • 所有
    @brd: BRD.XX.XX.XX
    标签引用的BRD ID有效
  • @depends: PRD-XX
    引用的PRD存在
  • @discoverability: PRD-XX
    引用的PRD存在
  • 标签格式符合规范
检测示例:
Validating traceability tags...
├── @brd tags: 15 found
│   ├── BRD.01.01.01 ✓ (exists in BRD-01)
│   ├── BRD.01.01.02 ✓
│   ├── BRD.01.99.01 ✗ NOT FOUND in BRD
│   └── ...
├── @depends tags: 2 found
│   ├── PRD-06 ✓ (exists)
│   └── PRD-07 ✓ (exists)
├── @discoverability tags: 2 found
│   ├── PRD-02 ✗ (planned, not yet created)
│   └── PRD-03 ✗ (planned, not yet created)
└── Result: 1 invalid @brd, 2 forward references (acceptable)
自动修复:
  • 移除无效的
    @brd
    标签
  • 如果存在近似匹配,修正标签ID的拼写错误
  • 为前向引用添加
    (planned)
    后缀
错误码:
错误码严重级别描述
REV-TR001错误@brd标签引用不存在的BRD ID
REV-TR002警告@depends引用不存在的PRD
REV-TR003提示@discoverability为前向引用
REV-TR004警告标签格式错误

6. Section Completeness

6. 章节完整性

Verifies all required sections have substantive content.
Scope:
  • Minimum word count per section (configurable)
  • Section headers present
  • Tables have data rows (not just headers)
  • Mermaid diagrams render properly
Detection:
Checking section completeness...
├── Section 1 (Document Control): 150 words ✓
├── Section 2 (Executive Summary): 280 words ✓
├── Section 10 (Customer Content): 45 words ⚠ THIN
├── Section 17 (Appendices): 820 words ✓
├── Table check: 12 tables, all have data rows ✓
├── Mermaid check: 3 diagrams, all valid ✓
└── Result: 16/17 complete, 1 thin section
Minimum Word Counts (configurable):
SectionMinimum Words
Executive Summary100
Problem Statement75
Functional Requirements200
Quality Attributes100
Customer Content100
Risk Assessment75
Appendices200
Error Codes:
CodeSeverityDescription
REV-S001ErrorRequired section missing entirely
REV-S002WarningSection below minimum word count
REV-S003WarningTable has no data rows
REV-S004ErrorMermaid diagram syntax error

验证所有必填章节都有实质内容。
检查范围:
  • 每个章节的最低字数(可配置)
  • 章节标题存在
  • 表格有数据行(不只有表头)
  • Mermaid图可正常渲染
检测示例:
Checking section completeness...
├── Section 1 (Document Control): 150 words ✓
├── Section 2 (Executive Summary): 280 words ✓
├── Section 10 (Customer Content): 45 words ⚠ THIN
├── Section 17 (Appendices): 820 words ✓
├── Table check: 12 tables, all have data rows ✓
├── Mermaid check: 3 diagrams, all valid ✓
└── Result: 16/17 complete, 1 thin section
最低字数要求(可配置):
章节最低字数
执行摘要100
问题陈述75
功能需求200
质量属性100
客户端内容100
风险评估75
附录200
错误码:
错误码严重级别描述
REV-S001错误必填章节完全缺失
REV-S002警告章节字数低于最低要求
REV-S003警告表格无数据行
REV-S004错误Mermaid图语法错误

7. Customer Content Review

7. 客户端内容审核

Flags Section 10 for mandatory business/marketing review.
Scope:
  • Section 10 (Customer-Facing Content) exists
  • Content is substantive (not placeholder)
  • Marketing language appropriate
  • No technical jargon in customer-facing text
Detection:
Reviewing customer-facing content (Section 10)...
├── Section exists: ✓
├── Word count: 180 words ✓
├── Placeholder check: PASS ✓
├── Technical jargon scan:
│   ├── "4D Matrix" - technical term found
│   ├── "OIDC" - acronym may need explanation
│   └── "mTLS" - technical term found
└── Result: FLAG for marketing review (3 technical terms)
Manual Review Required:
  • All Section 10 content requires business sign-off
  • Technical terms need customer-friendly alternatives
  • Messaging alignment with brand guidelines
Error Codes:
CodeSeverityDescription
REV-C001ErrorSection 10 missing
REV-C002WarningSection 10 is placeholder content
REV-C003InfoTechnical jargon in customer content
REV-C004FlagRequires marketing/business review

标记第10节为强制业务/营销审核项。
检查范围:
  • 第10节(面向客户端的内容)存在
  • 内容为实质内容(非占位符)
  • 营销用语合适
  • 面向客户端的文本无技术术语
检测示例:
Reviewing customer-facing content (Section 10)...
├── Section exists: ✓
├── Word count: 180 words ✓
├── Placeholder check: PASS ✓
├── Technical jargon scan:
│   ├── "4D Matrix" - technical term found
│   ├── "OIDC" - acronym may need explanation
│   └── "mTLS" - technical term found
└── Result: FLAG for marketing review (3 technical terms)
需要人工审核:
  • 所有第10节内容需要业务方签字确认
  • 技术术语需要替换为客户友好的表述
  • 消息传递与品牌指南对齐
错误码:
错误码严重级别描述
REV-C001错误第10节缺失
REV-C002警告第10节为占位符内容
REV-C003提示客户端内容中存在技术术语
REV-C004标记需要营销/业务审核

8. Naming Compliance

8. 命名合规性

Validates element IDs and threshold tags follow
doc-naming
standards.
Scope:
  • Element IDs use
    PRD.NN.TT.SS
    format
  • Element type codes valid for PRD (01-09, 11, 22, 24)
  • Threshold tags use
    @threshold: PRD.NN.key
    format
  • No legacy patterns (US-NNN, FR-NNN, AC-NNN, F-NNN)
Detection:
Validating naming compliance (per doc-naming skill)...
├── Element IDs: 24 found
│   ├── PRD.01.01.01 ✓ (valid format, code 01 valid for PRD)
│   ├── PRD.01.09.05 ✓ (valid format, code 09 valid for PRD)
│   ├── PRD.01.25.01 ✗ (code 25 not valid for PRD - EARS only)
│   └── ...
├── Threshold tags: 8 found
│   ├── @threshold: PRD.01.perf.auth.p99 ✓
│   ├── @threshold: perf.auth.p99 ✗ (missing PRD.NN prefix)
│   └── ...
├── Legacy patterns: 2 found
│   ├── US-001 ✗ (deprecated - use PRD.NN.09.SS)
│   └── FR-003 ✗ (deprecated - use PRD.NN.01.SS)
└── Result: 3 naming violations
Auto-Fix:
  • Convert legacy patterns to unified format
  • Add missing
    PRD.NN
    prefix to threshold tags
  • Suggest correct element type codes
Error Codes:
CodeSeverityDescription
REV-N001ErrorInvalid element ID format
REV-N002ErrorElement type code not valid for PRD
REV-N003ErrorLegacy pattern detected (US-NNN, FR-NNN, etc.)
REV-N004ErrorThreshold tag missing document reference
REV-N005WarningThreshold key format non-standard
Reference: See
doc-naming
skill for complete naming rules.

校验元素ID和阈值标签符合
doc-naming
标准。
检查范围:
  • 元素ID使用
    PRD.NN.TT.SS
    格式
  • 元素类型代码对PRD有效(01-09、11、22、24)
  • 阈值标签使用
    @threshold: PRD.NN.key
    格式
  • 无旧版命名模式(US-NNN、FR-NNN、AC-NNN、F-NNN)
检测示例:
Validating naming compliance (per doc-naming skill)...
├── Element IDs: 24 found
│   ├── PRD.01.01.01 ✓ (valid format, code 01 valid for PRD)
│   ├── PRD.01.09.05 ✓ (valid format, code 09 valid for PRD)
│   ├── PRD.01.25.01 ✗ (code 25 not valid for PRD - EARS only)
│   └── ...
├── Threshold tags: 8 found
│   ├── @threshold: PRD.01.perf.auth.p99 ✓
│   ├── @threshold: perf.auth.p99 ✗ (missing PRD.NN prefix)
│   └── ...
├── Legacy patterns: 2 found
│   ├── US-001 ✗ (deprecated - use PRD.NN.09.SS)
│   └── FR-003 ✗ (deprecated - use PRD.NN.01.SS)
└── Result: 3 naming violations
自动修复:
  • 将旧版命名模式转换为统一格式
  • 为阈值标签添加缺失的
    PRD.NN
    前缀
  • 推荐正确的元素类型代码
错误码:
错误码严重级别描述
REV-N001错误元素ID格式无效
REV-N002错误元素类型代码对PRD无效
REV-N003错误检测到旧版命名模式(US-NNN、FR-NNN等)
REV-N004错误阈值标签缺失文档引用
REV-N005警告阈值键格式不符合标准
参考:完整命名规则请参见
doc-naming
工具文档。

9. Structure Compliance (CRITICAL)

9. 结构合规性(关键)

Validates PRD follows the mandatory nested folder rule.
Nested Folder Rule: ALL PRDs MUST be in nested folders regardless of size.
Required Structure:
PRD TypeRequired Location
Monolithic
docs/02_PRD/PRD-NN_{slug}/PRD-NN_{slug}.md
Sectioned
docs/02_PRD/PRD-NN_{slug}/PRD-NN.0_index.md
,
PRD-NN.1_*.md
, etc.
Detection:
Validating folder structure...
├── PRD Location: docs/02_PRD/PRD-01_f1_iam/PRD-01_f1_iam.md
├── Expected Folder: PRD-01_f1_iam ✓
├── Parent Path: docs/02_PRD/ ✓
├── Nested Structure: Valid ✓
└── Result: PASS
Failure Detection:
Validating folder structure...
├── PRD Location: docs/02_PRD/PRD-02_f2_session.md
├── Expected: docs/02_PRD/PRD-02_f2_session/PRD-02_f2_session.md
├── Nested Structure: INVALID ✗
└── Result: FAIL - PRD not in nested folder
Auto-Fix:
  1. Create the nested folder
    docs/02_PRD/PRD-NN_{slug}/
  2. Move the PRD file(s) into the folder
  3. Update all internal links (navigation, cross-references)
  4. Update upstream BRD links:
    ../01_BRD/
    ../../01_BRD/
  5. Update any glossary links to correct path
Error Codes:
CodeSeverityDescription
REV-STR001ErrorPRD not in nested folder (blocking)
REV-STR002ErrorPRD folder name doesn't match PRD ID
REV-STR003WarningMonolithic PRD should be sectioned (>25KB)
REV-STR004ErrorBRD link path incorrect for nested folder
This check is BLOCKING - PRD must pass structure validation before other checks proceed.

校验PRD符合强制嵌套文件夹规则。
嵌套文件夹规则:所有PRD无论大小都必须存放在嵌套文件夹中。
要求结构:
PRD类型要求存放路径
单文件版
docs/02_PRD/PRD-NN_{slug}/PRD-NN_{slug}.md
分章节版
docs/02_PRD/PRD-NN_{slug}/PRD-NN.0_index.md
PRD-NN.1_*.md
检测示例:
Validating folder structure...
├── PRD Location: docs/02_PRD/PRD-01_f1_iam/PRD-01_f1_iam.md
├── Expected Folder: PRD-01_f1_iam ✓
├── Parent Path: docs/02_PRD/ ✓
├── Nested Structure: Valid ✓
└── Result: PASS
失败检测示例:
Validating folder structure...
├── PRD Location: docs/02_PRD/PRD-02_f2_session.md
├── Expected: docs/02_PRD/PRD-02_f2_session/PRD-02_f2_session.md
├── Nested Structure: INVALID ✗
└── Result: FAIL - PRD not in nested folder
自动修复:
  1. 创建嵌套文件夹
    docs/02_PRD/PRD-NN_{slug}/
  2. 将PRD文件移动到该文件夹中
  3. 更新所有内部链接(导航、交叉引用)
  4. 更新上游BRD链接:
    ../01_BRD/
    ../../01_BRD/
  5. 更新所有术语表链接为正确路径
错误码:
错误码严重级别描述
REV-STR001错误PRD未存放在嵌套文件夹中(阻断性)
REV-STR002错误PRD文件夹名称与PRD ID不匹配
REV-STR003警告单文件PRD体积超过25KB,建议拆分为分章节版
REV-STR004错误嵌套文件夹中的BRD链接路径不正确
此检查为阻断性检查——PRD必须先通过结构校验,才能继续执行其他检查。

10. Upstream Drift Detection (Mandatory Cache)

10. 上游文档漂移检测(强制缓存)

Detects when upstream source documents have been modified after the PRD was created or last updated. The drift cache is mandatory - the reviewer MUST create/update it after every review.
Purpose: Identifies stale PRD content that may not reflect current BRD documentation. When upstream documents (BRD specifications, business requirements) change, the PRD may need updates to maintain alignment.
Scope:
  • @ref:
    tag targets (BRD documents, technical specifications)
  • @brd:
    tag references
  • Traceability section upstream artifact links
  • Any markdown links to
    ../01_BRD/
    or source documents

检测上游源文档在PRD创建或上次更新后是否被修改。漂移缓存为强制要求——审核工具每次审核后必须创建/更新缓存。
用途:识别可能未与当前BRD文档对齐的过时PRD内容。当上游文档(BRD规范、业务需求)变更时,PRD可能需要更新以保持对齐。
检查范围:
  • @ref:
    标签目标(BRD文档、技术规范)
  • @brd:
    标签引用
  • 可追溯章节的上游工件链接
  • 所有指向
    ../01_BRD/
    或源文档的markdown链接

10.1 Drift Cache File (MANDATORY)

10.1 漂移缓存文件(强制要求)

Location:
docs/02_PRD/{PRD_folder}/.drift_cache.json
IMPORTANT: The reviewer MUST:
  1. Read the cache if it exists (for hash comparison)
  2. Create the cache if it doesn't exist
  3. Update the cache after every review with current hashes
Cache Schema:
json
{
  "schema_version": "1.0",
  "document_id": "PRD-01",
  "document_version": "1.0",
  "last_reviewed": "2026-02-10T17:00:00",
  "reviewer_version": "1.4",
  "upstream_documents": {
    "../../01_BRD/BRD-01_f1_iam/BRD-01.0_index.md": {
      "hash": "sha256:a1b2c3d4e5f6g7h8i9j0...",
      "last_modified": "2026-02-10T15:34:26",
      "file_size": 50781,
      "version": "1.0",
      "sections_tracked": ["#7-functional-requirements", "#8-non-functional-requirements"]
    },
    "../../01_BRD/BRD-01_f1_iam/BRD-01.7_functional_requirements.md": {
      "hash": "sha256:k1l2m3n4o5p6q7r8s9t0...",
      "last_modified": "2026-02-10T15:34:21",
      "file_size": 4730,
      "version": "1.0",
      "sections_tracked": ["#authentication", "#authorization"]
    }
  },
  "review_history": [
    {
      "date": "2026-02-10T16:30:00",
      "score": 97,
      "drift_detected": false,
      "report_version": "v002"
    }
  ]
}

存放路径
docs/02_PRD/{PRD_folder}/.drift_cache.json
重要说明:审核工具必须:
  1. 如果缓存存在则读取缓存(用于哈希对比)
  2. 如果缓存不存在则创建缓存
  3. 每次审核后使用当前哈希更新缓存
缓存Schema:
json
{
  "schema_version": "1.0",
  "document_id": "PRD-01",
  "document_version": "1.0",
  "last_reviewed": "2026-02-10T17:00:00",
  "reviewer_version": "1.4",
  "upstream_documents": {
    "../../01_BRD/BRD-01_f1_iam/BRD-01.0_index.md": {
      "hash": "sha256:a1b2c3d4e5f6g7h8i9j0...",
      "last_modified": "2026-02-10T15:34:26",
      "file_size": 50781,
      "version": "1.0",
      "sections_tracked": ["#7-functional-requirements", "#8-non-functional-requirements"]
    },
    "../../01_BRD/BRD-01_f1_iam/BRD-01.7_functional_requirements.md": {
      "hash": "sha256:k1l2m3n4o5p6q7r8s9t0...",
      "last_modified": "2026-02-10T15:34:21",
      "file_size": 4730,
      "version": "1.0",
      "sections_tracked": ["#authentication", "#authorization"]
    }
  },
  "review_history": [
    {
      "date": "2026-02-10T16:30:00",
      "score": 97,
      "drift_detected": false,
      "report_version": "v002"
    }
  ]
}

10.2 Detection Algorithm (Three-Phase)

10.2 检测算法(三阶段)

PHASE 1: Load Cache (if exists)
=========================================
1. Check for .drift_cache.json in PRD folder
2. If exists:
   - Load cached hashes and metadata
   - Set detection_mode = "hash_comparison"
3. If not exists:
   - Set detection_mode = "timestamp_only"
   - Will create cache at end of review

PHASE 2: Detect Drift
=========================================
For each upstream reference in PRD:

  A. Extract reference:
     - @ref: tags → [path, section anchor]
     - @brd: tags → [BRD ID, requirement ID]
     - Links to ../01_BRD/ → [path]
     - Traceability table upstream artifacts → [path]

  B. Resolve and validate:
     - Resolve path to absolute file path
     - Check file exists (skip if covered by Check #1)
     - Get file stats: mtime, size

  C. Compare (based on detection_mode):

     IF detection_mode == "hash_comparison":
       - Compute SHA-256 hash of current file content
       - Compare to cached hash
       - IF hash differs:
           - Calculate change_percentage
           - Flag as CONTENT_DRIFT (REV-D002)
           - IF change > 20%: Flag as CRITICAL (REV-D005)

     ELSE (timestamp_only):
       - Compare file mtime > PRD last_updated
       - IF mtime > PRD date:
           - Flag as TIMESTAMP_DRIFT (REV-D001)

  D. Check version field (if YAML frontmatter):
     - Extract version from upstream doc
     - Compare to cached version
     - IF version incremented: Flag REV-D003

PHASE 3: Update Cache (MANDATORY)
=========================================
1. Compute SHA-256 hash for ALL upstream documents
2. Create/update .drift_cache.json with:
   - Current hashes
   - Current timestamps
   - Current file sizes
   - Review metadata
3. Append to review_history array

阶段1: 加载缓存(如果存在)
=========================================
1. 检查PRD文件夹中是否存在.drift_cache.json
2. 如果存在:
   - 加载缓存的哈希和元数据
   - 设置检测模式 = "hash_comparison"
3. 如果不存在:
   - 设置检测模式 = "timestamp_only"
   - 审核结束后会创建缓存

阶段2: 检测漂移
=========================================
遍历PRD中的每个上游引用:

  A. 提取引用:
     - @ref: 标签 → [路径, 章节锚点]
     - @brd: 标签 → [BRD ID, 需求ID]
     - 指向../01_BRD/的链接 → [路径]
     - 可追溯表中的上游工件 → [路径]

  B. 解析与校验:
     - 将路径解析为绝对文件路径
     - 检查文件是否存在(如果已通过检查项1校验则跳过)
     - 获取文件属性:修改时间、大小

  C. 对比(基于检测模式):

     如果检测模式 == "hash_comparison":
       - 计算当前文件内容的SHA-256哈希
       - 与缓存的哈希对比
       - 如果哈希不同:
           - 计算变更百分比
           - 标记为CONTENT_DRIFT(REV-D002)
           - 如果变更 > 20%: 标记为严重(REV-D005)

     否则(timestamp_only模式):
       - 对比文件修改时间 > PRD上次更新时间
       - 如果修改时间晚于PRD日期:
           - 标记为TIMESTAMP_DRIFT(REV-D001)

  D. 检查版本字段(如果有YAML frontmatter):
     - 从上游文档提取版本
     - 与缓存的版本对比
     - 如果版本升级: 标记REV-D003

阶段3: 更新缓存(强制要求)
=========================================
1. 为所有上游文档计算SHA-256哈希
2. 创建/更新.drift_cache.json,包含:
   - 当前哈希
   - 当前时间戳
   - 当前文件大小
   - 审核元数据
3. 追加到review_history数组

10.3 Hash Calculation

10.3 哈希计算

python
import hashlib
from pathlib import Path

def compute_file_hash(file_path: str) -> str:
    """Compute SHA-256 hash of file content."""
    sha256 = hashlib.sha256()
    with open(file_path, 'rb') as f:
        for chunk in iter(lambda: f.read(8192), b''):
            sha256.update(chunk)
    return f"sha256:{sha256.hexdigest()}"

def compute_section_hash(file_path: str, section_anchor: str) -> str:
    """Compute hash of specific section (for anchor references)."""
    content = Path(file_path).read_text()
    # Extract section from anchor to next heading
    section_pattern = f"#{section_anchor.lstrip('#')}"
    # ... section extraction logic ...
    section_content = extract_section(content, section_pattern)
    return f"sha256:{hashlib.sha256(section_content.encode()).hexdigest()}"

def calculate_change_percentage(old_hash: str, new_content: str) -> float:
    """Estimate change percentage using content diff."""
    # Use difflib to calculate similarity ratio
    import difflib
    # ... comparison logic ...
    return change_percentage

python
import hashlib
from pathlib import Path

def compute_file_hash(file_path: str) -> str:
    """Compute SHA-256 hash of file content."""
    sha256 = hashlib.sha256()
    with open(file_path, 'rb') as f:
        for chunk in iter(lambda: f.read(8192), b''):
            sha256.update(chunk)
    return f"sha256:{sha256.hexdigest()}"

def compute_section_hash(file_path: str, section_anchor: str) -> str:
    """Compute hash of specific section (for anchor references)."""
    content = Path(file_path).read_text()
    # Extract section from anchor to next heading
    section_pattern = f"#{section_anchor.lstrip('#')}"
    # ... section extraction logic ...
    section_content = extract_section(content, section_pattern)
    return f"sha256:{hashlib.sha256(section_content.encode()).hexdigest()}"

def calculate_change_percentage(old_hash: str, new_content: str) -> float:
    """Estimate change percentage using content diff."""
    # Use difflib to calculate similarity ratio
    import difflib
    # ... comparison logic ...
    return change_percentage

10.4 Error Codes

10.4 错误码

CodeSeverityDescriptionTrigger
REV-D001WarningUpstream document modified after PRD creationmtime > PRD date (no cache)
REV-D002WarningReferenced content has changedhash mismatch (with cache)
REV-D003InfoUpstream document version incrementedversion field changed
REV-D004InfoNew content added to upstreamfile size increased >10%
REV-D005ErrorCritical modification (>20% change)hash diff >20%
REV-D006InfoCache created (first review)no prior cache existed

错误码严重级别描述触发条件
REV-D001警告上游文档在PRD创建后被修改修改时间晚于PRD日期(无缓存)
REV-D002警告引用内容已变更哈希不匹配(有缓存)
REV-D003提示上游文档版本升级版本字段变更
REV-D004提示上游文档新增内容文件大小增加超过10%
REV-D005错误严重变更(变更>20%)哈希差异超过20%
REV-D006提示缓存已创建(首次审核)之前无缓存

10.5 Report Output

10.5 报告输出

markdown
undefined
markdown
undefined

9. Upstream Drift Detection (5/5)

9. 上游漂移检测(5/5)

Cache Status

缓存状态

FieldValue
Cache File
.drift_cache.json
Cache Status✅ Updated
Detection ModeHash Comparison
Documents Tracked2
字段
缓存文件
.drift_cache.json
缓存状态✅ 已更新
检测模式哈希对比
跟踪文档数2

Upstream Document Analysis

上游文档分析

Upstream DocumentHash StatusLast ModifiedChange %Status
BRD-01.0_index.md✅ Match2026-02-10T15:34:260%Current
BRD-01.7_functional_requirements.md✅ Match2026-02-10T15:34:210%Current
上游文档哈希状态上次修改时间变更百分比状态
BRD-01.0_index.md✅ 匹配2026-02-10T15:34:260%已同步
BRD-01.7_functional_requirements.md✅ 匹配2026-02-10T15:34:210%已同步

Drift Summary

漂移汇总

StatusCountDetails
✅ Current2All upstream documents synchronized
⚠️ Warning0No drift detected
❌ Critical0No major changes
Cache updated: 2026-02-10T17:00:00

---
状态数量详情
✅ 已同步2所有上游文档已同步
⚠️ 警告0未检测到漂移
❌ 严重0无重大变更
缓存更新时间: 2026-02-10T17:00:00

---

10.6 Configuration

10.6 配置

SettingDefaultDescription
cache_enabled
trueMandatory - always create/update cache
drift_threshold_days
7Days before timestamp drift becomes Warning
critical_change_pct
20Percentage change for critical drift
track_sections
trueTrack individual section hashes for anchored refs
max_history_entries
10Maximum review_history entries to retain

设置默认值描述
cache_enabled
true强制要求 - 始终创建/更新缓存
drift_threshold_days
7时间戳漂移触发警告的天数阈值
critical_change_pct
20严重漂移的变更百分比阈值
track_sections
true为锚点引用跟踪单个章节的哈希
max_history_entries
10保留的最大review_history条目数

Review Score Calculation

审核评分计算

Scoring Formula:
CategoryWeightCalculation
Link Integrity10%(valid_links / total_links) × 10
Threshold Consistency10%(consistent_thresholds / total_thresholds) × 10
BRD Alignment18%(aligned_requirements / total_requirements) × 18
Placeholder Detection10%(no_placeholders ? 10 : 10 - (placeholder_count × 2))
Traceability Tags10%(valid_tags / total_tags) × 10
Section Completeness10%(complete_sections / total_sections) × 10
Customer Content5%(exists && substantive ? 5 : 0)
Naming Compliance10%(valid_ids / total_ids) × 10
Structure Compliance12%(nested_folder_valid ? 12 : 0) - BLOCKING
Upstream Drift5%(fresh_refs / total_refs) × 5
Total: Sum of all categories (max 100)
Note: Structure Compliance is a blocking check. If structure validation fails (REV-STR001), the review cannot pass regardless of other scores.
Thresholds:
  • PASS: ≥ 90 (configurable)
  • WARNING: 80-89
  • FAIL: < 80

评分公式:
分类权重计算方式
链接完整性10%(有效链接数 / 总链接数) × 10
阈值一致性10%(一致阈值数 / 总阈值数) × 10
BRD对齐度18%(对齐需求数 / 总需求数) × 18
占位符检测10%(无占位符则得10分,否则10 - (占位符数量 × 2))
可追溯标签10%(有效标签数 / 总标签数) × 10
章节完整性10%(完整章节数 / 总章节数) × 10
客户端内容5%(存在且有实质内容得5分,否则0分)
命名合规性10%(有效ID数 / 总ID数) × 10
结构合规性12%(嵌套文件夹有效得12分,否则0分) - 阻断性
上游漂移5%(最新引用数 / 总引用数) × 5
总分:所有分类得分之和(满分100)
说明:结构合规性为阻断性检查。如果结构校验不通过(REV-STR001),无论其他得分如何,审核都无法通过。
阈值:
  • 通过:≥ 90(可配置)
  • 警告:80-89
  • 不通过:< 80

Command Usage

命令使用

Basic Usage

基础用法

bash
undefined
bash
undefined

Review specific PRD

审核指定PRD

/doc-prd-reviewer PRD-01
/doc-prd-reviewer PRD-01

Review PRD by path

按路径审核PRD

/doc-prd-reviewer docs/02_PRD/PRD-01_f1_iam/
/doc-prd-reviewer docs/02_PRD/PRD-01_f1_iam/

Review all PRDs

审核所有PRD

/doc-prd-reviewer all
undefined
/doc-prd-reviewer all
undefined

Options

选项

OptionDefaultDescription
--min-score
90Minimum passing review score
--auto-fix
trueApply automatic fixes
--no-auto-fix
falseDisable auto-fix (report only)
--check
allSpecific checks to run (comma-separated)
--skip
noneChecks to skip (comma-separated)
--verbose
falseDetailed output per check
--report
trueGenerate markdown report
--report-path
autoReport location (auto = alongside document)
--version
autoReview version (auto = auto-increment)
选项默认值描述
--min-score
90审核通过的最低评分
--auto-fix
true应用自动修复
--no-auto-fix
false禁用自动修复(仅生成报告)
--check
all要运行的指定检查项(逗号分隔)
--skip
none要跳过的检查项(逗号分隔)
--verbose
false每个检查项输出详细信息
--report
true生成markdown报告
--report-path
auto报告存放位置(auto = 与文档同目录)
--version
auto审核版本(auto = 自动递增)

Examples

示例

bash
undefined
bash
undefined

Review with verbose output

审核时输出详细信息

/doc-prd-reviewer PRD-01 --verbose
/doc-prd-reviewer PRD-01 --verbose

Report only (no auto-fix)

仅生成报告(不自动修复)

/doc-prd-reviewer PRD-01 --no-auto-fix
/doc-prd-reviewer PRD-01 --no-auto-fix

Run only specific checks

仅运行指定检查项

/doc-prd-reviewer PRD-01 --check links,placeholders
/doc-prd-reviewer PRD-01 --check links,placeholders

Skip customer content check

跳过客户端内容检查

/doc-prd-reviewer PRD-01 --skip customer
/doc-prd-reviewer PRD-01 --skip customer

Lower threshold for draft review

降低草稿审核的阈值

/doc-prd-reviewer PRD-01 --min-score 80

---
/doc-prd-reviewer PRD-01 --min-score 80

---

Configuration

配置

yaml
undefined
yaml
undefined

config/prd_reviewer.yaml

config/prd_reviewer.yaml

prd_reviewer: version: "1.0"
scoring: min_score: 90 weights: link_integrity: 15 threshold_consistency: 20 brd_alignment: 25 placeholder_detection: 15 traceability_tags: 10 section_completeness: 10 customer_content: 5
checks: links: enabled: true check_external: false auto_fix: true thresholds: enabled: true source_priority: brd # brd or prd auto_fix: true alignment: enabled: true allow_orphans: false require_deferral_notes: true placeholders: enabled: true patterns: - "[TODO]" - "[TBD]" - "[PLACEHOLDER]" - "YYYY-MM-DDTHH:MM:SS" - "[Name]" auto_fix_dates: true auto_fix_names: true traceability: enabled: true allow_forward_refs: true auto_fix_typos: true completeness: enabled: true min_words: executive_summary: 100 problem_statement: 75 functional_requirements: 200 quality_attributes: 100 customer_content: 100 risk_assessment: 75 appendices: 200 customer: enabled: true flag_always: true jargon_patterns: - "OIDC" - "mTLS" - "JWT" - "4D Matrix"
output: report_format: markdown report_path: auto # auto = alongside reviewed document versioning: enabled: true pattern: "_vNNN" # e.g., _v001, _v002 auto_increment: true include_line_numbers: true include_fix_diff: true include_delta_report: true # Compare with previous version

---
prd_reviewer: version: "1.0"
scoring: min_score: 90 weights: link_integrity: 15 threshold_consistency: 20 brd_alignment: 25 placeholder_detection: 15 traceability_tags: 10 section_completeness: 10 customer_content: 5
checks: links: enabled: true check_external: false auto_fix: true thresholds: enabled: true source_priority: brd # brd or prd auto_fix: true alignment: enabled: true allow_orphans: false require_deferral_notes: true placeholders: enabled: true patterns: - "[TODO]" - "[TBD]" - "[PLACEHOLDER]" - "YYYY-MM-DDTHH:MM:SS" - "[Name]" auto_fix_dates: true auto_fix_names: true traceability: enabled: true allow_forward_refs: true auto_fix_typos: true completeness: enabled: true min_words: executive_summary: 100 problem_statement: 75 functional_requirements: 200 quality_attributes: 100 customer_content: 100 risk_assessment: 75 appendices: 200 customer: enabled: true flag_always: true jargon_patterns: - "OIDC" - "mTLS" - "JWT" - "4D Matrix"
output: report_format: markdown report_path: auto # auto = alongside reviewed document versioning: enabled: true pattern: "_vNNN" # e.g., _v001, _v002 auto_increment: true include_line_numbers: true include_fix_diff: true include_delta_report: true # Compare with previous version

---

Output Report

输出报告

File Naming & Versioning

文件命名与版本控制

Pattern:
PRD-NN.R_review_report_vNNN.md
Nested Folder Rule: ALL PRDs use nested folders (
PRD-NN_{slug}/
) regardless of size. This ensures review reports, fix reports, and drift cache files are organized with their parent document.
Location: Inside the PRD nested folder:
docs/02_PRD/PRD-NN_{slug}/
Versioning Rules:
  1. First Review: Creates
    PRD-NN.R_review_report_v001.md
  2. Subsequent Reviews: Auto-increments version (v002, v003, etc.)
  3. Same-Day Reviews: Each review gets unique version number
Example Directory:
docs/02_PRD/PRD-01_f1_iam/
├── PRD-01.0_index.md
├── PRD-01.R_review_report_v001.md    # First review
├── PRD-01.R_review_report_v002.md    # After fixes
└── PRD-01.R_review_report_v003.md    # Final review
命名规则
PRD-NN.R_review_report_vNNN.md
嵌套文件夹规则:所有PRD无论大小都使用嵌套文件夹(
PRD-NN_{slug}/
),确保审核报告、修复报告和漂移缓存文件与父文档放在一起统一管理。
存放位置:PRD嵌套文件夹内部:
docs/02_PRD/PRD-NN_{slug}/
版本控制规则:
  1. 首次审核:创建
    PRD-NN.R_review_report_v001.md
  2. 后续审核:版本自动递增(v002、v003等)
  3. 同日多次审核:每次审核都生成唯一版本号
目录示例:
docs/02_PRD/PRD-01_f1_iam/
├── PRD-01.0_index.md
├── PRD-01.R_review_report_v001.md    # 首次审核
├── PRD-01.R_review_report_v002.md    # 修复后审核
└── PRD-01.R_review_report_v003.md    # 最终审核

Report Structure

报告结构

markdown
undefined
markdown
undefined

PRD Review Report: PRD-01 (v003)

PRD审核报告: PRD-01 (v003)

Review Date: 2026-02-08T14:30:00 Review Version: v003 PRD: PRD-01 (F1 Identity & Access Management) Status: PASS Review Score: 95/100

审核日期: 2026-02-08T14:30:00 审核版本: v003 PRD: PRD-01 (F1身份与访问管理) 状态: 通过 审核评分: 95/100

Summary

汇总

CheckStatusScoreIssues
Link IntegrityPASS15/150
Threshold ConsistencyPASS20/200
BRD AlignmentPASS23/252 deferred
Placeholder DetectionPASS15/150
Traceability TagsPASS10/100
Section CompletenessPASS10/100
Customer ContentFLAG2/5Needs review
TotalPASS95/100

检查项状态得分问题数
链接完整性通过15/150
阈值一致性通过20/200
BRD对齐度通过23/252个延期项
占位符检测通过15/150
可追溯标签通过10/100
章节完整性通过10/100
客户端内容待审核2/5需要审核
总分通过95/100

Issues Detail

问题详情

Flagged for Manual Review

标记为需人工审核

FileLineIssueCode
PRD-01.10_customer_content.md42Technical jargon: "4D Matrix"REV-C003
PRD-01.10_customer_content.md58Technical jargon: "OIDC"REV-C003
PRD-01.10_customer_content.md-Requires marketing reviewREV-C004
文件行号问题错误码
PRD-01.10_customer_content.md42技术术语: "4D Matrix"REV-C003
PRD-01.10_customer_content.md58技术术语: "OIDC"REV-C003
PRD-01.10_customer_content.md-需要营销审核REV-C004

Auto-Fixes Applied

已应用的自动修复

FileLineFixCode
PRD-01.1_document_control.md15Date: YYYY-MM-DDTHH:MM:SS → 2026-02-08T14:30:00REV-P003
文件行号修复内容错误码
PRD-01.1_document_control.md15日期: YYYY-MM-DDTHH:MM:SS → 2026-02-08T14:30:00REV-P003

Deferred Items (Acceptable)

延期项(可接受)

RequirementReasonNote
BRD.01.01.10Device TrustMarked P3, next cycle
BRD.01.01.12Time-Based AccessMarked P3, next cycle

需求原因备注
BRD.01.01.10设备信任标记为P3,下个迭代实现
BRD.01.01.12基于时间的访问标记为P3,下个迭代实现

Recommendations

建议

  1. Section 10 Review: Schedule marketing review for customer-facing content
  2. Technical Terms: Consider adding glossary link for "4D Matrix", "OIDC"
  3. Deferred Items: Confirm P3 priority with stakeholders

Generated By: doc-prd-reviewer v1.1 Report Location: docs/02_PRD/PRD-01_f1_iam/PRD-01.R_review_report_v003.md Previous Review: v002 (Score: 91/100)
undefined
  1. 第10节审核:安排营销团队审核面向客户端的内容
  2. 技术术语:考虑为"4D Matrix"、"OIDC"添加术语表链接
  3. 延期项:与利益相关方确认P3优先级

生成工具: doc-prd-reviewer v1.1 报告位置: docs/02_PRD/PRD-01_f1_iam/PRD-01.R_review_report_v003.md 上次审核: v002 (得分: 91/100)
undefined

Delta Reporting

差异报告

When previous reviews exist, include score comparison:
markdown
undefined
如果存在之前的审核记录,包含得分对比:
markdown
undefined

Score Comparison (v002 → v003)

得分对比(v002 → v003)

MetricPrevious (v002)Current (v003)Delta
Overall Score9195+4
Errors20-2
Warnings53-2
Issues Resolved-4-
New Issues-0-

See `REVIEW_DOCUMENT_STANDARDS.md` for complete versioning requirements.

---
指标上次(v002)当前(v003)变化
总得分9195+4
错误数20-2
警告数53-2
已解决问题-4-
新增问题-0-

完整版本控制要求请参见`REVIEW_DOCUMENT_STANDARDS.md`。

---

Integration with doc-prd-autopilot

与doc-prd-autopilot的集成

This skill is automatically invoked during Phase 5 of
doc-prd-autopilot
:
mermaid
flowchart LR
    A[Phase 4: Validation] --> B[Phase 5: Final Review]
    B --> C{doc-prd-reviewer}
    C --> D[Phase 6: Continue]
Autopilot Integration:
yaml
undefined
本工具会在
doc-prd-autopilot
的第5阶段自动调用:
mermaid
flowchart LR
    A[第4阶段: 校验] --> B[第5阶段: 最终审核]
    B --> C{doc-prd-reviewer}
    C --> D[第6阶段: 继续流程]
自动 pilot 集成配置:
yaml
undefined

In doc-prd-autopilot config

In doc-prd-autopilot config

review: enabled: true skill: doc-prd-reviewer options: min_score: 90 auto_fix: true flag_customer_content: true

---
review: enabled: true skill: doc-prd-reviewer options: min_score: 90 auto_fix: true flag_customer_content: true

---

Standalone vs Integrated Use

独立使用 vs 集成使用

Use CaseCommandNotes
After autopilotAutomaticInvoked as Phase 5
Manual PRD edit
/doc-prd-reviewer PRD-01
Run explicitly
Pre-EARS check
/doc-prd-reviewer PRD-01
Verify before EARS
Periodic audit
/doc-prd-reviewer all
Review all PRDs

使用场景命令备注
自动 pilot 运行后自动执行作为第5阶段调用
手动编辑PRD后
/doc-prd-reviewer PRD-01
显式运行
EARS生成前检查
/doc-prd-reviewer PRD-01
生成EARS前校验
定期审计
/doc-prd-reviewer all
审核所有PRD

Error Recovery

错误恢复

Common Issues

常见问题

ErrorCauseResolution
PRDNotFoundError
PRD path invalidCheck path or PRD ID
BRDNotFoundError
BRD source missingVerify BRD exists for alignment check
LowScoreError
Score below thresholdFix flagged issues
错误原因解决方案
PRDNotFoundError
PRD路径无效检查路径或PRD ID
BRDNotFoundError
BRD源缺失确认对齐检查所需的BRD存在
LowScoreError
得分低于阈值修复标记的问题

Recovery Commands

恢复命令

bash
undefined
bash
undefined

Re-run after fixes

修复后重新运行

/doc-prd-reviewer PRD-01
/doc-prd-reviewer PRD-01

Run with lower threshold (for drafts)

降低阈值运行(适用于草稿)

/doc-prd-reviewer PRD-01 --min-score 75
/doc-prd-reviewer PRD-01 --min-score 75

Skip failing check temporarily

临时跳过失败的检查项

/doc-prd-reviewer PRD-01 --skip alignment

---
/doc-prd-reviewer PRD-01 --skip alignment

---

Related Skills

相关工具

SkillRelationship
doc-naming
Naming standards for Check #8
doc-prd-autopilot
Invokes this skill in Phase 5
doc-prd-validator
Structural validation (Phase 4)
doc-prd-fixer
Applies fixes based on review findings
doc-prd
PRD creation rules
doc-brd-validator
BRD source validation
doc-ears-autopilot
Downstream consumer

工具关系
doc-naming
检查项8的命名标准
doc-prd-autopilot
在第5阶段调用本工具
doc-prd-validator
结构校验(第4阶段)
doc-prd-fixer
根据审核结果应用修复
doc-prd
PRD创建规则
doc-brd-validator
BRD源校验
doc-ears-autopilot
下游消费者

Version History

版本历史

VersionDateChanges
1.62026-02-11Numbering Fix: Corrected Check #10 subsections from 9.1-9.6 to 10.1-10.6 (drift cache, detection algorithm, hash calculation, error codes, report output, configuration)
1.52026-02-11Structure Compliance: Added Check #9 for nested folder rule enforcement (REV-STR001-STR004); Shifted Upstream Drift to Check #10; Added structure compliance to scoring (12% weight, blocking); Updated workflow diagram to 10 checks
1.42026-02-10T17:00:00Mandatory drift cache: Reviewer MUST create/update
.drift_cache.json
after every review; Three-phase detection algorithm; SHA-256 hash computation; Hash comparison mode when cache exists; REV-D006 code for cache creation; Cache schema with review_history tracking
1.32026-02-10Added Check #9: Upstream Drift Detection - detects when BRD documents modified after PRD creation; REV-D001-D005 error codes; drift configuration; Added doc-prd-fixer to related skills
1.22026-02-10Added review versioning support (_vNNN pattern); Delta reporting for score comparison
1.12026-02-08Added Check #8: Naming Compliance (doc-naming integration)
1.02026-02-08Initial skill creation with 7 review checks
版本日期变更内容
1.62026-02-11编号修复:将检查项10的子章节编号从9.1-9.6修正为10.1-10.6(漂移缓存、检测算法、哈希计算、错误码、报告输出、配置)
1.52026-02-11结构合规性:新增检查项9用于强制嵌套文件夹规则(REV-STR001-STR004);将上游漂移检测移至检查项10;将结构合规性纳入评分(权重12%,阻断性);更新工作流图为10个检查项
1.42026-02-10T17:00:00强制漂移缓存:审核工具每次审核后必须创建/更新
.drift_cache.json
;三阶段检测算法;SHA-256哈希计算;存在缓存时使用哈希对比模式;新增REV-D006代码用于缓存创建;带review_history跟踪的缓存Schema
1.32026-02-10新增检查项9:上游漂移检测——检测BRD文档在PRD创建后是否被修改;REV-D001-D005错误码;漂移配置;将doc-prd-fixer加入相关工具
1.22026-02-10新增审核版本控制支持(_vNNN模式);得分对比差异报告
1.12026-02-08新增检查项8:命名合规性(与doc-naming集成)
1.02026-02-08工具首次发布,包含7个审核检查项