Skip to content
better-result
Esc
navigateopen⌘Jpreview
On this page

Documentation for agents

Give coding agents precise better-result context through Markdown exports, llms.txt, and portable repository skills.

This site is built for browser readers and plain-text-searching coding agents from the same source.

Machine-readable routes

Route Use
/llms.txt Compact documentation index
/llms-full.txt Full documentation corpus
/<page>.md Clean Markdown for one page
/<page>.mdx Original MDX source for one page
/agent-readability.json Generated readability metadata

Point an agent at the smallest source that answers its question. A focused page costs less context than the full corpus.

Portable skills

The repository ships two agent skills:

Install with skills.sh-compatible tooling:

npx skills add dmmulroy/better-result@adopt-better-result
npx skills add dmmulroy/better-result@migrate-better-result-3

Prompting contract

Useful agent instructions name the boundary and desired behavior:

Use better-result for the createUser vertical slice. Return tagged domain errors
from validation and persistence, compose them with Result.gen, and exhaustively
map them to the existing HTTP response contract. Do not convert defects to Err.

Avoid asking an agent to “Result-ify everything.” Result boundaries should correspond to caller decisions.

Search vocabulary

Use literal public names in searches and prompts:

  • Result.tryPromise for exceptions, retries, jitter, and abort signals;
  • Result.gen and Result.await for generator composition;
  • TaggedError, matchError, and matchErrorPartial for error unions;
  • Result.codec for validated transport/persistence boundaries;
  • Panic, isPanic, and panic for defects;
  • Result.all, allAsync, partition, and partitionAsync for collections.

Was this page helpful?