doc-code-consistency-check

doc-code-consistency-check is a skill for Claude Code, Codex from chen3feng/agent-skills. It costs 26 tokens per session (683 once invoked), scanned A, original, Apache-2.0.

A documentation review method that compares what a README or other guide says with what the project code and tests actually do. It checks specific claims such as command options, return values, defaults, errors, and supported versions.

In plain words
What is it for?
Use it before correcting project documentation to verify commands, APIs, settings, outputs, error handling, and version information against the code.
Why use it?
Documentation can become outdated when the code changes, and editing the document alone can preserve incorrect behavior. This check helps identify whether the documentation or the code is the source of each mismatch.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/chen3feng/agent-skills/doc-code-consistency-check
Any agent
npx skills add chen3feng/agent-skills --skill doc-code-consistency-check
Clone the repo
git clone --depth 1 https://github.com/chen3feng/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for doc-code-consistency-check

README.md
[![agentmods](https://agentmods.dev/badge/skills/chen3feng/agent-skills/doc-code-consistency-check.svg)](https://agentmods.dev/skills/chen3feng/agent-skills/doc-code-consistency-check)
Your own site
<a href="https://agentmods.dev/skills/chen3feng/agent-skills/doc-code-consistency-check"><img src="https://agentmods.dev/badge/skills/chen3feng/agent-skills/doc-code-consistency-check.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 683 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00026 $0.00683
Opus 5 $0.00013 $0.00342
Sonnet 5 $0.00005 $0.00137
Haiku 4.5 $0.00003 $0.00068

Measured 4d ago against content hash 872a21fe0c52, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

doc-code-consistency-check scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/doc-code-consistency-check/SKILL.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Doc–code consistency check

When to use

The user asks you to review or tidy up documentation (README, tutorials, help text) for a project whose code you can also read. Especially when they say "the docs look wrong" or "check whether the docs match the code".

Problem

Docs drift. Common observed drifts in real repos:

  • A CLI flag was renamed in code but the README still shows the old one.
  • A function described as "returns X" actually returns X-or-None.
  • A "supported versions" list that nobody updated after a bump.
  • Chinese and English versions of the same doc disagreeing with each other (and both possibly disagreeing with the code).

If you edit the docs to be self-consistent without re-reading the code, you often cement the wrong behavior.

Solution

Before changing a single word of a doc, do this loop:

  1. List the concrete claims the doc makes — flags, options, return types, default values, error behavior, supported platforms.
  2. Grep the code for each claim. Cross-reference against tests where possible.
  3. Categorize each discrepancy:
    • (a) Doc wrong, code right → update the doc (this is most common).
    • (b) Code wrong, doc right → ask the user; do not silently "fix" the doc.
    • (c) Both wrong → surface it; don't guess.
  4. For multilingual docs (README.md + README-zh.md), diff them after step 3 so both stay in sync.
  5. Write a short changelog of what you changed in the doc and why, based on the code evidence. This lets the user audit quickly.

Example

Symptom: README says _check_python accepts a version string like "3.11".

Bad fix: silently change the README to "3.11.0" because that's what "looks right".

Good fix:

grep -n "_check_python" -r src/
# read the function, note it calls shutil.which("python3") and parses
# sys.version_info, no version string is accepted

Then update the README to describe what the code actually does, and mention the mismatch in the PR description so the maintainer can decide if the code should change instead.

Read the full file on GitHub · 82 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 82 lines · 26 tokens per session scan A 872a21fe0c52

Subscribe to this mod's changes

doc-code-consistency-check is a skill published in the GitHub repository chen3feng/agent-skills (5 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 26 tokens to every session and 683 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.