| 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?"
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:
indexion plan documentation .
indexion plan documentation --format=github-issue .
indexion plan documentation --format=json .
For a quick per-file listing of undocumented items:
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.
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:
indexion plan reconcile --scope=package-docs .
indexion plan reconcile --scope=tree-docs .
indexion plan reconcile --doc='docs/**/*.md' .
indexion plan reconcile --doc-spec=markdown .
Timestamp strategies:
indexion plan reconcile --git .
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.
indexion doc graph src/config/
indexion doc graph --format=dot src/
indexion doc graph --format=d2 src/
indexion doc graph --format=text src/
indexion doc graph --format=json src/
indexion doc graph --title="KGF Dependencies" --output=deps.mmd src/kgf/
Analysis Workflow
indexion plan documentation --style=coverage .
indexion grep --undocumented src/
indexion plan reconcile --format=md .
indexion doc graph --output=deps.mmd src/
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. Use plan reconcile to 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
--git flag 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.