doc-ctr-reviewer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedoc-ctr-reviewer
doc-ctr-reviewer
Purpose
用途
Comprehensive content review and quality assurance for Data Contract (CTR) documents. This skill performs deep content analysis beyond structural validation, checking contract completeness, dual-file consistency (MD + YAML), OpenAPI compliance, REQ alignment, and identifying issues that require manual review.
Layer: 8 (CTR Quality Assurance)
Upstream: CTR (from or )
doc-ctr-autopilotdoc-ctrDownstream: None (final QA gate before SPEC generation)
针对数据契约(CTR)文档的全面内容审核与质量保证。该技能在结构验证之外执行深度内容分析,检查契约完整性、双文件一致性(MD + YAML)、OpenAPI合规性、REQ对齐情况,并识别需要人工审核的问题。
层级: 8(CTR质量保证)
上游: CTR(来自或)
doc-ctr-autopilotdoc-ctr下游: 无(生成SPEC前的最终QA关卡)
When to Use This Skill
何时使用该技能
Use when:
doc-ctr-reviewer- After CTR Generation: Run immediately after completes
doc-ctr-autopilot - Manual CTR Edits: After making manual changes to CTR
- Pre-SPEC Check: Before running
doc-spec-autopilot - API Changes: When external APIs are modified
- Periodic Review: Regular quality checks on existing CTRs
Do NOT use when:
- CTR does not exist yet (use or
doc-ctrfirst)doc-ctr-autopilot - Need structural/schema validation only (use )
doc-ctr-validator - Generating new CTR content (use )
doc-ctr
在以下场景使用:
doc-ctr-reviewer- CTR生成后: 完成后立即运行
doc-ctr-autopilot - CTR手动编辑后: 对CTR进行手动修改后
- 生成SPEC前检查: 运行之前
doc-spec-autopilot - API变更时: 外部API被修改时
- 定期审核: 对现有CTR进行常规质量检查
请勿在以下场景使用:
- CTR尚未生成(请先使用或
doc-ctr)doc-ctr-autopilot - 仅需要结构/模式验证(请使用)
doc-ctr-validator - 生成新的CTR内容(请使用)
doc-ctr
Skill vs Validator: Key Differences
技能与验证工具的核心差异
| Aspect | | |
|---|---|---|
| Focus | Schema compliance, SPEC-Ready score | Content quality, API consistency |
| Checks | Required sections, OpenAPI schema | Dual-file sync, endpoint coverage |
| Auto-Fix | Structural issues only | Content issues (sync, formatting) |
| Output | SPEC-Ready score (numeric) | Review score + issue list |
| Phase | Phase 4 (Validation) | Phase 5 (Final Review) |
| Blocking | SPEC-Ready < threshold blocks | Review score < threshold flags |
| 维度 | | |
|---|---|---|
| 核心关注点 | 模式合规性、SPEC就绪评分 | 内容质量、API一致性 |
| 检查内容 | 必填章节、OpenAPI模式 | 双文件同步、端点覆盖范围 |
| 自动修复 | 仅修复结构问题 | 修复内容问题(同步、格式) |
| 输出结果 | SPEC就绪评分(数值型) | 审核评分 + 问题列表 |
| 所处阶段 | 第4阶段(验证) | 第5阶段(最终审核) |
| 阻塞规则 | SPEC就绪评分低于阈值则阻塞 | 审核评分低于阈值则标记 |
Review Workflow
审核工作流
mermaid
flowchart TD
A[Input: CTR Path] --> B[Load CTR Files]
B --> C{MD + YAML Present?}
C -->|Both| D[Load Both Files]
C -->|Single| E[Load Available File]
D --> F[Run Review Checks]
E --> F
subgraph Review["Review Checks"]
F --> G[1. Dual-File Consistency]
G --> H[2. OpenAPI Compliance]
H --> I[3. REQ Alignment]
I --> J[4. Endpoint Coverage]
J --> K[5. Security Definition]
K --> L[6. Placeholder Detection]
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]mermaid
flowchart TD
A[输入: CTR路径] --> B[加载CTR文件]
B --> C{是否存在MD + YAML双文件?}
C -->|两者都存在| D[加载两个文件]
C -->|仅单个存在| E[加载可用文件]
D --> F[执行审核检查]
E --> F
subgraph Review["审核检查"]
F --> G[1. 双文件一致性]
G --> H[2. OpenAPI合规性]
H --> I[3. REQ对齐情况]
I --> J[4. 端点覆盖范围]
J --> K[5. 安全定义]
K --> L[6. 占位符检测]
L --> M[7. 命名合规性]
M --> M2[8. 上游漂移检测]
end
M2 --> 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
审核检查项
0. Structure Compliance (12/12) - BLOCKING
0. 结构合规性(12/12)- 阻塞性检查
Validates CTR follows the mandatory nested folder rule.
Nested Folder Rule: ALL CTR documents MUST be in nested folders.
Required Structure:
| CTR Type | Required Location |
|---|---|
| Dual-File | |
Error Codes:
| Code | Severity | Description |
|---|---|---|
| REV-STR001 | Error | CTR not in nested folder (BLOCKING) |
| REV-STR002 | Error | Folder name doesn't match CTR ID |
| REV-STR003 | Warning | File name doesn't match folder name |
This check is BLOCKING - CTR must pass structure validation before other checks proceed.
验证CTR是否遵循强制嵌套文件夹规则。
嵌套文件夹规则: 所有CTR文档必须存放在嵌套文件夹中。
必填结构:
| CTR类型 | 必填存放位置 |
|---|---|
| 双文件型 | |
错误代码:
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-STR001 | 错误 | CTR未存放在嵌套文件夹中(阻塞性) |
| REV-STR002 | 错误 | 文件夹名称与CTR ID不匹配 |
| REV-STR003 | 警告 | 文件名称与文件夹名称不匹配 |
本检查为阻塞性检查 - CTR必须通过结构验证后,才能执行其他检查。
1. Dual-File Consistency
1. 双文件一致性
Validates MD and YAML files are synchronized.
Scope:
- Endpoint definitions match
- Schema definitions aligned
- Version numbers consistent
- Descriptions synchronized
Error Codes:
| Code | Severity | Description |
|---|---|---|
| REV-DF001 | Error | Endpoint in YAML not in MD |
| REV-DF002 | Error | Schema mismatch between files |
| REV-DF003 | Warning | Version number inconsistent |
| REV-DF004 | Info | Description differs (may be intentional) |
验证MD与YAML文件内容同步。
检查范围:
- 端点定义匹配
- 模式定义对齐
- 版本号一致
- 描述内容同步
错误代码:
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-DF001 | 错误 | YAML中存在的端点未在MD中定义 |
| REV-DF002 | 错误 | 文件间模式不匹配 |
| REV-DF003 | 警告 | 版本号不一致 |
| REV-DF004 | 信息 | 描述内容存在差异(可能为有意修改) |
2. OpenAPI Compliance
2. OpenAPI合规性
Validates YAML follows OpenAPI 3.x specification.
Scope:
- Valid OpenAPI version
- Required fields present
- Schema types correct
- Response codes documented
Error Codes:
| Code | Severity | Description |
|---|---|---|
| REV-OA001 | Error | Invalid OpenAPI version |
| REV-OA002 | Error | Required OpenAPI field missing |
| REV-OA003 | Error | Invalid schema type |
| REV-OA004 | Warning | Response code not documented |
| REV-OA005 | Info | Example values missing |
验证YAML是否遵循OpenAPI 3.x规范。
检查范围:
- OpenAPI版本有效
- 必填字段存在
- 模式类型正确
- 响应代码已文档化
错误代码:
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-OA001 | 错误 | OpenAPI版本无效 |
| REV-OA002 | 错误 | 缺失必填OpenAPI字段 |
| REV-OA003 | 错误 | 模式类型无效 |
| REV-OA004 | 警告 | 响应代码未文档化 |
| REV-OA005 | 信息 | 缺失示例值 |
3. REQ Alignment
3. REQ对齐情况
Validates CTR traces to REQ requirements.
Scope:
- Every endpoint maps to REQ
- External API requirements covered
- Interface contracts complete
Error Codes:
| Code | Severity | Description |
|---|---|---|
| REV-RA001 | Error | Endpoint without REQ source |
| REV-RA002 | Warning | REQ interface not in CTR |
| REV-RA003 | Info | Multiple CTRs from single REQ (acceptable) |
验证CTR与REQ要求的追溯关系。
检查范围:
- 每个端点都映射到REQ
- 外部API要求已覆盖
- 接口契约完整
错误代码:
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-RA001 | 错误 | 端点无REQ来源 |
| REV-RA002 | 警告 | REQ接口未在CTR中定义 |
| REV-RA003 | 信息 | 单个REQ对应多个CTR(可接受) |
4. Endpoint Coverage
4. 端点覆盖范围
Validates all expected endpoints documented.
Scope:
- CRUD operations complete
- Error endpoints defined
- Health check endpoints present
- Versioning strategy documented
Error Codes:
| Code | Severity | Description |
|---|---|---|
| REV-EC001 | Warning | Missing CRUD operation |
| REV-EC002 | Warning | No error endpoint defined |
| REV-EC003 | Info | Health check endpoint missing |
| REV-EC004 | Info | API versioning not documented |
验证所有预期端点已文档化。
检查范围:
- CRUD操作完整
- 错误端点已定义
- 健康检查端点存在
- 版本控制策略已文档化
错误代码:
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-EC001 | 警告 | 缺失CRUD操作 |
| REV-EC002 | 警告 | 未定义错误端点 |
| REV-EC003 | 信息 | 缺失健康检查端点 |
| REV-EC004 | 信息 | API版本控制未文档化 |
5. Security Definition
5. 安全定义
Validates security schemes documented.
Scope:
- Authentication method defined
- Authorization scopes documented
- Security schemes in OpenAPI
- Rate limiting documented
Error Codes:
| Code | Severity | Description |
|---|---|---|
| REV-SD001 | Error | No security scheme defined |
| REV-SD002 | Warning | Authorization scopes missing |
| REV-SD003 | Warning | Rate limiting not documented |
| REV-SD004 | Info | Security examples missing |
验证安全机制已文档化。
检查范围:
- 已定义认证方式
- 已文档化授权范围
- OpenAPI中包含安全机制
- 已文档化速率限制规则
错误代码:
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-SD001 | 错误 | 未定义安全机制 |
| REV-SD002 | 警告 | 缺失授权范围 |
| REV-SD003 | 警告 | 速率限制未文档化 |
| REV-SD004 | 信息 | 缺失安全示例 |
6. Placeholder Detection
6. 占位符检测
Identifies incomplete content requiring replacement.
Error Codes:
| 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 | 警告 | 模板值未替换 |
7. Naming Compliance
7. 命名合规性
Validates element IDs follow standards.
doc-namingScope:
- Element IDs use format
CTR.NN.TT.SS - Element type codes valid for CTR (28, 29)
- Contract naming convention
Error Codes:
| Code | Severity | Description |
|---|---|---|
| REV-N001 | Error | Invalid element ID format |
| REV-N002 | Error | Element type code not valid for CTR |
| REV-N003 | Error | Legacy pattern detected |
验证元素ID遵循标准。
doc-naming检查范围:
- 元素ID使用格式
CTR.NN.TT.SS - 元素类型代码对CTR有效(28、29)
- 契约命名符合规范
错误代码:
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-N001 | 错误 | 元素ID格式无效 |
| REV-N002 | 错误 | 元素类型代码对CTR无效 |
| REV-N003 | 错误 | 检测到旧版命名模式 |
8. Upstream Drift Detection (Mandatory Cache)
8. 上游漂移检测(强制缓存)
Detects when upstream REQ documents have been modified after the CTR was created or last updated.
The drift cache is mandatory. All CTR reviewer operations must maintain the drift cache to enable reliable change detection across sessions.
Purpose: Identifies stale CTR content that may not reflect current REQ documentation. When REQ documents (interface requirements, external API specifications) change, the CTR may need updates to maintain alignment.
Scope:
- tag targets (REQ documents)
@req: - Traceability section upstream artifact links
- Any markdown links to or REQ source documents
../07_REQ/
检测上游REQ文档在CTR创建或最后更新后是否被修改。
漂移缓存为强制要求。所有CTR审核操作必须维护漂移缓存,以实现跨会话的可靠变更检测。
目的: 识别可能未反映当前REQ文档的陈旧CTR内容。当REQ文档(接口要求、外部API规范)发生变更时,CTR可能需要更新以保持对齐。
检查范围:
- 标签目标(REQ文档)
@req: - 追溯章节中的上游工件链接
- 任何指向或REQ源文档的Markdown链接
../07_REQ/
Drift Cache File (MANDATORY)
漂移缓存文件(强制要求)
Location:
docs/08_CTR/.drift_cache.jsonSchema:
json
{
"schema_version": "1.0",
"last_updated": "2026-02-10T17:00:00",
"documents": {
"CTR-03-001": {
"ctr_path": "docs/08_CTR/CTR-03-001_provider_api/CTR-03-001.md",
"ctr_updated": "2026-02-10T14:30:00",
"upstream_hashes": {
"docs/07_REQ/REQ-03.md": {
"full_hash": "a1b2c3d4e5f6...",
"section_hashes": {
"interfaces": "1a2b3c4d...",
"external_apis": "5e6f7g8h..."
},
"last_checked": "2026-02-10T17:00:00"
}
}
}
}
}存放位置:
docs/08_CTR/.drift_cache.jsonSchema:
json
{
"schema_version": "1.0",
"last_updated": "2026-02-10T17:00:00",
"documents": {
"CTR-03-001": {
"ctr_path": "docs/08_CTR/CTR-03-001_provider_api/CTR-03-001.md",
"ctr_updated": "2026-02-10T14:30:00",
"upstream_hashes": {
"docs/07_REQ/REQ-03.md": {
"full_hash": "a1b2c3d4e5f6...",
"section_hashes": {
"interfaces": "1a2b3c4d...",
"external_apis": "5e6f7g8h..."
},
"last_checked": "2026-02-10T17:00:00"
}
}
}
}
}Three-Phase Detection Algorithm
三阶段检测算法
Phase 1: Cache Initialization
1. Check if docs/08_CTR/.drift_cache.json exists
2. If not exists → create with schema_version: "1.0"
3. Load cache into memory
Phase 2: Reference Extraction and Hash Comparison
1. Extract all upstream references from CTR:
- @req: tags → [path, section anchor]
- Links to ../07_REQ/ → [path]
- Traceability table upstream artifacts → [path]
2. For each upstream reference:
a. Resolve path to absolute file path
b. Check file exists (already covered by Check #3)
c. Compute SHA-256 hash of full file content
d. If section anchor specified → compute section hash
e. Compare hashes against cached values
f. If hash differs → flag as DRIFT
Phase 3: Cache Update
1. Update upstream_hashes with current values
2. Set last_checked timestamp
3. Write cache to disk
4. Report cache status in output阶段1: 缓存初始化
1. 检查docs/08_CTR/.drift_cache.json是否存在
2. 若不存在 → 创建并设置schema_version: "1.0"
3. 将缓存加载至内存
阶段2: 引用提取与哈希对比
1. 从CTR中提取所有上游引用:
- @req: 标签 → [路径, 章节锚点]
- 指向../07_REQ/的链接 → [路径]
- 追溯表中的上游工件 → [路径]
2. 针对每个上游引用:
a. 将路径解析为绝对文件路径
b. 检查文件是否存在(已由检查项#3覆盖)
c. 计算文件完整内容的SHA-256哈希
d. 若指定章节锚点 → 计算章节哈希
e. 将哈希值与缓存值对比
f. 若哈希值不同 → 标记为漂移
阶段3: 缓存更新
1. 使用当前值更新upstream_hashes
2. 设置last_checked时间戳
3. 将缓存写入磁盘
4. 在输出中报告缓存状态Hash Calculation
哈希计算
Full File Hash:
python
import hashlib
def compute_file_hash(file_path: str) -> str:
"""Compute SHA-256 hash of file content."""
with open(file_path, 'rb') as f:
return hashlib.sha256(f.read()).hexdigest()Section Hash:
python
def compute_section_hash(file_path: str, section_anchor: str) -> str:
"""Compute SHA-256 hash of specific section content."""
content = extract_section(file_path, section_anchor)
return hashlib.sha256(content.encode()).hexdigest()Error Codes:
| Code | Severity | Description |
|---|---|---|
| REV-D001 | Warning | Upstream REQ document modified after CTR creation |
| REV-D002 | Warning | Referenced section content has changed (hash mismatch) |
| REV-D003 | Info | Upstream document version incremented |
| REV-D004 | Info | New content added to upstream document |
| REV-D005 | Error | Critical upstream document substantially modified (>20% change) |
| REV-D006 | Error | Drift cache missing or corrupted - regenerating |
Report Output:
markdown
undefined完整文件哈希:
python
import hashlib
def compute_file_hash(file_path: str) -> str:
"""Compute SHA-256 hash of file content."""
with open(file_path, 'rb') as f:
return hashlib.sha256(f.read()).hexdigest()章节哈希:
python
def compute_section_hash(file_path: str, section_anchor: str) -> str:
"""Compute SHA-256 hash of specific section content."""
content = extract_section(file_path, section_anchor)
return hashlib.sha256(content.encode()).hexdigest()错误代码:
| 代码 | 严重程度 | 描述 |
|---|---|---|
| REV-D001 | 警告 | 上游REQ文档在CTR创建后被修改 |
| REV-D002 | 警告 | 引用章节内容已变更(哈希不匹配) |
| REV-D003 | 信息 | 上游文档版本已递增 |
| REV-D004 | 信息 | 上游文档新增内容 |
| REV-D005 | 错误 | 关键上游文档已大幅修改(变更占比>20%) |
| REV-D006 | 错误 | 漂移缓存缺失或损坏 - 正在重新生成 |
报告输出示例:
markdown
undefinedUpstream Drift Analysis
上游漂移分析
Cache Status: Active | Last Updated: 2026-02-10T17:00:00
| Upstream Document | CTR Reference | Hash Status | Last Modified | Days Stale | Severity |
|---|---|---|---|---|---|
| REQ-03.md | @req interfaces | CHANGED | 2026-02-08 | 3 | Warning |
| REQ-03.md | Traceability | UNCHANGED | 2026-02-05 | 0 | OK |
Drift Summary:
- Total References: 5
- Unchanged: 3
- Changed: 2
- New (uncached): 0
Recommendation: Review upstream REQ changes and update CTR if interface requirements have changed.
**Auto-Actions**:
- Create `.drift_cache.json` if not exists
- Update cache with current hashes after every review
- Add `[DRIFT]` marker to affected @req tags (optional)
- Generate drift summary in review report
**Configuration**:
| Setting | Default | Description |
|---------|---------|-------------|
| `cache_enabled` | true | Drift cache (Mandatory - cannot be disabled) |
| `drift_threshold_days` | 7 | Days before drift becomes Warning |
| `critical_threshold_days` | 30 | Days before drift becomes Error |
| `tracked_patterns` | `@req:` | Patterns to track for drift |
---缓存状态: 活跃 | 最后更新时间: 2026-02-10T17:00:00
| 上游文档 | CTR引用 | 哈希状态 | 最后修改时间 | 过期天数 | 严重程度 |
|---|---|---|---|---|---|
| REQ-03.md | @req interfaces | 已变更 | 2026-02-08 | 3 | 警告 |
| REQ-03.md | 追溯关系 | 未变更 | 2026-02-05 | 0 | 正常 |
漂移摘要:
- 总引用数: 5
- 未变更: 3
- 已变更: 2
- 新增(未缓存): 0
建议: 审核上游REQ变更,若接口要求已变更则更新CTR。
**自动操作**:
- 若`.drift_cache.json`不存在则创建
- 每次审核后用当前哈希值更新缓存
- 可选:在受影响的@req标签中添加`[DRIFT]`标记
- 在审核报告中生成漂移摘要
**配置项**:
| 设置项 | 默认值 | 描述 |
|---------|---------|-------------|
| `cache_enabled` | true | 漂移缓存(强制要求 - 不可禁用) |
| `drift_threshold_days` | 7 | 漂移变为警告的天数阈值 |
| `critical_threshold_days` | 30 | 漂移变为错误的天数阈值 |
| `tracked_patterns` | `@req:` | 用于漂移检测的追踪模式 |
---Review Score Calculation
审核评分计算
Scoring Formula:
| Category | Weight | Calculation |
|---|---|---|
| Dual-File Consistency | 24% | (consistent_elements / total) × 24 |
| OpenAPI Compliance | 19% | (valid_fields / required_fields) × 19 |
| REQ Alignment | 14% | (aligned_endpoints / total) × 14 |
| Endpoint Coverage | 14% | (covered / expected) × 14 |
| Security Definition | 10% | (security_score) × 10 |
| Placeholder Detection | 5% | (no_placeholders ? 5 : 5 - count) |
| Naming Compliance | 9% | (valid_ids / total_ids) × 9 |
| Upstream Drift | 5% | (fresh_refs / total_refs) × 5 |
Total: Sum of all categories (max 100)
Thresholds:
- PASS: >= 90
- WARNING: 80-89
- FAIL: < 80
评分公式:
| 类别 | 权重 | 计算方式 |
|---|---|---|
| 双文件一致性 | 24% | (一致元素数 / 总元素数) × 24 |
| OpenAPI合规性 | 19% | (有效字段数 / 必填字段数) × 19 |
| REQ对齐情况 | 14% | (对齐端点数 / 总端点数) × 14 |
| 端点覆盖范围 | 14% | (覆盖数 / 预期数) × 14 |
| 安全定义 | 10% | (安全评分) × 10 |
| 占位符检测 | 5% | (无占位符则得5分,否则得5 - 占位符数量分) |
| 命名合规性 | 9% | (有效ID数 / 总ID数) × 9 |
| 上游漂移 | 5% | (新鲜引用数 / 总引用数) × 5 |
总分: 所有类别得分之和(最高100分)
阈值:
- 通过: >= 90
- 警告: 80-89
- 失败: < 80
Command Usage
命令使用示例
bash
undefinedbash
undefinedReview specific CTR
审核指定CTR
/doc-ctr-reviewer CTR-03-001
/doc-ctr-reviewer CTR-03-001
Review CTR by path
通过路径审核CTR
/doc-ctr-reviewer docs/08_CTR/CTR-03-001_provider_api/
/doc-ctr-reviewer docs/08_CTR/CTR-03-001_provider_api/
Review all CTRs
审核所有CTR
/doc-ctr-reviewer all
---/doc-ctr-reviewer all
---Output Report
输出报告
Review reports are stored alongside the reviewed document per project standards.
Nested Folder Rule: ALL CTR use nested folders () regardless of size. This ensures dual files (.md + .yaml), review reports, fix reports, and drift cache files are organized together.
CTR-NN_{slug}/File Naming:
CTR-NN-SSS.R_review_report_vNNN.mdLocation: Inside the CTR nested folder:
docs/08_CTR/CTR-NN_{slug}/审核报告将按照项目标准存储在被审核文档的同级目录。
嵌套文件夹规则: 所有CTR无论大小都使用嵌套文件夹()。确保双文件(.md + .yaml)、审核报告、修复报告和漂移缓存文件统一管理。
CTR-NN_{slug}/文件命名:
CTR-NN-SSS.R_review_report_vNNN.md存放位置: CTR嵌套文件夹内:
docs/08_CTR/CTR-NN_{slug}/Versioning Rules
版本规则
- First Review: Creates
CTR-NN-SSS.R_review_report_v001.md - Subsequent Reviews: Auto-increments version (v002, v003, etc.)
- Same-Day Reviews: Each review gets unique version number
Version Detection: Scans folder for existing files and increments.
CTR-NN-SSS.R_review_report_v*.mdExample:
docs/08_CTR/CTR-03-001_provider_api/
├── CTR-03-001.md
├── CTR-03-001.yaml
├── CTR-03-001.R_review_report_v001.md # First review
├── CTR-03-001.R_review_report_v002.md # After fixes
└── .drift_cache.json- 首次审核: 创建
CTR-NN-SSS.R_review_report_v001.md - 后续审核: 自动递增版本号(v002、v003等)
- 同日多次审核: 每次审核使用唯一版本号
版本检测: 扫描文件夹中已存在的文件并递增版本号。
CTR-NN-SSS.R_review_report_v*.md示例:
docs/08_CTR/CTR-03-001_provider_api/
├── CTR-03-001.md
├── CTR-03-001.yaml
├── CTR-03-001.R_review_report_v001.md # 首次审核
├── CTR-03-001.R_review_report_v002.md # 修复后审核
└── .drift_cache.jsonDelta Reporting
差异报告
When previous reviews exist, include score comparison in the report.
See for complete versioning requirements.
REVIEW_DOCUMENT_STANDARDS.md当存在历史审核记录时,报告中需包含评分对比。
完整版本要求请参考。
REVIEW_DOCUMENT_STANDARDS.mdIntegration with doc-ctr-autopilot
与doc-ctr-autopilot的集成
This skill is invoked during Phase 5 of :
doc-ctr-autopilotmermaid
flowchart LR
A[Phase 4: Validation] --> B[Phase 5: Final Review]
B --> C{doc-ctr-reviewer}
C --> D[Phase 6: Continue]该技能在的第5阶段被调用:
doc-ctr-autopilotmermaid
flowchart LR
A[阶段4: 验证] --> B[阶段5: 最终审核]
B --> C{doc-ctr-reviewer}
C --> D[阶段6: 继续]Related Skills
相关技能
| Skill | Relationship |
|---|---|
| Naming standards for Check #7 |
| Invokes this skill in Phase 5 |
| Structural validation (Phase 4) |
| Applies fixes based on review findings |
| CTR creation rules |
| Upstream QA |
| Downstream consumer |
| 技能 | 关系 |
|---|---|
| 检查项#7的命名标准来源 |
| 在阶段5调用本技能 |
| 结构验证(阶段4) |
| 根据审核结果执行修复 |
| CTR创建规则来源 |
| 上游QA工具 |
| 下游消费工具 |
Version History
版本历史
| Version | Date | Changes |
|---|---|---|
| 1.4 | 2026-02-11 | Added Check #0: Structure Compliance (BLOCKING) - validates nested folder rule; REV-STR001-003 error codes; BLOCKING behavior prevents other checks until structure passes |
| 1.3 | 2026-02-10 | Mandatory drift cache implementation - cache now required; Three-Phase Detection Algorithm; SHA-256 hash calculation with Python examples; REV-D006 error code for missing/corrupted cache; cache status in report output; centralized cache at docs/08_CTR/.drift_cache.json |
| 1.2 | 2026-02-10 | Added Check #8: Upstream Drift Detection - detects when REQ documents modified after CTR creation; REV-D001-D005 error codes; drift cache support; configurable thresholds; added doc-ctr-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; Dual-file consistency; OpenAPI compliance; Security definition |
| 版本 | 日期 | 变更内容 |
|---|---|---|
| 1.4 | 2026-02-11 | 新增检查项#0: 结构合规性(阻塞性)- 验证嵌套文件夹规则;新增REV-STR001-003错误代码;阻塞性规则要求结构通过后才能执行其他检查 |
| 1.3 | 2026-02-10 | 实现强制漂移缓存 - 缓存变为必填项;新增三阶段检测算法;提供SHA-256哈希计算的Python示例;新增REV-D006错误代码(缓存缺失/损坏);报告中新增缓存状态;缓存集中存储于docs/08_CTR/.drift_cache.json |
| 1.2 | 2026-02-10 | 新增检查项#8: 上游漂移检测 - 检测REQ文档在CTR创建后是否被修改;新增REV-D001-D005错误代码;支持漂移缓存;可配置阈值;新增doc-ctr-fixer至相关技能列表 |
| 1.1 | 2026-02-10 | 支持审核版本控制(_vNNN模式);新增评分对比的差异报告 |
| 1.0 | 2026-02-10 | 初始技能创建,包含7项审核检查;双文件一致性;OpenAPI合规性;安全定义 |