Reboot Python framework for building transactional microservices with durable actor state. APIs are defined in pydantic Python (`reboot.api`). Use this skill when writing Python code for a Reboot application, defining APIs with reader/writer/transaction/workflow methods, changing an API of an application that has already been deployed or has persisted state (schema evolution rules; see `references/api-schema-evolution.md`), implementing Servicers, calling actor refs across services, scheduling work (including recurring / "cron" jobs), building durable workflows with the right call primitive (`.per_workflow(alias)` / `.per_iteration(alias)` / `.always()` for Reboot calls; `at_least_once` / `at_most_once` for external calls; `until` / `until_changes` for reactive waiting on Reboot state), calling an LLM / building an AI agent in the backend via the durable `reboot.agents.pydantic_ai.Agent`, or testing Reboot applications with Gherkin feature files run by `reboot.bdd` (and, for crash recovery, the `Reboot()` test harness).
Ships in reboot. 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.
Version notices: if
rbtreports a version mismatch or that a newer Reboot is available, the upgrade skill says how and when to react.
Guide for building transactional microservices in Python with the Reboot
framework. Reboot APIs are defined in pydantic Python
(reboot.api) and code-generated into typed Servicer base classes;
you implement async methods that receive a typed context
(ReaderContext, WriterContext, TransactionContext, or
WorkflowContext).
Reference these guidelines when:
.rbtrc, pyproject.toml,
application entry point)references/api-schema-evolution.md firstService.ref(id).method(context, ...)WorkflowContext, picking the right
primitive per servicer-workflow.md (Reboot calls use
.per_workflow(alias) / .per_iteration(alias) / .always();
external calls default to at_least_once, with at_most_once for
the rare non-retryable call)
plus until / until_changes for reactive waitingref.schedule(when=...).method(context),
including recurring / "cron" jobs (self-rescheduling at an absolute
wall-clock time)reboot.agents.pydantic_ai.AgentOrderedMap, mailgun, etc.)reboot.bdd, and
crash-recovery tests on the Reboot() harnessmypy backend/ tests/ and fix all
errors before considering Python work done (see "Type-checking"
below)| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Lifecycle | CRITICAL | lifecycle- |
| 2 | API | CRITICAL | api- |
| 3 | Servicer | HIGH | servicer- |
| 4 | Agent | HIGH | agent- |
| 5 | Stdlib | HIGH | stdlib- |
| 6 | Crypto | HIGH | crypto- |
| 7 | State | HIGH | state- |
| 8 | Auth | HIGH | auth- |
| 9 | RPC | MEDIUM | rpc- |
| 10 | Scheduling | MEDIUM | scheduling- |
| 11 | Testing | LOW-MEDIUM | testing- |
| 12 | Patterns | LOW-MEDIUM | patterns- |
The Workflow(...) context method is the fourth servicer context
type alongside reader / writer / transaction; its (large) reference
is servicer-workflow.md.
A Reboot Servicer subclasses the generated <Type>.Servicer base class and
implements one async def per RPC. Each method takes a typed context as the
second argument; that type is determined by the API method factory
(Reader/Writer/Transaction/Workflow):
from chat_room.v1.chat_room_rbt import ChatRoom
from reboot.aio.contexts import ReaderContext, WriterContext
class ChatRoomServicer(ChatRoom.Servicer):
# No `authorizer()` defined — fine for `rbt dev` (the runtime
# warns and allows). Before going to production, add a
# `TokenVerifier` and a real `authorizer()` rule (see
# references/servicer-authorizer.md).
async def messages(
self,
context: ReaderContext,
) -> ChatRoom.MessagesResponse:
return ChatRoom.MessagesResponse(messages=self.state.messages)
async def send(
self,
context: WriterContext,
request: ChatRoom.SendRequest,
) -> None:
self.state.messages.append(request.message)
A Reboot application's main constructs an Application with the list of
Servicer classes and runs it under asyncio:
import asyncio
from reboot.aio.applications import Application
from reboot.aio.external import InitializeContext
from chat_room.v1.chat_room_rbt import ChatRoom
from chat_room_servicer import ChatRoomServicer
async def initialize(context: InitializeContext):
# Implicitly construct the singleton on first write.
await ChatRoom.ref("reboot-chat-room").send(context, message="Hello!")
async def main():
await Application(
servicers=[ChatRoomServicer],
initialize=initialize,
).run()
if __name__ == '__main__':
asyncio.run(main())
Never hand-edit generated *_rbt.py files. The pydantic API definition
file is the source of truth (see references/api-pydantic.md):
from reboot.api import API, Field, Methods, Model, Reader, Type, Writer
# Every Field needs an explicit default and a description (see Key
# Constraints below).
class ChatRoomState(Model):
messages: list[str] = Field(
tag=1,
default_factory=list,
description="Every message posted to the room, oldest first.",
)
class SendRequest(Model):
message: str = Field(
tag=1,
default="",
description="The text to post, as the sender typed it.",
)
class MessagesResponse(Model):
messages: list[str] = Field(
tag=1,
default_factory=list,
description="Every message posted so far, oldest first.",
)
api = API(
ChatRoom=Type(
state=ChatRoomState,
methods=Methods(
messages=Reader(
request=None,
response=MessagesResponse,
description="Every message posted so far, oldest first.",
mcp=None,
),
send=Writer(
request=SendRequest,
response=None,
description="Post one message to the room.",
mcp=None,
),
),
description="One chat room, and everyone posting into it.",
),
)
rbt generate (run automatically by rbt dev run) emits
<pkg>/<v>/<name>_rbt.py with the <Type> class, request/response
messages nested as attributes, the Servicer base class, and the
.ref(id) factory.
Reader(...) requires ReaderContext; Writer(...)
requires WriterContext; Transaction(...) requires
TransactionContext; Workflow(...) requires WorkflowContext.self.state is read-only inside ReaderContext. Mutate it only inside
WriterContext or TransactionContext. Workflows mutate state by
calling Service.ref().write(context, callback) — not self.state —
because workflows can re-execute on replay..rbtrc is line-based, not YAML. Each line is <subcommand> <flag>.
Use --application-name=<app> (canonical since Reboot 1.0.4; --name
still works as a deprecated alias but warns).self.ref().state_id inside writer/reader/
transaction methods, and context.state_id inside workflows.
self.state_id does not exist and raises AttributeError.Field(tag=N) needs an explicit zero-value default
(default="", default=0, default=0.0, default=False,
default_factory=list, etc.). Two layered rules:
(1) model_construct() drops fields lacking declared defaults, so
reads AttributeError; (2) only the type's zero value is accepted —
non-zero defaults raise UserPydanticError at import time. Set
domain defaults (turn="r", delay=1.0, etc.) inside the
constructor method, not on the Field. Applies to state,
request/response, and error Models.Field(tag=N) gets a description= saying what the
value means, in state, request, response, and error Models alike.
The dashboard shows it beside the property, and a property without
one shows a request to add it. Never add a property without a
description, and describe the value, not the type: "What the
account holds, in dollars, never below zero", not "The balance
(float)".TransactionContext
(one-shot) or WorkflowContext (durable, long-running).references/api-schema-evolution.md to
understand the rules you must follow for API schema evolution.await ref.deposit(context, amount=10), not
await ref.deposit(context, DepositRequest(amount=10)).Queue, Topic, OrderedMap, Presence, Item are
stdlib actor names — use them, don't redefine them. If a
design or task names any of these (e.g. "publish to a
Topic", "track members in an OrderedMap", "subscribe a
Queue", "presence shows who's online"), the answer is to
import the stdlib actor — not to declare a pydantic Model
with the same name. Defining your own Topic / Queue /
etc. forfeits durability, ordering, blocking semantics, and
concurrency guarantees the stdlib already provides. See the
trigger table under "How to Use → Using stdlib state types"
below.Most footguns in this skill are distributed across reference files — skipping the right reference means hitting a runtime error that the docs would have prevented. Before writing code, load the references the task actually requires from the lists below. "Common gotchas" should be loaded for almost every task.
Everything you read stays in the conversation and is re-sent on every
later turn, so read a reference at the step that needs it rather than
all of them up front, and read each one once. That cost is also
why generated and installed source — *_rbt.py, *_rbt_react.ts,
site-packages/, node_modules/, codegen templates — is the most
expensive place in the system to learn a fact: the shapes worth
knowing are written out in the references below. When something
genuinely isn't covered, bound the output hard (a targeted
grep -n … | head -40, or sed -n '<start>,<end>p' over a known
range), never a whole generated file.
references/servicer-workflow.md — the single, comprehensive
workflow reference; read it top to bottom before writing the body.
Covers the @classmethod / WorkflowContext declaration shape and
scheduling; the call-classification model that routes each call
to the right primitive (Reboot scope .per_workflow(alias) /
.per_iteration(alias) / .always() vs. external at_least_once /
at_most_once); context.loop(...) iteration; inline state
mutation via Service.ref().<scope>.write(context, fn);
until / until_changes reactive waiting; and the declared-vs-
undeclared exception rule for how a workflow exitsBackend LLM calls — chat completions, AI agents, tool-using
assistants — go through the durable reboot.agents.pydantic_ai.Agent,
never a raw anthropic / openai SDK or a bare
pydantic_ai.Agent. A raw call re-hits (and re-bills) the provider
on every workflow replay. Read both before writing agent code:
references/agent-pydantic-ai.md — always read for any
backend LLM work: constructing the Agent, the required
name=, running it inside a WorkflowContext, variant= for
repeated runs, and the streaming / replay caveatsreferences/agent-tools.md — @agent.tool /
@agent.tool_plain so the agent can read and mutate Reboot
stateThe Agent runs only inside a WorkflowContext, so also read the
"Building a workflow" references above.
references/api-pydantic.md — always read: the zero-default
rule bites at import timereferences/api-methods.md — Reader / Writer / Transaction /
Workflow factories and the factory=True constructor optionreferences/api-errors.md — typed error declarationreferences/state-collections.md — always read when modeling
any collection: decide whether each contained item should be
its own state Type, and pick between in-state list[Sub],
in-state list[str] of foreign IDs, or an OrderedMap of
foreign IDs. The most common modeling mistake — packing an
entity collection like list[Person] into one parent's state —
fails silently in demos and forces a full rewrite later.references/state-nested-models.md — same rule from the nested-
Model angle: state Models never appear as fields of other
state Modelsreferences/api-schema-evolution.md — always read before
modifying an API that has already been deployed or run with
persisted state: the rules you must follow for API schema
evolutionreferences/servicer-{reader,writer,transaction,workflow,constructor,authorizer}.md
— one per context type and the constructor / authorizer concerns.
servicer-workflow.md is the large one — see "Building a workflow"
above for when to reach for itreferences/rpc-refs.md — always read: self.ref().state_id vs.
self.state_id (which doesn't exist) is a recurring tripreferences/rpc-calls.md — always read: the kwargs-not-Request
trap (await ref.deposit(context, DepositRequest(amount=10))) is a
recurring miss; passes type-check and fails at runtimereferences/rpc-constructor-calls.md — always read when the
agent invokes a constructor: use <X>.create(context, id, ...) or
<X>.<CtorMethod>(context, id, ...), NEVER <X>.ref(id).<ctor>(...)
(the trap that skips creation semantics). The factory-declaration
side is servicer-constructor.md; the call-site side is hereIf your design calls for any of the concepts in the left column,
the stdlib already provides the canonical actor. Read the
reference before writing your own actor type — defining your
own Queue / OrderedMap / etc. is almost always wrong
and forfeits durability, ordering, and concurrency guarantees:
| You need... | Use | Reference |
|---|---|---|
| Durable FIFO — work queue, job queue, intake | Queue | stdlib-queue.md |
| Sorted key-value with pagination / ordering | OrderedMap | stdlib-ordered-map.md |
| Presence — who's online / connected | Presence | stdlib-presence.md |
| Pubsub / broadcast / fan-out to subscribers | PubSub | stdlib-pubsub.md |
Item builder for Queue / PubSub payloads | Item | stdlib-item.md |
| Store OAuth access/refresh tokens from a provider | OAuthTokenManager | stdlib-oauth-tokens.md |
| A field holds a password/API key/secret/PII | Ciphertext | stdlib-ciphertext.md |
| Encrypt at rest / crypto-shred (right-to-erasure) | Ciphertext | stdlib-ciphertext.md |
Each stdlib reference also lists its library registration —
forgetting <thing>_library() and the stdlib actor's
<thing>.servicers() in your Application(...) fails at boot
with "unknown actor type."
references/stdlib-ciphertext.md — encrypting sensitive data at
rest or crypto-shredding (GDPR right-to-erasure): the
Ciphertext library handles envelope encryption, per-scope erasure,
and automatic root-key rotation for you. Reach here before
hand-rolling any encryption.references/stdlib-oauth-tokens.md — storing an external provider's
OAuth access/refresh tokens: use the purpose-built
OAuthTokenManager (with store_tokens=True the OAuth server captures
them for you), not a str field and not hand-rolled Ciphertext.references/crypto-root-keys.md — only when building your own
key-deriving library/feature: HKDF-deriving purpose-specific keys
from Reboot's managed root keys, and the rotation control loop +
use_root_key_version / disuse_root_key_version markers. Most apps
want Ciphertext instead.references/auth-allow-deny.md — minimal/correct shapereferences/auth-allow-if.md and references/auth-built-in-predicates.md
— composition patternsreferences/auth-custom-predicates.md — for app-specific rulesreferences/auth-context-propagation.md — always read when a
method calls another servicer or records who acted: a nested call
carries the caller's context.auth and stays app-internal (so
writers can audit who did what and owner rules still match), what
is not carried (the bearer token, scheduled calls), and why a
reader's body must not read context.auth (the answer must be the
same for every admitted caller, or the reader cannot be cached).references/auth-external-api-calls.md — acting as the user at an
external service: capture a provider's OAuth tokens (your own
authorize/callback HTTP endpoints → OAuthTokenManager.store), read
them back with fetch, and make the outbound call inside a
Workflow. Also the user-provided API-key path for services
without OAuth (Ciphertext-encrypted, the ciphertext id kept in
state; the developer's own service keys are env-var secrets instead).
Host-agnostic (MCP Apps and web apps). Pairs with
stdlib-oauth-tokens.md (the OAuthTokenManager type).references/auth-http-routes.md — a plain HTTP route only a
signed-in user may call (a file download, an image or video the
page shows, an export): require_oauth_token=True on
application.http.get(...), and the page-side fetch-with-bearer
pattern that replaces <img src> / <a href>. Read it before
checking a bearer or writing CORS headers in a route yourself.An application's tests are Gherkin .feature files run by
reboot.bdd; the order of work that writes them (agree on the
feature in English, tag it @wip, iterate on scenarios) is the
feature skill.
references/testing-project-setup.md — tests/ layout,
pytest.ini, reboot[dev] and the other dev-deps, .gitignore,
uv run pytestreferences/testing-features.md — always read before writing a
scenario: the built-in steps' spelling (who calls, factories
making ids up, saved values, assertions, eventually, attempts
and aborts, tasks), @wip / @blocked, feature / rule / scenario
structure, custom steps as plain Reboot code, mocks and stand-insreferences/testing-web-app.md — scenarios that open the web app:
the frontend fixture, the web app steps, the accessible markup
the page needs, sign-in, recordingsreferences/testing-harness.md — the Reboot() harness the
scenarios run on, and how a custom step or a harness test
impersonates a userreferences/testing-external-context.md — create_external_context
in custom steps and harness tests, asserting on <Method>Aborted,
waiting on tasks/workflows, mocking external services / LLMsreferences/testing-failure-recovery.md — restarting the app under
test with rbt.down() / rbt.up(revision=...), landing the crash
inside a method with a stalling mock, and asserting work happened
exactly once across it; the one kind of test that stays on the
harness instead of in a feature fileThe generated *_rbt.py stubs are fully typed, so mypy checks the
code you write against them and catches the mistakes that pass a
visual read — a field set to the wrong type, a missing or misspelled
keyword argument, a method called with the wrong context type, a
response field that doesn't exist, a servicer method returning the
wrong type. Treat a clean type-check as part of finishing, not an
optional extra:
.mypy.ini (config and rationale
in references/lifecycle-project-setup.md). It puts backend/src,
backend/api, tests, and api on mypy_path with
explicit_package_bases = True so the generated *_rbt.py modules
resolve. If it's missing, create it first — mypy is useless
without it.backend/, run
uv run mypy backend/ tests/ (or mypy backend/ tests/) from the project root and
fix every error.mypy backend/ tests/ and uv run pytest are green.references/patterns-common-gotchas.md — the consolidated trip-list
including the pydantic zero-default rule, self.state_id
non-existence, and --name vs. --application-name. Read it once
per task.Reference files live in references/ and are named
{prefix}-{topic}.md (e.g., servicer-transaction.md). Load only
the files relevant to the current task; the "How to Use" section
above lists the right ones grouped by task type. The full catalog:
Lifecycle (lifecycle-):
references/lifecycle-project-setup.mdreferences/lifecycle-rbtrc.mdreferences/lifecycle-application-entry.mdreferences/lifecycle-initialize-hook.mdreferences/lifecycle-secrets.mdreferences/lifecycle-dockerfile.mdreferences/lifecycle-reboot-cloud.mdreferences/lifecycle-signals.md — usually nothing to do on
SIGTERM/SIGINT; when something is, install_cleanup(), never a
signal handler of your ownAPI (api-):
references/api-pydantic.mdreferences/api-methods.mdreferences/api-errors.mdreferences/api-schema-evolution.md — schema evolution rules for
deployed applications / persisted stateServicer (servicer-):
references/servicer-reader.mdreferences/servicer-writer.mdreferences/servicer-transaction.mdreferences/servicer-workflow.md — the single, comprehensive
workflow reference (declaration, call-classification, scopes,
context.loop, external at_least_once / at_most_once,
until / until_changes, and workflow exit semantics)references/servicer-constructor.mdreferences/servicer-authorizer.mdAgent (agent-):
references/agent-pydantic-ai.mdreferences/agent-tools.mdStdlib (stdlib-):
references/stdlib-ordered-map.mdreferences/stdlib-queue.mdreferences/stdlib-pubsub.mdreferences/stdlib-presence.mdreferences/stdlib-item.mdreferences/stdlib-ciphertext.mdreferences/stdlib-oauth-tokens.mdCrypto (crypto-):
references/crypto-root-keys.mdState (state-):
references/state-scalar-fields.mdreferences/state-collections.mdreferences/state-nested-models.mdAuth (auth-):
references/auth-allow-deny.mdreferences/auth-allow-if.mdreferences/auth-built-in-predicates.mdreferences/auth-custom-predicates.mdreferences/auth-context-propagation.md — context.auth follows a
call through the application; audit in writers, never in readersreferences/auth-external-api-calls.mdreferences/auth-http-routes.mdRPC (rpc-):
references/rpc-refs.mdreferences/rpc-calls.mdreferences/rpc-constructor-calls.mdreferences/rpc-forall.mdScheduling (scheduling-):
references/scheduling-basic.mdreferences/scheduling-recurring.mdTesting (testing-):
references/testing-project-setup.mdreferences/testing-features.mdreferences/testing-web-app.mdreferences/testing-harness.mdreferences/testing-external-context.mdreferences/testing-failure-recovery.mdFrontend (shared by web-app and mcp-app):
references/react-generated-client.md — what
rbt generate --react= emits: hook overloads, Use<Type>Api,
reader/mutation return shapes, typed errors, naming rules.Patterns (patterns-):
references/patterns-error-handling.mdreferences/patterns-idempotency.mdreferences/patterns-common-gotchas.mdagents/openai.yaml (opens in a new tab)references/_sections.md (opens in a new tab)references/agent-pydantic-ai.md (opens in a new tab)references/agent-tools.md (opens in a new tab)references/api-errors.md (opens in a new tab)references/api-methods.md (opens in a new tab)references/api-pydantic.md (opens in a new tab)references/api-schema-evolution.md (opens in a new tab)references/auth-allow-deny.md (opens in a new tab)references/auth-allow-if.md (opens in a new tab)references/auth-built-in-predicates.md (opens in a new tab)references/auth-context-propagation.md (opens in a new tab)references/auth-custom-predicates.md (opens in a new tab)references/auth-external-api-calls.md (opens in a new tab)references/auth-http-routes.md (opens in a new tab)references/crypto-root-keys.md (opens in a new tab)references/lifecycle-application-entry.md (opens in a new tab)references/lifecycle-dockerfile.md (opens in a new tab)references/lifecycle-initialize-hook.md (opens in a new tab)references/lifecycle-project-setup.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/reboot:pythonfrom reboot
npx claudepluginhub reboot-dev/reboot-plugin --plugin reboot11 skills in this plugin
/agents-mdGive a Reboot application an `AGENTS.md`, the project's map and rules for any coding agent, and a `CLAUDE.md` that imports it. Use when creating a Reboot app (the `mcp-app` and `web-app` skills call this at their first step), when working in an existing Reboot project (one with a `.rbtrc`) that has no `AGENTS.md`, and whenever a change moves a file, changes a command, or teaches a rule the next session needs./appBuild a Reboot application from a user description. Routes to the `mcp-app` skill (MCP Apps for ChatGPT, Claude, VSCode, Goose), the web-app skill (standalone web apps with a browser frontend), or BOTH (dual-frontend apps sharing one backend and one User per identity via `oauth=...`). Commits to a route only when the prompt verbatim names the front-door (MCP/Claude/ChatGPT for MCP App; a URL/SPA/"website" for web-app; explicit conjunction for both); otherwise asks the user. Does NOT infer the front-door from the app's domain (CRM, todo, dashboard, blog, …) — those describe what the app does, not where it lives./dashboardStart the Reboot developer dashboard (`rbt dashboard`) for a project and open it in the browser. Puts the minimum files in place (a `pyproject.toml` depending on `reboot[dev]`, a `.rbtrc`, the API directory), starts the dashboard in a background shell if one is not already serving (it opens itself in the browser), and hands the user its URL. Use this while BUILDING an app — the dashboard watches the API directory from before anything is running, so the developer watches the API take shape as it is written. Not for running an app (see the run skill)./deployDeploy a finished Reboot app to production on Reboot Cloud with `rbt cloud up` — one container that runs the backend and serves the built MCP Apps and web app from it, same-origin, so there is no second host, no cross-origin configuration and no cross-site cookie trouble. Covers the Dockerfile that builds the frontend into the image, the `.rbtrc` `serve run` lines that serve it, the OAuth and `allowed_origins` production checks, and verification; and what hosting the web app on a CDN of your own (Cloudflare Pages, Firebase, Vercel, ...) costs instead./featureSpecify a Reboot application's feature before and while building it, as a Gherkin `.feature` file the tests run and the dashboard shows. Use whenever the user asks for a new capability or a change to one ("add transfers", "users should be able to..."), before touching the API or code; and when converting an existing test suite to feature files. Agrees on the feature in plain English first, writes it down tagged `@wip`, builds it with the `python` / `web-app` / `mcp-app` skills, then iterates on scenarios with the user until they agree to take the tag off./inspectInspect the live state of a running Reboot application from the command line with `rbt inspect`. Lists the application's state types, lists the state IDs (actor IDs) for a type, and prints a single actor's state as JSON. Works against both a local `rbt dev run` backend and a deployed Reboot Cloud app via `--application-url` and `--admin-credential`. Use this to answer "what state types does this app have?", "which actors of this type exist?", or "what is stored in this actor right now?" — i.e. to debug persisted state from the terminal instead of the `/__/inspect` web dashboard.