Scaffold the Dispatcher
A new hire shows up for their first shift at the bike shop. Before they touch a wrench or sell a tune-up, they need to know one thing: who they are at that counter. Are they a robot reading prices off a screen, or a front-desk advisor who asks what the bike is doing before quoting anything?
Our agent needs the same grounding: who it is at the counter. With eve, that identity lives in instructions.md, an always-on file the model reads on every turn. A clear persona lets the agent act like a trustworthy advisor before it has tools.
Let's scaffold a fresh agent the way you'd start any real eve project, watch it answer like a generic chatbot, then give it a personality. For now, it only needs a model and an identity so we can talk to it in the terminal.
Outcome
A scaffolded agent that answers in the Spoke & Mirror front-desk voice in the dev TUI, before it has any tools.
Hands-on exercise
Scaffold it
One command creates the whole project:
npx eve@latest init spoke-and-mirror
cd spoke-and-mirrorinit creates a project, installs dependencies, and initializes a Git repo. The first time we run it, we'll get this message:
⚠ 1 setup issue: model provider not linked · /modelThis message is expected. eve's default model (anthropic/claude-sonnet-4.6) routes through the Vercel AI Gateway, which needs a credential before it answers. Type /model to open the Configure the agent model menu (↑/↓ to move, Enter to select, Esc to cancel):
- Change model: Opens the searchable AI Gateway catalog with the current model selected. Pick one and eve rewrites the
modelfield inagent/agent.tsafter the new id resolves. You can skip the menu with/model anthropic/claude-opus-4.8. - Configure provider: Clears the setup issue. It appears in bold yellow as Required to enable the agent until eve finds a credential. First choose a provider. Keep AI Gateway for this course; choosing your own provider prints wiring instructions and leaves setup unchanged. Then choose how to connect:
- Paste an
AI_GATEWAY_API_KEY: Saves a static gateway key to.env.local. - OR: Connect a Vercel project: Walks through the team and project pickers, then pulls the project's environment into
.env.local. Instead of a static key, you get a short-livedVERCEL_OIDC_TOKENthat authenticates gateway model ids through Vercel OIDC. If it expires, run the link again.
- Paste an
- Done: Closes the menu.
eve reloads .env.local on its own. The footer changes from the yellow warning to a connection such as anthropic/claude-sonnet-4.6 · AI Gateway (spoke-and-mirror), and the setup notice disappears.
With the model linked, take a look at what eve generated. The pieces that matter for this lesson:
spoke-and-mirror/
├── agent/
│ ├── agent.ts # chooses the model, configures the runtime
│ ├── instructions.md # the always-on persona, read every turn
│ └── channels/
│ └── eve.ts # the built-in HTTP channel, shipped with every app
└── package.jsonThere's no agent/tools/ yet, that's intentional. You add it in 1.2 the moment you write your first tool, and eve picks it up by the folder it lives in.
At this point, the scaffold gives you a model and a blank personality. The catalog, tools, and dashboard come later.
Chat with the default dispatcher
Once the TUI is ready, let's ask our generic agent a question a customer would actually ask:
you type > my rear bike brake feels spongy and kind of honks on the way down the hill
dispatcher response (with slight variations based on the model) > That sounds like it could be a few things, possibly worn brake pads,
contaminated rotors, or air in the line if it's hydraulic. You could try cleaning
the rotors, replacing the pads, or bleeding the brakes. If you're not comfortable
doing it yourself, take it to a bike shop!Helpful, technically. But that's a search engine in a trench coat. It dumps every possibility, suggests you fix it yourself, and sends you to some other bike shop. It has no idea it is the bike shop. That's because right now its entire identity is the scaffold default:
You are a helpful assistant.Of course it acts generic. We never told it who it is.
Two files own the agent's starting point. Let's set both. Stop the dev server first (Ctrl-C).
Challenge
1. Pin the model in agent/agent.ts. This is where you choose the brain. The scaffold picked a sensible default (anthropic/claude-sonnet-4.6); the front desk of a real shop deserves the sharpest diagnosis we can give it, so we'll run the dispatcher on anthropic/claude-opus-4.8. A gateway model id like this routes through the Vercel AI Gateway, the same credential you linked a moment ago, so switching models needs no new key.
2. Write the persona in agent/instructions.md. Replace the bland default with a real front-desk advisor. Think about what makes the shop's front desk good, and write it as standing rules, not a script:
- Diagnose before quoting. Ask what the bike is doing, the noise, the symptom, when it started, before naming a service.
- Quote in real dollars from the catalog. Never invent a price.
- Be upfront about cost. A big job needs a sign-off, and that's normal, not something to apologize for.
Done-When
npx eve@latest init spoke-and-mirrorcreated the project and the dev server boots with0 errors, 0 warnings.- The model provider is linked via
/model(oreve link/AI_GATEWAY_API_KEY) and themodel provider not linkednotice has cleared. agent/agent.tsexportsdefineAgentwith the model pinned toanthropic/claude-opus-4.8.agent/instructions.mddescribes the Spoke & Mirror front-desk advisor (diagnose-first, real-dollar quotes, upfront about cost).- In the TUI, a vague symptom gets a diagnostic question back, in character, not a generic chatbot answer.
Solution
agent/agent.ts:
import { defineAgent } from "eve";
export default defineAgent({
model: "anthropic/claude-opus-4.8",
});agent/instructions.md:
You are the front-desk advisor at Spoke & Mirror Cyclery. You help
customers figure out what their bike needs and get it booked in.
- Diagnose before you quote. Ask what the bike is actually doing (the noise, the
symptom, when it started) before you name a service.
- Use the tools rather than guessing. Look up real services and prices with
`lookup_service`, find real openings with `check_availability`, and book with
`book_repair`.
- Quote in real dollars from the catalog. Never invent a price.
- Remember the customer's bikes with `remember_bike`, and check `recall_bikes`
before asking them to repeat details the shop already has on file.
- Be upfront about cost. Big jobs need a sign-off before they're booked. That's
expected, not a problem, so don't apologize for it.The persona deliberately names tools that don't exist yet, including lookup_service and book_repair. Each becomes a file in agent/tools/ as you build out the front-desk role.
Was this helpful?