ln-600-docs-auditor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDocumentation Auditor
文档审计工具
Audit project documentation quality. Universal for any tech stack.
审计项目文档质量。适用于任何技术栈。
Purpose
目标
- Proactively compress - find all opportunities to reduce size while preserving value
- Eliminate meaningless, redundant, and verbose content
- Convert prose to structured formats (tables, lists)
- Verify documentation hierarchy with CLAUDE.md as root
- Detect duplication and enforce Single Source of Truth
- Ensure docs match current code state
- Semantic verification - delegate to ln-601 to verify content matches SCOPE and codebase reality
- 主动精简 - 寻找所有在保留价值的前提下缩减文档篇幅的机会
- 移除无意义、重复和冗长的内容
- 将散文式内容转换为结构化格式(表格、列表)
- 验证以CLAUDE.md为根的文档层级结构
- 检测重复内容并落实单一信息源(SSOT)原则
- 确保文档与当前代码状态一致
- 语义验证 - 委托ln-601验证内容是否符合SCOPE和代码库实际情况
Invocation
调用方式
- Direct: User invokes for documentation quality review
- Pipeline: Called by ln-100-documents-pipeline (Phase 5, if auditDocs=true)
- 直接调用: 用户发起文档质量审查请求
- 流水线调用: 由ln-100-documents-pipeline调用(第5阶段,当auditDocs=true时)
Workflow
工作流程
- Scan: Find all .md files in project (CLAUDE.md, README.md, docs/**)
- Build Tree: Construct hierarchy from CLAUDE.md outward links
- Audit Categories 1-7: Run structural checks (see Audit Categories below)
- Semantic Audit (Category 8): For each project document, delegate to ln-601-semantic-content-auditor
- Score: Calculate X/10 per category (including semantic scores from ln-601)
- Report: Output findings and recommended actions
- 扫描: 查找项目中所有.md文件(CLAUDE.md、README.md、docs/**)
- 构建树状结构: 从CLAUDE.md的外部链接构建文档层级
- 审计类别1-7: 执行结构性检查(见下方审计类别)
- 语义审计(类别8): 对每个项目文档,委托给ln-601-semantic-content-auditor处理
- 评分: 计算每个类别的X/10分数(包括来自ln-601的语义分数)
- 生成报告: 输出问题发现和建议措施
Phase 4: Semantic Audit Delegation
第4阶段:语义审计委托
For each project document (excluding tasks/, reference/, presentation/):
FOR doc IN [CLAUDE.md, docs/README.md, docs/project/*.md]:
result = DELEGATE ln-601-semantic-content-auditor {
doc_path: doc,
project_root: project_root,
tech_stack: detected_stack
}
semantic_findings.append(result.findings)
semantic_scores[doc] = result.scoresTarget documents: CLAUDE.md, docs/README.md, docs/documentation_standards.md, docs/principles.md, docs/project/*.md
Excluded: docs/tasks/, docs/reference/, docs/presentation/, tests/
对于每个项目文档(排除tasks/、reference/、presentation/目录下的文件):
FOR doc IN [CLAUDE.md, docs/README.md, docs/project/*.md]:
result = DELEGATE ln-601-semantic-content-auditor {
doc_path: doc,
project_root: project_root,
tech_stack: detected_stack
}
semantic_findings.append(result.findings)
semantic_scores[doc] = result.scores目标文档: CLAUDE.md、docs/README.md、docs/documentation_standards.md、docs/principles.md、docs/project/*.md
排除文档: docs/tasks/、docs/reference/、docs/presentation/、tests/
Audit Categories
审计类别
| # | Category | What to Check |
|---|---|---|
| 1 | Hierarchy & Links | CLAUDE.md is root; all docs reachable via links; no orphaned files; no broken links |
| 2 | Single Source of Truth | No content duplication; duplicates replaced with links to source; clear ownership |
| 3 | Proactive Compression | Eliminate verbose/redundant content; prose→tables; remove meaningless info; compress even under-limit files; see size_limits.md |
| 4 | Requirements Compliance | Correct sections; within size limits; no code blocks (tables/ASCII diagrams/text only); stack-appropriate doc links |
| 5 | Actuality (CRITICAL) | Verify facts against code: paths exist, functions match, APIs work, configs valid; outdated docs are worse than none |
| 6 | Legacy Cleanup | No history sections; no "was changed" notes; no deprecated info; current state only |
| 7 | Stack Adaptation | Links/refs match project stack; no Python examples in .NET project; official docs for correct platform |
| 8 | Semantic Content | Delegated to ln-601: Content matches SCOPE; serves project goals; descriptions match actual code behavior; architecture/API docs reflect reality |
| 序号 | 类别 | 检查内容 |
|---|---|---|
| 1 | 层级结构与链接 | CLAUDE.md为根文档;所有文档可通过链接访问;无孤立文件;无失效链接 |
| 2 | 单一信息源(SSOT) | 无内容重复;重复内容替换为指向源的链接;明确内容归属 |
| 3 | 主动精简 | 移除冗长/重复内容;散文转表格;删除无意义信息;即使文件未超限制也要精简;详见size_limits.md |
| 4 | 合规性要求 | 章节结构正确;符合篇幅限制;无代码块(仅允许表格/ASCII图/文本);链接适配项目技术栈 |
| 5 | 时效性(关键) | 对照代码验证事实: 路径存在、函数匹配、API可用、配置有效;过时文档不如没有文档 |
| 6 | 遗留内容清理 | 无历史章节;无“已修改”注释;无废弃信息;仅保留当前状态内容 |
| 7 | 技术栈适配 | 链接/参考内容匹配项目技术栈;.NET项目中无Python示例;官方文档指向对应平台 |
| 8 | 语义内容 | 委托给ln-601处理: 内容符合SCOPE;满足项目目标;描述与实际代码行为一致;架构/API文档反映真实情况 |
Output Format
输出格式
markdown
undefinedmarkdown
undefinedDocumentation Audit Report - [DATE]
文档审计报告 - [日期]
Compliance Score
合规分数
| Category | Score | Issues |
|---|---|---|
| Hierarchy & Links | X/10 | N issues found |
| Single Source of Truth | X/10 | N duplications |
| Proactive Compression | X/10 | N compression opportunities |
| Requirements Compliance | X/10 | N violations |
| Actuality | X/10 | N mismatches with code |
| Legacy Cleanup | X/10 | N legacy items |
| Stack Adaptation | X/10 | N stack mismatches |
| Semantic Content | X/10 | N semantic issues (via ln-601) |
| Overall | X/10 |
| 类别 | 分数 | 问题数量 |
|---|---|---|
| 层级结构与链接 | X/10 | 发现N个问题 |
| 单一信息源 | X/10 | 发现N处重复 |
| 主动精简 | X/10 | 发现N个精简机会 |
| 合规性要求 | X/10 | 发现N处违规 |
| 时效性 | X/10 | 发现N处与代码不符 |
| 遗留内容清理 | X/10 | 发现N项遗留内容 |
| 技术栈适配 | X/10 | 发现N处技术栈不匹配 |
| 语义内容 | X/10 | 发现N处语义问题(由ln-601检测) |
| 整体评分 | X/10 |
Critical Findings
关键问题
- [Category] - Issue description. Action: Fix suggestion.
path/file.md:line
- [类别] - 问题描述。措施: 修复建议。
path/file.md:line
Recommended Actions
建议措施
| Priority | Action | Location | Category |
|---|---|---|---|
| High | Remove duplicate section | docs/X.md | SSOT |
| Medium | Add link to CLAUDE.md | docs/Y.md | Hierarchy |
undefined| 优先级 | 措施 | 位置 | 类别 |
|---|---|---|---|
| 高 | 移除重复章节 | docs/X.md | SSOT |
| 中 | 添加指向CLAUDE.md的链接 | docs/Y.md | 层级结构 |
undefinedScoring Algorithm
评分算法
See for unified formula and score interpretation.
shared/references/audit_scoring.mdSeverity mapping:
| Issue Type | Severity |
|---|---|
| Outdated content (code mismatch) | CRITICAL |
| Broken links, orphaned docs | HIGH |
| Semantic mismatch (via ln-601) | HIGH |
| Content duplication | MEDIUM |
| Missing compression opportunity | LOW |
统一公式和分数说明详见
shared/references/audit_scoring.md严重程度映射:
| 问题类型 | 严重程度 |
|---|---|
| 过时内容(与代码不符) | 关键 |
| 失效链接、孤立文档 | 高 |
| 语义不符(由ln-601检测) | 高 |
| 内容重复 | 中 |
| 未抓住精简机会 | 低 |
Reference Files
参考文件
- Size limits and targets: references/size_limits.md
- Detailed checklist: references/audit_checklist.md
- 篇幅限制与目标:references/size_limits.md
- 详细检查清单:references/audit_checklist.md
Critical Notes
重要注意事项
- Fix content, not rules: NEVER modify standards/rules files (*_standards.md, *_rules.md, *_limits.md) to make violations pass. Always fix the violating files instead.
- Verify facts against code: Actively check every path, function name, API, config mentioned in docs. Run commands. Outdated docs mislead - they're worse than no docs.
- Compress always: Size limits are upper bounds, not targets. A 100-line file instead of 300 is a win. Always look for compression opportunities.
- Meaningless content: Remove filler words, obvious statements, over-explanations. If it doesn't add value, delete it.
- No code in docs: Documents describe algorithms in tables or ASCII diagrams. Code belongs in codebase.
- Forbidden: Code blocks, implementation snippets
- Allowed: Tables, ASCII diagrams, Mermaid, method signatures (1 line)
- Instead of code: "See Official docs" or "See src/file.cs:42"
- Format Priority: Tables/ASCII > Lists (enumerations only) > Text (last resort)
- Stack adaptation: Verify all documentation references match project stack. .NET project must not have Python examples. Check official doc links point to correct platform (Microsoft docs for C#, MDN for JS, etc.)
- Code is truth: When docs contradict code, always update docs. Never "fix" code to match documentation.
- Delete, don't archive: Legacy content should be removed, not moved to "archive"
- No history: Documents describe current state only; git tracks history
Version: 4.0.0
Last Updated: 2026-01-28
- 修正内容,而非规则: 绝不要修改标准/规则文件(_standards.md、_rules.md、*_limits.md)来掩盖违规问题。始终修改违规的文档文件。
- 对照代码验证事实: 主动检查文档中提到的每个路径、函数名、API、配置。执行相关命令验证。过时文档会误导他人——比没有文档更糟。
- 始终精简: 篇幅限制是上限,而非目标。300行的文件精简到100行就是进步。始终寻找精简机会。
- 无意义内容: 移除填充词、显而易见的陈述、过度解释。如果内容没有价值,就删除它。
- 文档中禁止出现代码: 文档需用表格或ASCII图描述算法。代码应放在代码库中。
- 禁止: 代码块、实现片段
- 允许: 表格、ASCII图、Mermaid、方法签名(单行)
- 替代方案: “详见官方文档”或“详见src/file.cs:42”
- 格式优先级: 表格/ASCII图 > 列表(仅枚举) > 文本(最后选择)
- 技术栈适配: 验证所有文档参考内容匹配项目技术栈。.NET项目中不得出现Python示例。检查官方文档链接指向正确平台(C#用微软文档,JS用MDN等)
- 代码即事实: 当文档与代码矛盾时,始终更新文档。绝不要“修改”代码来匹配文档。
- 直接删除,而非归档: 遗留内容应直接删除,而非移至“归档”文件夹
- 无历史记录: 文档仅描述当前状态;历史记录由git追踪
Version: 4.0.0
Last Updated: 2026-01-28