feat: ship llms.txt, a guide for LLM coding agents, in the npm and JSR packages #185

Merged
chrnx merged 2 commits from feat/llms-txt into develop 2026-10-31 01:35:10 +00:00
Owner

Part B of the LLM-guidance plan. The other parts:

  • A: Matcha #19, an AGENTS.md in every project, pointing here.
  • C: docs #30, /docs/llms-full.txt.
  • F: Matcha #18, routes/tokens --json.
  • G: an evaluation, in progress.

The file: llms.txt (320 lines, the llms.txt format) at the package root. It is added to files (npm) and publish.include (JSR) and lands at node_modules/@green-tea/core/llms.txt. It covers:

  • the mental model;
  • a complete app with serving per runtime;
  • a cheat sheet of decorators and built-in tokens;
  • responses and errors;
  • validation and streaming;
  • the createApp options;
  • common mistakes from Express and Nest;
  • testing with app.fetch and overrides;
  • inspection with matcha;
  • stability and links.

Verified:

  • Every ts block typechecks against src/ (strict, experimentalDecorators).
  • The main examples run under tsx.
  • Each behavioural claim was checked with a small probe app.
  • npm pack --dry-run and deno publish --dry-run both include the file.
  • npm test passes (1213); npm audit is clean.

Freeze: the public API does not change. This only adds a file to the package (api:check unaffected).

Found while writing it (the RC.1 docs will be fixed in docs #29):

  • An unknown token in overrides fails in boot()/fetch(), not when the app is created.
  • A step cannot declare needs: ['cookies'].
  • events is also a built-in node.
  • app.listen should be awaited.
Part B of the LLM-guidance plan. The other parts: - **A:** Matcha #19, an `AGENTS.md` in every project, pointing here. - **C:** docs #30, `/docs/llms-full.txt`. - **F:** Matcha #18, `routes`/`tokens --json`. - **G:** an evaluation, in progress. **The file:** `llms.txt` (320 lines, the llms.txt format) at the package root. It is added to `files` (npm) and `publish.include` (JSR) and lands at `node_modules/@green-tea/core/llms.txt`. It covers: - the mental model; - a complete app with serving per runtime; - a cheat sheet of decorators and built-in tokens; - responses and errors; - validation and streaming; - the `createApp` options; - common mistakes from Express and Nest; - testing with `app.fetch` and `overrides`; - inspection with `matcha`; - stability and links. **Verified:** - Every `ts` block typechecks against `src/` (strict, `experimentalDecorators`). - The main examples run under `tsx`. - Each behavioural claim was checked with a small probe app. - `npm pack --dry-run` and `deno publish --dry-run` both include the file. - `npm test` passes (1213); `npm audit` is clean. **Freeze:** the public API does not change. This only adds a file to the package (`api:check` unaffected). **Found while writing it** (the RC.1 docs will be fixed in docs #29): - An unknown token in `overrides` fails in `boot()`/`fetch()`, not when the app is created. - A step cannot declare `needs: ['cookies']`. - `events` is also a built-in node. - `app.listen` should be awaited.
chrnx added 2 commits 2026-10-31 01:30:41 +00:00
green-tea is new, so coding agents have no training data on it and
write Express: app.use, next(), res.status().json(). llms.txt states
what differs: the mental model, a complete app, the decorators and
built-in tokens, how to return responses, the options agents usually
need, common mistakes with the correct form, testing, and how to
inspect an app first.

Every code block was typechecked against src/, and each behavioural
claim was checked with a small probe app.

The file ships inside the package, so it always matches the installed
version. matcha's scaffolded AGENTS.md points at it. Only a packaged
file is added; the API is unchanged.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
docs(llms): the node and handler contracts are enforced now
CI / dco (pull_request) Successful in 4s
CI / build (pull_request) Successful in 58s
CI / runtimes (bun) (pull_request) Successful in 49s
CI / runtimes (deno) (pull_request) Successful in 1m3s
CI / runtimes (edge) (pull_request) Successful in 54s
fa788d17da
Follows core's fix: a provider returning its value bare fails the boot,
and a returned Response fails the request. Merge after that fix.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx force-pushed feat/llms-txt from 3b02734aa9 to fa788d17da 2026-10-31 01:30:41 +00:00 Compare
chrnx merged commit df2e4b416d into develop 2026-10-31 01:35:10 +00:00
Sign in to join this conversation.