Documentation Audit
Comprehensive audit to ensure zero documentation drift across ALL docs, agent instructions, and config files.
Principle: Use existing scripts instead of ad-hoc grep commands. Never create temporary audit scripts — all checks are covered by the repo's tooling and test suite.
Complete Documentation Inventory
Layer 1: Primary Docs
| File |
Drift-sensitive fields |
docs/README.md |
File tree, asset paths, tech stack |
docs/ARCHITECTURE.md |
File paths, component structure |
docs/CHANGELOG.md |
Missing entries for recent changes |
[FILL: docs/CONFIG-REFERENCE.md] |
[FILL: Schema tables, field descriptions] |
docs/decisions/ |
ADR accuracy vs. current implementation |
Layer 2: Agent Instructions
| File |
Drift-sensitive fields |
AGENTS.md |
File structure (paths), coding rules |
CLAUDE.md |
File map (paths), key patterns |
.github/copilot-instructions.md |
Key files table (paths), always/never rules |
.agent/rules/coding-standards.md |
Rules, path conventions |
| [FILL: Additional agent instruction files] |
[FILL: Drift-sensitive fields] |
Layer 3: Root-Level Files
| File |
Drift-sensitive fields |
README.md |
File paths, quickstart instructions |
| [FILL: Add project-specific root-level files] |
[FILL: Drift-sensitive fields] |
Phase 0 — File Tree Completeness (Structural Drift)
Why this is Phase 0: Missing files in file maps is the #1 drift source. Check this first.
Compare the actual file tree against every file-map section in agent instruction files and docs:
- List actual files:
ls src/, ls config/, ls docs/
- Cross-check against file maps in:
| File |
Section name |
AGENTS.md |
## File Structure |
CLAUDE.md |
## File Map |
[FILL: docs/README.md] |
[FILL: Section name for file tree] |
- Every real file/directory must appear in all file maps. Flag any missing entries.
Phase 1 — Identify What Changed
git diff --stat
git log --oneline -10
Classify the change type:
- Config change → schema, examples, stats references may be stale
- UI/layout change → styling guide, layout constraints may be stale
- New feature → user flow, architecture, changelog, roadmap may be stale
- File added/removed/renamed → file trees, path references may be stale
- Agent rule change → must propagate to ALL agent instruction files
Phase 2 — Run Automated Drift Checks
Do not use ad-hoc grep commands or create temporary scripts for checks that existing tooling already covers.
# Run all automated tests
npm test
# [FILL: Add any project-specific drift/stats scripts here]
Verify policy alignment:
Phase 3 — Verify Path Conventions
# Find references to potentially stale paths
grep -rn "[FILL: old-path-prefix]" docs/ .agent/ .claude/ .github/ AGENTS.md CLAUDE.md --include="*.md"
Current correct conventions:
- [FILL: Path convention 1 — e.g. "No leading
/ or ./ in asset paths"]
- [FILL: Path convention 2 — e.g. "Assets at
assets/{name}.ext"]
Phase 4 — Verify Config ↔ Code Consistency
Use existing tooling — do not write ad-hoc scripts for these checks.
All automated checks from Phase 2 cover config consistency. If they all pass, this phase is done.
Phase 5 — Cross-Check Agent Files
5a. File map sync (structural)
Verify all files/directories in the repo are listed in the agent file maps (see Phase 0).
5b. Fact consistency
All agent instruction files must agree on:
| Fact |
Must match across |
| Coding rules |
AGENTS.md, CLAUDE.md, copilot-instructions.md, coding-standards.md |
| Security requirements |
AGENTS.md, CLAUDE.md, copilot-instructions.md, coding-standards.md |
| [FILL: Project-specific fact] |
[FILL: Which files must agree] |
Phase 6 — Workflow & Skill Consistency
Phase 7 — Update CHANGELOG
If any doc fixes were made:
### Fixed
- Documentation drift: updated [specific counts/paths/conventions] across [N] files
Change → Doc Impact Matrix
| If you changed… |
Update these docs |
| File added/removed/renamed |
AGENTS.md (file structure), CLAUDE.md (file map), docs/ARCHITECTURE.md |
| Architecture decision |
docs/decisions/ (add new ADR file) |
| New feature / bug fix |
docs/CHANGELOG.md |
| Coding rule changed |
AGENTS.md, CLAUDE.md, copilot-instructions.md, coding-standards.md |
| [FILL: Project-specific change] |
[FILL: Affected docs] |
Drift Severity
| Level |
Description |
Action |
| 🔴 Critical |
Wrong paths, wrong schema, contradictory policy rules |
Fix immediately |
| 🟠 High |
Missing files in agent file maps, outdated conventions |
Fix before next AI-assisted change |
| 🟡 Medium |
Missing changelog entry, outdated roadmap |
Fix in next doc pass |
| 🟢 Low |
Stylistic inconsistency |
Fix when convenient |
1---2name: doc-audit3description: 8-phase documentation drift audit across all docs, agent instructions, and config files. Use when checking for documentation drift, stale paths/counts, or inconsistencies between code and docs.4---56# Documentation Audit78Comprehensive audit to ensure zero documentation drift across ALL docs, agent instructions, and config files.910**Principle:** Use existing scripts instead of ad-hoc grep commands. Never create temporary audit scripts — all checks are covered by the repo's tooling and test suite.1112---1314## Complete Documentation Inventory1516### Layer 1: Primary Docs1718<!-- SETUP: Replace with your project's actual doc structure. -->1920| File | Drift-sensitive fields |21| --- | --- |22| `docs/README.md` | File tree, asset paths, tech stack |23| `docs/ARCHITECTURE.md` | File paths, component structure |24| `docs/CHANGELOG.md` | Missing entries for recent changes |25| [FILL: `docs/CONFIG-REFERENCE.md`] | [FILL: Schema tables, field descriptions] |26| `docs/decisions/` | ADR accuracy vs. current implementation |2728### Layer 2: Agent Instructions2930| File | Drift-sensitive fields |31| --- | --- |32| `AGENTS.md` | **File structure** (paths), coding rules |33| `CLAUDE.md` | **File map** (paths), key patterns |34| `.github/copilot-instructions.md` | Key files table (paths), always/never rules |35| `.agent/rules/coding-standards.md` | Rules, path conventions |36| [FILL: Additional agent instruction files] | [FILL: Drift-sensitive fields] |3738### Layer 3: Root-Level Files3940| File | Drift-sensitive fields |41| --- | --- |42| `README.md` | File paths, quickstart instructions |43| [FILL: Add project-specific root-level files] | [FILL: Drift-sensitive fields] |4445---4647## Phase 0 — File Tree Completeness (Structural Drift)4849> **Why this is Phase 0:** Missing files in file maps is the #1 drift source. Check this first.5051Compare the **actual** file tree against **every file-map section** in agent instruction files and docs:52531. List actual files: `ls src/`, `ls config/`, `ls docs/`542. Cross-check against file maps in:5556| File | Section name |57| --- | --- |58| `AGENTS.md` | `## File Structure` |59| `CLAUDE.md` | `## File Map` |60| [FILL: `docs/README.md`] | [FILL: Section name for file tree] |61621. Every real file/directory must appear in all file maps. Flag any missing entries.6364---6566## Phase 1 — Identify What Changed6768```bash69git diff --stat70git log --oneline -1071```7273Classify the change type:74- **Config change** → schema, examples, stats references may be stale75- **UI/layout change** → styling guide, layout constraints may be stale76- **New feature** → user flow, architecture, changelog, roadmap may be stale77- **File added/removed/renamed** → file trees, path references may be stale78- **Agent rule change** → must propagate to ALL agent instruction files7980---8182## Phase 2 — Run Automated Drift Checks8384> **Do not use ad-hoc grep commands or create temporary scripts for checks that existing tooling already covers.**8586```bash87# Run all automated tests88npm test8990# [FILL: Add any project-specific drift/stats scripts here]91```9293Verify policy alignment:94- [ ] Agent docs do not hardcode mutable totals as static source-of-truth values95- [ ] If a snapshot number is documented, it is clearly labeled with snapshot context/date9697---9899## Phase 3 — Verify Path Conventions100101```bash102# Find references to potentially stale paths103grep -rn "[FILL: old-path-prefix]" docs/ .agent/ .claude/ .github/ AGENTS.md CLAUDE.md --include="*.md"104```105106**Current correct conventions:**107- [FILL: Path convention 1 — e.g. "No leading `/` or `./` in asset paths"]108- [FILL: Path convention 2 — e.g. "Assets at `assets/{name}.ext`"]109110---111112## Phase 4 — Verify Config ↔ Code Consistency113114> **Use existing tooling** — do not write ad-hoc scripts for these checks.115116All automated checks from Phase 2 cover config consistency. If they all pass, this phase is done.117118---119120## Phase 5 — Cross-Check Agent Files121122### 5a. File map sync (structural)123124Verify all files/directories in the repo are listed in the agent file maps (see Phase 0).125126### 5b. Fact consistency127128All agent instruction files must agree on:129130| Fact | Must match across |131| --- | --- |132| Coding rules | AGENTS.md, CLAUDE.md, copilot-instructions.md, coding-standards.md |133| Security requirements | AGENTS.md, CLAUDE.md, copilot-instructions.md, coding-standards.md |134| [FILL: Project-specific fact] | [FILL: Which files must agree] |135136---137138## Phase 6 — Workflow & Skill Consistency139140- [ ] `.agent/workflows/doc-audit.md` — This workflow is itself still accurate? (meta-audit)141- [ ] `.claude/skills/doc-audit/SKILL.md` — Same as above?142- [ ] `.github/pull_request_template.md` — Contains explicit docs/ADR/policy alignment gates?143- [ ] [FILL: Any project-specific workflows to check]144145---146147## Phase 7 — Update CHANGELOG148149If any doc fixes were made:150151```markdown152### Fixed153- Documentation drift: updated [specific counts/paths/conventions] across [N] files154```155156---157158## Change → Doc Impact Matrix159160<!-- SETUP: Fill in the impact matrix for your project. -->161162| If you changed… | Update these docs |163| --- | --- |164| **File added/removed/renamed** | AGENTS.md (file structure), CLAUDE.md (file map), docs/ARCHITECTURE.md |165| **Architecture decision** | `docs/decisions/` (add new ADR file) |166| **New feature / bug fix** | `docs/CHANGELOG.md` |167| **Coding rule changed** | AGENTS.md, CLAUDE.md, copilot-instructions.md, coding-standards.md |168| [FILL: Project-specific change] | [FILL: Affected docs] |169170---171172## Drift Severity173174| Level | Description | Action |175| --- | --- | --- |176| 🔴 Critical | Wrong paths, wrong schema, contradictory policy rules | Fix immediately |177| 🟠 High | Missing files in agent file maps, outdated conventions | Fix before next AI-assisted change |178| 🟡 Medium | Missing changelog entry, outdated roadmap | Fix in next doc pass |179| 🟢 Low | Stylistic inconsistency | Fix when convenient |