> ~/claude-skills/llms-txt

A table of contents for language models.

Generates, updates or validates an llms.txt at the repository root following the llmstxt.org format, so a model can navigate the project instead of grepping it. Curated, not exhaustive: the point of the file is restraint.

Why it exists

A language model dropped into a repository has to work out what matters by reading around. llms.txt tells it directly. The file is a proposal from llmstxt.org: the project name, a one-sentence summary, and the canonical docs in priority order, small enough to fit in a model’s context. Think of it as a table of contents written for a reader with a limited attention budget.

The format is simple and easy to get subtly wrong: a second H1, a heading that goes too deep, a link to a file that was moved. The harder part is editorial. A generated index that lists every Markdown file in the repo is valid and useless.

So this skill curates. The whole point of the file is restraint.

What it produces

# acme-cli

> Command-line client for the Acme API, with offline mode and
> shell completions.

## Docs
- [Getting started](docs/getting-started.md): install, auth,
  first request
- [Configuration](docs/config.md): config file format and
  environment variables

## Optional
- [Changelog](CHANGELOG.md): release history

## Optional has a defined meaning in the format: a model short on context may skip it. Everything non-essential goes there and nothing essential does.

This repository’s own llms.txt is kept with it.

How it works

  1. Discovers candidates: the manifest, root documents such as the README and changelog, everything under docs/, and other Markdown a few levels deep.
  2. Reads and synthesises the name and the one-sentence summary from the manifest and the README.
  3. Sorts the candidates into sections: Docs, Examples, API Reference and Optional.
  4. Writes the draft in the exact shape the format requires.
  5. Validates it and fixes what fails.
  6. Shows you the file, or a diff against the existing one, and writes after a yes.

Modes

Argument What happens
(none) Generates llms.txt at the repo root
full Also generates llms-full.txt, the full text of every linked local doc
validate Checks an existing llms.txt and reports each problem with its line number; changes nothing
update Refreshes an existing file from the current repo

update treats the existing file as curated. It keeps your section names, their order and any description you wrote by hand; it adds links for new docs and removes links whose target is gone.

What validation checks

  • Exactly one H1, and it is the first line.
  • A blockquote summary directly after it.
  • No heading deeper than H2.
  • Every list item is - [Title](url) or - [Title](url): description.
  • Every relative link resolves to a file that exists.
  • No duplicate links.

How the file is written

  • The summary is one factual sentence in the present tense, with no marketing language.
  • Each description is one line of about twelve words that says why the file matters, not what it literally contains.
  • Order within a section is by importance, because a model may stop reading partway.

What it will not do

  • Invent a URL. It links only to files that exist in the repo and to URLs already written in the README or the manifest.
  • Index a secret. Files that look like secrets (.env*, *.pem, credentials*) are skipped and mentioned to you, as is anything gitignored or in build output.
  • Replace an existing llms.txt without showing the diff and getting a yes.