10 Core Primitives
Core interaction types with companion elements for results, warnings, actions, and progress.
Standard vocabulary for every surface where AI meets humans â or AI meets AI.
Interactive preview initializes in the browser.
Use the editor and rendered preview after the page hydrates. The docs site is mounted under /grain/.
Grain gives AI producers and interface surfaces one shared contract. A model, orchestration layer, or tool runner can emit Grain once, and adapters can render the same document consistently in the browser, terminal, MCP surface, or agent runtime.
The documentation site is treated as part of the product contract. If an example on this site stops parsing or rendering, that is a repo bug rather than a low-priority docs mismatch.
Use the canonical preview command from the repository root:
pnpm docs:previewThe docs site is deployed as a GitHub Pages project site under /grain/, so the correct local preview URL is http://127.0.0.1:<port>/grain/. Opening / is expected to return 404.