Agent skill

Docs Guard

by amElnagdy in amElnagdy/guard-skills

Checks generated or edited documentation against the source code, flagging invented symbols, outdated samples and unverifiable claims before publishing.

MITAuto-check passedDevelopment

Install Docs Guard

skills CLI
$ npx skills add amElnagdy/guard-skills --skill docs-guard -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install amElnagdy/guard-skills docs-guard --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/amElnagdy/guard-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/docs-guard .claude/skills/docs-guard && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
docs-guard
GitHub stars
1.3k
Token cost
~2.1k tokens
SKILL.md length
1,013 words
Files
7 (incl. references)
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Checks generated or edited documentation against the source code, flagging invented symbols, outdated samples and unverifiable claims before publishing.

  • Works in 3 steps: Read the project's agent instructions… → Identify the docs surfaces that must… → Note the documented version policy:…
  • Reviewing a README or API reference an agent just wrote
  • SKILL.md covers How to use this skill, Adapt to the project first, The Rules and Self-check before delivery, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Treating documentation as a set of checkable claims, this skill has the agent verify every function, flag, endpoint, config key, environment variable, file path and code sample against the real source rather than from memory. A reference that cannot be verified does not ship.

It works in three modes. Guard-pass runs after docs or docstrings were written or changed. Live mode is invoked before writing, so the agent reads the implementation first. Review mode walks a checklist and returns findings with file and line evidence without rewriting anything. The agent first reads CLAUDE.md, AGENTS.md and any docs style guide, finds the doc surfaces that must change together, such as the README, reference docs, docstrings, changelog, examples and config samples, and notes the project's version policy.

Reference files cover the verification procedure, code samples, docstrings, sources and the review checklist, and the skill also trims filler. It is not meant for production code review, test review, marketing copy, non-technical prose editing or documentation site theming.

When your agent uses it

  • Reviewing a README or API reference an agent just wrote
  • Checking docs after a code change altered documented behavior
  • Adding a docstring or changelog entry that must match the code
  • Running a final accuracy pass before publishing documentation

Example prompts

  • “Review the docs in ./docs against the source and list every claim you cannot verify.”
  • “Update the README for the new dry-run flag and check each example against the code.”
  • “Add a PHPDoc block to the OrderExporter class and verify the parameter types.”
  • “Fact-check this API reference for drift from the route table.”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Read the project's agent instructions (CLAUDE.md, AGENTS.md) and any docs style guide. Project conventions win on conflict.
  2. Identify the docs surfaces that must move together: README, reference docs, docstrings, changelog, examples, config samples. A change to…
  3. Note the documented version policy: which versions does the project support, and where are features version-tagged?

What it can do on your machine

Read from SKILL.md and the folder at commit ffa2603. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Docs Guard loads about 2.1k tokens when it runs, and up to ~5.2k if it reads all its reference files. Until then it costs about 209 tokens; SKILL.md has 1,013 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~209
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from amElnagdy/guard-skills at commit ffa2603, republished under its MIT licence (© amElnagdy). 1,013 words, ~2,068 tokens.

Download SKILL.mdSave it as .claude/skills/docs-guard/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
docs-guard
description
Review generated or changed documentation before it ships — READMEs, API references, docstrings, PHPDoc/JSDoc, changelogs, tutorials, and doc sites. Best used reactively after an agent writes or edits docs, after code changes documented behavior, or before publishing docs. Use when the user says 'review the docs', 'is this documentation accurate', 'update the docs', 'write a README', 'document this API', 'add a docstring', or 'add a changelog entry'. Core job: verify every referenced function, flag, endpoint, config key, and code sample against the source; catch docs-vs-code drift; strip filler and unverifiable claims. DO NOT USE for production code review (use clean-code-guard), test review (use test-guard), marketing copy or blog posts, prose style editing of non-technical writing, or documentation site theming.

Docs Guard

You are reviewing generated or changed documentation before it ships. Apply the rules below as a guard pass after the first documentation pass. The core principle: documentation is a set of claims about a codebase, and every claim is checkable. Your job is to check them.

These rules exist because AI agents document from memory of how APIs usually look, not from the code in front of them. Published research: half of AI answers to programming questions contain incorrect information, and models produce valid invocations for infrequent APIs barely a third of the time — yet the prose sounds authoritative either way. Readers cannot tell verified docs from hallucinated docs. You can, because you have the source.

How to use this skill

Guard-pass mode (recommended): after documentation or docstrings have been generated or edited, verify every claim against the source and run the self-check before delivery.

Live mode (explicit): when the user invokes this skill before writing docs, verify before you write — read the actual implementation, then document what it does. Run the self-check before delivery.

Review mode (the user asks you to review, audit, or fact-check docs): walk references/review-checklist.md against the target docs and produce a findings report with file:line evidence. Do not rewrite in review mode unless asked.

Adapt to the project first

  1. Read the project's agent instructions (CLAUDE.md, AGENTS.md) and any docs style guide. Project conventions win on conflict.
  2. Identify the docs surfaces that must move together: README, reference docs, docstrings, changelog, examples, config samples. A change to one usually owes a change to others (Rule 6).
  3. Note the documented version policy: which versions does the project support, and where are features version-tagged?

The Rules

Accuracy — must fix
  1. Every referenced symbol must exist. Every function, method, class, hook, CLI command, flag, endpoint, config key, env var, and file path mentioned in the docs gets verified against the actual source, CLI help output, route table, or schema — by reading it, not recalling it. The verification procedure is in references/verification.md. An unverifiable reference does not ship.

  2. Every code sample must work. Imports resolve, APIs exist with the documented signatures (names, argument order, defaults, return shape), and the sample runs outside the author's machine — no hardcoded local paths, no real credentials, no implicit prior state. Sample rules: references/code-samples.md.

  3. Document the code's actual behavior, not its intended behavior. Read the implementation before describing it. Where code and comments/specs disagree, the code is the truth — and flag the disagreement to the user instead of silently picking a side.

  4. No unverifiable claims. Performance numbers, compatibility matrices, scale limits, and "production-ready" assertions require a source in the repository (benchmark script, CI matrix, changelog entry) or they come out. "Fast" is marketing; "O(n log n), benchmarked in bench/sort.md" is documentation.

Versioning and drift
  1. Versions are explicit. Features, flags, and behaviors state the version that introduced them when the project tracks versions. Prerequisites are pinned or ranged, never "latest". Deprecated items say so, with the replacement.

  2. A code change owes a docs change. When editing code whose behavior is documented — rename, signature change, new default, removed flag — update every doc surface that mentions it in the same change. Grep the docs for the old symbol before finishing.

Show full SKILL.md (472 more words)Show less
Substance — should fix
  1. No filler, no slop. Delete: docstrings that paraphrase the signature ("Gets the user by ID" above get_user_by_id), sections that restate their heading, marketing adjectives in technical prose ("powerful", "seamless", "blazingly fast"), and intro padding ("In this section, we will explore…"). A docstring earns its place by adding contracts the signature cannot express: units, ranges, error conditions, side effects, threading/ordering guarantees.

  2. Don't paraphrase upstream docs. Link to external documentation instead of restating it — paraphrased upstream docs drift the moment upstream changes. Document only your project's relationship to the external thing (which subset you use, what you configure differently).

  3. Examples cover the failure path too. A tutorial that only shows the happy path documents half the API. Show what the error looks like and what the caller should do — using the error types the code actually raises (verify per Rule 1).

Structure — worth noting
  1. Navigation tells the truth. Headings describe their sections, the table of contents matches the actual headings, internal links and anchors resolve, and there are no TODO stubs or "coming soon" sections in published docs — unwritten sections are removed, not promised.

Self-check before delivery

  1. List every symbol, flag, endpoint, config key, and path your docs mention. Did you verify each one against the source in this session — not from memory?
  2. Would every code sample run on a clean machine? Did you check each import and signature?
  3. Any number, compatibility claim, or superlative without a repo-verifiable source?
  4. If this change touched code: did you grep all docs surfaces for the old names?
  5. Any docstring that just restates the signature? Any section that restates its heading?
  6. Do all internal links and anchors resolve?

If any answer is wrong, fix it before showing the user.

Reporting format (review mode)

**Rule N violation** in `docs/path.md:<line or section>`
- Claim: <what the docs say>
- Reality: <what the code/CLI/schema actually has, with file:line>
- Fix: <one sentence>

Lead with Rule 1–4 findings (false claims), then drift, then substance. If a doc is clean, say so in one line — accuracy deserves credit.

Severity guide

  • Must fix: Rules 1–4 — false documentation is worse than no documentation; readers act on it
  • Should fix: Rules 5–9 — drift debt and noise that buries the signal
  • Worth noting: Rule 10 — navigation and polish

References

What this skill does not do

  • Review the code itself — clean-code-guard's jurisdiction. This skill reviews what the docs claim about the code.
  • Generate documentation strategy or information architecture from scratch — it guards accuracy and substance, not scope decisions.
  • Enforce a prose style guide — tone belongs to the project; truth belongs to this skill.

© amElnagdy, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in skills/docs-guard of amElnagdy/guard-skills.

  • SKILL.md
  • agents/openai.yaml
  • references/code-samples.md
  • references/docstrings.md
  • references/review-checklist.md
  • references/sources.md
  • references/verification.md

Open the folder on GitHubat commit ffa2603

Compare with similar skills

Docs Guard next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Docs Guard compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Docs Guard this skillamElnagdy/guard-skills1.3k—~2.1kAutomated safety check: PassMIT
Doc-Code Sync Checkfancyboi999/open-tag203—~1.7kAutomated safety check: PassApache-2.0
Opik Documentation Patternscomet-ml/opik22k—~1.3kAutomated safety check: PassApache-2.0
Content Modelguardana/guardana129—~1.2kAutomated safety check: PassApache-2.0
Opik Docs Writercomet-ml/opik22k—~3.2kAutomated safety check: PassApache-2.0
Tech Writerstacklok/mecatl241—~2.2kAutomated safety check: PassApache-2.0

Similar skills

  • Doc-Code Sync Check

    fancyboi999/open-tag

    Reconciles documentation with code at the end of a change or as a periodic audit, following a repo rule that code changes and doc changes land in one commit.

    203 GitHub stars~1.7k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Rules for writing PR descriptions, changelog entries and feature documentation in the Opik repository, including the exact headings that CI requires.

    22k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Content Model

    guardana/guardana

    Route wording work to GPT (codex CLI) or Gemini (agy CLI) instead of writing it with Claude — landing-page copy, a readability rewrite of a README or docs page, attack and judge prompts for a rule…

    129 GitHub stars~1.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Opik Docs Writer

    comet-ml/opik

    Guides writing Fern MDX pages for the Opik documentation site, including frontmatter, structure, components, navigation entries and release-note routing.

    22k GitHub stars~3.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Tech Writer

    stacklok/mecatl

    A skill your agent uses when writing or substantively editing user-facing documentation: drafting a new page, rewriting or restructuring an existing one, adding a major section, or turning…

    241 GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    Writes and maintains .NET preview, RC and GA release notes from a scored features.json, working with sibling skills for change data, API diffs, code sample checks and review.

    22k GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed

More from amElnagdy/guard-skills

  • Clean Code Guard

    amElnagdy/guard-skills

    Reviews generated or changed production code against Clean Code, SOLID, DRY, KISS, YAGNI and LLM-specific failure modes before it ships, in any language.

    1.3k GitHub starsUsed in 2 repos~4.3k tokens
    Auto-check passed
  • Test Guard

    amElnagdy/guard-skills

    Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.

    1.3k GitHub starsUsed in 2 repos~2.1k tokens
    Auto-check passed
  • WooCommerce Code Guard

    amElnagdy/guard-skills

    Reviews generated or changed WooCommerce code for HPOS safety, CRUD use, checkout validation and money handling before it ships.

    1.3k GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • WordPress Code Guard

    amElnagdy/guard-skills

    Reviews WordPress plugin, theme and block code after an agent writes or edits it, catching missing escaping, nonces, capability checks and unprepared queries.

    1.3k GitHub stars~2.4k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Docs Guard

What does Docs Guard do?

Checks generated or edited documentation against the source code, flagging invented symbols, outdated samples and unverifiable claims before publishing. Treating documentation as a set of checkable claims, this skill has the agent verify every function, flag, endpoint, config key, environment variable, file path and code sample against the real source rather than from memory. A reference that cannot be verified does not ship.

When should I use Docs Guard?

Docs Guard fits situations like: reviewing a README or API reference an agent just wrote; checking docs after a code change altered documented behavior; adding a docstring or changelog entry that must match the code; running a final accuracy pass before publishing documentation.

How do I install Docs Guard in Claude Code?

Run `npx skills add amElnagdy/guard-skills --skill docs-guard -a claude-code`. Or copy the skill folder (skills/docs-guard in amElnagdy/guard-skills) into .claude/skills/docs-guard in your project. Claude Code loads it when a task matches its description.

How do I install Docs Guard in Codex?

Run `npx skills add amElnagdy/guard-skills --skill docs-guard -a codex`. Or copy the skill folder (skills/docs-guard in amElnagdy/guard-skills) into .agents/skills/docs-guard in your project. Codex loads it when a task matches its description.

Can I use Docs Guard in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add amElnagdy/guard-skills --skill docs-guard -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/docs-guard, .gemini/skills/docs-guard, .github/skills/docs-guard and .opencode/skills/docs-guard in your project.

What does Docs Guard need to run?

SKILL.md names no scripts, command-line tools or credentials: Docs Guard is instructions for the agent only.

Does Docs Guard access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Docs Guard safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Docs Guard use?

Docs Guard is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Docs Guard use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.1k tokens, read only when the agent opens those files.

What are the alternatives to Docs Guard?

Skills that share tags, products or a category with Docs Guard: Doc-Code Sync Check (fancyboi999/open-tag, 203 stars), Opik Documentation Patterns (comet-ml/opik, 22k stars), Content Model (guardana/guardana, 129 stars) and Opik Docs Writer (comet-ml/opik, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Docs Guard?

amElnagdy (a GitHub user) maintains it in amElnagdy/guard-skills, which has 1,260 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on July 4, 2026.

Source: amElnagdy/guard-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.