← All workflows
Cloud and edge / Workflow kit

Build a stateful Worker

A locally tested Worker with a Durable Object that owns a per-room counter.

Install the skills

From the project you want to work in, use Node.js 22.20 or later, npm and Git. Run the block below to copy the selected skills into .claude/skills/. Existing copies with the same names can be replaced.

Project terminal
npx --yes skills@1.10.0 add cloudflare/skills@42a677cd3f0f328da03c1ccd5e00254120028543 --skill durable-objects workers-best-practices wrangler --agent claude-code --copy --yes

Start Claude Code in that project and enter /skills to check the installed names.

Try it on your project

Bring along · A Cloudflare Workers project with a Wrangler config, dependencies installed and a local test runner.

  1. Choose the room ID as the object identity and define the increment response.
  2. Implement persistent state in the object, then review the binding and migration configuration.
  3. Exercise repeated writes and independent room IDs locally through Wrangler.
Starter prompt
Build a local per-room counter using this project’s Durable Objects setup. Reuse the existing Wrangler config. Test concurrent increments for one room, isolation between two rooms and persistence after a local restart. Keep deployment manual.

Check the result

Two simultaneous increments are retained. A second room starts from zero. The first room keeps its value after restarting the local server.

Optional connections

You can supply the same context as a local file or pasted excerpt. To connect a service, run its command in the project and check its status with /mcp inside Claude Code.

Cloudflare documentation

Look up Worker binding semantics and compatibility details during review. The documentation endpoint searches public reference material. It does not deploy a Worker.

Terminal
claude mcp add --scope local --transport http cloudflare-docs "https://docs.mcp.cloudflare.com/mcp"

Provider setup →