doc-check

A command that checks whether repository documentation follows the rules in CLAUDE.md files. It first installs the rule checker, then runs the Maven validation that applies those rules.

In plain words
What is it for?
Use it to verify documentation changes in a Maven project, investigate failed CLAUDE.md checks, or confirm that the expected number of rules passed.
Why use it?
It prevents stale checking rules from producing misleading results and explains which document value violated which rule. It also distinguishes rule failures from setup or build failures.

Command for Claude Code

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 commands/adamw7/tools/doc-check
Clone the repo
git clone --depth 1 https://github.com/adamw7/tools

Made for: Claude Code.

Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 496 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.00017 $0.00496
Opus 5 $0.00009 $0.00248
Sonnet 5 $0.00003 $0.00099
Haiku 4.5 $0.00002 $0.00050

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

Security

Grade A, and why

doc-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 2d 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.

.claude/commands/doc-check.md · 44 lines

What it actually says

Run this repository's documentation contract check the way .github/workflows/maven.yml runs it, and act on the result.

Both commands, in this order — the first publishes the rule, the second uses it:

mvn -pl claude-code-enforcer -am install
mvn -N validate -DenforceClaudeMd

Running only the second checks the new documents with the previously installed rules, which is how a rule change appears to pass when it does not. If you changed nothing under claude-code-enforcer, the first command is still cheap insurance against a stale local artifact.

Then:

  • Everything passed — say so, and name how many rules reported a pass. A rule that never ran also never fails, so the count is the evidence.
  • A rule failed — read the violation lines rather than the summary. Each one names the file and the value it objected to. Fix the document, not the rule: these rules encode a contract that was agreed before the document was written, and a rule bent to fit a document guards nothing afterwards. If the rule really is wrong, say so explicitly and stop, rather than editing it in passing.
  • The build failed before the rules ran — a missing JDK 25, a Maven outside 3.9.x, or an unresolved tools.claude-code-enforcer artifact. That is a toolchain problem; report it as such, because the documents were not checked.

Two failures are worth naming precisely, because their message points away from their cause:

  • contextBudget on CLAUDE.md means the file outgrew 32 KB. The fix is moving detail into AGENTS.md or a skill, never trimming the required sections.
  • moduleMapConsistency after adding a module means the module is not mentioned in both CLAUDE.md and AGENTS.md — add it to the module map in each.

Load the doc-contract skill before editing any of the three documents, and the enforcer-rules skill before touching a rule.

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. 2d ago First seen · 44 lines · 17 tokens per session scan A 254b4c5aec7d

Subscribe to this mod's changes

doc-check is a command published in the GitHub repository adamw7/tools (11 stars, last pushed 4d ago), licensed MIT. It adds 17 tokens to every session and 496 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-30.