---
name: llms-txt-validator
description: Generate and validate a spec-compliant /llms.txt index, /llms-full.txt archive, RFC 8288 discovery headers, and clean Markdown (.md) twins for LLM retrieval and coding agents.
version: 1.0.0
author: Jason Zhu (Yansen Zhu) <https://jasonzhu.ai>
license: MIT
---

# llms.txt Generator & Spec Validator

Use this skill when creating or auditing `/llms.txt` for a SaaS product, developer documentation site, or content hub. Most `/llms.txt` files fail because they dump 500 unfiltered sitemap URLs instead of curating high-signal canonical sources.

## Specification Gates (7 Checks)

### 1. Structural Compliance (llmstxt.org Spec)
- **Single H1:** `# <Site or Brand Name>` on line 1.
- **Concise Blockquote Summary:** Immediately under H1, a 1–3 sentence `> ...` summary stating what the product/site does, who built it, and its canonical domain.
- **Curated H2 Sections:** Group links under clear H2 headings (`## Docs`, `## Primary Research`, `## API & Pricing`, `## Author / Entity`, `## Optional`).
- **Bullet Format:** Every entry must follow `- [Exact Title](https://...): One-line factual description`.

### 2. Signal-to-Noise Weight Budget
- Keep `/llms.txt` strictly **<= 15 KB** (typically 15–40 pillar URLs) so agents can read the whole file in a single cheap context pass.
- Put full archives, changelogs, or complete inline dumps at `/llms-full.txt` and link it under `## Optional`.

### 3. HTTP & Content-Type Hygiene
Verify via `curl -sI https://<domain>/llms.txt`:
- HTTP status is `200 OK` (no redirect chain, no soft-404 HTML page).
- `Content-Type: text/plain; charset=utf-8` (or `text/markdown; charset=utf-8`).
- Never blocked by Cloudflare Bot Fight Mode, geo-fencing, or `robots.txt`.

### 4. Link Integrity & Auth Check
Sample or crawl every URL listed in `/llms.txt`:
- Zero `404`, `403`, `5xx`, or login-walled URLs.
- Prefer direct `.md` twin URLs (e.g. `/docs/auth.md` or `/en/blog/post.md`) where available, since clean Markdown cuts LLM token cost by 60–80% vs bloated HTML.

### 5. RFC 8288 Discovery Header
Add an HTTP `Link` header on the homepage (`/`):
```http
Link: </llms.txt>; rel="describedby"; type="text/plain"
```

### 6. Entity & Author Grounding
Include a dedicated `## About / Canonical Entity` block with the official legal company name, founder name (with disambiguation if needed), canonical `/about` URL, and primary external profiles (GitHub, docs, Zenodo/DOI).

### 7. Output Deliverable
Always return:
1. Pass/Fail scorecard across all 7 gates.
2. Exact broken/bloated URLs to prune.
3. A ready-to-deploy `/llms.txt` draft + Next.js/Cloudflare route config snippet.

