# llms.txt and Markdown exports

URL: /docs/agents/llms-txt
Markdown: /docs/agents/llms-txt.md

> The two llms.txt files for Sakura Lang - this site's Markdown exports, and the language reference in docs/llms.txt that sakura prompt emits.

This page is for anyone feeding Sakura Lang docs to a model. The project has two different
`llms.txt` files: one exports this website's pages, the other teaches a model the language.
Use the language reference to write code and the site exports to read explanations.

| | Site exports | Language reference |
| --- | --- | --- |
| Where | This website: `/llms.txt`, `/llms-full.txt`, `/docs/<page>.md` | The repository: [`docs/llms.txt`](https://github.com/icantcodefyi/sakuralang/blob/main/docs/llms.txt) |
| Contents | These docs pages, as Markdown | The whole core language in one file, written for a model's context |
| How to get it | Fetch the URLs | Read the file, or run `sakura prompt` |
| Use it for | Explanations, the tour, agent tooling docs | Writing Sakura Lang code |

## Site exports [#site-exports]

These URLs export this site's docs as Markdown, so a model can read them without the web page
around them.


| URL | Contents |
| --- | --- |
| [`/llms.txt`](/llms.txt) | An index of every docs page with title, description, and URL, grouped by sidebar section, following the [llms.txt](https://llmstxt.org) convention. |
| [`/llms-full.txt`](/llms-full.txt) | Every docs page concatenated into one Markdown file. |
| `/docs.md` | The docs root as Markdown. |
| `/docs/<path>.md` | Any docs page as Markdown. Append `.md` to its URL. `.mdx` works too. |

```bash
curl https://www.sakuralang.com/llms.txt
curl https://www.sakuralang.com/llms-full.txt
curl https://www.sakuralang.com/docs/tour/effects.md
```

Each exported page starts with its title, its URL, its Markdown URL, and its description. Components are flattened to plain Markdown: callouts become blockquotes and card grids become link lists.

Every rendered page also has a **Copy as Markdown** button and a menu linking to its `.md` version and its source on GitHub.

Use `/llms.txt` to choose pages when the model's context is tight, and a page's `.md` URL to refresh one topic. `/llms-full.txt` is the whole site, so it is much larger than the language reference.

## The language reference: `docs/llms.txt` [#the-language-reference-docsllmstxt]

[`docs/llms.txt`](https://github.com/icantcodefyi/sakuralang/blob/main/docs/llms.txt) is the one-file reference an agent needs to write correct Sakura Lang. It covers:

- the toolchain loop (`sakura check --json`, `sakura test --json`, `sakura run`) and fix impact rules;
- the syntax on one screen, plus the rules agents get wrong (newlines, casing, no call-site type arguments, no named arguments, explicit imports, one lambda form);
- types, refinements, and the derived constraints `Eq`, `Ord`, `Hash`, `Show`, `Schema`;
- effects, `Fail<E>`, `try`/`catch`, defects, handlers, and authority;
- concurrency and memory;
- the most used standard library names;
- common diagnostics and their fixes.

It does not list every library signature. Look those up with the MCP `symbol_query` tool or offline with `sakura doc --search`.

### `sakura prompt` [#sakura-prompt]

```bash
sakura prompt
sakura prompt --budget 8000
```

`sakura prompt` prints the copy of `docs/llms.txt` built into your compiler, so it always matches the version you run. `--budget N` keeps the output under about `N` tokens: it counts four bytes per token and drops whole sections from the end. It is not a real tokenizer, and it does not add library signatures; use `sakura doc <symbol>` or `sakura doc --search <pattern>` for those.

The newest version from the repository, which may be ahead of your installed compiler:

```bash
curl https://raw.githubusercontent.com/icantcodefyi/sakuralang/main/docs/llms.txt
```

## The Sakura skill [#the-sakura-skill]

The [`sakura` skill](/skills/sakura/SKILL.md) adds the compiler workflow, examples and common
repairs to the language reference. The [agents overview](/docs/agents#install-the-sakura-skill)
shows how to download, verify and install it. Its files are served exactly as they are in the
repository, without the Markdown conversion the docs pages get.

## System prompt snippet [#system-prompt-snippet]

A starting point for the system prompt of an agent that writes Sakura Lang:

```text
You write code in Sakura Lang. Before writing code, read the Sakura Lang language reference
(docs/llms.txt, or the output of `sakura prompt`) and follow it exactly. Do not
borrow syntax from other languages.

- Write full signatures first: parameter types, `-> T`, the effect row after
  `!`, the `Fail<...>` error union, and `requires`/`ensures`. Leave bodies as
  typed holes (`?body`) and run `sakura check --json`.
- Fill holes using the `hole` records: expected_type, allowed_effects, locals,
  candidates, contracts_in_scope.
- Apply only fixes with "impact": "local". Never apply a fix whose impact is
  "contract_change" or "authority_change" unless asked. List every
  "interface_change" in your summary for human review.
- Never weaken or delete requires/ensures/where clauses or test bodies to pass
  a check. Never use .trust(@trust(...)) or Secret.expose without a true reason.
- No call-site type arguments and no named arguments: annotate the binding
  (`let rows: List<User> = Sql.query(q)`) and pass records for options.
  Import every non-prelude name explicitly (`import std/http.{Http}` and `import std/request.{Request}`).
- Use `sakura explain <code>` before guessing at a fix.
```

## Next [#next]

[MCP server](/docs/agents/mcp): the compiler tools agents call directly.
