Skip to content

feat: generate llms.txt for AI agent consumption#73

Merged
Tim Beyer (TimBeyer) merged 8 commits into
mainfrom
feat/llms-txt
May 11, 2026
Merged

feat: generate llms.txt for AI agent consumption#73
Tim Beyer (TimBeyer) merged 8 commits into
mainfrom
feat/llms-txt

Conversation

@TimBeyer
Copy link
Copy Markdown
Collaborator

@TimBeyer Tim Beyer (TimBeyer) commented May 11, 2026

Summary

  • Add scripts/generate-llms-txt.mjs — zero-dependency post-build script that generates llms.txt (curated index with quick start snippet) and llms-full.txt (README + API reference inlined, ~74KB) for AI coding agents
  • Chain the script after astro build in docs-site — deploys automatically with the docs site
  • Add ArkType schema syntax primer to docs/api.md so agents understand type() expressions
  • Fix stray 4-backtick fence in SPEC.md that was wrapping ~1700 lines in a code block

Details

The llms.txt standard (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 links
  • https://contentful.github.io/skill-kit/llms-full.txt — complete docs for context injection

Content is derived from existing markdown sources (no duplication). The script uses only node:fs and node:path.

Test plan

  • cd docs-site && pnpm run build succeeds, outputs both files to dist/
  • llms.txt contains Quick Start snippet, categorized links, source document references
  • llms-full.txt contains README + API Reference with ArkType primer, no SPEC/architecture/hosts
  • Verify SPEC.md renders correctly on GitHub (no stray code block)

🤖 Generated with Claude Code

Tim Beyer (TimBeyer) and others added 7 commits May 11, 2026 16:01
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>
@TimBeyer Tim Beyer (TimBeyer) merged commit 45a809f into main May 11, 2026
9 checks passed
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.

2 participants