description: Create, update, audit, and validate repository llms.txt files following llmstxt.org. Use when the user asks to add llms.txt, refresh an existing llms.txt after documentation or specification changes, choose which repository docs to expose to LLMs, reorganize llms.txt sections, fix formatting or links, or compare llms.txt with the current repository structure. Inspect the repository first and preserve useful existing curation instead of regenerating blindly.
Maintain `llms.txt` as a concise, curated map of the repository's useful human-readable documentation for LLMs.
- **Create:** no useful `llms.txt` exists.
- **Update:** an existing file should be refreshed after repository changes.
- **Audit:** validate structure, links, coverage, and stale entries without rewriting unnecessarily.
1. Read the current `llms.txt` if present.
2. Inspect the repository structure, especially README/docs, specifications, examples, API references, configuration guides, and generated documentation entrypoints.
3. Determine what a model actually needs to understand or use the project. Do not dump every file into the index.
4. Preserve useful section names and ordering from an existing file unless they are misleading.
5. Add new relevant docs, update moved/renamed links, and remove stale or redundant entries.
6. Validate all local paths/URLs and the final Markdown shape.
Prefer documents that are:
- canonical rather than duplicated or generated mirrors;
- explanatory rather than raw implementation files;
- stable entrypoints to deeper documentation;
- useful for setup, API usage, architecture, configuration, examples, or specifications.
- dependency lockfiles, binaries, vendored files, build outputs, and generated caches;
- low-value implementation files when a maintained doc explains the same concern;
- duplicated translations unless they are intentionally first-class documentation;
- stale pages superseded by a canonical document.
Follow the current `llmstxt.org` specification. A typical repository file has:
> Optional short project summary.
Optional context paragraph.
- [Getting started](docs/getting-started.md): Setup and first use.
- [API](docs/api.md): Public API reference.
- [Examples](examples/README.md): Extended examples.
Use descriptive link labels and short annotations when they help models choose the right document. Keep the file compact enough to remain a map, not a second documentation site.
When updating an existing file:
- compare against repository changes instead of recreating from scratch;
- preserve intentional curation and comments;
- remove links only when the target is gone, obsolete, duplicated, or clearly low-value;
- avoid churn from cosmetic reordering with no navigation benefit.
- the file is at the intended repository root;
- Markdown is valid and readable;
- every relative link resolves;
- section names reflect the actual content;
- important current docs are represented;
- stale or duplicate entries are gone;
- no sensitive/private paths are exposed in a public repository.
For a compact decision checklist and spec notes, read `references/selection-and-validation.md`.