/restate-agent:restate-gen-sdkfrom restate-agent
Builds and composes Restate services, virtual objects, and workflows using the generator-based TypeScript SDK with function* handlers, durable RPC, state, timers, signals, and awakeables.
Ships in restate-agent. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Restate records every step of a handler in a journal. After a crash or restart
the handler replays: completed steps return their recorded results and
execution continues from the first unfinished one. The generator SDK expresses
a handler as a function*; each durable step is something you yield*.
import {serve} from "@restatedev/restate-sdk";
import * as restate from "@restatedev/restate-sdk-gen";
export const greeter = restate.service({
name: "Greeter",
handlers: {
*greet(name: string) {
const id = yield* restate.run(async () => sendWelcomeEmail(name), {name: "send email"});
return `Hello ${name} (${id})`;
},
},
});
await serve({services: [greeter], port: 9080});
There is no ctx parameter. Operations are free functions on restate
(restate.run, restate.state(), restate.client(...)) that find the current
invocation themselves. Do not mix in promise-SDK idioms such as
ctx.run, ctx.serviceClient, async handlers, or Promise.all.
package.json has @restatedev/restate-sdk-gen → this skill applies.
@restatedev/restate-sdk is still needed as a peer (for serve,
TerminalError, Opts, SendOpts).packages/libs/core with
agent-config.ts) → also load the restate-agent skill.restate.service(, restate.object(, restate.workflow( to find
existing building blocks before adding new ones.Introduce concepts one at a time. Each step adds one idea to a working handler.
| # | Concept | Core API | Reference |
|---|---|---|---|
| 1 | A service handler with a journaled side effect | restate.service, restate.run | references/handlers-and-state.md |
| 2 | Typed, validated input and output | restate.schemas({input, output}, fn) | references/handlers-and-state.md |
| 3 | An entity with durable state, one writer per key | restate.object, restate.state() | references/handlers-and-state.md |
| 4 | Readers that run alongside the writer | options.handlers.X.shared, restate.sharedState() | references/handlers-and-state.md |
| 5 | Retries, terminal failures, determinism | run(..., {retry}), TerminalError, restate.date(), restate.rand() | references/side-effects-and-errors.md |
| 6 | Call another handler durably | restate.client(def[, key]).handler(input) | references/composition.md |
| 7 | Fire and forget, or send later | restate.sendClient, SendOpts.from({delay}) | references/composition.md |
| 8 | Fan out and join, race, timeouts | restate.all/any/race/allSettled/select, restate.spawn | references/composition.md |
| 9 | Wait for the outside world | restate.sleep, restate.awakeable, restate.signal, invocation(id).signal(name) | references/waiting-and-signals.md |
| 10 | A multi-step process with its own ID | restate.workflow, restate.workflowPromise | references/waiting-and-signals.md |
| 11 | Contracts shared between teams or tools | restate.iface.*, restate.implement | references/composition.md |
| 12 | Serve, register, call, and test | serve, restate deployments register, connect, RestateTestEnvironment | references/running-and-testing.md |
To compose a bigger application, read references/patterns.md. It shows how
the blocks above combine into orchestrators, sagas, entities, pub/sub feeds,
and human-in-the-loop flows.
| Need | Use |
|---|---|
| Stateless logic, any number of concurrent calls | restate.service |
| State per key (a user, cart, session, conversation), with calls for one key run one at a time | restate.object |
| A process that runs once per ID, with shared handlers to signal or query it while it runs | restate.workflow |
*name() or function*), and every
Future or Operation it uses is consumed with yield*.restate.run, or through restate.date() / restate.rand().await and promises appear only inside a restate.run(async () => ...) closure.
No restate.* calls happen inside that closure.restate.run has a name: {name: "..."} or a named function.restate.all/any/race/allSettled/select, never
Promise.all.TerminalError (from @restatedev/restate-sdk).run write state.
Shared handlers use restate.sharedState() and only read. A shared
handler needs shared: true in its options, even when its interface
uses iface.shared.*.references/running-and-testing.md).For deployment, server configuration, Kafka, and other operational topics,
query the bundled restate-docs MCP server (https://docs.restate.dev/mcp).
references/composition.md (opens in a new tab)references/handlers-and-state.md (opens in a new tab)references/patterns.md (opens in a new tab)references/running-and-testing.md (opens in a new tab)references/side-effects-and-errors.md (opens in a new tab)references/waiting-and-signals.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub restatedev/agent --plugin restate-agent2 skills in this plugin
Other plugins' skills for the same job