Expand description
Layered, Obsidian-ready documentation vault generator.
The docs generator turns the cgx graph into a markdown vault organised by the
Diátaxis-ish layout described in cgx-docs:
00-Overview/— Architecture.md, Glossary.md10-PublicAPI/— one note per community’s exported surface20-Architecture/— Communities, CrossClusterDeps, EntryPoints30-Modules/<community>/<file>.md— per-file notes with prompt packets40-Risk/— Hotspots, ComplexityHigh, DeadCode, Duplicates50-Ownership/— Owners, BlameGraph
cgx never calls an LLM. Each module note ends with a <!-- cgx-prompt --> block
that contains all context the user’s AI agent needs to produce prose without
re-exploring the repo. The agent runs outside cgx.
Modules§
- incremental
- Per-file slice-hash tracking, persisted to
~/.cgx/<repo_id>/docs_state.json. - label
- Replace cgx’s dominant-node-name community labels with labels derived from the common path prefix of nodes in each community. Much more readable.
- layered
- Diátaxis-ish layered vault writer.
- obsidian_
detect - Best-effort detection of an Obsidian vault on the user’s machine.
- project
- Detect “what is this project?” by walking every manifest in the repo and cross-referencing declared dependencies with actual imports in source code.
- prompt_
packet - Builds the
<!-- cgx-prompt -->block embedded in every module note. - prompts_
index - Helper for
cgx docs prompts— scan the vault for module notes whose<!-- cgx-prompt -->block hasn’t been filled in yet. - role
- Heuristic role classifier for a source file. Drives the TL;DR badge and a frontmatter tag in each module note.
- wiki_
link - Wiki-link / markdown-link formatting + safe filename conversion.
Structs§
- Docs
Options - Options that flow from CLI flags /
DocsConfiginto the generator. - Docs
Report - Stats returned by
generate_vault.
Enums§
- Docs
Mode - Mode of generation.
- Docs
Target - User-selected output target for
cgx docs. - Wiki
Link Style
Functions§
- generate_
vault - Main entry point — generate (or refresh) a docs vault for the repo indexed in
db.