Skip to content
tl-docs-audit logo

tl-docs-audit

Audit existing documentation for gaps, staleness, and sync issues. Generates sync reports with actionable findings. Use when reviewing doc coverage, finding outdated docs, or syncing docs with code.

toddlevy/tl-agent-skills0installs0stars

SKILL.md

Full skill instructions

<!-- Copyright (c) 2026 Todd Levy. Licensed under MIT. SPDX-License-Identifier: MIT -->

Documentation Audit

Audit existing documentation for gaps, staleness, and sync issues. Generates actionable sync reports.

When to Use

  • "audit the docs"
  • "review doc coverage"
  • "find outdated docs"
  • "sync docs with code"
  • "docs audit"
  • "check documentation gaps"
  • Joining a project with existing documentation
  • After major refactoring
  • Quarterly documentation review

For creating new docs from scratch, see tl-docs-create.

Outcomes

  • Decision: Sync report with categorized findings
  • Decision: Code-to-docs mapping table
  • Decision: Prioritized list of proposed edits
  • Artifact (optional): Fixed documentation

Configuration Discovery

Before auditing, gather scope through structured questions. See references/​configuration.md for full schemas.

Question Flow Summary

  1. Light scan — Inventory existing docs
  2. Scope — Full audit / Changed files only / Specific areas
  3. Output — Report only / Report + fixes
  4. Fix confirmation — Per-finding approval (if fixing)

Phase 1: Feature Inventory

Scan the codebase for documentable elements before comparing.

What to Inventory

CategoryWhere to LookWhat to Extract
Public APIsrc/​index.ts, exported modulesFunctions, classes, types
Configurationconfig/, env files, schema filesOptions, defaults, constraints
Environment Variables.env.example, config loadersVariable names, services, required vs optional
CLI Commandspackage.json scripts, bin/Command names, options, examples
Routes/​Endpointsroutes/, api/, controllersHTTP methods, paths, request/​response
Database SchemaMigrations, drizzle/​schema.tsTables, relations, constraints
Componentscomponents/, ui/Props, variants, usage patterns

Inventory Format

## Feature Inventory

### Public API
- `createUser(options)` — Creates a new user
- `getUser(id)` — Retrieves user by ID

### CLI Commands
- `pnpm dev` — Start dev server
- `pnpm build` — Production build

Phase 2: Doc-First Pass

Walk through existing docs and check coverage against the feature inventory.

Process

  1. List all documentation files
  2. For each file, extract topics and features referenced
  3. Cross-reference against feature inventory
  4. Flag gaps by category

Finding Categories

CategoryDescriptionExample
MissingFeature exists but not documentedAPI endpoint with no docs
OutdatedDoc describes old behaviorRenamed function, changed default
StructuralDoc exists but poorly organizedAll endpoints on one page
OrphanedDoc not linked from anywhereUnreachable page
IncompleteDoc exists but lacks depthOnly signature, no examples

Phase 3: Code-First Pass

Start from code and verify each element has adequate documentation.

Code-to-Docs Mapping

Create a mapping table for ongoing maintenance.

Source PathDoc LocationNotes
src/​api/​users.tsdocs/​api/​users.mdREST endpoints
src/​config/​index.tsdocs/​reference/​config.mdConfig schema
drizzle/​schema.tsdocs/​reference/​database.mdSchema definitions

Verification Checklist

For each code element:

  • Documented somewhere?
  • Documentation accurate to current implementation?
  • Examples work with current API?
  • Linked from appropriate index/​overview page?

Phase 4: Sync Report

Generate a structured report of findings.

Report Template

# Documentation Sync Report

Generated: YYYY-MM-DD
Scope: Full codebase analysis

## Summary

| Category | Count |
|----------|-------|
| Missing | 3 |
| Outdated | 2 |
| Structural | 1 |
| Orphaned | 0 |

## Doc-First Findings

### Missing Content

| Page | Missing | Evidence |
|------|---------|----------|
| `docs/​api/​users.md` | PATCH endpoint | `src/​api/​users.ts:45` exports `updateUser` |

### Outdated Content

| Page | Issue | Correct Info |
|------|-------|--------------|
| `docs/​config.md` | Default port shown as 8080 | Default is 3000 |

## Code-First Gaps

| Feature | Evidence | Suggested Location |
|---------|----------|-------------------|
| `validateEmail` helper | Exported in `src/​utils/​email.ts` | `docs/​reference/​utils.md` |

## Proposed Edits

1. **docs/​api/​users.md** — Add PATCH endpoint documentation
2. **README.md** — Add "Database Setup" section

Phase 5: Optional Fixes

If user selected "Report + fixes", implement proposed edits.

Fix Process

  1. Present each proposed edit for confirmation
  2. Use tl-docs-create writing standards for consistency
  3. Add "Last Updated" date to modified files
  4. Run verification checklist

Lifecycle Integration

Run audits at key moments.

TriggerScopeAction
New feature mergedChanged files onlyCheck for doc gaps
Major releaseFull codebaseComplete sync report
Quarterly reviewFull codebaseStaleness audit
Developer onboardingAreas of responsibilityVerify docs are current

Staleness Indicators

Flag docs as potentially stale if:

  • Not updated in 90+ days
  • References deprecated APIs
  • Links to removed files
  • Mentions outdated dependency versions

Shared Content Handling

When content appears in multiple places, identify the source of truth.

Principles

  1. Edit source, not duplicates — Find the canonical location
  2. Use links over repetition — Reference instead of copying
  3. Sync, don't diverge — If duplication is necessary, ensure consistency

References

Skill References

FilePurpose
references/​configuration.mdAskQuestion flows for scope selection
references/​sync-report.mdFull sync report template

Automated Tooling

  • Vale — Prose linting (style, grammar, terminology)
  • linkinator — Dead link detection
  • alex — Inclusive writing checker
  • markdownlint — Markdown style linting

CI Integration

# .github/​workflows/​docs-lint.yml
jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4
      - run: npx linkinator docs/ --recurse
      - run: npx vale docs/

Related Skills