Sakura Lang

llms.txt and Markdown exports

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 exportsLanguage reference
WhereThis website: /llms.txt, /llms-full.txt, /docs/<page>.mdThe repository: docs/llms.txt
ContentsThese docs pages, as MarkdownThe whole core language in one file, written for a model's context
How to get itFetch the URLsRead the file, or run sakura prompt
Use it forExplanations, the tour, agent tooling docsWriting Sakura Lang code

Site exports

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

URLContents
/llms.txtAn index of every docs page with title, description, and URL, grouped by sidebar section, following the llms.txt convention.
/llms-full.txtEvery docs page concatenated into one Markdown file.
/docs.mdThe docs root as Markdown.
/docs/<path>.mdAny docs page as Markdown. Append .md to its URL. .mdx works too.
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

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
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:

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

The Sakura skill

The sakura skill adds the compiler workflow, examples and common repairs to the language reference. The agents overview 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

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

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

MCP server: the compiler tools agents call directly.

Edit on GitHub

Last updated

On this page