agentleFS
jasonmichaelbell78-creatorjasonmichaelbell78-creator/sonash-v0/.claude/skills/doc-ecosystem-audit/SKILL.md

doc-ecosystem-audit

Skill2 starsChanged 9 months agoApache-2.0View on GitHub

Comprehensive diagnostic of the documentation ecosystem — 16 categories across 5 domains with composite health scoring, trend tracking, patch suggestions, and interactive finding-by-finding walkthrough. Covers index sync, link integrity, content quality, generation pipelines, and documentation coverage.

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When to use: When you want to understand the overall health of the documentation system, identify broken links, orphaned docs, stale …

    line 26
  2. Distinctive:

    When the task doesn't match this skill's scope -- check related skills

    line 40
  3. Distinctive:

    When a more specialized skill exists for the specific task

    line 41
  4. Distinctive:

    Run the audit script:

    line 70
  5. Distinctive:

    Create a session decision log file:

    line 78
  6. Very specific:

    Create .claude/tmp/ directory if it doesn't exist

    line 80
  7. Very specific:

    Write report to .claude/tmp/doc-audit-report-{YYYY-MM-DD}.md.

    line 149
  8. Very specific:

    Process verification: Run __tests__/ suite:

    line 151

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “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
<!-- prettier-ignore-start -->

Document Version: 1.0 Last Updated: 2026-02-24 Status: ACTIVE

<!-- prettier-ignore-end -->

Doc Ecosystem Audit

Deep diagnostic of the entire documentation ecosystem — documentation index (DOCUMENTATION_INDEX.md), cross-references, content quality, generation pipelines (docs:index, doc-optimizer), and coverage completeness. Produces per-category scores, a composite health grade (A-F), trend tracking across runs, and an interactive walkthrough with patch suggestions.

Invocation: /doc-ecosystem-audit

When to use: When you want to understand the overall health of the documentation system, identify broken links, orphaned docs, stale content, or pipeline issues. Complementary with /hook-ecosystem-audit (hook audit owns hook internals; doc audit owns documentation quality).


When to Use

  • |
  • User explicitly invokes /doc-ecosystem-audit

When NOT to Use

  • When the task doesn't match this skill's scope -- check related skills
  • When a more specialized skill exists for the specific task

CRITICAL RULES (Read First)

Read .claude/skills/_shared/ecosystem-audit/CRITICAL_RULES.md and follow all 8 rules. The rules below are summaries — the shared file is authoritative.

  1. CHECK for saved progress first (MUST)
  2. ALWAYS run the script first (MUST)
  3. ALWAYS display the dashboard (MUST)
  4. Use conversational Q&A for decisions (MUST) — NEVER use AskUserQuestion
  5. SAVE progress after every decision (MUST)
  6. Show patch suggestions inline (SHOULD)
  7. Create TDMS entries (MUST) for deferred findings
  8. Save decisions (MUST) to session log

Compaction Guard

Read .claude/skills/_shared/ecosystem-audit/COMPACTION_GUARD.md for the full compaction guard protocol (state file schema, resume, save, cleanup).

State file path: .claude/tmp/doc-audit-progress.json


Phase 1: Run & Parse

  1. Run the audit script:
node .claude/skills/doc-ecosystem-audit/scripts/run-doc-ecosystem-audit.js
  1. Parse the v2 JSON output from stdout (progress goes to stderr).
  2. Create a session decision log file:
    • Path: .claude/tmp/doc-audit-session-{YYYY-MM-DD-HHMM}.jsonl
    • Create .claude/tmp/ directory if it doesn't exist
  3. Save initial progress state to .claude/tmp/doc-audit-progress.json with currentFindingIndex: 0, the full findings data, score, and grade.

Phase 2: Dashboard Overview (compact)

Present a compact header with composite grade and domain breakdown:

Doc Ecosystem Health: {grade} ({score}/100)  |  Trend: {sparkline} ({delta})
{errors} errors · {warnings} warnings · {info} info  |  {patches} patch suggestions

┌──────────────────────────────────────┬───────┬──────────┬──────────────┐
│ Category                             │ Score │ Rating   │ Trend        │
├──────────────────────────────────────┼───────┼──────────┼──────────────┤
│ D1: Index & Registry Health          │       │          │              │
│   Index-Filesystem Sync              │  {s}  │ {rating} │ {trend}      │
│   Index Metadata Accuracy            │  {s}  │ {rating} │ {trend}      │
│   Orphaned Documents                 │  {s}  │ {rating} │ {trend}      │
├──────────────────────────────────────┼───────┼──────────┼──────────────┤
│ D2: Link & Reference Integrity       │       │          │              │
│   Internal Link Health               │  {s}  │ {rating} │ {trend}      │
│   Cross-Doc Dependency Accuracy      │  {s}  │ {rating} │ {trend}      │
│   Anchor Reference Validity          │  {s}  │ {rating} │ {trend}      │
│   Image Asset References             │  {s}  │ {rating} │ {trend}      │
├──────────────────────────────────────┼───────┼──────────┼──────────────┤
│ D3: Content Quality & Compliance     │       │          │              │
│   Header & Frontmatter Compliance    │  {s}  │ {rating} │ {trend}      │
│   Formatting Consistency             │  {s}  │ {rating} │ {trend}      │
│   Content Freshness                  │  {s}  │ {rating} │ {trend}      │
├──────────────────────────────────────┼───────┼──────────┼──────────────┤
│ D4: Generation Pipeline Health       │       │          │              │
│   Docs Index Correctness             │  {s}  │ {rating} │ {trend}      │
│   Doc Optimizer Pipeline             │  {s}  │ {rating} │ {trend}      │
│   Pre-commit Doc Checks              │  {s}  │ {rating} │ {trend}      │
├──────────────────────────────────────┼───────┼──────────┼──────────────┤
│ D5: Coverage & Completeness          │       │          │              │
│   Documentation Coverage             │  {s}  │ {rating} │ {trend}      │
│   Agent Doc References               │  {s}  │ {rating} │ {trend}      │
│   README & Onboarding                │  {s}  │ {rating} │ {trend}      │
└──────────────────────────────────────┴───────┴──────────┴──────────────┘

Rating badges: good = "Good", average = "Avg", poor = "Poor"

Then say: "Found N findings to review. Walking through each one (impact-weighted)..."


Phase 3: Finding-by-Finding Walkthrough

Read .claude/skills/_shared/ecosystem-audit/FINDING_WALKTHROUGH.md for the full walkthrough protocol (finding card, decisions, patches, delegation, batching).

Sort findings by impactScore descending (highest impact first). DEBT entries use source_id: review:doc-ecosystem-audit-{date}.


Phase 4: Summary & Actions

Read .claude/skills/_shared/ecosystem-audit/SUMMARY_AND_TRENDS.md for the summary template, trend report template, and verification re-run template.

Write report to .claude/tmp/doc-audit-report-{YYYY-MM-DD}.md.

Process verification: Run __tests__/ suite:

node --test .claude/skills/doc-ecosystem-audit/scripts/__tests__/*.test.js

Phase 5: Trend Report (if previous runs exist)

Uses trend report template from SUMMARY_AND_TRENDS.md.

History: .claude/state/doc-ecosystem-audit-history.jsonl


Phase 6: Self-Audit (Verification)

Uses verification re-run template from SUMMARY_AND_TRENDS.md.

Re-run script:

node .claude/skills/doc-ecosystem-audit/scripts/run-doc-ecosystem-audit.js

Category Reference

Domain 1: Index & Registry Health (20% weight)

CategoryWhat It Checks
Index-Filesystem SyncEvery DOCUMENTATION_INDEX.md entry has a matching file on disk and v.v.
Index Metadata AccuracyTitles and descriptions in the index match actual file content
Orphaned DocumentsFiles in docs/ referenced by at least one other document

Domain 2: Link & Reference Integrity (25% weight)

CategoryWhat It Checks
Internal Link HealthAll markdown links text resolve to existing files
Cross-Doc Dependency AccuracyCross-doc dependency checker exists and rules are valid
Anchor Reference ValidityLinks with #section anchors point to existing headings
Image Asset ReferencesImage references (![](path), <img src>) point to real files

Domain 3: Content Quality & Compliance (20% weight)

CategoryWhat It Checks
Header & Frontmatter ComplianceRequired elements: title heading, Purpose, Version History
Formatting ConsistencyHeading levels, code block language tags, list markers
Content FreshnessDocs not >30 days behind their referenced code files

Domain 4: Generation Pipeline Health (20% weight)

CategoryWhat It Checks
Docs Index Correctnessnpm docs:index script exists, referenced file exists, index valid
Doc Optimizer Pipelinedoc-optimizer skill present, state files valid
Pre-commit Doc ChecksDoc-related stages present in .husky/pre-commit

Domain 5: Coverage & Completeness (15% weight)

CategoryWhat It Checks
Documentation CoverageMajor systems (from package.json, directories) have docs
Agent Doc ReferencesAll docs referenced in CLAUDE.md exist and are non-empty
README & OnboardingREADME, CLAUDE.md, AI_WORKFLOW.md present and consistent

Benchmarks & Checker Development

Read .claude/skills/_shared/ecosystem-audit/CLOSURE_AND_GUARDRAILS.md for scoring conventions and the checker development guide.

16 categories. Domain weights: D1=20%, D2=25%, D3=20%, D4=20%, D5=15%.

Data Sources

SourcePathContent
Documentation IndexDOCUMENTATION_INDEX.mdMaster doc listing
Documentation filesdocs/**/*.mdAll documentation
Main AI configCLAUDE.mdAI rules and doc references
AI workflowAI_WORKFLOW.mdSession startup, navigation
Pre-commit pipeline.husky/pre-commitDoc quality gates
Cross-doc depsscripts/check-cross-doc-deps.jsDependency rules
Doc optimizer.claude/skills/doc-optimizer/Optimizer state and config
Package configpackage.jsonnpm scripts for doc tools
State files.claude/state/*.jsonlAudit history and trends

Version History

VersionDateDescription
1.12026-03-25Extract shared patterns to _shared/ecosystem-audit/
1.02026-02-24Initial implementation

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.