# llms-txt

Publishes an [`llms.txt`](https://llmstxt.org) for a project: a short map for an agent that consumes the package or site, covering what the project is, the conventions across its surface, which areas exist, and where the detail lives. The file is generated from the project's public surface, never written by hand, and a drift check in CI keeps it current.

## When to use

- "add an llms.txt" / "generate llms.txt"
- "our llms.txt is out of date"
- "make this package readable by agents"
- a project gains or reshapes a public API and its `llms.txt` has to follow

## Who the file is for

`llms.txt` is for someone **using** the published package or site. `AGENTS.md` is for someone **changing** the repo. The skill keeps the two apart: public surface goes in `llms.txt`, and build commands, invariants, and traps stay in `AGENTS.md`.

## What it does

1. **Decides whether the project needs one.** A published library, a docs site, or a service with a public API does. An application with no public surface, or a private repo nobody installs, does not; the skill says so and stops.
2. **Finds the surface's source of truth:** something the project already maintains, so the file cannot describe an API that is gone. For a TypeScript library that is the package entry read through the compiler API; for a CLI, the command table its parser is built from; for an HTTP service, the route table or OpenAPI document; for a docs site, the content collection.
3. **Writes a generator** in the package's existing scripts directory. The generator derives every name, count, and grouping. It throws when the surface grows a member its mapping table does not cover. It claims nothing it has not checked on disk, and leaves out values that change on release, such as the package version. The file it writes says it is generated and names the generator. The generator has a default write mode, a `--check` mode that names the files that differ, and a mode that reports gaps.
4. **Follows the llmstxt.org format:** an H1, a one-line summary, body prose, and link sections with absolute URLs. A `## Optional` section holds what an agent short on context may skip.
5. **Decides where it ships**, and says why: in the package's `files` (read from `node_modules`, possibly offline), on the docs site at `/llms.txt`, or both, generated by one function and covered by one drift check.
6. **Reports the documentation gap without filling it.** Generating from the real surface exposes the undocumented members. The skill prints them, files an issue with that output and a proposed order of work, and links the issue from the change. Writing the missing docs is separate work.
7. **Wires `--check` into the command CI already runs.** It reads the workflows first, including any reusable workflow they call, and adds the check to that command's chain instead of adding a new job.
8. **Verifies:** runs the generator and `--check`, changes one thing in the surface to confirm the file follows, then reverts it, runs the formatter and full verify, and confirms the file appears in the built site when it ships there.

An existing `llms.txt` that is already generated is regenerated. One written by hand is replaced by a generator, and its prose is carried over only after you see the before and after.

## How to invoke

Ask for it directly, or run `/llms-txt` where slash commands are supported.

## What it produces

A generator script, the `llms.txt` file or files it writes, a drift check in the command CI already runs, and an issue that lists the documentation gap. The report says what the file covers, where it ships and why, what the drift check is attached to, and how large the gap is.

## Install

```sh
npx skills add repobuddy/repobuddy --skill llms-txt
```
