scripts/generate-llms-txt.ts
Ghost doc — This is a real utility script found at
scripts/generate-llms-txt.ts in the Smithers repository. It generates the llms-full.txt file used to give LLMs full documentation context.Source
Running
What This Demonstrates
- llms.txt convention — Generates a single text file containing all documentation, following the
llms.txtstandard for giving AI models project context. - Shared docs manifest — The generator, route preview server, and browser smoke tests all read the same manifest helper, so route changes do not drift across tooling.
- MDX to Markdown conversion — Strips YAML frontmatter and converts MDX components (
<Warning>,<Tip>,<Note>) to markdown blockquotes. - Navigation-driven sync — Reads
docs/docs.jsonso the exported context tracks the current API tabs and shared sections. - Source URL attribution — Each section includes a source URL back to the live docs page.
Related Validation
tests/docs-artifacts.test.tskeeps the committeddocs/llms-full.txtoutput in sync with the current docs manifest.tests/docs-e2e.playwright.tsexercises docs routes and legacy redirects against a local preview server built from the same source data.