| name | setup-llms-txt | |||||
|---|---|---|---|---|---|---|
| description | Create and configure llms.txt for any website or project. Analyzes project structure, generates a spec-compliant llms.txt, and places it in the correct location for your framework. Optionally generates llms-full.txt as a companion file. Use when setting up llms.txt, updating an existing one, or making a site LLM-friendly. | |||||
| triggers |
|
Create and configure llms.txt for any website or project. This file is a curated Markdown guide served at /llms.txt that helps LLMs understand and use your site.
llms-full.txt is an optional companion file (not part of the core spec) that inlines full content so LLMs can ingest it in one request.
Spec: https://llmstxt.org
Before generating anything, check whether an llms.txt already exists — locally or deployed. If one exists, analyze it for gaps and improve it rather than overwriting.
Examine the project to understand:
- What the site/product does
- Key pages and documentation
- API endpoints (if any)
- Framework being used
Where to gather content from:
README.md— project description, getting starteddocs/orcontent/directories — documentation structure- Package manifests (
package.json,pyproject.toml,Gemfile,composer.json) — name, description, homepage - Route definitions and navigation config — site hierarchy
- Existing sitemap data — as an internal page inventory
- Prefer clean Markdown pages or
.mdendpoints when available
Detect the framework using decisive markers:
| Marker | Framework |
|---|---|
next.config.* |
Next.js |
astro.config.* |
Astro |
gatsby-config.* |
Gatsby |
nuxt.config.* |
Nuxt |
svelte.config.* |
SvelteKit |
vite.config.* (no framework-specific config) |
Vite/React |
docusaurus.config.* |
Docusaurus |
mkdocs.yml |
MkDocs |
conf.py (with Sphinx imports) |
Sphinx |
.eleventy.js or eleventy.config.* |
11ty |
_config.yml (with Jekyll patterns) |
Jekyll |
config.toml or hugo.toml |
Hugo |
manage.py |
Django |
Flask app entrypoint (app.py with Flask import) |
Flask |
config/routes.rb |
Rails |
artisan |
Laravel |
remix.config.* or app/routes/ |
Remix |
# Check for common framework markers
ls package.json next.config.* astro.config.* nuxt.config.* docusaurus.config.* mkdocs.yml conf.py .eleventy.js manage.py artisan 2>/dev/null
# Find key content
find . -name "*.md" -o -name "*.mdx" | head -20
ls -la public/ static/ docs/ content/ 2>/dev/null
# Check for existing llms.txt (local)
ls -la public/llms.txt static/llms.txt llms.txt 2>/dev/null
# Check for existing llms.txt (deployed, if URL is known)
curl -s "https://YOUR_SITE/llms.txt" | head -5Create the file following the official format. The structure must be:
- H1 heading (required) — project or site name
- Blockquote (optional) — short summary
- Free-form prose (optional) — additional context before any H2 sections
- H2 sections — file lists where every bullet contains a Markdown hyperlink with an optional description
Important: H2 sections are file lists. Every bullet under an H2 must contain a Markdown hyperlink. Non-link metadata (base URLs, email addresses, social handles) belongs in the free-form prose before the first H2, not inside H2 sections.
A ## Optional section indicates content that LLMs and tools may skip when context is limited. Place lower-priority links here.
# [Site/Product Name]
> [One-line description of what the site does]
[Product] provides [core value prop]. The API base URL is https://api.example.com. For support, contact support@example.com.
## Docs
- [Getting Started](/docs/getting-started): How to get started with [Product]
- [API Reference](/docs/api): Full API documentation
- [Examples](/docs/examples): Code examples and tutorials
## API
- [Authentication](/docs/auth): How to authenticate API requests
- [Rate Limits](/docs/rate-limits): API rate limiting details
- [Endpoints](/docs/endpoints): Available API endpoints
## Optional
- [Pricing](/pricing): Plans and pricing
- [Blog](/blog): Latest updates and articles
- [Changelog](/changelog): Product updates
Guidelines:
- Use Markdown format
- Start with
#heading and>blockquote summary - Place non-link metadata (URLs, emails, social) in free-form prose before H2 sections
- Every bullet under an
##heading must contain a[text](url)hyperlink - Use
## Optionalfor secondary content that can be skipped - Write clear, brief, non-marketing descriptions — imagine explaining the site to someone unfamiliar with it
- Avoid jargon that assumes prior knowledge
- Keep it concise — this is a curated guide, not full docs
Suggest sections based on project type:
- Docs site →
## Docs,## API,## Examples - SDK/library →
## Installation,## Usage,## API - CLI tool →
## CLI,## Commands,## Configuration - Open source →
## Contributing,## Community - Has MCP server →
## MCP - All projects →
## Optionalfor lower-priority links
llms-full.txt is not part of the core llms.txt spec — it is an optional companion file that inlines full content. Focus on producing a strong llms.txt first.
If the project would benefit (especially documentation sites), create an expanded version with full content inline:
# [Site/Product Name]
> [Description]
## Getting Started
[Full getting started content here, not just a link]
## API Reference
[Full API docs inline]
...
Place based on framework. For frameworks with configurable static directories, verify the project's config before assuming the default path.
| Framework | Default Location | Notes |
|---|---|---|
| Next.js | public/llms.txt |
|
| Astro | public/llms.txt |
|
| Gatsby | static/llms.txt |
|
| Hugo | static/llms.txt |
|
| Nuxt | public/llms.txt |
|
| SvelteKit | static/llms.txt |
|
| Vite/React | public/llms.txt |
|
| Remix | public/llms.txt |
|
| Docusaurus | static/llms.txt |
Configurable via docusaurus.config.* |
| Jekyll | Root directory | Copied to _site/ on build |
| 11ty | Root or input directory | Check .eleventy.js for input config |
| MkDocs | docs/ directory |
Or use extra config for custom paths |
| Sphinx | Root directory | Add to html_extra_path in conf.py |
| VitePress | public/llms.txt |
|
| Django | Serve via URL route | urlpatterns + view returning text/plain |
| Flask | Serve via route | @app.route('/llms.txt') |
| Rails | public/llms.txt |
|
| Laravel | public/llms.txt |
|
| Express/Node | Serve via route | See example below |
| Plain HTML | Root directory |
For backend frameworks without a static public directory, serve /llms.txt from a simple route that returns plain text:
// Express example
app.get('/llms.txt', (req, res) => {
res.type('text/plain').sendFile(path.join(__dirname, 'llms.txt'));
});Validation has two parts: spec compliance and delivery best practices.
Spec compliance (required):
- Starts with an H1 heading
- Blockquote summary follows the H1 (if present)
- Any free-form prose comes before the first H2
- Every bullet under an H2 contains a Markdown hyperlink
## Optionalsection (if used) contains only skippable content
Delivery best practices (recommended):
# Check it's accessible
curl -s https://YOUR_SITE/llms.txt | head -20
# Verify content type (should be text/plain or text/markdown)
curl -sI https://YOUR_SITE/llms.txt | grep -i content-type
# Check file size (aim for under 10KB)
curl -s https://YOUR_SITE/llms.txt | wc -cManual checklist:
- File returns HTTP 200
- Content-Type is
text/plainortext/markdown - Content is UTF-8 encoded
- No authentication required to access
- File size is reasonable (under 10KB for llms.txt)
- All linked pages are accessible
LLM smoke test: Paste the generated llms.txt into an LLM and ask basic questions about the site (What does it do? How do I get started? Where are the API docs?). If the LLM can answer accurately, the file is working.
- Non-link bullets in H2 sections — every H2 bullet must contain a
[text](url)hyperlink - Misusing
## Optional— this section has spec-defined semantics; don't use it as a catch-all - Auth-gated links — LLMs cannot log in; only link to publicly accessible pages
- Oversized companion files — keep llms-full.txt under 500KB; it should still be digestible
- Keep llms.txt under 10KB — it's a curated guide, not full docs
- llms-full.txt (if used) can be larger but aim for under 500KB
- Update when you add major features, change docs structure, restructure navigation, or modify API endpoints
- Include API endpoints if you have a public API
- Link to your MCP server if you have one