ln-614-docs-fact-checker by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-614-docs-fact-checkerPaths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
专门用于从文档中提取可验证的声明,并根据实际代码库逐一验证的工作器。
.md 文件中提取所有可验证的声明广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
docs/reference/、docs/tasks/、tests/必读: 加载 shared/references/audit_worker_core_contract.md。
接收包含以下内容的 contextStore:tech_stack、project_root、output_dir。
从 contextStore 中提取技术栈、项目根目录、output_dir。
在项目中 Glob 查找所有 .md 文件。排除:
node_modules/、.git/、dist/、build/docs/project/.audit/ (审计输出,非项目文档)CHANGELOG.md (设计上为历史记录)必读: 加载 shared/references/two_layer_detection.md 了解检测方法。
对于每个文档,使用 Grep/正则表达式模式提取可验证的声明。
必读: 加载 references/claim_extraction_rules.md 获取每种声明类型的详细提取模式。
9 种声明类型:
---|---|---|---
1 | 文件路径 | 源文件、目录、配置的路径 | 反引号内的路径,匹配 src/、lib/、app/、docs/、config/、tests/ 的链接目标
2 | 版本 | 包/工具/镜像版本 | 依赖项/包/镜像名称附近的 Semver 模式
3 | 数量/统计 | 关于代码库的数字声明 | \d+ (modules 4 | **API 端点** | HTTP 方法 + 路径 | (GET
5 | 配置键/环境变量 | 环境变量、配置键 | 配置上下文中出现的 [A-Z][A-Z_]{2,}、process.env.、os.environ
6 | CLI 命令 | Shell 命令 | 反引号代码块中的 npm run、python、docker、make
7 | 函数/类名 | 代码实体引用 | 反引号或代码上下文中的 CamelCase/snake_case
8 | 行号引用 | file:line 模式 | [\w/.]+:\d+ 模式
9 | Docker/基础设施声明 | 镜像标签、端口、服务名称 | 带有标签的镜像名称,docker 上下文中的端口映射
每个声明的输出:{doc_path, line, claim_type, claim_value, raw_context}。
针对每个提取的声明,根据代码库进行验证:
| 声明类型 | 验证方法 | 发现类型 |
|---|---|---|
| 文件路径 | Glob 或 ls 检查是否存在 | PATH_NOT_FOUND |
| 版本 | Grep 包文件 (package.json, requirements.txt, docker-compose.yml),比较 | VERSION_MISMATCH |
| 数量 | Glob/Grep 以统计实际实体数量,与声明的数字比较 | COUNT_MISMATCH |
| API 端点 | Grep 路由/控制器定义 | ENDPOINT_NOT_FOUND |
| 配置键 | 在源代码中 Grep 实际使用情况 | CONFIG_NOT_FOUND |
| CLI 命令 | 检查 package.json 脚本、Makefile 目标、二进制文件是否存在 | COMMAND_NOT_FOUND |
| 函数/类 | 在源代码中 Grep 定义 | ENTITY_NOT_FOUND |
| 行号 | 读取文件指定行,检查内容是否与声明的上下文匹配 | LINE_MISMATCH |
| Docker/基础设施 | Grep docker-compose.yml 查找镜像标签、端口 | INFRA_MISMATCH |
误报过滤 (第 2 层推理):
{placeholder}、YOUR_*、<project>、xxx) — 跳过.env.example 值 — 跳过 (预期与实际不同)比较跨文档提取的声明以发现矛盾:
| 检查项 | 方法 | 发现类型 |
|---|---|---|
| 相同路径,不同位置 | 对文件路径声明分组,检查是否都指向同一真实路径 | CROSS_DOC_PATH_CONFLICT |
| 相同实体,不同版本 | 按实体名称对版本声明分组,比较值 | CROSS_DOC_VERSION_CONFLICT |
| 相同指标,不同数量 | 按主题对数量声明分组,比较值 | CROSS_DOC_COUNT_CONFLICT |
| 规范中有但指南中没有的端点 | 比较 api_spec.md 与 guides/runbook 之间的端点声明 | CROSS_DOC_ENDPOINT_GAP |
算法:
claim_index = {} # key: normalized(claim_type + entity), value: [{doc, line, value}]
FOR claim IN all_verified_claims WHERE claim.verified == true:
key = normalize(claim.claim_type, claim.entity_name)
claim_index[key].append({doc: claim.doc_path, line: claim.line, value: claim.claim_value})
FOR key, entries IN claim_index:
unique_values = set(entry.value for entry in entries)
IF len(unique_values) > 1:
CREATE finding(type=CROSS_DOC_*_CONFLICT, severity=HIGH,
location=entries[0].doc + ":" + entries[0].line,
issue="'" + key + "' stated as '" + val1 + "' in " + doc1 + " but '" + val2 + "' in " + doc2)
必读: 加载 shared/references/audit_worker_core_contract.md 和 shared/references/audit_scoring.md。
使用惩罚公式计算分数。撰写报告。
| ID | 检查项 | 涵盖内容 |
|---|---|---|
path_claims | 文件/目录路径 | 所有路径引用均根据文件系统验证 |
version_claims | 版本号 | 包、工具、镜像版本与清单文件对比 |
count_claims | 数量与统计 | 数字断言与实际数量对比 |
endpoint_claims | API 端点 | 路由定义与控制器/路由器对比 |
config_claims | 配置与环境变量 | 环境变量、配置键与源代码对比 |
command_claims | CLI 命令 | 脚本、命令与 package.json/Makefile 对比 |
entity_claims | 代码实体名称 | 函数、类与源代码定义对比 |
line_ref_claims | 行号引用 | file:line 与实际文件内容对比 |
cross_doc | 跨文档一致性 | 跨文档的相同事实保持一致 |
| 问题类型 | 严重性 | 理由 |
|---|---|---|
| PATH_NOT_FOUND (关键文件:CLAUDE.md, runbook, api_spec) | CRITICAL | 设置/上手流程失败 |
| PATH_NOT_FOUND (其他文档) | HIGH | 误导性引用 |
| VERSION_MISMATCH (主版本) | HIGH | 根本性错误 |
| VERSION_MISMATCH (次版本/补丁版本) | MEDIUM | 表面性偏差 |
| COUNT_MISMATCH | MEDIUM | 误导性指标 |
| ENDPOINT_NOT_FOUND | HIGH | 影响 API 消费者 |
| CONFIG_NOT_FOUND | HIGH | 部署中断 |
| COMMAND_NOT_FOUND | HIGH | 设置/CI 中断 |
| ENTITY_NOT_FOUND | MEDIUM | 造成混淆 |
| LINE_MISMATCH | LOW | 轻微不准确 |
| INFRA_MISMATCH | HIGH | 影响 Docker/部署 |
| CROSS_DOC_*_CONFLICT | HIGH | 削弱信任,文档矛盾 |
必读: 加载 shared/references/audit_worker_core_contract.md 和 shared/templates/audit_worker_report_template.md。
将报告写入 {output_dir}/614-fact-checker.md,设置 category: "Fact Accuracy" 和 checks: path_claims, version_claims, count_claims, endpoint_claims, config_claims, command_claims, entity_claims, line_ref_claims, cross_doc。
向协调器返回摘要:
Report written: docs/project/.audit/ln-610/{YYYY-MM-DD}/614-fact-checker.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)
必读: 加载 shared/references/audit_worker_core_contract.md。
file:line 以便程序化导航必读: 加载 shared/references/audit_worker_core_contract.md。
.md 文件 (范围广泛){output_dir}/614-fact-checker.md (原子性单次 Write 调用)shared/references/audit_output_schema.mdshared/references/two_layer_detection.md版本: 1.0.0 最后更新: 2026-03-06
每周安装数
87
仓库
GitHub 星标数
253
首次出现
2026年3月7日
安全审计
安装于
cursor82
claude-code80
gemini-cli79
github-copilot79
amp79
cline79
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
Specialized worker that extracts verifiable claims from documentation and validates each against the actual codebase.
.md files in projectdocs/reference/, docs/tasks/, tests/ in scopeMANDATORY READ: Load shared/references/audit_worker_core_contract.md.
Receives contextStore with: tech_stack, project_root, output_dir.
Extract tech stack, project root, output_dir from contextStore.
Glob ALL .md files in project. Exclude:
node_modules/, .git/, dist/, build/docs/project/.audit/ (audit output, not project docs)CHANGELOG.md (historical by design)MANDATORY READ: Load shared/references/two_layer_detection.md for detection methodology.
For each document, extract verifiable claims using Grep/regex patterns.
MANDATORY READ: Load references/claim_extraction_rules.md for detailed extraction patterns per claim type.
9 claim types:
---|---|---|---
1 | File paths | Paths to source files, dirs, configs | Backtick paths, link targets matching src/, lib/, app/, docs/, config/, tests/
2 | Versions | Package/tool/image versions | Semver patterns near dependency/package/image names
3 | Counts/Statistics | Numeric claims about codebase | \d+ (modules 4 | **API endpoints** | HTTP method + path | (GET
5 | Config keys/env vars | Environment variables, config keys | [A-Z][A-Z_]{2,} in config context, process.env.,
6 | | Shell commands | , , , in backtick blocks
7 | | Code entity references | CamelCase/snake_case in backticks or code context
8 | | file:line patterns | patterns
9 | | Image tags, ports, service names | Image names with tags, port mappings in docker context
Output per claim: {doc_path, line, claim_type, claim_value, raw_context}.
For each extracted claim, verify against codebase:
| Claim Type | Verification Method | Finding Type |
|---|---|---|
| File paths | Glob or ls for existence | PATH_NOT_FOUND |
| Versions | Grep package files (package.json, requirements.txt, docker-compose.yml), compare | VERSION_MISMATCH |
| Counts | Glob/Grep to count actual entities, compare with claimed number | COUNT_MISMATCH |
| API endpoints | Grep route/controller definitions | ENDPOINT_NOT_FOUND |
| Config keys | Grep in source for actual usage | CONFIG_NOT_FOUND |
| CLI commands | Check package.json scripts, Makefile targets, binary existence | COMMAND_NOT_FOUND |
| Function/class | Grep in source for definition | ENTITY_NOT_FOUND |
| Line numbers | Read file at line, check content matches claimed context |
False positive filtering (Layer 2 reasoning):
{placeholder}, YOUR_*, <project>, xxx) — skip.env.example values — skip (expected to differ from actual)Compare extracted claims across documents to find contradictions:
| Check | Method | Finding Type |
|---|---|---|
| Same path, different locations | Group file path claims, check if all point to same real path | CROSS_DOC_PATH_CONFLICT |
| Same entity, different version | Group version claims by entity name, compare values | CROSS_DOC_VERSION_CONFLICT |
| Same metric, different count | Group count claims by subject, compare values | CROSS_DOC_COUNT_CONFLICT |
| Endpoint in spec but not in guide | Compare endpoint claims across api_spec.md vs guides/runbook | CROSS_DOC_ENDPOINT_GAP |
Algorithm:
claim_index = {} # key: normalized(claim_type + entity), value: [{doc, line, value}]
FOR claim IN all_verified_claims WHERE claim.verified == true:
key = normalize(claim.claim_type, claim.entity_name)
claim_index[key].append({doc: claim.doc_path, line: claim.line, value: claim.claim_value})
FOR key, entries IN claim_index:
unique_values = set(entry.value for entry in entries)
IF len(unique_values) > 1:
CREATE finding(type=CROSS_DOC_*_CONFLICT, severity=HIGH,
location=entries[0].doc + ":" + entries[0].line,
issue="'" + key + "' stated as '" + val1 + "' in " + doc1 + " but '" + val2 + "' in " + doc2)
MANDATORY READ: Load shared/references/audit_worker_core_contract.md and shared/references/audit_scoring.md.
Calculate score using penalty formula. Write report.
| ID | Check | What It Covers |
|---|---|---|
path_claims | File/Directory Paths | All path references verified against filesystem |
version_claims | Version Numbers | Package, tool, image versions against manifests |
count_claims | Counts & Statistics | Numeric assertions against actual counts |
endpoint_claims | API Endpoints | Route definitions against controllers/routers |
config_claims |
| Issue Type | Severity | Rationale |
|---|---|---|
| PATH_NOT_FOUND (critical file: CLAUDE.md, runbook, api_spec) | CRITICAL | Setup/onboarding fails |
| PATH_NOT_FOUND (other docs) | HIGH | Misleading reference |
| VERSION_MISMATCH (major version) | HIGH | Fundamentally wrong |
| VERSION_MISMATCH (minor/patch) | MEDIUM | Cosmetic drift |
| COUNT_MISMATCH | MEDIUM | Misleading metric |
| ENDPOINT_NOT_FOUND | HIGH | API consumers affected |
| CONFIG_NOT_FOUND | HIGH | Deployment breaks |
| COMMAND_NOT_FOUND | HIGH | Setup/CI breaks |
| ENTITY_NOT_FOUND | MEDIUM | Confusion |
MANDATORY READ: Load shared/references/audit_worker_core_contract.md and shared/templates/audit_worker_report_template.md.
Write report to {output_dir}/614-fact-checker.md with category: "Fact Accuracy" and checks: path_claims, version_claims, count_claims, endpoint_claims, config_claims, command_claims, entity_claims, line_ref_claims, cross_doc.
Return summary to coordinator:
Report written: docs/project/.audit/ln-610/{YYYY-MM-DD}/614-fact-checker.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)
MANDATORY READ: Load shared/references/audit_worker_core_contract.md.
file:line for programmatic navigationMANDATORY READ: Load shared/references/audit_worker_core_contract.md.
.md files discovered (broad scope){output_dir}/614-fact-checker.md (atomic single Write call)shared/references/audit_output_schema.mdshared/references/two_layer_detection.mdVersion: 1.0.0 Last Updated: 2026-03-06
Weekly Installs
87
Repository
GitHub Stars
253
First Seen
Mar 7, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykFail
Installed on
cursor82
claude-code80
gemini-cli79
github-copilot79
amp79
cline79
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
44,900 周安装
canvas-design:AI驱动设计哲学与视觉表达工具,创建设计美学运动
1 周安装
Node.js/Express/TypeScript 后端开发指南:微服务架构与最佳实践
1 周安装
Azure Functions 最佳实践指南:独立工作进程、Node.js/Python 编程模型与反模式详解
1 周安装
Avalonia Zafiro 开发指南:跨平台应用函数式响应式MVVM架构规范
1 周安装
Avalonia ViewModels 最佳实践:使用 Zafiro 和 ReactiveUI 构建现代化桌面应用
1 周安装
自主代理模式指南:构建AI编码代理的设计模式与架构实现
1 周安装
os.environnpm runpythondockermake[\w/.]+:\d+| LINE_MISMATCH |
| Docker/infra | Grep docker-compose.yml for image tags, ports | INFRA_MISMATCH |
| Config & Env Vars |
| Environment variables, config keys against source |
command_claims | CLI Commands | Scripts, commands against package.json/Makefile |
entity_claims | Code Entity Names | Functions, classes against source definitions |
line_ref_claims | Line Number References | file:line against actual file content |
cross_doc | Cross-Document Consistency | Same facts across documents agree |
| LINE_MISMATCH |
| LOW |
| Minor inaccuracy |
| INFRA_MISMATCH | HIGH | Docker/deployment affected |
| CROSS_DOC_*_CONFLICT | HIGH | Trust erosion, contradictory docs |