indexion-documentation
trkbt10/indexion-skills
Assess documentation coverage, detect code-to-doc drift, and visualize module dependencies.
What is indexion-documentation?
Analyzes the state of your documentation by measuring coverage of public APIs, detecting when code has diverged from existing docs, and generating dependency diagrams. Use this to answer "what needs docs?" and "are my docs still accurate?"
- Measure documentation coverage percentage for public APIs with per-package breakdown
- Identify undocumented public functions, types, structs, enums, and traits
- Detect vocabulary divergence between code and documentation to find stale docs
- Generate dependency diagrams in Mermaid, Graphviz, D2, or text format
- Compare code symbols against documentation with timestamp-based drift detection
How to install indexion-documentation
npx skills add https://github.com/trkbt10/indexion-skills --skill indexion-documentation- KGF-supported language (language-agnostic tokenization)
- Git repository (optional, for accurate timestamp-based drift detection)
How to use indexion-documentation
- 1.Run `indexion plan documentation --style=coverage .` to get overall coverage percentage
- 2.Run `indexion grep --undocumented src/` to list specific undocumented items
- 3.Run `indexion plan reconcile --format=md .` to detect code-to-doc drift
- 4.Run `indexion doc graph --output=deps.mmd src/` to generate a dependency diagram
- 5.Review the reconcile report's Vocabulary Divergence table for gap terms and stale docs
Use cases
- Audit a codebase to find which public APIs lack documentation
- Track documentation drift after code refactoring or feature changes
- Generate visual dependency maps for onboarding or architecture documentation
- Prioritize documentation work by identifying high-impact undocumented modules
- Verify that README descriptions match current implementation before release
- Documentation maintainers
- Technical leads managing code quality
- Open-source project maintainers
- Teams with large codebases needing coverage tracking
indexion-documentation FAQ
Any public declaration paired with a `///` doc comment counts as documented. Note: marker-only comments (`///|`) count as documented even without descriptive text. Check `doc_preview` in output to assess quality beyond coverage.
Auto-generated skeleton READMEs (API listings only) have high divergence because they lack descriptive vocabulary about what the code does. Enrich them with explanations beyond just exporting items.
Use `--git` for accurate timestamps in collaborative projects (requires git history). Use `--mtime-only` for faster checks without git dependency. If you fixed docs but haven't committed, `--mtime-only` will detect the fix but `--git` won't.
Clear the cache with `rm -rf .indexion/cache/reconcile`. This happens after schema changes or indexion upgrades.
No. Reconcile only checks code → docs direction (code terms missing from docs). To detect docs referencing nonexistent features, manually compare each README against `indexion <command> --help`.
Full instructions (SKILL.md)
Source of truth, from trkbt10/indexion-skills.
name: indexion-documentation description: Documentation analysis — assess coverage, detect code-to-doc drift with plan reconcile, visualize dependencies with doc graph. Answers "what needs docs?" and "are docs still accurate?"
indexion documentation — Documentation Analysis
Assess documentation state and detect drift. This skill covers the
evaluation side of the documentation lifecycle: what exists, what's
missing, what's stale. For building READMEs, see indexion-readme.
"What needs documentation?"
# Quick coverage overview — how much of the public API is documented?
indexion plan documentation --style=coverage .
Reports:
- Overall coverage percentage (documented / total pub items)
- Per-package breakdown with README presence
- Functions vs types coverage split
Output example:
Overall Coverage: 81% (2285/2806)
Functions: 89%, Types: 75%
For a detailed plan with prioritized action items:
# Full plan with priorities and package inventory
indexion plan documentation .
# As a GitHub Issue for tracking
indexion plan documentation --format=github-issue .
# JSON for scripting
indexion plan documentation --format=json .
For a quick per-file listing of undocumented items:
# Which pub declarations lack doc comments?
indexion grep --undocumented src/
How detection works: Uses KGF tokenization to find visibility keywords
(pub, public, export) paired with declaration keywords (fn, struct,
enum, type, trait). Associates /// doc comments with declarations.
Language-agnostic — works for any KGF-supported language.
Caveat: ///| marker-only comments count as "documented" even without
descriptive text. Check doc_preview in the output for quality, not just coverage.
"Are my docs up to date?"
Detect drift between implementation code and documentation.
# Full reconcile report in markdown
indexion plan reconcile --format=md .
This compares code symbols against documentation and reports:
- Vocabulary divergence: source code terms missing from co-located docs
- Stale docs: code changed after docs were last updated
- Missing docs: code modules with no documentation coverage
Read the report:
The Vocabulary Divergence table shows distance (0-100%) between code vocabulary and documentation. 90%+ distance means the README is essentially unrelated to the current code. Check the Gap Terms column for specific missing vocabulary.
Scoped checks:
# Check only package-level docs
indexion plan reconcile --scope=package-docs .
# Check only tree-level docs
indexion plan reconcile --scope=tree-docs .
# Check specific documents
indexion plan reconcile --doc='docs/**/*.md' .
indexion plan reconcile --doc-spec=markdown .
Timestamp strategies:
# Use git commit timestamps (more accurate for collaborative projects)
indexion plan reconcile --git .
# Use file mtimes only (faster, no git dependency)
indexion plan reconcile --mtime-only .
Cache and drift:
plan reconcile maintains a cache at .indexion/cache/reconcile/. After schema
changes or indexion upgrades, the cache can become stale and cause deserialization
errors. Clear it:
rm -rf .indexion/cache/reconcile
"Show me the dependency structure"
Generate dependency diagrams for understanding module relationships.
# Mermaid diagram (default — embeddable in GitHub README)
indexion doc graph src/config/
# Other formats
indexion doc graph --format=dot src/ # Graphviz DOT
indexion doc graph --format=d2 src/ # D2
indexion doc graph --format=text src/ # ASCII text
indexion doc graph --format=json src/ # Machine-readable
# Custom title and output file
indexion doc graph --title="KGF Dependencies" --output=deps.mmd src/kgf/
Analysis Workflow
# 1. What's the current state?
indexion plan documentation --style=coverage .
# 2. What specific items lack docs?
indexion grep --undocumented src/
# 3. Has code drifted from existing docs?
indexion plan reconcile --format=md .
# 4. What does the dependency structure look like?
indexion doc graph --output=deps.mmd src/
# 5. Fix flagged docs, re-verify
indexion plan reconcile --format=md .
Common Pitfalls
"plan reconcile shows 90%+ divergence everywhere"
- Auto-generated skeleton READMEs (API listing only) have high divergence because they lack the vocabulary of the actual implementation. Enrich them with descriptions of what the code does, not just what it exports.
"plan documentation says 100% coverage but docs are wrong"
- Coverage measures presence of doc comments, not accuracy. A
///|marker counts as documented. Useplan reconcileto check content accuracy.
"plan reconcile crashes on startup"
- Cache deserialization error after schema changes. Clear it:
rm -rf .indexion/cache/reconcile
"plan reconcile detects drift I already fixed"
- The
--gitflag uses commit timestamps. If you fixed docs but haven't committed, mtime-based detection (--mtime-only) will see the fix, but git-based won't.
Reconcile only checks implementation -> docs direction. It detects code terms
missing from docs, but does NOT detect docs referencing nonexistent CLI options.
For that direction, compare each README against indexion <command> --help manually.
Related skills
More from trkbt10/indexion-skills and the wider catalog.
indexion-readme
Initialize, generate, and assemble project READMEs from templates, doc comments, and configuration.
indexion-sdd
Generate SDD requirements from RFCs/specs and verify implementation conformance with quantitative drift detection.
indexion-refactor
Detect and eliminate code duplication at textual, structural, and conceptual levels using indexion analysis.
indexion-segment
Split text into contextual chunks for RAG/embedding pipelines using divergence, TF-IDF, or punctuation strategies.
indexion-kgf
Debug KGF specs by inspecting tokenization, parse events, and extracted edges from source files.
indexion-wiki
Maintain project wikis with change tracking, structural linting, and code-to-doc drift detection.