Indexing and Generated Files
This repository commits generated Markdown indexes so canon, reference, lore, story, open-question, summary, topic, and time-period views are easy to inspect.
Generated Directory
generated/ contains deterministic Markdown views derived from hand-authored source docs.
Core generated views include:
generated/content-index.mdgenerated/canon-index.mdgenerated/open-questions.mdgenerated/timeline-overview.mdgenerated/validation-report.mdgenerated/topics.mdgenerated/layers/generated/time/generated/summaries/
Do not hand-edit generated files. Update source docs or the generator, then regenerate.
Do not manually maintain Canon Index, Open Questions, or Timeline Overview. These files are generated views.
Generator
The generator lives at tools/generate-indexes.ts.
It scans:
reference/lore/stories/- an explicit allowlist of root foundation documents
It intentionally skips folder README.md files so local navigation pages do not become canon index entries.
Contributor docs under docs/ are not indexed as canon content by default. If a contributor doc needs to become an indexed foundation document, add it intentionally and update this guidance.
Source Doc Responsibilities
New content PRs should update source docs, then run the generator.
- Canon inclusion is determined by committed source documents and their layer, not by draft/candidate labels.
- Timeline data belongs in source doc
Time periodsmetadata, not in a manual timeline. - Open questions belong in source doc
## Open Questionssections, not in a manual global list. - Summaries, atomic notes, related documents, topics, regions, and cultures should be maintained in source docs so generated views stay useful.
If generated output is wrong, fix the source doc metadata or fix the generator.
Commands
Regenerate committed indexes:
npm run generate:indexes
Check that committed indexes are current:
npm run generate:indexes:check
Run source Markdown linting:
npm run lint:md
Auto-fix supported Markdown lint issues:
npm run lint:md:fix
Run the full local check suite:
npm run lint
Commit Hooks
Lefthook installs a local pre-commit hook through the npm prepare script.
On normal local git commit, the hook:
- runs
npm run lint:md:fixon staged Markdown files outsidegenerated/and.obsidian/ - re-stages fixed Markdown files
- runs
npm run generate:indexes:check
Generated Markdown is not linted directly. Regenerate it with npm run generate:indexes.
Agents such as Claude Code will run this hook when they use normal local Git commits. Commits made with --no-verify or through non-local APIs can bypass local hooks.
CI
generate-indexes.yml runs on pull requests and pushes to main.
The workflow:
- installs Node
- installs dependencies
- runs
npm run generate:indexes - fails if
generated/has uncommitted differences
Validation
Review generated/validation-report.md after structural changes. It highlights missing summaries, invalid metadata labels, broken local Markdown links, stale generated files, and other documentation issues.