docs-guard
amelnagdy/guard-skills
Verify documentation accuracy against source code before publishing.
What is docs-guard?
Docs Guard reviews generated or changed documentation—READMEs, API references, docstrings, changelogs, tutorials—to catch drift between docs and code. Use it reactively after an agent writes or edits docs, or before publishing, to verify every function, flag, endpoint, config key, and code sample against the actual source.
- Verify every referenced symbol (functions, methods, classes, CLI commands, flags, endpoints, config keys, env vars, file paths) against source code
- Validate that all code samples work with correct imports, signatures, and no hardcoded state or credentials
- Detect docs-vs-code drift by reading implementation and flagging where code behavior differs from documentation
- Strip unverifiable claims (performance numbers, compatibility matrices, scale limits) without repository evidence
- Check that versions are explicit and features are tagged with the version that introduced them
- Ensure all internal links, anchors, and navigation resolve correctly
How to install docs-guard
npx skills add https://github.com/amelnagdy/guard-skills --skill docs-guardHow to use docs-guard
- 1.After documentation is generated or edited, read the actual source code implementation for the symbols being documented
- 2.Verify each referenced function, method, class, CLI flag, endpoint, config key, and file path exists in the source with the documented signature
- 3.Test each code sample to confirm imports resolve, APIs exist with correct signatures, and the sample runs on a clean machine
- 4.Check for unverifiable claims (performance numbers, compatibility matrices, scale limits) and remove any without repository evidence
- 5.Grep all documentation surfaces (README, API docs, docstrings, changelog, examples) for old symbol names if code was changed
- 6.Run the self-check: list every symbol verified, confirm all samples are runnable, check all links resolve, and ensure no docstrings merely paraphrase signatures
Use cases
- After an agent generates a README or API reference, verify all function signatures and examples match the actual codebase
- When code behavior changes (rename, signature change, new default), audit all doc surfaces for outdated references
- Review docstrings and JSDoc/PHPDoc to catch paraphrasing of signatures and unverifiable claims before merge
- Audit changelogs and tutorials to ensure error paths and actual error types are documented, not just happy paths
- Fact-check technical prose in docs for filler, marketing language, and unverifiable superlatives
- Developers and agents writing or editing technical documentation
- Teams maintaining API references, READMEs, and docstrings
- Projects with strict accuracy requirements for shipped documentation
- Code reviewers auditing documentation for drift after code changes
docs-guard FAQ
Use docs-guard for documentation accuracy and drift (READMEs, API references, docstrings, changelogs). Use clean-code-guard for production code review and test-guard for test review. Do not use docs-guard for marketing copy, blog posts, prose style editing, or documentation site theming.
A claim is verifiable if you can check it against the source code, CLI help output, route table, schema, or a benchmark/CI matrix in the repository. Performance numbers, compatibility claims, and scale limits must cite a source in the repo or be removed. Paraphrased upstream documentation should be replaced with a link instead.
No. In review mode, walk the review checklist against the target docs and produce a findings report with file:line evidence. Only rewrite if the user explicitly asks you to.
The code is the truth. Flag the disagreement to the user instead of silently choosing a side, and update the documentation to match the actual implementation.
Code samples must run on a clean machine with no hardcoded local paths, no real credentials, and no implicit prior state. Use placeholder credentials, environment variables, or mock data. Always show error paths and the actual error types the code raises.
Full instructions (SKILL.md)
Source of truth, from amelnagdy/guard-skills.
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
- Read the project's agent instructions (CLAUDE.md, AGENTS.md) and any docs style guide. Project conventions win on conflict.
- 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 8).
- Note the documented version policy: which versions does the project support, and where are features version-tagged?
The Rules
Accuracy — must fix
-
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.
-
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.
-
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.
-
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
-
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.
-
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.
Substance — should fix
-
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. -
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).
-
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
- 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
- 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?
- Would every code sample run on a clean machine? Did you check each import and signature?
- Any number, compatibility claim, or superlative without a repo-verifiable source?
- If this change touched code: did you grep all docs surfaces for the old names?
- Any docstring that just restates the signature? Any section that restates its heading?
- 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
- references/verification.md — the mechanical procedure: extracting claims, verifying symbols, signatures, CLI flags, endpoints, config keys, links
- references/code-samples.md — what makes a sample shippable: runnability, realistic data, secrets hygiene, error paths
- references/docstrings.md — docstring/PHPDoc/JSDoc-specific rules: when one is justified, what it must contain, paraphrase detection
- references/review-checklist.md — structured walk-through for review mode
- references/sources.md — research and style-guide URLs; read only when citing a source
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.
Related skills
More from amelnagdy/guard-skills and the wider catalog.

test-guard
Review AI-generated test code against universal testing rules before it ships.

woo-guard
Review generated or changed WooCommerce code — extensions, payment and shipping integrations, checkout customizations, and order/product logic — before it ships. Best used reactively after an agent writes, edits, or reviews code touching WooCommerce APIs: wc_get_order, wc_get_orders, wc_get_product, WC() cart or session, woocommerce_* hooks, Store API endpoints, payment gateways, order or product meta, HPOS, subscriptions, or bookings. Use on 'review this Woo plugin', 'is this HPOS compatible', or after tasks like 'write a WooCommerce extension', 'add a checkout field', 'hook into the order flow', or 'update stock'. Enforces HPOS-safe order access, CRUD over direct meta, feature-compatibility declarations, server-side checkout validation, money-handling discipline, and hooks over template overrides. DO NOT USE for WordPress code without WooCommerce APIs (use wp-guard), generic code review (use clean-code-guard), test review (use test-guard), or store configuration and admin-screen questions.

wp-guard
Review generated or changed WordPress code — plugins, themes, and blocks — before it ships. Best used reactively after an agent writes, edits, or reviews code touching WordPress APIs: add_action/add_filter, shortcodes, meta boxes, AJAX handlers, REST routes, WP_Query or $wpdb, widgets, or WP-CLI commands. Use on 'review this plugin', 'is this safe to ship', 'make this translatable', 'speed up this query', or after tasks like 'write a plugin' or 'add an endpoint/shortcode/meta box'. Enforces escaping and sanitization, nonces plus capability checks, prepared database queries, core-API-first development, translation-ready strings, and query/caching discipline. DO NOT USE for WooCommerce-specific order, product, or checkout logic (use woo-guard), non-WordPress PHP, generic code quality review (use clean-code-guard), test code review (use test-guard), server or hosting configuration, or conceptual WordPress questions.

clean-code-guard
Review production code against Clean Code, SOLID, DRY, KISS, YAGNI, and LLM-specific failure modes before shipping.

angular-component
Create modern Angular v20+ standalone components with signals, OnPush detection, and accessibility built-in.

angular-di
Implement dependency injection in Angular v20+ with inject(), tokens, and provider configuration.