Skip to content

feat(handbook): add LLM-friendly documentation endpoints#54

Merged
nerdalytics merged 7 commits into
trunkfrom
feat/llm-friendly-docs
Apr 4, 2026
Merged

feat(handbook): add LLM-friendly documentation endpoints#54
nerdalytics merged 7 commits into
trunkfrom
feat/llm-friendly-docs

Conversation

@nerdalytics
Copy link
Copy Markdown
Owner

Summary

  • Adds llms.txt, llms-full.txt, and .md endpoints following the llms.txt proposal so LLMs can consume handbook documentation as raw markdown
  • All routes are statically prerendered — no runtime server needed
  • Input validation uses strict allowlists against versions.ts and navigation.ts; no user-supplied strings reach filesystem paths

Endpoints

URL pattern Description
/llms.txt Version index with links to each version's llms.txt
/{version}/llms.txt Page index for a specific version
/{version}/llms-full.txt All pages merged into one document
/{version}/{page}.md Individual page raw markdown with frontmatter

Test plan

  • Run cd handbook && npm run build — no 404 warnings
  • Verify build/llms.txt, build/latest/llms.txt, build/latest/llms-full.txt, build/latest/state.md all exist
  • Verify diff src/routes/latest/state/+page.md build/latest/state.md shows no differences
  • Run npx biome check and npx svelte-check — zero errors

… routes

- Replace __dirname with process.cwd() for ROUTES_DIR — import.meta.url
  resolves to .svelte-kit/output/ at prerender time, not src/
- Extract slugFromHref() helper to replace non-null assertions
- Add explicit return types to entries() functions
- Fix import ordering and formatting per Biome rules
- Remove redundant validation from [page].md route handler —
  readPageMarkdown validates internally
- Use versions.map() instead of Set spread for explicit ordering
- Add --- separator between pages in llms-full.txt for clearer boundaries
@nerdalytics nerdalytics merged commit 3fb1e39 into trunk Apr 4, 2026
12 checks passed
@nerdalytics nerdalytics deleted the feat/llm-friendly-docs branch April 4, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant