doc-contract

A documentation-maintenance skill for CLAUDE.md, AGENTS.md, and README.md. It keeps these files aligned with the repository's required headings, size limit, module map, and shared facts.

In plain words
What is it for?
Use it when adding modules, changing the listed documentation, updating Java, or investigating a failed documentation check.
Why use it?
It helps prevent documentation checks and builds from failing when project files or documentation change.

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/adamw7/tools/doc-contract
Any agent
npx skills add adamw7/tools --skill doc-contract
Clone the repo
git clone --depth 1 https://github.com/adamw7/tools

Made for: Claude Code, Codex.

Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,131 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.00081 $0.01131
Opus 5 $0.00041 $0.00566
Sonnet 5 $0.00016 $0.00226
Haiku 4.5 $0.00008 $0.00113

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

Security

Grade A, and why

doc-contract 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/skills/doc-contract/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 Contract Skill

In this repository the documentation is a build artifact: CLAUDE.md, AGENTS.md and README.md are validated by the claude-code-enforcer rules, and a -DenforceClaudeMd build fails when they drift. Edit them with the rules in mind rather than discovering them in CI.

Who is the source of truth

AGENTS.md is the single source of truth. CLAUDE.md is a quick-reference summary that defers to it — it is loaded into every session, so contextBudget caps it at 32 KB. New detail belongs in AGENTS.md or in a skill, not in CLAUDE.md.

Required structure

Document Title Required ## sections
CLAUDE.md # CLAUDE.md Project · Java version · Maven · Principles for Java Development · Testing · Dependencies
AGENTS.md # AGENTS.md Project overview · Module layout · Environment & toolchain · Build, test, and run · Code style & conventions · Releasing · Pull requests & commits

Also checked: the title must be the first non-blank line; a required section must have a non-empty body (a heading with nothing under it fails); CLAUDE.md must reference AGENTS.md; and memoryImports validates the @-import graph.

The consistency rules — what must change together

  • moduleMapConsistency — every <module> in the root pom.xml must be mentioned in both CLAUDE.md and AGENTS.md. Adding a module means editing three files in one commit: the pom, the module map in CLAUDE.md, and Module layout in AGENTS.md.
  • crossDocConsistency — the Java (\d+) pattern must read the same in CLAUDE.md and AGENTS.md. A JDK bump touches both.
  • readmeConsistency — the proto(\d) pattern must agree between README.md and AGENTS.md.
  • contextBudgetCLAUDE.md ≤ 32 KB.
  • noSecrets — no credentials in .claude/settings.json, .mcp.json, or .claude/hooks.

Skills, settings and hooks are checked too

  • skillFilesExist — each directory under .claude/skills needs a non-empty SKILL.md opening with YAML front matter carrying name and description. The name must be lower-case kebab-case, ≤ 64 chars, and equal to the directory name; an unknown front-matter key is reported (it catches descripton).
  • uniqueNames / uniqueDescriptions — two definitions may not share a name or a description (compared case- and whitespace-insensitively). Claude routes by description, so duplicates make one skill shadow another. Write a description that says what it covers and when to use it, with the trigger phrases.
  • settingsJsonValid, permissionsFormat, hookCommandsValid, hooksFormat, localSettingsIgnored.claude/settings.json, the hook scripts, and the .claude/settings.local.json entry in .gitignore (removing that entry fails the build).

Read the full file on GitHub · 82 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 82 lines · 81 tokens per session scan A db83fbcbd861

Subscribe to this mod's changes

doc-contract is a skill published in the GitHub repository adamw7/tools (11 stars, last pushed 5d ago), licensed MIT. It adds 81 tokens to every session and 1,131 once invoked, about $0.0004 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.