본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)48k · #4168

cloudflare-workers-expert

하는 일

이 전문가는 인터넷의 ‘엣지’에서 실행되는 프로그램(Cloudflare Workers)을 만들고 최적화하도록 돕습니다. 이런 프로그램을 빠르게 만들고, 데이터를 저장하고, 다른 Cloudflare 서비스와 상호작용하는 방법을 이해합니다.

사용하는 경우

  • ✓전 세계 사용자에게 매우 빠르게 동작해야 하는 프로그램을 만들 때.
  • ✓Cloudflare 네트워크에 정보를 직접 저장하고 싶을 때.
  • ✓메인 서버에 닿기 전에 웹사이트로 들어오고 나가는 요청을 수정하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cloudflare-workers-expert/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“웹페이지의 제목을 Cloudflare KV 저장소에 저장하는 Worker를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

Wrangler 같은 도구를 사용해 Worker를 설정하고 테스트합니다. Workers는 표준 웹 Fetch API를 사용하고, wrangler.toml 파일에 설정한 ‘바인딩’을 통해 KV, D1, R2 같은 서비스에 연결합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.
자주 묻는 질문

Cloudflare Workers란 무엇인가요?

Cloudflare의 전 세계 네트워크에서 사용자 가까이 실행되어 더 빠르게 동작하는 작은 프로그램입니다.

‘엣지 컴퓨팅’이란 무엇인가요?

데이터를 처리하고 프로그램을 중앙 데이터 센터가 아니라, 데이터가 생성되는 곳이나 사용자에게 더 가까운 곳에서 실행하는 개념입니다.

KV, D1, R2는 무엇인가요?

Workers가 사용하는 Cloudflare 서비스로, 데이터를 빠르고 분산된 방식으로 저장하는 데 쓰입니다.

상세 정보

작성자의 원본 설명

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

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4168
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬