.toon file uses the TOON format (Token-Oriented Object Notation) — a compact, line-oriented data format that combines YAML-style indentation for objects with CSV-style tabular layout for uniform arrays. TOON is not YAML: it requires explicit array lengths ([N]), supports tabular {field} headers, and has no comment syntax. Smithers compiles .toon files to the same durable execution engine as the Effect builder API.
What Is a TOON File?
A.toon file describes a workflow as structured TOON blocks with embedded prompts and optional inline TypeScript. Smithers compiles it into a typed workflow graph at build time.
agents: block declares named agents — each with a type: (the runtime), a model:, and optional instructions: and tools:. Steps reference an agent by name via agent:. That is a complete workflow — no imports, no schema classes, no Effect boilerplate.
Three-Layer Architecture
Smithers offers three ways to define workflows, each building on the one below:| Layer | Format | When to Use |
|---|---|---|
| TOON | .toon files | Most workflows. Declarative, prompt-first, zero boilerplate. |
| Effect Builder | TypeScript | Advanced control flow, custom services, complex dependency injection. |
| JSX | TSX | Component-based API using React-style JSX syntax. |
Why TOON?
Most AI workflows are prompt-centric: define inputs, call a model with a prompt, get structured output, pass it to the next step. TOON makes that the default path:- No schema ceremony — field types are declared inline
- Prompts are first-class — multi-line prompts live directly in the workflow definition
- Control flow is visual — sequences, parallels, loops, and approvals are node kinds, not nested function calls
- Components are reusable — extract repeated patterns into parameterized components
Minimal Example
A two-step research workflow:report step references {research.summary} — Smithers resolves this as a typed dependency edge, just like needs in the Effect builder.
Control Flow
Steps execute sequentially by default. TOON supports the same control flow primitives as the JSX and Effect APIs.Parallel
Run steps concurrently withkind: parallel:
<Parallel> in JSX or $.parallel() in the Effect builder.
Loops
Repeat steps until a condition is met withkind: loop (equivalent to <Loop> in JSX):
Branching
Choose between paths withkind: branch (equivalent to <Branch> in JSX):
Approvals
Suspend execution for human review withkind: approval:
Agents
Everyprompt: step needs an agent to handle it. Agents are declared in the top-level agents: block and referenced by name on each step.
Agent types
Thetype: field selects the agent runtime. Smithers supports all the same agent backends as the JSX and Effect APIs:
| Type | Runtime | JSX Equivalent |
|---|---|---|
claude-code | Claude Code CLI | ClaudeCodeAgent |
codex | OpenAI Codex CLI | CodexAgent |
gemini | Gemini CLI | GeminiAgent |
pi | PI Coding Agent | PiAgent |
kimi | Kimi CLI | KimiAgent |
forge | Forge CLI | ForgeAgent |
api | AI SDK (direct API) | Agent from ai |
Declaring agents
type— which agent runtime to usemodel— the AI modelinstructions— system prompt / persona- Additional type-specific options (e.g.,
tools,fullAuto,permissionMode,timeoutMs)
Using agents in steps
Importing agents
You can also import agents defined in TypeScript:run: or handler: instead of prompt: do not need an agent — they execute TypeScript directly. See Inline Code for details.
How It Compiles
A.toon file compiles to the same internal graph as a Smithers.workflow(...).build(...) call:
Running a TOON Workflow
Next Steps
- TOON Installation — Install the runtime and optional plugins.
- TOON Quickstart — Build a complete workflow in a single
.toonfile. - Schemas — Define input and output types inline.
- Nodes — All node kinds: step, sequence, parallel, loop, approval, branch, worktree.
- Prompts — Write prompts with interpolation and multi-line syntax.
- Effect Builder API — When you need more power.