Directory Layout
Why This Structure
- MDX prompts — Prompt engineering is separate from orchestration logic. You can iterate on prompts without touching code.
- Schema files — Each step has a
.schema.tsexporting a Zod schema and TypeScript type. Schemas auto-create SQLite tables and validate agent output. - One component per step — Each step (Discover, Implement, Review, etc.) is a React component, making workflows composable and independently testable.
- Thin workflow.tsx — The root file just composes components. All logic lives in component files.
- Shared agents — A single
agents.tsconfigures all models, making it easy to swap between CLI and API agents.
Key Files
smithers.ts — Schema Registry
All Zod schemas are registered in one place. createSmithers() generates typed SQLite tables and returns typed hooks:
agents.ts — Model Configuration
See Model Selection for the full dual-agent setup pattern with CLI and API SDK agents.
config.ts — Shared Constants
Centralize tunable values so they are easy to adjust:
preload.ts + bunfig.toml — MDX Support
Enable .mdx imports in Bun:
workflow.tsx — Root Composition
The root file should be thin — just composing components:
components/index.ts — Re-exports
run.sh — Launch Script
package.json
tsconfig.json
The Component Pattern
Each step follows the same three-file pattern:1. Schema (Component.schema.ts)
2. Prompt (Component.mdx)
{props.schema} variable is auto-injected by Smithers with a JSON example generated from the Zod schema.
3. Component (Component.tsx)
Next Steps
- MDX Prompts — Deep dive on MDX for system prompts and per-step prompts.
- Implement-Review Loop — The ValidationLoop component pattern.
- Dynamic Tickets — Agent-driven ticket discovery.
- Patterns — Naming conventions, output access patterns, and more.