Back to Skills

docs-guard

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, f

1,021stars119forksUpdated 7/16/2026

Security Assessment

Safe(100/100)
Security Score100/100

About docs-guard

Docs-guard reviews generated or changed documentation before it ships, covering READMEs, API references, docstrings, PHPDoc/JSDoc, changelogs, tutorials, and doc sites. Its core principle is that documentation is a set of checkable claims about a codebase, and its job is to verify every referenced function, flag, endpoint, config key, and code sample against the source, catch docs-versus-code drift, and strip filler and unverifiable claims. It exists because AI agents tend to document from memory of how APIs usually look rather than from the code in front of them, producing authoritative-sounding but sometimes incorrect docs that readers cannot distinguish from verified ones.

The skill operates in three modes: guard-pass mode (the recommended default) verifies claims against the source and runs a self-check after docs are generated; live mode verifies before writing by reading the actual implementation first; and review mode walks references/review-checklist.md against target docs to produce a findings report with file:line evidence without rewriting unless asked. It first adapts to the project by reading agent instructions like CLAUDE.md or AGENTS.md and any style guide, then applies ten rules grouped by severity. Must-fix accuracy rules require every referenced symbol to exist, every code sample to work, documentation of actual (not intended) behavior, and no unverifiable claims. Versioning and drift rules require explicit versions and that a code change owes a docs change (grep the docs for old symbols). Should-fix substance rules remove filler and slop, discourage paraphrasing upstream docs, and require examples to cover failure paths. A structure rule requires navigation, tables of contents, and links to resolve. A self-check before delivery confirms every symbol was verified against the source, samples would run on a clean machine, and links resolve, and a defined reporting format leads with Rule 1-4 findings.

The skill targets developers and agents who need to ship accurate technical documentation, and is best used reactively after docs are written or edited, after code changes documented behavior, or before publishing. Supporting references cover the verification procedure, code-sample rules, docstring rules, the review checklist, and source citations. It explicitly does not do production code review (use clean-code-guard), test review (use test-guard), marketing copy or blog posts, prose editing of non-technical writing, or documentation-site theming.

FAQ

What modes can docs-guard run in?

Three: guard-pass mode (recommended) verifies claims against the source and runs the self-check after docs are generated; live mode verifies before writing by reading the implementation first; and review mode walks references/review-checklist.md against the docs to produce a findings report with file:line evidence, without rewriting unless asked.

What kinds of documentation does it review?

READMEs, API references, docstrings, PHPDoc/JSDoc, changelogs, tutorials, and doc sites. Triggers include requests like 'review the docs', 'is this documentation accurate', 'write a README', 'document this API', 'add a docstring', or 'add a changelog entry'.

What are the must-fix accuracy rules?

Rules 1-4: every referenced symbol must exist and be verified against the source, every code sample must work (imports resolve, signatures match, runs on a clean machine), documentation must describe the code's actual behavior rather than intended behavior, and there must be no unverifiable claims such as unsupported performance numbers or 'production-ready' assertions.

How does it handle code changes that affect docs?

Rule 6 states 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, and grep the docs for the old symbol before finishing.

What is out of scope for this skill?

It does not do 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.

All Files

7 files
agents/openai.yaml0.2 KB
View
SKILL.md8.1 KB
View
references/code-samples.md2.8 KB
View
references/review-checklist.md2.1 KB
View
references/docstrings.md2.7 KB
View
references/sources.md1.5 KB
View
references/verification.md2.9 KB
View

Install docs-guard

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill