audit-docs

Orchestrate sequential documentation audits with checkpointing and resumption.

24 stars

Best use case

audit-docs is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Orchestrate sequential documentation audits with checkpointing and resumption.

Teams using audit-docs should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/audit-docs/SKILL.md --create-dirs "https://raw.githubusercontent.com/leogodin217/leos_claude_starter/main/.claude/skills/audit-docs/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/audit-docs/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How audit-docs Compares

Feature / Agentaudit-docsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Orchestrate sequential documentation audits with checkpointing and resumption.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Audit Docs

Orchestrate sequential documentation audits with file-based checkpointing. Enables resumption across sessions.

## Output Location

```
docs/audits/
  YYYY-MM-DD_HHMMSS/
    manifest.yaml         # checkpoint state
    summary.md            # generated after all audits complete
    findings/
      actors.md
      behaviors.md
      ...
```

## Process

### 1. Check for Incomplete Session

Look for existing sessions:
```
Glob: docs/audits/*/manifest.yaml
```

For each manifest found, read it. If any has `status: auditing` or `status: summarizing`:

```
AskUserQuestion:
  question: "Found incomplete audit session from {session_id}. How should I proceed?"
  options:
    - "Resume the incomplete session"
    - "Start a fresh audit (abandons previous)"
```

If "Resume" → skip to Phase 2 or 3 based on manifest status.
If "Start fresh" → continue to initialization.

If no incomplete sessions found, proceed to initialization.

### 2. Initialize Session

Create session folder:
```
session_id = current timestamp as "YYYY-MM-DD_HHMMSS"
folder = docs/audits/{session_id}/
```

Create the folder structure:
```
docs/audits/{session_id}/
docs/audits/{session_id}/findings/
```

Discover architecture docs:
```
Glob: docs/architecture/*.md
```

**Exclude:**
- `README.md` (index/navigation)
- `PROCESS.md` (workflow documentation)

Write initial manifest:
```yaml
session_id: "{session_id}"
created_at: "{ISO timestamp}"
status: "auditing"
docs:
  - name: "actors.md"
    path: "docs/architecture/actors.md"
    status: "pending"
    error: null
  - name: "behaviors.md"
    path: "docs/architecture/behaviors.md"
    status: "pending"
    error: null
  # ... all discovered docs
```

Report: "Created audit session {session_id} with {N} docs to audit."

### 3. Audit Phase (Sequential, Checkpointed)

Read manifest to find docs with `status: pending`.

For each pending doc, **one at a time**:

1. **Update manifest** - set doc `status: "auditing"`

2. **Launch doc-auditor agent** (NOT in background):
   ```
   Task(
       subagent_type="doc-auditor",
       prompt="Audit this architecture doc against implementation.\n\ndoc_path: {doc_path}",
       run_in_background=false
   )
   ```

3. **Write findings file** - take agent response and write to `findings/{doc_name}`:
   ```markdown
   # Audit: {doc_name}

   **Audited:** {ISO timestamp}
   **Doc path:** {doc_path}

   ## Findings

   {findings from agent, numbered list}

   ## Verified Accurate

   {verified items from agent, bullet list}
   ```

4. **Update manifest** - set doc `status: "complete"`

5. **Report progress**: "Completed {n}/{total}: {doc_name} - {X} findings"

6. **Continue to next pending doc**

**If agent returns error:** Set doc `status: "error"`, `error: "{message}"`, continue to next doc.

**Checkpoint guarantee:** After each doc, manifest reflects current state. If context exhausts, next session resumes from manifest.

### 4. Summary Phase

Once all docs have `status: complete` or `status: error`:

1. **Update manifest** - set `status: "summarizing"`

2. **Read all findings files** from `findings/` folder

3. **Generate summary.md**:
   ```markdown
   # Documentation Audit Summary

   **Session:** {session_id}
   **Completed:** {ISO timestamp}

   ## Overview

   - Docs audited: {total}
   - Docs with findings: {count with findings}
   - Docs verified accurate: {count with no findings}
   - Docs with errors: {count with errors}

   ## Findings

   ### {doc_name}

   {copy findings section from that doc's file}

   ### {doc_name}

   ...

   ## Verified Accurate

   - {doc_name}
   - {doc_name}
   - ...

   ## Errors

   - {doc_name}: {error message}
   - ...
   ```

4. **Update manifest** - set `status: "complete"`

5. **Report**: "Audit complete. Summary written to docs/audits/{session_id}/summary.md"

### 5. Present and Ask for Approval

Display the summary to the user (read and output summary.md content).

Then ask:
```
AskUserQuestion:
  question: "How should I proceed with documentation updates?"
  options:
    - "Fix all findings"
    - "Show me the specific changes first"
    - "Skip updates for now"
```

### 6. Apply Fixes (If Approved)

For each finding to fix:

1. Read the doc
2. Locate the incorrect section
3. Edit to match implementation
4. Follow "Code Is Truth" principle:
   - Prune duplicated details (link to code instead)
   - Keep rationale and invariants
   - Remove stale content

Report each change made.

### 7. Verification (Optional)

After fixes, offer to re-run audit on modified docs only:
```
AskUserQuestion:
  question: "Want me to verify the fixes?"
  options:
    - "Yes, re-audit modified docs"
    - "No, I'll review manually"
```

---

## Manifest Schema

```yaml
session_id: str        # "YYYY-MM-DD_HHMMSS"
created_at: str        # ISO 8601 timestamp
status: str            # "auditing" | "summarizing" | "complete"
docs:
  - name: str          # "actors.md"
    path: str          # "docs/architecture/actors.md"
    status: str        # "pending" | "auditing" | "complete" | "error"
    error: str | null  # error message if status=error
```

---

## Findings File Format

```markdown
# Audit: {doc_name}

**Audited:** {ISO timestamp}
**Doc path:** {path}

## Findings

1. **{title}**
   - Doc says: "{quote from doc}"
   - Code does: {actual behavior}
   - Location: {file}:{line}

2. **{title}**
   ...

## Verified Accurate

- {item verified correct}
- {item verified correct}
```

---

## Doc-to-Code Mapping

The doc-auditor agent discovers code paths from within the doc itself:

1. **Explicit references:** Look for `src/fabulexa/...` paths in the doc
2. **Code References section:** Many docs have a table linking topics to files
3. **Naming convention:** `{name}.md` often maps to `src/fabulexa/{name}/`

The agent should NOT rely on a hardcoded mapping.

---

## Example: Fresh Run

```
User: /audit-docs

Claude: Checking for incomplete sessions...
        No incomplete sessions found.

        Creating audit session 2025-01-21_143022 with 10 docs to audit.

        Auditing actors.md...
        Completed 1/10: actors.md - 2 findings

        Auditing behaviors.md...
        Completed 2/10: behaviors.md - 0 findings

        ...

        Audit complete. Summary written to docs/audits/2025-01-21_143022/summary.md

        # Documentation Audit Summary
        ...

        How should I proceed with documentation updates?
        [Fix all findings] [Show changes first] [Skip updates]
```

## Example: Resume After Context Exhaustion

```
User: /audit-docs

Claude: Checking for incomplete sessions...
        Found incomplete audit session from 2025-01-21_143022.
        Progress: 6/10 docs complete.

        How should I proceed?
        [Resume the incomplete session] [Start a fresh audit]

User: Resume

Claude: Resuming session 2025-01-21_143022...

        Auditing simulation.md...
        Completed 7/10: simulation.md - 1 finding

        ...
```

Related Skills

verify-sprint

24
from leogodin217/leos_claude_starter

Spec-fidelity verification tracing requirements through code.

session

24
from leogodin217/leos_claude_starter

Analyze Claude Code session transcripts — search, summarize, list, or inspect how a session went.

role-educator

24
from leogodin217/leos_claude_starter

Course designer mode for creating exercises, configs, and QA criteria.

role-architect

24
from leogodin217/leos_claude_starter

System architect mode for designing interfaces, contracts, and architecture decisions.

review-tests

24
from leogodin217/leos_claude_starter

Comprehensive test review using parallel test-reviewer agents.

review-sprint

24
from leogodin217/leos_claude_starter

Post-implementation mechanical audit of sprint deliverables.

issue

24
from leogodin217/leos_claude_starter

Create, list, and resolve review issues. Critical issues get individual files for research; warnings and gaps go to a quick-fix checklist.

implement-sprint

24
from leogodin217/leos_claude_starter

Automated sprint implementation with context discipline and quality gates.

get-started

24
from leogodin217/leos_claude_starter

Interactive setup guide for configuring CLAUDE.md and CAPABILITIES.md.

eval-sprint

24
from leogodin217/leos_claude_starter

Adversarial evaluation of sprint spec before implementation.

create-sprint

24
from leogodin217/leos_claude_starter

Guide sprint planning from scope assessment to spec artifacts.

arch-review

24
from leogodin217/leos_claude_starter

Review architecture documents against code implementation and principles.