agentleFS
terceltercel/spec-forge/skills/audit/SKILL.md

audit

Skill8 starsChanged 4 months agoMITView on GitHub

Audit existing project documentation for quality, completeness, consistency, and code alignment. Scans docs against the actual codebase to find stale references, missing coverage, internal contradictions, and quality issues. Generates a structured findings report with severity levels and actionable fix recommendations. Works on any project with a docs/ directory.

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use delight, teach-impeccable and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • HK-hubSkill

    delight

    Add moments of joy, personality, and unexpected touches that make interfaces memorable and enjoyable to use. Elevates functional to delightful. Use when the user asks to add polish, personality, animations, micro-interactions, delight, or make an interface feel fun or memorable.

    Also in 32 projects that use this

  • HK-hubSkill

    teach-impeccable

    One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.

    Also in 19 projects that use this

  • zwy123zwySkill

    normalize

    将用户随意输入的提示词规范化为结构清晰、便于大模型执行的标准化提示词。适用于需要整理、统一提示词格式时调用。

    Also in 19 projects that use this

  • SkillPilotCHSkill

    level-up

    Eine Automatisierung pro Woche finden, scopen, shippen. Output landet als proposed-Eintrag in cadence.md mit konkreten Implementations-Schritten.

    Also in 12 projects that use this

  • ww-w-aiSkill

    pm-discovery

    PM Agent Team - Automated product discovery, strategy, and PRD generation. Runs PM analysis workflow to produce comprehensive PRD before PDCA Plan phase.

    Also in 3 projects that use this

  • +7 more from HK-hub

The file

Show its rules and text

We split this skill into the rules it gives an agent

25 rules. 0 are common, 20 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 20

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Evidence-based: Every finding must cite a specific file, section, or line — no vague complaints

    line 21
  2. Very specific:

    If a path argument is provided (e.g., /spec-forge:audit ../../other-project), use that as the project root

    line 42
  3. Distinctive:

    If no path, use the current working directory

    line 43
  4. Very specific:

    Verify the target has documentation (check for docs/, README.md, or markdown files)

    line 44
  5. Distinctive:

    If no documentation found, inform the user and stop.

    line 46
  6. Very specific:

    Use AskUserQuestion to ask:

    line 48
  7. Distinctive:

    Code alignment: Should I cross-reference docs against the codebase?

    line 50
  8. Distinctive:

    Do parameter names and types match?

    line 110
  9. Distinctive:

    Do return types match?

    line 111
  10. Distinctive:

    Check feature doc accuracy: Do feature descriptions match the current implementation?

    line 124
  11. Distinctive:

    Check documents against each other for contradictions and coherence:

    line 139
  12. Distinctive:

    Factual consistency: Do different docs make contradictory claims?

    line 144
  13. Distinctive:

    Version/dependency consistency: Do different docs reference different versions of the same thing?

    line 145
  14. Distinctive:

    Link integrity: Do internal cross-references actually point to existing documents/sections?

    line 146
  15. Distinctive:

    Format consistency: Do similar documents follow similar structures?

    line 150
  16. Very specific:

    Write the findings report to {project-docs-path}/audit-report.md (or a user-specified path).

    line 178
  17. Distinctive:

    If the user wants fixes, proceed to Step 8.

    line 276
  18. Distinctive:

    Read the target document

    line 282
  19. Distinctive:

    Only modify the specific section cited in the finding

    line 287
  20. Distinctive:

    Do NOT restructure or rewrite entire documents

    line 288
  21. Distinctive:

    Do NOT add new documents — only fix existing ones

    line 289
  22. Distinctive:

    If a fix requires information you don't have (e.g., the correct API signature), mark it as "needs manual review" instead of guessing

    line 290
  23. Distinctive:

    After all fixes, re-run a quick validation to ensure fixes didn't introduce new issues

    line 291
  24. Distinctive:

    Update the audit report to mark resolved findings:

    line 293
  25. Very specific:

    Incremental audits: If a previous audit-report.md exists, note which findings are new vs.

    line 301

“Common” is measured: kept by at least 6 in 10 of the 175 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Audit — Documentation Quality & Consistency Review

Systematically review existing project documentation for quality, completeness, consistency with code, and internal coherence. Produce a prioritized findings report.

Core Principles

  1. Evidence-based: Every finding must cite a specific file, section, or line — no vague complaints
  2. Code-grounded: Cross-reference documentation claims against the actual codebase
  3. Prioritized: Findings are classified by severity so the user can fix what matters first
  4. Read-only by default: This skill only reads and reports — document modifications require explicit user opt-in (Step 8)
  5. Honest: Report real issues, don't inflate findings to look thorough

Severity Levels

SeverityMeaningExample
CriticalDocumentation is wrong or dangerously misleadingAPI doc shows deleted endpoint, security guide has incorrect auth flow
MajorSignificant gap or inconsistency that causes confusionFeature doc missing for a core module, conflicting architecture descriptions
MinorQuality issue that degrades usefulness but isn't blockingTypos in API params, outdated version numbers, missing examples
InfoObservation or improvement suggestionBetter organization possible, diagram would help clarity

Workflow

Step 1: Determine Audit Scope

Parse the arguments to determine what to audit:

  1. If a path argument is provided (e.g., /spec-forge:audit ../../other-project), use that as the project root
  2. If no path, use the current working directory
  3. Verify the target has documentation (check for docs/, README.md, or markdown files)

If no documentation found, inform the user and stop.

Use AskUserQuestion to ask:

  • Audit focus: Full audit, or focus on a specific area? (Options: Full / API docs only / Feature docs only / Architecture docs only / Custom path)
  • Code alignment: Should I cross-reference docs against the codebase? (Yes / No — skip if docs-only repo like aipartnerup-docs)

Step 2: Document Inventory

Scan the documentation landscape and build a complete inventory.

Fast path (preferred): resolve <sf_scripts> (see @../shared/scripts.md) and run

python3 "<sf_scripts>/sf-scan.py" --root "<project_root>" --docs-only

Use its documents / document_index fields as the starting enumeration — the discovered markdown files plus the requirement IDs each declares — so you do not have to glob and count by hand. The script enumerates; you still judge each document's TYPE (the categories below) and its quality. Fallback: if python3 is unavailable or the script is not found, glob and enumerate by hand as described below.

  1. Glob for all markdown files in the docs directory (and README at root)
  2. Categorize each document by type:
    • api — API reference documentation
    • architecture — Architecture, design, system overview
    • feature — Feature specifications or descriptions
    • guide — How-to guides, tutorials, getting started
    • spec — Protocol specs, conformance, standards
    • decision — ADRs, decision records
    • reference — Data models, type mappings, glossaries
    • meta — READMEs, indexes, navigation docs
    • other — Doesn't fit above categories
  3. Read each document — read enough of each to extract its metadata and claims; for very large files read strategically (headings + relevant sections) rather than a fixed prefix. (The sf-scan enumeration above already supplies the file list and declared IDs, so a fixed first-200-lines metadata pass is unnecessary.)
  4. Record metadata for each document:
    • File path
    • Category
    • Approximate word count
    • Last modified date (from git if available)
    • Key topics covered
    • Cross-references to other docs (internal links)
    • Cross-references to code (file paths, class/function names mentioned)

Display the inventory:

Document Inventory: {project-name}
  Path: {project-root}
  Total documents: {N}

  Category          | Count | Files
  api               |   4   | api/README.md, api/executor-api.md, ...
  feature           |   8   | features/acl-system.md, ...
  guide             |   7   | guides/creating-modules.md, ...
  ...

Step 3: Code Alignment Check

Skip this step if the user opted out in Step 1 (e.g., docs-only repo).

Cross-reference documentation against the actual codebase:

3.1 API Surface Audit

  1. Scan the codebase for public API surfaces: exported functions, classes, interfaces, types, endpoints
  2. Compare against API docs: For each documented API, verify:
    • Does the function/class/endpoint still exist in code?
    • Do parameter names and types match?
    • Do return types match?
    • Are documented examples still valid?
  3. Find undocumented APIs: Public APIs that exist in code but have no documentation

Report findings:

  • Stale API docs: Documented APIs that no longer exist or have changed
  • Undocumented APIs: Code APIs with no corresponding documentation
  • Parameter mismatches: Documented params that don't match code signatures

3.2 Feature Coverage Audit

  1. Identify features in code: Major modules, systems, or functional areas in the codebase
  2. Compare against feature docs: Is each significant feature documented?
  3. Check feature doc accuracy: Do feature descriptions match the current implementation?

Report findings:

  • Undocumented features: Significant code modules with no feature documentation
  • Stale feature docs: Feature docs describing behavior that has changed
  • Missing feature aspects: Feature docs that exist but skip important aspects (config, error handling, limitations)

3.3 Architecture Alignment

  1. Infer architecture from code: Module structure, dependency graph, communication patterns
  2. Compare against architecture docs: Does the documented architecture match reality?
  3. Check for architectural drift: Places where code has evolved away from the documented design

Step 4: Internal Consistency Check

Check documents against each other for contradictions and coherence:

4.1 Cross-Document Consistency

  1. Terminology consistency: Same concept referred to by different names across docs?
  2. Factual consistency: Do different docs make contradictory claims? (e.g., architecture doc says "microservices" but feature doc says "monolith")
  3. Version/dependency consistency: Do different docs reference different versions of the same thing?
  4. Link integrity: Do internal cross-references actually point to existing documents/sections?

4.2 Structural Consistency

  1. Format consistency: Do similar documents follow similar structures? (e.g., all feature docs should have similar sections)
  2. Depth consistency: Are some areas documented exhaustively while others are skeletal?
  3. Naming consistency: File naming conventions, heading styles, code formatting

Step 5: Quality Assessment

Fast path (preferred) for the structural half of Completeness: resolve <sf_scripts> (see @../shared/scripts.md) and run, per document,

python3 "<sf_scripts>/sf-verify-doc.py" "<file>" --type unknown

Audit runs on arbitrary external doc collections, not spec-forge's own doc types, so pass --type unknown to run only the type-agnostic checks — non-empty + titled, well-formed/unique IDs, and no leftover template placeholders — instead of expecting spec-forge sections. Use its findings for the deterministic part of the Completeness dimension below (TBD/TODO markers, placeholder text, empty sections). Whether a doc is missing sections for its own purpose stays a model judgement. Fallback: if python3 is unavailable or the script is not found, check these by hand.

Evaluate each document (or document category) on quality dimensions:

DimensionWhat to Check
CompletenessMissing sections, TBD/TODO markers, placeholder text, empty sections
AccuracyIncorrect information (detected via code alignment or internal contradictions)
ClarityAmbiguous language, undefined terms, unclear instructions
SpecificityVague descriptions vs. concrete details (e.g., "fast" vs. "< 100ms p99")
ActionabilityCan a developer act on this doc without guessing? Are examples provided?
CurrencySigns of staleness — old dates, deprecated references, outdated patterns
NavigationCan readers find what they need? Cross-references, indexes, logical organization

Step 6: Generate Findings Report

Write the findings report to {project-docs-path}/audit-report.md (or a user-specified path).

Report format:

# Documentation Audit Report

> Project: {project-name}
> Audited: {date}
> Scope: {full / api-only / feature-only / etc.}
> Documents reviewed: {N}
> Code alignment: {Yes / Skipped}

## Executive Summary

{2-3 paragraph overview: overall documentation health, biggest strengths, most critical gaps}

## Findings Summary

| Severity | Count | Categories |
|----------|-------|------------|
| Critical |   {n} | {which areas} |
| Major    |   {n} | {which areas} |
| Minor    |   {n} | {which areas} |
| Info     |   {n} | {which areas} |

## Document Health Matrix (optional)

Grade a document only where the letter grade drives a priority action; otherwise summarize its health in prose. The A–D boundaries are undefined, so do not force a grade onto every document just to fill the table — a clear sentence beats pseudo-precision. Include only the rows worth grading.

| Document | Completeness | Accuracy | Clarity | Currency | Overall |
|----------|-------------|----------|---------|----------|---------|
| {path}   | {A/B/C/D}   | {A/B/C/D}| {A/B/C/D}| {A/B/C/D}| {A/B/C/D} |

(A = Excellent, B = Good, C = Needs Work, D = Poor)

## Critical Findings

### CRIT-001: {Finding title}
- **Location**: {file path, section/line}
- **Issue**: {What is wrong}
- **Evidence**: {How you know — code reference, conflicting doc, etc.}
- **Impact**: {Why this matters}
- **Fix**: {Concrete recommendation}

### CRIT-002: ...

## Major Findings

### MAJ-001: {Finding title}
...

## Minor Findings

### MIN-001: {Finding title}
...

## Observations & Suggestions

### INFO-001: {Suggestion title}
...

## Coverage Map

{Mermaid diagram showing documentation coverage — which areas are well-documented vs. gaps}

## Recommended Priority Actions

1. **{Action}** — fixes CRIT-001, CRIT-002 — {estimated effort: small/medium/large}
2. **{Action}** — fixes MAJ-001 through MAJ-003 — {effort}
3. ...

Step 7: Present Results

Display a summary to the user:

Audit complete: {project-name}

  Documents reviewed: {N}
  Findings: {critical} critical, {major} major, {minor} minor, {info} info

  Report: {path-to-audit-report.md}

  Top 3 priority actions:
    1. {action} — {severity} — {effort}
    2. {action} — {severity} — {effort}
    3. {action} — {severity} — {effort}

Use AskUserQuestion to ask:

  • Fix mode: Would you like me to fix any of these issues now?
    • Fix critical findings
    • Fix all findings (critical + major + minor)
    • Just the report, I'll fix manually
    • Fix specific findings (list IDs)

If the user wants fixes, proceed to Step 8.

Step 8: Apply Fixes (Optional)

For each finding the user wants fixed:

  1. Read the target document
  2. Apply the fix described in the finding
  3. Mark the finding as resolved in the report

Rules for fixes:

  • Only modify the specific section cited in the finding
  • Do NOT restructure or rewrite entire documents
  • Do NOT add new documents — only fix existing ones
  • If a fix requires information you don't have (e.g., the correct API signature), mark it as "needs manual review" instead of guessing
  • After all fixes, re-run a quick validation to ensure fixes didn't introduce new issues

Update the audit report to mark resolved findings:

### CRIT-001: {Finding title} [RESOLVED]

Notes

  1. Scope flexibility: The audit can target the current project, a sibling project, or any directory with docs
  2. Incremental audits: If a previous audit-report.md exists, note which findings are new vs. recurring
  3. No false positives: It's better to miss an issue than to report a non-issue. Every finding must have concrete evidence
  4. Respect existing structure: The audit evaluates documentation as-is — it doesn't impose spec-forge's own document structure on projects that use different conventions

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.