feat: generate llms.txt for AI agent consumption#73
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a post-build script that produces two files for AI agent consumption: - llms.txt: curated index with links to docs site pages and source files - llms-full.txt: full documentation inlined (README, SPEC, API, Architecture, Hosts) The script runs automatically after `astro build` and writes to dist/. No new dependencies — uses only node:fs and node:path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
A ```````` on line 317 was opening a code block that didn't close until the end of the file, preventing everything after the step builder example from rendering as markdown. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove SPEC.md, architecture, and hosts reference from the full dump - Keep only README + API Reference (~72KB, no redundancy) - Reorder: API Reference before SPEC in source list - Add inline Quick Start snippet to llms.txt index Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a "Schema Syntax" section at the top of the API reference explaining common type() patterns (required/optional fields, arrays, unions, nested objects, reusable schemas). Agents unfamiliar with ArkType can now understand the schema expressions used throughout. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show all three skill types in the llms.txt index so agents can immediately identify the pattern they need. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Explain where reference files live, how they're discovered at build time, and how refs.load() resolves them at runtime - Document automatic validation retry behavior (engine re-prompts with error until schema passes or maxVisits is hit) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
François (Lp-Francois)
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/generate-llms-txt.mjs— zero-dependency post-build script that generatesllms.txt(curated index with quick start snippet) andllms-full.txt(README + API reference inlined, ~74KB) for AI coding agentsastro buildin docs-site — deploys automatically with the docs sitedocs/api.mdso agents understandtype()expressionsSPEC.mdthat was wrapping ~1700 lines in a code blockDetails
The
llms.txtstandard (adopted by Anthropic, Stripe, Vercel, Cloudflare, 900+ sites) makes documentation accessible to AI agents helping developers. Files are served at:https://contentful.github.io/skill-kit/llms.txt— structured index with linkshttps://contentful.github.io/skill-kit/llms-full.txt— complete docs for context injectionContent is derived from existing markdown sources (no duplication). The script uses only
node:fsandnode:path.Test plan
cd docs-site && pnpm run buildsucceeds, outputs both files todist/llms.txtcontains Quick Start snippet, categorized links, source document referencesllms-full.txtcontains README + API Reference with ArkType primer, no SPEC/architecture/hosts🤖 Generated with Claude Code