src/orchestrator/plugins/cloudflare/SKILL.md
Creates and deploys Cloudflare Workers, configures wrangler.toml bindings, sets up KV/D1/R2 storage and Durable Objects, manages Pages deployments, and implements edge function patterns. Use when building or deploying Cloudflare Workers, setting up Pages, working with KV/D1/R2 storage, configuring wrangler.toml, or deploying edge applications.
npx skillsauth add monkilabs/opencastle cloudflare-platformInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Read the matching reference before writing code for any of these topics:
| Topic | Reference |
|-------|-----------|
| Workers & edge functions | references/workers.md |
| Storage (KV, D1, R2) | references/storage.md |
| Pages & deployment | references/deployment.md |
Workers
process, Buffer, fs) — Workers run in V8 isolateswrangler.toml and access them via the env parameterctx.waitUntil(promise) for non-blocking side effects (logging, analytics) that outlast the responseStorage Selection
D1
env.DB.prepare(sql).bind(...params).run() for all DML; always use parameterized queriesenv.DB.batch([...stmts]) for multiple queries in a single round tripMCP Code Mode
search and executesearch searches the Cloudflare API spec; execute runs JavaScript against the Cloudflare APIWrangler
wrangler.toml (or wrangler.jsonc) for all config — npx wrangler dev for local devnpx wrangler deploy for production; wrangler tail for live log streamingwrangler secret put VAR_NAME — never hardcode in wrangler.tomlSecurity
env.VAR_NAME — never hardcode credentials in Worker code// src/index.ts
export interface Env {
SESSIONS: KVNamespace; // bound in wrangler.toml
API_SECRET: string; // secret bound in wrangler.toml
}
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
const url = new URL(request.url);
if (url.pathname === '/session') {
const sessionId = request.headers.get('x-session-id');
if (!sessionId) return new Response('Missing session', { status: 400 });
const data = await env.SESSIONS.get(sessionId, { type: 'json' });
if (!data) return new Response('Not found', { status: 404 });
// Non-blocking analytics — does not delay the response
ctx.waitUntil(logAnalytics(sessionId));
return Response.json(data);
}
return new Response('Not found', { status: 404 });
},
} satisfies ExportedHandler<Env>;
I need to store data → What type?
├── Key-value pairs (cache, sessions, feature flags) → KV
├── Relational/SQL data → D1
├── Files, images, blobs → R2
├── Stateful coordination (counters, locks, chat) → Durable Objects
└── Async job queue → Queues
references/workers.md — Worker structure, bindings, env, waitUntil, Durable Objects, Cron Triggers, Wrangler commandsreferences/storage.md — KV, D1, R2 APIs; decision guide for choosing between storage typesreferences/deployment.md — Pages setup, wrangler.toml, secrets, custom domains, CI/CD integrationnpm create cloudflare@latest and select "Hello World" Worker templatewrangler.toml under [[kv_namespaces]] / [[d1_databases]]npx wrangler kv:namespace list / npx wrangler d1 list — create any missing resources before continuing
npx wrangler kv:namespace create <NAME> or npx wrangler d1 create <DB> → copy the ID into wrangler.tomlfetch handler in src/index.ts — type the Env interface to match your bindingsnpx wrangler dev — verify the worker responds correctly at http://localhost:8787
wrangler.toml syntax → verify binding IDs match → run npx wrangler whoami to confirm account authnpx wrangler deploy — confirm the deployment URL is returned
wrangler.toml bindings match created resources → verify compatibility_date is set → check account permissionswrangler tail for live logs from productiondevelopment
Defines 10 sequential validation gates: secret scanning, lint/test/build checks, blast radius analysis, dependency auditing, browser testing, cache management, regression checks, smoke tests. Use when running pre-deploy validation or CI checks, CI/CD pipelines, deployment pipeline validation, pre-merge checks, continuous integration, or pull request validation.
development
Generates test plans, writes unit/integration/E2E test files, identifies coverage gaps, flags common testing anti-patterns. Use when writing tests, creating test suites, planning test strategies, mocking dependencies, measuring code coverage, or test planning.
development
Provides model routing rules, validates delegation prerequisites, supplies cost tracking templates, defines dead-letter queue formats for Team Lead orchestration. Load when assigning tasks to agents, choosing model tiers, starting delegation session, running multi-agent workflow, delegating work, choosing which model to use, or assigning tasks.
testing
Saves, restores session state including task progress, file changes, delegation history. Use when saving progress, resuming interrupted work, picking up where you left off, or checkpointing current work.