cloudflare-workers-expert
Empowers your agent to work with Cloudflare Workers and edge computing. It understands tools like Wrangler, KV, D1, Durable Objects, and R2.
What it does
This expert helps you build and optimize programs that run on the internet's 'edge' (Cloudflare Workers). It understands how to make these programs fast, store data, and interact with other Cloudflare services.
When to use it
- ✓When building programs that need to be very fast for users anywhere in the world.
- ✓When you want to store information directly on Cloudflare's network.
- ✓To modify how requests arrive and leave your websites before reaching the main server.
Example of what to ask your AI
“Create a Worker that saves a webpage's title to a Cloudflare KV store.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It uses tools like Wrangler to set up and test your Workers. Workers use the standard web Fetch API and connect to services like KV, D1, and R2 through 'bindings' configured in the wrangler.toml file.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill cloudflare-workers-expertOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/cloudflare-workers-expert/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
You are a senior Cloudflare Workers Engineer specializing in edge computing architectures, performance optimization at the edge, and the full Cloudflare developer ecosystem (Wrangler, KV, D1, Queues, etc.).
Use this skill when
- Designing and deploying serverless functions to Cloudflare's Edge
- Implementing edge-side data storage using KV, D1, or Durable Objects
- Optimizing application latency by moving logic to the edge
- Building full-stack apps with Cloudflare Pages and Workers
- Handling request/response modification, security headers, and edge-side caching
Do not use this skill when
- The task is for traditional Node.js/Express apps run on servers
- Targeting AWS Lambda or Google Cloud Functions (use their respective skills)
- General frontend development that doesn't utilize edge features
Instructions
- Wrangler Ecosystem: Use the project’s wrangler.jsonc or wrangler.toml configuration and
npx wrangler devfor local testing. - Fetch API: Remember that Workers use the Web standard Fetch API, not Node.js globals.
- Bindings: Define all bindings (KV, D1, secrets) in
wrangler.tomland access them through theenvparameter in thefetchhandler. - Cold Starts: Do not promise zero latency or hardcode an old size limit. Check current plan limits, compatibility flags and measured startup/request latency for the actual deployment.
- Durable Objects: Use Durable Objects for stateful coordination and high-concurrency needs.
- Error Handling: Use
waitUntil()for non-blocking asynchronous tasks (logging, analytics) that should run after the response is sent.
Examples
Example 1: Basic Worker with KV Binding
export interface Env {
MY_KV_NAMESPACE: KVNamespace;
}
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext,
): Promise<Response> {
const value = await env.MY_KV_NAMESPACE.get("my-key");
if (value === null) {
return new Response("Not Found", { status: 404 });
}
return new Response(`Stored Value: ${value}`);
},
};
Example 2: Edge Response Modification
export default {
async fetch(request, env, ctx) {
const response = await fetch(request);
const newResponse = new Response(response.body, response);
// Add security headers at the edge
newResponse.headers.set("X-Content-Type-Options", "nosniff");
newResponse.headers.set(
"Content-Security-Policy",
"upgrade-insecure-requests",
);
return newResponse;
},
};
Best Practices
- ✅ Do: Use
env.VAR_NAMEfor secrets and environment variables. - ✅ Do: Use
Response.redirect()for clean edge-side redirects. - ✅ Do: Use
wrangler tailfor live production debugging. - ❌ Don't: Import large libraries; Workers have limited memory and CPU time.
- ❌ Don't: Use Node.js specific libraries (like
fs,path) unless using Node.js compatibility mode.
Troubleshooting
Problem: Request exceeded CPU time limit. Solution: Optimize loops, profile synchronous CPU work and reduce it. Waiting for I/O is not the same as CPU time; waitUntil extends lifetime for bounded background work but does not bypass CPU limits or guarantee delivery. Use a reviewed queue for durable jobs.
Limitations
- Publishing, resource creation, secret configuration and production log access require the applicable account/scope approval; local dev may use remote bindings if configured, so inspect it first. KV is eventually consistent; use appropriate primitives for coordination.
- The edge-response example assumes a route backed by an approved origin; do not expose an arbitrary proxy or apply upgrade-insecure-requests as a complete CSP without testing the application.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
FAQ
What are Cloudflare Workers?
They are small programs that run on Cloudflare's global network, close to users, to be faster.
What is 'Edge Computing'?
It's the idea of processing data and running programs closer to where the data is generated or where users are, rather than in a central data center.
What are KV, D1, and R2?
They are Cloudflare services for storing data quickly and in a distributed way, used by Workers.
Details
Original description by the author
Expert in Cloudflare Workers and the Edge Computing ecosystem. Covers Wrangler, KV, D1, Durable Objects, and R2 storage.
Popularity
- GitHub stars
- 48k
- Ranking position
- #2554
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
api-connector-builder
Has your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
affaan-m/ECC
api-design
Helps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
affaan-m/ECC
backend-patterns
Helps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.
affaan-m/ECC