Skip to content
documenting-with-audit logo

Documentation Auditing

documenting-with-audit

Automated documentation auditing - ensures CLAUDE.md coverage, updates stale docs, recommends structural improvements

SKILL.md

Full skill instructions

Documentation Auditing

Knowledge for automated documentation auditing. Defines state tracking, scope system, generation templates, and output formats.

Purpose

Documentation drifts from code. This skill provides knowledge for:

  • CLAUDE.md coverage in meaningful directories
  • Automatic doc updates when code changes
  • Freshness tracking via git commits + timestamps
  • Structural improvement recommendations

State File: .docsaudit.yaml

Tracks audit state for all docs.

Format:

version: 1

ignore:
  - node_modules/​**
  - .git/​**
  - dist/​**
  - __pycache__/​**

max_age_days: 90

audits:
  README.md:
    commit: abc123
    date: 2025-11-19T10:30:00Z
    scope: ["**/​*"]

  src/​auth/​CLAUDE.md:
    commit: def456
    date: 2025-11-15T09:00:00Z
    # No scope = directory default (src/​auth/​**/​*)

Bootstrap: If missing, create with sensible defaults, scan existing docs, initialize with current HEAD.

Scope System

Scope = glob patterns defining which files a doc describes.

Default Scope (Automatic):

  • README.md (root) -> **/​* (whole project)
  • src/​auth/​CLAUDE.md -> src/​auth/​**/​*
  • docs/​api.md -> docs/​**/​*

Explicit Override:

docs/​api.md:
  scope: ["src/​api/​**/​*"]  # Track API code, not docs dir

Independent Docs:

CONTRIBUTING.md:
  scope: []  # Explicit empty = no code dependencies

Staleness Triggers:

  1. Files in scope changed since commit
  2. More than max_age_days since date

CLAUDE.md Generation

Analysis approach:

  • Read directory structure and file list
  • Sample code: imports/​exports, class/​function names, module patterns
  • Check existing README/​comments
  • Understand purpose and relationships

Template:

# [Module Name]

## Purpose
[1-2 sentences: what this does]

## Key Components
- [file/​class]: [purpose]
- [file/​class]: [purpose]

## Dependencies
- Uses: [other modules]
- Used by: [other modules]

## Notes
[Important context, conventions, gotchas]

Principles:

  • 2-line CLAUDE.md better than none
  • Add value, avoid obvious
  • Focus on non-obvious context
  • Explain "why" not "what"

Examples:

# tests/​fixtures/​auth

JWT tokens and auth payloads for testing.
Tokens are expired but have valid structure.
# scripts/​deployment

Production deployment utilities.
Run via `just deploy <env>` - never manually.
Handles DB migrations, health checks, rollback.

Coverage Decisions

Create CLAUDE.md when:

  • Any meaningful code/​content
  • Logic, utilities, modules
  • Config, data, assets needing explanation
  • Test fixtures, scripts, migrations

Ignore only:

  • Build artifacts (dist/, pycache)
  • Dependencies (node_modules/)
  • Git internals (.git/)

Sanity Check Patterns

Consolidate: >70% content overlap between docs Move: Doc location vs scope mismatch (e.g., docs/​database.md with scope src/​db/​**/​*) Delete: Scope patterns match zero files Split: Doc >500 lines with multiple distinct topics Merge: Multiple tiny docs (<50 lines each) with related scopes

Present recommendations, don't auto-apply - bigger decisions need human judgment.

Output Format

Documentation Audit Report

Coverage (CLAUDE.md files):
  Created (N):
    + path/​to/​new.md (reason)

  Un-ignored (N):
    + path/​to/​unignored.md (reason)

Freshness (content updates):
  Updated (N):
    ~ path/​to/​updated.md (summary)

  Already current (N):
    ✓ path/​to/​current.md

Recommendations:
  ⚠ Issue: description
  ⚠ Issue: description

Files changed: N
Review: git diff
Commit: git commit -am "docs: automated audit"

Symbols:

  • + Created/​added
  • ~ Updated/​modified
  • ✓ Already current
  • ⚠ Recommendation

Default Ignore Patterns

ignore:
  - node_modules/​**
  - .git/​**
  - dist/​**
  - build/​**
  - __pycache__/​**
  - "*.pyc"
  - .pytest_cache/​**
  - .mypy_cache/​**
  - coverage/​**
  - htmlcov/​**

Add project-specific: generated code, vendor dependencies, build outputs, IDE files.

Philosophy

Comprehensive coverage: CLAUDE.md everywhere it adds value. Even 2-line docs beat nothing. Context is cheap, confusion is expensive.

Automated maintenance: System does the work. Git provides review. Commit or revert.

Continuous improvement: Regular audits catch drift. Sanity checks improve structure. Documentation evolves with code.

Trust but verify: Automation creates/​updates. Human reviews via git. Best of both worlds.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View