Saltar al contenido
Skillpedia
APIs y servidores (backend)48 mil · #4168

cloudflare-workers-expert

Qué hace

Este experto te ayuda a crear y optimizar programas que se ejecutan en la 'edge' de internet (Cloudflare Workers). Sabe cómo hacer que estos programas sean rápidos, cómo guardar datos y cómo interactuar con otros servicios de Cloudflare.

Cuándo usarla

  • ✓Cuando creas programas que necesitan ser muy rápidos para usuarios de cualquier parte del mundo.
  • ✓Cuando quieres guardar información directamente en la red de Cloudflare.
  • ✓Para modificar cómo llegan y salen las peticiones de tus sitios web antes de que lleguen al servidor principal.

Link de la skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cloudflare-workers-expert/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cloudflare-workers-expert/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Crea un Worker que guarde el título de una página web en un almacén KV de Cloudflare.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Usa herramientas como Wrangler para configurar y probar tus Workers. Los Workers utilizan la API Fetch estándar de la web y se conectan a servicios como KV, D1 y R2 mediante 'bindings' configurados en el archivo wrangler.toml.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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

  1. Wrangler Ecosystem: Use the project’s wrangler.jsonc or wrangler.toml configuration and npx wrangler dev for local testing.
  2. Fetch API: Remember that Workers use the Web standard Fetch API, not Node.js globals.
  3. Bindings: Define all bindings (KV, D1, secrets) in wrangler.toml and access them through the env parameter in the fetch handler.
  4. 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.
  5. Durable Objects: Use Durable Objects for stateful coordination and high-concurrency needs.
  6. 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_NAME for secrets and environment variables.
  • ✅ Do: Use Response.redirect() for clean edge-side redirects.
  • ✅ Do: Use wrangler tail for 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.
Preguntas frecuentes

¿Qué son los Cloudflare Workers?

Son pequeños programas que se ejecutan en la red global de Cloudflare, cerca de los usuarios, para que funcionen más rápido.

¿Qué es la 'Edge Computing'?

Es la idea de procesar datos y ejecutar programas más cerca de donde se generan los datos o donde están los usuarios, en lugar de hacerlo en un centro de datos central.

¿Qué son KV, D1 y R2?

Son servicios de Cloudflare para guardar datos de forma rápida y distribuida, que los Workers utilizan.

Detalles

Descripción original del autor

Expert in Cloudflare Workers and the Edge Computing ecosystem. Covers Wrangler, KV, D1, Durable Objects, and R2 storage.

repo: sickn33/agentic-awesome-skills

Popularidad

Estrellas en GitHub
48 mil
Posición en el ranking
#4168
Licencia
MIT
Actualizada
15/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas