Skip to main content
This page is for the AI agent operating Smithers on a human’s behalf. It belongs to the Technical API docs set, which is written for agents, not humans. The human-facing docs are the Product API, starting at What Smithers Is; send humans there. Agents should read this page and the generated llms.txt / llms-full.txt bundles before driving Smithers for a user. The human does not use Smithers by memorizing CLI commands or authoring .tsx workflows. The human talks to you. You decide when Smithers is the right tool, you run the commands, you watch the run, you ask for account-gated decisions, and you return a clear report with evidence. If you remember one rule, remember this:
Do not ask the human to run Smithers commands. The human’s job is to state the outcome, answer product questions, approve gates, and provide credentials or account access when needed. Your job is to operate the harness.
And one more rule that is just as important:
You are an orchestrator, not an implementer. Do the background work through Smithers, not through your own ad-hoc subagents. For anything long-running, multi-step, retryable, or run-while-the-human-is-away, launch a Smithers workflow. Smithers spawns the worker agents and persists every step. Spend your time observing the run, clearing gates, and reporting. If you want parallel help, point your own subagents at monitoring the Smithers run (tailing events, summarizing, flagging gates), never at re-doing the work a workflow should own. The moment you’re tempted to spawn a subagent to “go build/fix/research this in the background,” that is the signal to run a workflow instead.
And one rule about the operator boundary:
The workspace Gateway is the run control plane. A controller, Bun cron job, monitor, bot, or custom client must use smithers-orchestrator/gateway-client or Gateway RPC/REST for run discovery, health, events, launch/resume/cancel, approvals, signals, scores, and node output. Never open SQLite, PGlite, or Postgres from an operator script; never query _smithers_*; never import openSmithersStore or CLI-internal findAndOpenDb; and never probe stores by adding --backend to ps or inspect. Direct store access is reserved for runtime implementation, migration, and maintainer diagnostics. One-shot public CLI commands are fine; durable automation goes through the Gateway.
And a rule about how hard to push before involving the human:
Drive workflows to completion; fix what you can yourself. When a run is launched to run to completion (especially “in the background” or while the human is away), it is your job to make it succeed end-to-end. Try your hardest. If the run fails or stalls on anything you are capable of fixing (a bad model id, a non-executable binary, a stale/polluted baseline, an over-strict or mis-wired gate, a verdict that is written to disk but not captured into the workflow’s done-check, a bug in a generated workflow), fix it and resume the run. Keep a keeper/supervisor loop alive so the run survives owner-exits, and re-run after each fix. Only stop and involve the human for (a) an explicit human approval gate in the workflow, or (b) something only a human can do (credentials, account access, irreversible outward actions). Do not hand a self-fixable issue back to the human and wait. A human who said “run it to completion” and walked away expects a finished result, not a report asking permission to apply an obvious fix. Diagnosing the problem is not the finish line; a working run is.

The operating loop

Use this loop for broad, ambiguous, risky, long-running, or multi-agent work:
  1. Capture the word barf. Let the human describe the outcome in messy language.
  2. Grill for missing context. Ask focused questions only when the answer cannot be discovered safely from the repo, docs, services, or prior artifacts.
  3. Convert the request into a goal-based spec. Define done, non-goals, acceptance criteria, risks, and the evidence the human needs to see.
  4. Design the Smithers run. Decide the workflow, agents, gates, retry loops, observability, assumption tests, and report artifacts before you start.
  5. Validate the workflow shape. Render the graph with bunx smithers-orchestrator graph <workflow> (there is no up --dry-run; the graph verb is the dry-run path, rendering the graph without executing or persisting anything) or dry-run evals before launching expensive or destructive work.
  6. Run with observability. Use hot reload while authoring, inspect the run while it executes, and suggest the UI when a visual state would help the human.
  7. Report with evidence. Produce a concise Markdown or HTML report that links to outputs, tests, traces, screenshots, GIFs, and the run ID.
This is the “make a harness that makes the app” pattern: the first deliverable is not just code. It is a durable system that can plan, build, verify, observe, and explain the code.

Translate human prompts into Smithers work

Route a most-trivial edit that takes only a few turns directly. Route any clear single-goal task through smithers oneshot, which launches quickly in the background with a live chat and diff UI; one strong agent finishes repo-wide goals of up to roughly 300k tokens in a single oneshot run, so a large goal alone never justifies a workflow. Use a full workflow when the task is genuinely multi-goal in shape: staged phases, approval gates, durable loops, parallel work, or a need for reuse. Clarify ambiguous goals before launching either form.

Context engineering

Context engineering is the work of turning a vague request into a runnable, auditable job. Start by writing down:
  • Outcome: what should exist when the run is done.
  • Finish line: how you will know the work is done.
  • Evidence: what the human needs to see to trust the result.
  • Constraints: files, platforms, budgets, style, deadlines, and non-goals.
  • Unknowns: assumptions that must be proven before you build on them.
Then gather context before executing:
  • Read repo docs, README files, package scripts, tests, issue trackers, design docs, and previous Smithers outputs.
  • Inspect relevant source files and architecture before making a plan.
  • Read third-party docs or APIs when behavior could have changed.
  • Prefer small probes over confident guesses for external services.
  • Store the resulting spec somewhere durable, such as .smithers/specs/, docs/, or an artifact directory, so later agents can consume it.
Good Smithers prompts are goal-based, not instruction soup:
Use explicit stop conditions. “Keep going until tests pass” should also carry a cap, a fallback, and a report path. Infinite effort is not a finish line.

Backpressure verification

Backpressure means the workflow pushes evidence back against the agent’s claim that the task is done. Do not accept “looks good” as verification. Encode checks that can fail. Use these Smithers patterns:
  • <CheckSuite> for parallel command or agent checks with one pass/fail verdict.
  • <ScanFixVerify> for scan -> fix -> verify -> report loops.
  • <ReviewLoop> or <LoopUntilScored> when the exit condition is reviewer approval or a score threshold.
  • Eval suites for repeatable workflow-level regressions with JSON reports.
  • Task scorers for telemetry such as schema adherence, faithfulness, relevance, latency, and custom LLM-judge checks.
A strong run defines backpressure before execution:
Backpressure should be independent where possible. The agent that wrote the code should not be the only judge. Use a second reviewer agent, command-based tests, eval cases, or real service probes.

Assumption tests

Assumption tests are small probes that prove third-party libraries, APIs, cloud services, entitlements, or chains behave the way the plan assumes. Write them before the main build when the assumption is expensive to unwind. Examples: Keep assumption probes narrow. They should answer one question and produce evidence. If the probe fails, report that the product plan must change before implementation continues.

Observability-first runs

If you cannot see the run, you cannot operate it well. For local and development work, use the CLI surfaces yourself:
For any long-lived observer or controller, start from the workspace singleton and use its typed API:
The status response provides the verified url for the current workspace. If no singleton is running, start bunx smithers-orchestrator gateway under the controller’s service manager, then create a SmithersGatewayClient with that URL. Do not assume port 7331 and do not parse the Gateway runtime state file; gateway status performs workspace and process identity verification for you. Use getRun/listRuns for snapshots and streamRunEventsResilient for live health instead of polling storage files. If Gateway startup reports SMITHERS_MIGRATION_REQUIRED, stop there and perform the explicit smithers migrate operation (after preserving the legacy store), then restart the Gateway. Do not delete the database, pin a different backend in a monitoring script, or pass --backend to read/control commands to make the error disappear. Backend selection is a Gateway boot/deployment concern; once the Gateway is healthy, every operator uses the same API regardless of whether the store behind it is SQLite, PGlite, or Postgres. Use serve mode when you need HTTP status, SSE events, remote approvals, or Prometheus metrics:
Use the observability stack when the work needs traces, metrics, dashboards, or a reviewer evidence bundle:
Enable OpenTelemetry export when you need trace-level proof, then include the Grafana, Loki, Tempo, or Prometheus links and query results in the final report. For debugging, correlate run ID, node ID, attempt, event stream, agent trace, and any application logs. When the human would benefit from seeing the work, suggest the UI and operate it for them:
  • bunx smithers-orchestrator monitor [RUN_ID] opens the Smithers Monitor: a zero-setup live view over every run in the workspace (grouped runs, execution tree, event log, approvals inbox), optionally focused on one run. It observes only; it launches nothing.
  • bunx smithers-orchestrator gui <path> opens the workspace view.
  • bunx smithers-orchestrator ui RUN_ID opens a workflow custom UI when the Gateway is running and the workflow has a registered UI.
  • Gateway and custom UI streams expose run state, frames, approvals, node output, and DevTools snapshots for richer visual monitoring.
Phrase this as: “I can open the Smithers UI for this run so you can watch the plan, gates, and evidence live.” Do not phrase it as homework for the human.

Hot validation loop

Use hot mode while authoring or tuning a workflow:
The graph command validates the rendered shape without executing the whole job. Hot mode lets workflow and prompt edits apply on the next render frame while finished tasks stay persisted. Rules of thumb:
  • Use --hot true for prompt wording, task body, and non-schema workflow edits.
  • Restart fresh when output schemas or task ID shapes change.
  • Keep task IDs stable and data-derived so resume and hot reload can preserve completed work.
  • After a hot edit, inspect the graph or next frame to confirm the workflow now does what you intended.
Do not treat hot reload as magic. Validate that the new frame mounted the right tasks, the old completed tasks stayed completed, and any changed prompt actually reached the next agent attempt.

Reports for the human

End every substantial Smithers run with a human-readable report. Markdown is fine; HTML is better when screenshots, GIFs, traces, or tables make the result clearer. Write it as an artifact, for example:
The report should include:
  • Summary: what changed, what shipped, and what did not.
  • Run metadata: workflow name, run ID, branch or worktree, key node IDs.
  • Prompt and spec: the interpreted goal, acceptance criteria, and non-goals.
  • Verification: commands, tests, evals, scorers, reviewer verdicts, and failures.
  • Assumption tests: probes run, outputs captured, and open risks.
  • Observability: event excerpts, metrics/traces, logs, screenshots of dashboards.
  • Visual evidence: screenshots, GIFs per major screen, and walkthrough video for UI or product work.
  • Human decisions: approvals requested, decisions made, and remaining gates.
  • Next steps: exact options, tradeoffs, and what you recommend.
For UI work, the minimum visual report is screenshots for each important state. The stronger report includes GIFs for interactions and a walkthrough video that clicks through every user-visible flow. If you cannot capture visuals, say why and include the command or environment blocker you observed.

Failure protocol

When a run fails or pauses unexpectedly, stay in the operator role:
  1. Inspect the run with why, inspect, events, node, and logs.
  2. Identify whether the blocker is code, tests, credentials, an approval gate, a third-party service, rate limits, missing context, or a workflow bug.
  3. If it is fixable by you, fix it or resume from the correct frame.
  4. If it needs the human, ask for the smallest decision or credential needed.
  5. Report what happened, what evidence supports that diagnosis, and what you are doing next.
Bad response:
Good response:
The human should feel like they are talking to a careful operator, not like they were handed a control plane manual.

Minimal checklist

Before launching:
  • Outcome, finish line, and evidence are written down.
  • Missing context has been researched or asked for.
  • Third-party assumptions have probes or are explicitly marked as risks.
  • Workflow graph (bunx smithers-orchestrator graph <workflow>, the dry-run path) or eval dry-run has been checked.
  • Backpressure checks exist and can fail.
  • Observability path is chosen.
  • Report artifact path is chosen.
While running:
  • Watch the run.
  • Use the UI when visual state, approvals, or steering would help.
  • Feed failures back into the workflow instead of manually papering over them.
  • Keep the human updated in plain English.
Before closing:
  • Regenerate or collect the final evidence.
  • Write the report.
  • Include screenshots, GIFs, videos, logs, traces, eval reports, and reviewer verdicts when they exist.
  • Explain remaining risk honestly.
  • Commit or open the review artifact only after verification is complete.