doc-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedoc-review
doc-review
Description: Multi-agent documentation quality review system that analyzes a single file or all files in a folder for data inconsistencies, reference errors, typos, and unclear terminology.
Category: Quality Assurance
Complexity: High (multi-agent coordination)
描述:多代理文档质量审查系统,可分析单个文件或文件夹中的所有文件,检测数据不一致、引用错误、拼写错误以及不明确的术语。
分类:质量保障
复杂度:高(多代理协同)
Purpose
用途
Comprehensive documentation quality review using specialized sub-agents to detect:
- Data inconsistencies: Contradictory information, wrong data, confusing content
- Reference errors: Broken links, invalid cross-references, missing anchors
- Typos and spelling: Misspellings, grammatical errors, formatting issues
- Terminology issues: Undefined terms, inconsistent naming, ambiguous language
通过专业子代理进行全面的文档质量审查,检测以下问题:
- 数据不一致:矛盾信息、错误数据、易混淆内容
- 引用错误:失效链接、无效交叉引用、缺失锚点
- 拼写错误:拼写失误、语法错误、格式问题
- 术语问题:未定义术语、命名不一致、歧义语言
Analysis Modes
分析模式
| Mode | Input | Behavior |
|---|---|---|
| Single File | | Analyzes one file in depth |
| Folder | | Analyzes ALL files in folder together, including cross-file consistency |
Folder mode provides additional cross-file checks:
- Terminology consistency across all documents
- Cross-document reference validation
- Duplicate content detection across files
- Consistent naming conventions
| 模式 | 输入 | 行为 |
|---|---|---|
| 单个文件 | | 深入分析单个文件 |
| 文件夹 | | 分析文件夹中的所有文件,包括跨文件一致性检查 |
文件夹模式提供额外的跨文件检查:
- 所有文档间的术语一致性
- 跨文档引用验证
- 文件间重复内容检测
- 一致的命名规范
When to Use This Skill
何时使用该Skill
Use doc-review when:
- Reviewing documentation before publication
- Validating files after batch creation
- Performing quality audits on markdown/YAML files
- Checking cross-reference integrity
- Pre-commit quality validation
- Reviewing a single file or entire folder
Do NOT use when:
- Full traceability validation needed (use trace-check)
- Code-specific review needed (use code-review)
- Single document structure validation (use doc-*-validator skills)
在以下场景使用doc-review:
- 发布前审查文档
- 批量创建后验证文件
- 对markdown/YAML文件执行质量审计
- 检查交叉引用完整性
- 提交前的质量验证
- 审查单个文件或整个文件夹
请勿在以下场景使用:
- 需要完整可追溯性验证(使用trace-check)
- 需要针对代码的审查(使用code-review)
- 需要单个文档结构验证(使用doc-*-validator类Skill)
Skill Inputs
Skill输入参数
| Input | Type | Required | Description | Example |
|---|---|---|---|---|
| path | string | Yes | Single file path or folder path to review | |
| scope | string | No | Review scope | |
| focus | array | No | Specific checks to run | |
| report_format | string | No | Output format | |
| auto_fix | boolean | No | Attempt automatic fixes | |
| 输入项 | 类型 | 是否必填 | 描述 | 示例 |
|---|---|---|---|---|
| path | 字符串 | 是 | 要审查的单个文件路径或文件夹路径 | |
| scope | 字符串 | 否 | 审查范围 | |
| focus | 数组 | 否 | 要执行的特定检查项 | |
| report_format | 字符串 | 否 | 输出格式 | |
| auto_fix | 布尔值 | 否 | 尝试自动修复 | |
Sub-Agent Architecture
子代理架构
The skill coordinates 4 specialized sub-agents that run in parallel:
mermaid
graph TD
A[doc-review Skill] --> B[Input: File or Folder]
B --> C[File Discovery]
C --> D[Parallel Sub-Agents]
D --> E[Data Consistency Agent]
D --> F[Reference Checker Agent]
D --> G[Typo Detection Agent]
D --> H[Terminology Agent]
E --> I[Merge Results]
F --> I
G --> I
H --> I
I --> J[Generate Report]
J --> K[Output: Quality Report]该Skill会协调4个专业子代理并行运行:
mermaid
graph TD
A[doc-review Skill] --> B[Input: File or Folder]
B --> C[File Discovery]
C --> D[Parallel Sub-Agents]
D --> E[Data Consistency Agent]
D --> F[Reference Checker Agent]
D --> G[Typo Detection Agent]
D --> H[Terminology Agent]
E --> I[Merge Results]
F --> I
G --> I
H --> I
I --> J[Generate Report]
J --> K[Output: Quality Report]Sub-Agent 1: Data Consistency Agent
子代理1:数据一致性Agent
Purpose: Detect inconsistent, wrong, or confusing information
Checks:
- Contradictory statements within same document
- Numerical inconsistencies (counts, dates, versions)
- Status field mismatches (metadata vs content)
- Duplicate content with variations
- Logical contradictions
- Outdated information markers
Detection Patterns:
yaml
data_consistency_checks:
count_mismatch:
pattern: "\\d+ (requirements|items|sections)"
validate: "count matches actual items"
error_code: "DATA-E001"
status_mismatch:
pattern: "Status:\\s*(Draft|Approved|Implemented)"
validate: "matches content maturity"
error_code: "DATA-E002"
date_inconsistency:
pattern: "\\d{4}-\\d{2}-\\d{2}"
validate: "Last Updated >= Created"
error_code: "DATA-E003"
version_format:
pattern: "Version:\\s*[\\d.]+"
validate: "semantic versioning compliance"
error_code: "DATA-E004"
duplicate_content:
pattern: "similar paragraphs >80%"
validate: "intentional or error"
error_code: "DATA-W001"用途:检测不一致、错误或易混淆的信息
检查项:
- 同一文档内的矛盾陈述
- 数值不一致(数量、日期、版本)
- 状态字段不匹配(元数据与内容)
- 存在差异的重复内容
- 逻辑矛盾
- 过时信息标记
检测规则:
yaml
data_consistency_checks:
count_mismatch:
pattern: "\\d+ (requirements|items|sections)"
validate: "count matches actual items"
error_code: "DATA-E001"
status_mismatch:
pattern: "Status:\\s*(Draft|Approved|Implemented)"
validate: "matches content maturity"
error_code: "DATA-E002"
date_inconsistency:
pattern: "\\d{4}-\\d{2}-\\d{2}"
validate: "Last Updated >= Created"
error_code: "DATA-E003"
version_format:
pattern: "Version:\\s*[\\d.]+"
validate: "semantic versioning compliance"
error_code: "DATA-E004"
duplicate_content:
pattern: "similar paragraphs >80%"
validate: "intentional or error"
error_code: "DATA-W001"Sub-Agent 2: Reference Checker Agent
子代理2:引用检查Agent
Purpose: Validate all links, references, and cross-document connections
Checks:
- Markdown link resolution ()
[text](path#anchor) - Internal anchor existence ()
#section-id - Cross-document reference validity
- Relative path correctness
- External URL accessibility (optional)
- Traceability tag format (,
@brd:, etc.)@prd:
Detection Patterns:
yaml
reference_checks:
broken_link:
pattern: "\\[.*?\\]\\(.*?\\)"
validate: "target file exists"
error_code: "REF-E001"
invalid_anchor:
pattern: "\\[.*?\\]\\(.*?#.*?\\)"
validate: "anchor exists in target"
error_code: "REF-E002"
orphan_anchor:
pattern: "^#{1,6}\\s+.*$"
validate: "has incoming references"
error_code: "REF-W001"
relative_path:
pattern: "\\.\\./|\\./"
validate: "path resolves correctly"
error_code: "REF-E003"
tag_format:
pattern: "@(brd|prd|ears|bdd|adr|sys|req|spec|impl|ctr|tasks):"
validate: "follows TYPE.NN.TT.SS format"
error_code: "REF-E004"
circular_reference:
pattern: "A→B→...→A"
validate: "no circular chains"
error_code: "REF-E005"用途:验证所有链接、引用和跨文档关联
检查项:
- Markdown链接解析()
[text](path#anchor) - 内部锚点存在性()
#section-id - 跨文档引用有效性
- 相对路径正确性
- 外部URL可达性(可选)
- 可追溯性标签格式(,
@brd:等)@prd:
检测规则:
yaml
reference_checks:
broken_link:
pattern: "\\[.*?\\]\\(.*?\\)"
validate: "target file exists"
error_code: "REF-E001"
invalid_anchor:
pattern: "\\[.*?\\]\\(.*?#.*?\\)"
validate: "anchor exists in target"
error_code: "REF-E002"
orphan_anchor:
pattern: "^#{1,6}\\s+.*$"
validate: "has incoming references"
error_code: "REF-W001"
relative_path:
pattern: "\\.\\./|\\./"
validate: "path resolves correctly"
error_code: "REF-E003"
tag_format:
pattern: "@(brd|prd|ears|bdd|adr|sys|req|spec|impl|ctr|tasks):"
validate: "follows TYPE.NN.TT.SS format"
error_code: "REF-E004"
circular_reference:
pattern: "A→B→...→A"
validate: "no circular chains"
error_code: "REF-E005"Sub-Agent 3: Typo Detection Agent
子代理3:拼写检测Agent
Purpose: Find spelling errors, grammatical issues, and formatting problems
Checks:
- Common misspellings
- Technical term spelling
- Capitalization inconsistencies
- Punctuation errors
- Whitespace issues
- Markdown syntax errors
Detection Patterns:
yaml
typo_checks:
common_misspellings:
dictionary: "en_US + technical_terms"
error_code: "TYPO-E001"
case_inconsistency:
pattern: "same term, different cases"
examples: ["GitHub/github", "API/api", "JavaScript/Javascript"]
error_code: "TYPO-W001"
double_words:
pattern: "\\b(\\w+)\\s+\\1\\b"
error_code: "TYPO-E002"
markdown_syntax:
patterns:
- "unclosed_code_block"
- "mismatched_brackets"
- "broken_table"
error_code: "TYPO-E003"
punctuation:
patterns:
- "double_period: \\.\\."
- "space_before_comma: \\s,"
- "missing_space_after_period: \\.[A-Z]"
error_code: "TYPO-W002"
whitespace:
patterns:
- "trailing_whitespace"
- "multiple_blank_lines"
- "tabs_vs_spaces"
error_code: "TYPO-W003"用途:查找拼写错误、语法问题和格式问题
检查项:
- 常见拼写错误
- 技术术语拼写
- 大小写不一致
- 标点错误
- 空白字符问题
- Markdown语法错误
检测规则:
yaml
typo_checks:
common_misspellings:
dictionary: "en_US + technical_terms"
error_code: "TYPO-E001"
case_inconsistency:
pattern: "same term, different cases"
examples: ["GitHub/github", "API/api", "JavaScript/Javascript"]
error_code: "TYPO-W001"
double_words:
pattern: "\\b(\\w+)\\s+\\1\\b"
error_code: "TYPO-E002"
markdown_syntax:
patterns:
- "unclosed_code_block"
- "mismatched_brackets"
- "broken_table"
error_code: "TYPO-E003"
punctuation:
patterns:
- "double_period: \\.\\."
- "space_before_comma: \\s,"
- "missing_space_after_period: \\.[A-Z]"
error_code: "TYPO-W002"
whitespace:
patterns:
- "trailing_whitespace"
- "multiple_blank_lines"
- "tabs_vs_spaces"
error_code: "TYPO-W003"Sub-Agent 4: Terminology Agent
子代理4:术语检查Agent
Purpose: Identify unclear, undefined, or inconsistent terminology
Checks:
- Undefined acronyms
- Inconsistent term usage
- Ambiguous language
- Jargon without definition
- Conflicting definitions
- Domain-specific term validation
Detection Patterns:
yaml
terminology_checks:
undefined_acronym:
pattern: "\\b[A-Z]{2,}\\b"
validate: "defined on first use or in glossary"
error_code: "TERM-E001"
inconsistent_naming:
examples:
- "user/User/USER"
- "login/sign-in/authenticate"
- "config/configuration/settings"
error_code: "TERM-E002"
ambiguous_terms:
flagged_words:
- "it"
- "this"
- "that"
- "they"
context: "unclear antecedent"
error_code: "TERM-W001"
subjective_qualifiers:
flagged_words:
- "easy"
- "simple"
- "fast"
- "efficient"
- "powerful"
context: "lacks quantification"
error_code: "TERM-W002"
undefined_jargon:
pattern: "domain-specific terms without definition"
error_code: "TERM-W003"
conflicting_definitions:
pattern: "same term, different meanings"
error_code: "TERM-E003"用途:识别不清晰、未定义或不一致的术语
检查项:
- 未定义的首字母缩写
- 不一致的术语使用
- 歧义语言
- 未定义的行话
- 冲突的定义
- 特定领域术语验证
检测规则:
yaml
terminology_checks:
undefined_acronym:
pattern: "\\b[A-Z]{2,}\\b"
validate: "defined on first use or in glossary"
error_code: "TERM-E001"
inconsistent_naming:
examples:
- "user/User/USER"
- "login/sign-in/authenticate"
- "config/configuration/settings"
error_code: "TERM-E002"
ambiguous_terms:
flagged_words:
- "it"
- "this"
- "that"
- "they"
context: "unclear antecedent"
error_code: "TERM-W001"
subjective_qualifiers:
flagged_words:
- "easy"
- "simple"
- "fast"
- "efficient"
- "powerful"
context: "lacks quantification"
error_code: "TERM-W002"
undefined_jargon:
pattern: "domain-specific terms without definition"
error_code: "TERM-W003"
conflicting_definitions:
pattern: "same term, different meanings"
error_code: "TERM-E003"Workflow Execution
工作流执行
Step 1: File Discovery
步骤1:文件发现
python
undefinedpython
undefinedExpand path/pattern to file list
Expand path/pattern to file list
def discover_files(path_pattern):
if is_glob_pattern(path_pattern):
return glob.glob(path_pattern, recursive=True)
elif os.path.isfile(path_pattern):
return [path_pattern]
elif os.path.isdir(path_pattern):
return glob.glob(f"{path_pattern}/**/*.md", recursive=True)
else:
raise FileNotFoundError(f"Path not found: {path_pattern}")
undefineddef discover_files(path_pattern):
if is_glob_pattern(path_pattern):
return glob.glob(path_pattern, recursive=True)
elif os.path.isfile(path_pattern):
return [path_pattern]
elif os.path.isdir(path_pattern):
return glob.glob(f"{path_pattern}/**/*.md", recursive=True)
else:
raise FileNotFoundError(f"Path not found: {path_pattern}")
undefinedStep 2: Launch Parallel Sub-Agents
步骤2:启动并行子代理
python
undefinedpython
undefinedLaunch 4 sub-agents in parallel using Task tool
Launch 4 sub-agents in parallel using Task tool
async def run_review(files, scope, focus):
tasks = []
if "data" in focus or focus == "all":
tasks.append(Task(
subagent_type="general-purpose",
prompt=f"Review files for data consistency: {files}",
description="Data consistency check"
))
if "references" in focus or focus == "all":
tasks.append(Task(
subagent_type="general-purpose",
prompt=f"Validate all references and links: {files}",
description="Reference validation"
))
if "typos" in focus or focus == "all":
tasks.append(Task(
subagent_type="general-purpose",
prompt=f"Check for typos and formatting: {files}",
description="Typo detection"
))
if "terms" in focus or focus == "all":
tasks.append(Task(
subagent_type="general-purpose",
prompt=f"Validate terminology consistency: {files}",
description="Terminology review"
))
# Run all tasks in parallel
results = await asyncio.gather(*tasks)
return merge_results(results)undefinedasync def run_review(files, scope, focus):
tasks = []
if "data" in focus or focus == "all":
tasks.append(Task(
subagent_type="general-purpose",
prompt=f"Review files for data consistency: {files}",
description="Data consistency check"
))
if "references" in focus or focus == "all":
tasks.append(Task(
subagent_type="general-purpose",
prompt=f"Validate all references and links: {files}",
description="Reference validation"
))
if "typos" in focus or focus == "all":
tasks.append(Task(
subagent_type="general-purpose",
prompt=f"Check for typos and formatting: {files}",
description="Typo detection"
))
if "terms" in focus or focus == "all":
tasks.append(Task(
subagent_type="general-purpose",
prompt=f"Validate terminology consistency: {files}",
description="Terminology review"
))
# Run all tasks in parallel
results = await asyncio.gather(*tasks)
return merge_results(results)undefinedStep 3: Merge and Prioritize Results
步骤3:合并并优先级排序结果
python
def merge_results(agent_results):
merged = {
"errors": [], # Severity: ERROR (must fix)
"warnings": [], # Severity: WARNING (should fix)
"info": [], # Severity: INFO (consider)
"stats": {}
}
for result in agent_results:
merged["errors"].extend(result.get("errors", []))
merged["warnings"].extend(result.get("warnings", []))
merged["info"].extend(result.get("info", []))
# Deduplicate and sort by severity
merged["errors"] = deduplicate(merged["errors"])
merged["warnings"] = deduplicate(merged["warnings"])
return mergedpython
def merge_results(agent_results):
merged = {
"errors": [], # Severity: ERROR (must fix)
"warnings": [], # Severity: WARNING (should fix)
"info": [], # Severity: INFO (consider)
"stats": {}
}
for result in agent_results:
merged["errors"].extend(result.get("errors", []))
merged["warnings"].extend(result.get("warnings", []))
merged["info"].extend(result.get("info", []))
# Deduplicate and sort by severity
merged["errors"] = deduplicate(merged["errors"])
merged["warnings"] = deduplicate(merged["warnings"])
return mergedStep 4: Generate Report
步骤4:生成报告
Output format based on parameter.
report_format根据参数指定的格式输出结果。
report_formatError Codes Reference
错误码参考
Data Consistency (DATA)
数据一致性(DATA)
| Code | Severity | Description | Auto-Fix |
|---|---|---|---|
| DATA-E001 | ERROR | Count mismatch (stated vs actual) | Yes |
| DATA-E002 | ERROR | Status/content maturity mismatch | Manual |
| DATA-E003 | ERROR | Date inconsistency | Yes |
| DATA-E004 | ERROR | Invalid version format | Yes |
| DATA-W001 | WARNING | Potential duplicate content | Manual |
| DATA-W002 | WARNING | Outdated information marker | Manual |
| 错误码 | 严重程度 | 描述 | 自动修复 |
|---|---|---|---|
| DATA-E001 | ERROR | 数量不匹配(声明值与实际值) | 是 |
| DATA-E002 | ERROR | 状态/内容成熟度不匹配 | 手动 |
| DATA-E003 | ERROR | 日期不一致 | 是 |
| DATA-E004 | ERROR | 无效版本格式 | 是 |
| DATA-W001 | WARNING | 潜在重复内容 | 手动 |
| DATA-W002 | WARNING | 过时信息标记 | 手动 |
References (REF)
引用(REF)
| Code | Severity | Description | Auto-Fix |
|---|---|---|---|
| REF-E001 | ERROR | Broken link (file not found) | Manual |
| REF-E002 | ERROR | Invalid anchor | Manual |
| REF-E003 | ERROR | Relative path error | Yes |
| REF-E004 | ERROR | Invalid traceability tag format | Yes |
| REF-E005 | ERROR | Circular reference detected | Manual |
| REF-W001 | WARNING | Orphan anchor (no incoming refs) | Manual |
| 错误码 | 严重程度 | 描述 | 自动修复 |
|---|---|---|---|
| REF-E001 | ERROR | 失效链接(文件不存在) | 手动 |
| REF-E002 | ERROR | 无效锚点 | 手动 |
| REF-E003 | ERROR | 相对路径错误 | 是 |
| REF-E004 | ERROR | 无效可追溯性标签格式 | 是 |
| REF-E005 | ERROR | 检测到循环引用 | 手动 |
| REF-W001 | WARNING | 孤立锚点(无传入引用) | 手动 |
Typos (TYPO)
拼写错误(TYPO)
| Code | Severity | Description | Auto-Fix |
|---|---|---|---|
| TYPO-E001 | ERROR | Misspelled word | Yes |
| TYPO-E002 | ERROR | Double word | Yes |
| TYPO-E003 | ERROR | Markdown syntax error | Manual |
| TYPO-W001 | WARNING | Case inconsistency | Manual |
| TYPO-W002 | WARNING | Punctuation issue | Yes |
| TYPO-W003 | WARNING | Whitespace issue | Yes |
| 错误码 | 严重程度 | 描述 | 自动修复 |
|---|---|---|---|
| TYPO-E001 | ERROR | 拼写错误的单词 | 是 |
| TYPO-E002 | ERROR | 重复单词 | 是 |
| TYPO-E003 | ERROR | Markdown语法错误 | 手动 |
| TYPO-W001 | WARNING | 大小写不一致 | 手动 |
| TYPO-W002 | WARNING | 标点问题 | 是 |
| TYPO-W003 | WARNING | 空白字符问题 | 是 |
Terminology (TERM)
术语(TERM)
| Code | Severity | Description | Auto-Fix |
|---|---|---|---|
| TERM-E001 | ERROR | Undefined acronym | Manual |
| TERM-E002 | ERROR | Inconsistent term usage | Manual |
| TERM-E003 | ERROR | Conflicting definitions | Manual |
| TERM-W001 | WARNING | Ambiguous pronoun | Manual |
| TERM-W002 | WARNING | Subjective qualifier | Manual |
| TERM-W003 | WARNING | Undefined jargon | Manual |
| 错误码 | 严重程度 | 描述 | 自动修复 |
|---|---|---|---|
| TERM-E001 | ERROR | 未定义的首字母缩写 | 手动 |
| TERM-E002 | ERROR | 不一致的术语使用 | 手动 |
| TERM-E003 | ERROR | 冲突的定义 | 手动 |
| TERM-W001 | WARNING | 歧义代词 | 手动 |
| TERM-W002 | WARNING | 主观限定词 | 手动 |
| TERM-W003 | WARNING | 未定义的行话 | 手动 |
Usage Examples
使用示例
Example 1: Review Single File
示例1:审查单个文件
/doc-review ai_dev_flow/EARS/EARS_CREATION_RULES.mdOutput:
=== Documentation Review Report ===
File: ai_dev_flow/EARS/EARS_CREATION_RULES.md
Mode: Single File
Scope: full
Data Consistency: 2 issues
[DATA-E001] Line 547: States "total_requirements: 135" but only 130 found
[DATA-W001] Line 89-95: Similar content to lines 105-111
References: 1 issue
[REF-E002] Line 137: Anchor #cross-reference-link-format-mandatory not found
Typos: 0 issues
Terminology: 1 issue
[TERM-W002] Line 26: "Complete reference" - subjective qualifier
Summary: 4 issues (2 errors, 2 warnings)/doc-review ai_dev_flow/EARS/EARS_CREATION_RULES.md输出:
=== 文档审查报告 ===
文件: ai_dev_flow/EARS/EARS_CREATION_RULES.md
模式: 单个文件
范围: full
数据一致性: 2个问题
[DATA-E001] 第547行:声明"total_requirements: 135"但实际仅找到130项
[DATA-W001] 第89-95行:与第105-111行内容相似
引用: 1个问题
[REF-E002] 第137行:锚点#cross-reference-link-format-mandatory不存在
拼写错误: 0个问题
术语: 1个问题
[TERM-W002] 第26行:"Complete reference" - 主观限定词
摘要: 4个问题(2个错误,2个警告)Example 2: Review All Files in Folder
示例2:审查文件夹中的所有文件
/doc-review docs/EARS/Output:
=== Documentation Review Report ===
Folder: docs/EARS/
Mode: Folder (all files together)
Files analyzed: 12
Scope: full
Cross-File Analysis:
[TERM-E002] Inconsistent term: "requirement" vs "EARS requirement" across 4 files
[REF-E001] Broken cross-reference: EARS-001.md → EARS-005.md#section-missing
Per-File Issues:
EARS-001.md: 2 errors, 1 warning
EARS-002.md: 0 errors, 3 warnings
...
Summary: 8 errors, 15 warnings across 12 files/doc-review docs/EARS/输出:
=== 文档审查报告 ===
文件夹: docs/EARS/
模式: 文件夹(所有文件一起分析)
分析文件数: 12
范围: full
跨文件分析:
[TERM-E002] 术语不一致:"requirement"与"EARS requirement"在4个文件中混用
[REF-E001] 失效交叉引用:EARS-001.md → EARS-005.md#section-missing
单文件问题:
EARS-001.md: 2个错误,1个警告
EARS-002.md: 0个错误,3个警告
...
摘要: 12个文件中存在8个错误,15个警告Example 3: Focus on Specific Checks
示例3:聚焦特定检查项
/doc-review ai_dev_flow/PRD/ --focus references,typos/doc-review ai_dev_flow/PRD/ --focus references,typosExample 4: Quick Pre-Commit Check
示例4:快速提交前检查
/doc-review docs/ --scope quick --report_format summaryOutput:
Quick Review: docs/
Files scanned: 87
Errors: 3
Warnings: 12
Status: NEEDS ATTENTION (fix errors before commit)/doc-review docs/ --scope quick --report_format summary输出:
快速审查: docs/
扫描文件数: 87
错误数: 3
警告数: 12
状态: 需要处理(提交前修复错误)Integration Points
集成点
With Other Skills
与其他Skill集成
| Skill | Integration |
|---|---|
| trace-check | Shares reference validation logic |
| doc-validator | Complementary (cross-doc vs single-file) |
| quality-advisor | Real-time vs batch validation |
| code-review | Source code vs documentation focus |
| Skill | 集成方式 |
|---|---|
| trace-check | 共享引用验证逻辑 |
| doc-validator | 互补(跨文档 vs 单文件) |
| quality-advisor | 实时 vs 批量验证 |
| code-review | 源代码 vs 文档聚焦 |
With CI/CD
与CI/CD集成
yaml
undefinedyaml
undefined.github/workflows/docs-review.yml
.github/workflows/docs-review.yml
name: Documentation Review
on: [pull_request]
jobs:
doc-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run doc review
run: |
claude-code /doc-review docs/ --scope quick --report_format json > review.json
- name: Check for errors
run: |
if jq '.errors | length > 0' review.json; then
echo "Documentation errors found"
exit 1
fi
---name: Documentation Review
on: [pull_request]
jobs:
doc-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run doc review
run: |
claude-code /doc-review docs/ --scope quick --report_format json > review.json
- name: Check for errors
run: |
if jq '.errors | length > 0' review.json; then
echo "Documentation errors found"
exit 1
fi
---Quality Gates
质量门禁
Definition of Done
完成定义
- All ERROR-level issues resolved
- WARNING-level issues reviewed and addressed or justified
- No broken links
- All acronyms defined
- Terminology consistent across documents
- No typos in headers or critical content
- 所有ERROR级问题已解决
- 所有WARNING级问题已审查并处理或说明理由
- 无失效链接
- 所有首字母缩写已定义
- 术语在所有文档中保持一致
- 标题或关键内容无拼写错误
Severity Thresholds
严重程度阈值
| Scope | Errors Allowed | Warnings Allowed |
|---|---|---|
| quick | 0 | 10 |
| full | 0 | 5 |
| deep | 0 | 0 |
| 范围 | 允许错误数 | 允许警告数 |
|---|---|---|
| quick | 0 | 10 |
| full | 0 | 5 |
| deep | 0 | 0 |
Sub-Agent Prompts
子代理提示词
Data Consistency Agent Prompt
数据一致性Agent提示词
You are a data consistency reviewer. Analyze the following file(s) for:
1. **Count Mismatches**: Find stated counts that don't match actual items
- "N requirements" should match actual requirement count
- "N sections" should match actual section count
2. **Status Inconsistencies**: Check metadata vs content alignment
- Status: Approved but content has TBD markers
- Version mismatches between header and changelog
3. **Date Inconsistencies**: Validate date logic
- Last Updated should be >= Created date
- Referenced dates should be valid
4. **Duplicate Content**: Flag similar paragraphs that may be errors
Output format: JSON with error_code, line_number, description, severity你是一名数据一致性审查员。请分析以下文件,检查:
1. **数量不匹配**:查找声明数量与实际项数不符的内容
- "N项需求"应与实际需求数量一致
- "N个章节"应与实际章节数量一致
2. **状态不一致**:检查元数据与内容是否对齐
- 状态为已批准但内容包含TBD标记
- 页眉与变更日志中的版本不匹配
3. **日期不一致**:验证日期逻辑
- 最后更新日期应大于等于创建日期
- 引用的日期应有效
4. **重复内容**:标记可能为错误的相似段落
输出格式:包含error_code、line_number、description、severity的JSONReference Checker Agent Prompt
引用检查Agent提示词
You are a reference validation expert. Analyze the following file(s) for:
1. **Broken Links**: Verify all markdown links resolve
- [text](path) - file exists
- [text](path#anchor) - anchor exists
2. **Invalid Cross-References**: Check traceability tags
- @brd: BRD.NN.TT.SS format
- @prd: PRD.NN.TT.SS format
- Document referenced must exist
3. **Relative Path Errors**: Validate ../ paths resolve correctly
4. **Orphan Anchors**: Find headers with no incoming links (optional)
Output format: JSON with error_code, line_number, target, description, severity你是一名引用验证专家。请分析以下文件,检查:
1. **失效链接**:验证所有Markdown链接是否可解析
- [text](path) - 文件存在
- [text](path#anchor) - 锚点存在
2. **无效交叉引用**:检查可追溯性标签
- @brd: 符合BRD.NN.TT.SS格式
- @prd: 符合PRD.NN.TT.SS格式
- 引用的文档必须存在
3. **相对路径错误**:验证../路径是否可正确解析
4. **孤立锚点**:查找无传入链接的标题(可选)
输出格式:包含error_code、line_number、target、description、severity的JSONTypo Detection Agent Prompt
拼写检测Agent提示词
You are a proofreading expert. Analyze the following file(s) for:
1. **Spelling Errors**: Common misspellings and technical terms
- Use standard English dictionary + technical glossary
- Flag words not in either
2. **Markdown Syntax**: Validate proper formatting
- Unclosed code blocks
- Mismatched brackets/parentheses
- Broken table syntax
3. **Punctuation Issues**: Common punctuation errors
- Double periods, missing spaces after periods
- Comma usage
4. **Whitespace Problems**: Formatting consistency
- Trailing whitespace
- Multiple blank lines
- Inconsistent indentation
Output format: JSON with error_code, line_number, word/pattern, suggestion, severity你是一名校对专家。请分析以下文件,检查:
1. **拼写错误**:常见拼写错误和技术术语
- 使用标准英语词典 + 技术术语表
- 标记不在两者中的单词
2. **Markdown语法**:验证格式是否正确
- 未关闭的代码块
- 不匹配的括号/圆括号
- 损坏的表格语法
3. **标点问题**:常见标点错误
- 双句号、句号后缺失空格
- 逗号使用
4. **空白字符问题**:格式一致性
- 行尾空白
- 多个空行
- 不一致的缩进
输出格式:包含error_code、line_number、word/pattern、suggestion、severity的JSONTerminology Agent Prompt
术语检查Agent提示词
You are a terminology consistency expert. Analyze the following file(s) for:
1. **Undefined Acronyms**: Find uppercase abbreviations without definitions
- Check if defined on first use
- Check if in glossary section
2. **Inconsistent Naming**: Same concept, different names
- user/User/USER
- login/sign-in/authenticate
- Build term consistency map
3. **Ambiguous Language**: Unclear references
- Pronouns with unclear antecedents (it, this, that)
- Vague quantifiers (some, many, few)
4. **Subjective Qualifiers**: Unmeasurable claims
- "easy to use", "fast", "efficient"
- "simple configuration"
Output format: JSON with error_code, line_number, term, issue, suggestion, severity你是一名术语一致性专家。请分析以下文件,检查:
1. **未定义的首字母缩写**:查找未定义的大写缩写
- 检查是否在首次使用时定义
- 检查是否在术语表章节中
2. **不一致的命名**:同一概念使用不同名称
- user/User/USER
- login/sign-in/authenticate
- 构建术语一致性映射
3. **歧义语言**:不明确的指代
- 指代对象不明确的代词(it, this, that)
- 模糊的量词(some, many, few)
4. **主观限定词**:无法衡量的表述
- "易于使用"、"快速"、"高效"
- "简单配置"
输出格式:包含error_code、line_number、term、issue、suggestion、severity的JSONConfiguration
配置
Custom Dictionary
自定义词典
Add project-specific terms to skip false positives:
yaml
undefined添加项目特定术语以避免误报:
yaml
undefined.doc-review.yaml
.doc-review.yaml
custom_dictionary:
- "EARS"
- "BDD"
- "ADR"
- "Gherkin"
- "SDD"
- "traceability"
ignored_patterns:
- "node_modules/"
- "*.min.js"
- "vendor/"
severity_overrides:
TERM-W002: "INFO" # Downgrade subjective qualifiers to INFO
---custom_dictionary:
- "EARS"
- "BDD"
- "ADR"
- "Gherkin"
- "SDD"
- "traceability"
ignored_patterns:
- "node_modules/"
- "*.min.js"
- "vendor/"
severity_overrides:
TERM-W002: "INFO" # 将主观限定词降级为INFO级
---Performance
性能
Benchmarks
基准测试
| Files | Scope | Time | Memory |
|---|---|---|---|
| 10 | quick | <5s | 50MB |
| 50 | full | <30s | 200MB |
| 100 | deep | <60s | 400MB |
| 文件数 | 范围 | 耗时 | 内存占用 |
|---|---|---|---|
| 10 | quick | <5秒 | 50MB |
| 50 | full | <30秒 | 200MB |
| 100 | deep | <60秒 | 400MB |
Optimization
优化措施
- Parallel sub-agents reduce wall-clock time by ~60%
- Caching of dictionary lookups
- Incremental mode for changed files only
- 并行子代理可将耗时减少约60%
- 词典查找缓存
- 仅变更文件的增量模式
Limitations
局限性
- Cannot understand semantic meaning deeply (may miss logical contradictions)
- May produce false positives for domain-specific terminology
- External URL validation requires network access
- Auto-fix limited to simple patterns (typos, formatting)
- Complex reference chains require manual review
- 无法深度理解语义含义(可能遗漏逻辑矛盾)
- 可能对特定领域术语产生误报
- 外部URL验证需要网络访问
- 自动修复仅支持简单模式(拼写、格式)
- 复杂引用链需要手动审查
Version Information
版本信息
Version: 1.0.0
Created: 2026-01-01
Status: Active
Author: AI Dev Flow Framework
Change Log:
- 1.1.0 (2026-01-01): Renamed to doc-review, clarified analysis modes
- Single file mode: deep analysis of one file
- Folder mode: analyze all files together with cross-file checks
- Added cross-file consistency checks in folder mode
- 1.0.0 (2026-01-01): Initial release as file-review with 4 sub-agents
- Data consistency checking
- Reference validation
- Typo detection
- Terminology review
- Parallel execution support
- Multiple output formats
版本:1.0.0
创建日期:2026-01-01
状态:活跃
作者:AI Dev Flow Framework
变更日志:
- 1.1.0 (2026-01-01): 重命名为doc-review,明确分析模式
- 单文件模式:深入分析单个文件
- 文件夹模式:一起分析所有文件并执行跨文件检查
- 在文件夹模式中新增跨文件一致性检查
- 1.0.0 (2026-01-01): 初始版本为file-review,包含4个子代理
- 数据一致性检查
- 引用验证
- 拼写检测
- 术语审查
- 并行执行支持
- 多种输出格式