Cloudflare Workers Expert logo

Cloudflare Workers Expert

Community
roedyrustam
cloudflare-workers-expert

Cloudflare Workers ecosystem: D1, KV, R2, Queues, Durable Objects / Ekosistem Cloudflare Workers: D1, KV, R2, Queues, Durable Objects.

Overview

Publisherroedyrustam
Repositoryvibes-plug
Skill namecloudflare-workers-expert
Stars
117
Forks
27
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by roedyrustam on GitHub. Read the source before you install it.

Installation

Install the Cloudflare Workers Expert AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/roedyrustam/vibes-plug/tree/main/skills/cloudflare-workers-expert
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/roedyrustam/vibes-plug.git /tmp/vibes-plug
mkdir -p .claude/skills
cp -r /tmp/vibes-plug/skills/cloudflare-workers-expert .claude/skills/cloudflare-workers-expert
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cloudflare Workers Expert in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cloudflare Workers Expert on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cloudflare Workers Expert is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Cloudflare Workers Ecosystem Expert (2026 Edition)

English | Bahasa Indonesia


English

Orchestration & Integration

Connects and orchestrates with domain skills:

  • Edge Backend & APIs: js-backend-expert (Hono v4 on Workers, V8 isolates), api-design-expert (edge REST & RPC endpoints), and sse-websocket-streaming-expert (Durable Objects WebSockets).
  • Edge Storage & DBs: database-orm-expert (Drizzle with D1, Hyperdrive pooling), file-upload-media-expert (R2 presigned URLs), and vector-db-rag-expert (Vectorize & Workers AI).
  • Frontend & Cloud: cloud-hosting-expert (custom domains, CDN rules), senior-frontend (Workers Static Assets), and anti-slop (clean edge architecture without node:fs polyfill traps).
  • Lifecycle & DevOps: ci-cd-devops-architect (GitHub Actions Wrangler deployments), brainstorming, and zero-to-prod-orchestrator (Phase 4: Backend & APIs).

Description

Expert guide for building full-stack edge applications using the Cloudflare Workers ecosystem. Covers Workers runtime, D1 (SQLite at edge), KV (key-value store), R2 (S3-compatible object storage), Queues (message queues), Durable Objects (stateful edge), Hyperdrive (database connection pooling), Workers AI (inference at edge), and Wrangler CLI for development and deployment.

Trigger Conditions

  • Building serverless edge applications on Cloudflare Workers.
  • Using D1 as an edge SQLite database.
  • Storing files with R2 (S3-compatible, zero egress fees).
  • Implementing KV for distributed key-value caching.
  • Building stateful applications with Durable Objects.
  • Setting up Queues for async job processing at the edge.
  • Connecting to external databases via Hyperdrive connection pooling.
  • Running AI inference at the edge with Workers AI.
  • Deploying with Wrangler CLI and wrangler.toml configuration.
  • Using Hono v4 as the web framework on Workers.

What's New in 2026

Cloudflare Workers — Platform Updates
  • D1 GA: SQLite at the edge — fully production-ready with point-in-time recovery, read replicas, and up to 10GB databases.
  • Queues GA: Reliable message queues for async processing, dead letter queues, and batch consumption.
  • Hyperdrive GA: Connection pooling for PostgreSQL, MySQL — eliminates cold connection latency from Workers.
  • Workers AI Stable: Run LLM inference (Llama 3, Mistral, embedding models) at the edge with zero cold starts.
  • Durable Objects Hibernation: Cost-effective stateful edge — objects hibernate when idle, wake instantly on request.
  • Workers Static Assets: Serve static files directly from Workers without separate Pages deployment.
  • Node.js Compatibility Mode: Import Node.js built-in modules (node:crypto, node:buffer, node:streams) directly in Workers.

Core Architecture Patterns

1. Project Setup (Wrangler + Hono)
bash
# Create new Workers project with Hono
npm create cloudflare@latest my-app -- --framework=hono
cd my-app

# wrangler.toml configuration
toml
# wrangler.toml
name = "my-app"
compatibility_date = "2026-10-01"
compatibility_flags = ["nodejs_compat_v2"]

# D1 Database
[[d1_databases]]
binding = "DB"
database_name = "my-app-db"
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

# KV Namespace
[[kv_namespaces]]
binding = "CACHE"
id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# R2 Bucket
[[r2_buckets]]
binding = "STORAGE"
bucket_name = "my-app-assets"

# Queue Producer
[[queues.producers]]
queue = "email-queue"
binding = "EMAIL_QUEUE"

# Queue Consumer
[[queues.consumers]]
queue = "email-queue"
max_batch_size = 10
max_batch_timeout = 30

# Durable Object
[[durable_objects.bindings]]
name = "RATE_LIMITER"
class_name = "RateLimiter"

[[migrations]]
tag = "v1"
new_classes = ["RateLimiter"]

# Hyperdrive (PostgreSQL connection pooling)
[[hyperdrive]]
binding = "HYPERDRIVE"
id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Workers AI
[ai]
binding = "AI"
2. Hono Application on Workers
typescript
import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { bearerAuth } from 'hono/bearer-auth';

type Bindings = {
  DB: D1Database;
  CACHE: KVNamespace;
  STORAGE: R2Bucket;
  EMAIL_QUEUE: Queue;
  AI: Ai;
  HYPERDRIVE: Hyperdrive;
};

const app = new Hono<{ Bindings: Bindings }>();

app.use('*', cors());

// D1 SQLite query
app.get('/api/products', async (c) => {
  const { results } = await c.env.DB.prepare(
    'SELECT id, name, price FROM products WHERE active = 1 ORDER BY created_at DESC LIMIT 50'
  ).all();
  return c.json(results);
});

// KV cache-aside pattern
app.get('/api/config/:key', async (c) => {
  const key = c.req.param('key');
  const cached = await c.env.CACHE.get(key, 'json');
  if (cached) return c.json(cached);

  const { results } = await c.env.DB.prepare(
    'SELECT value FROM config WHERE key = ?'
  ).bind(key).all();
  
  if (results.length > 0) {
    await c.env.CACHE.put(key, JSON.stringify(results[0]), { expirationTtl: 3600 });
    return c.json(results[0]);
  }
  return c.notFound();
});

// R2 file upload
app.post('/api/upload', async (c) => {
  const formData = await c.req.formData();
  const file = formData.get('file') as File;
  const key = `uploads/${Date.now()}-${file.name}`;
  
  await c.env.STORAGE.put(key, file.stream(), {
    httpMetadata: { contentType: file.type },
  });
  
  return c.json({ key, url: `/files/${key}` });
});

// Queue producer — send async job
app.post('/api/send-email', async (c) => {
  const body = await c.req.json();
  await c.env.EMAIL_QUEUE.send({
    to: body.email,
    subject: body.subject,
    template: body.template,
  });
  return c.json({ status: 'queued' });
});

// Workers AI — text generation
app.post('/api/ai/generate', async (c) => {
  const { prompt } = await c.req.json();
  const response = await c.env.AI.run('@cf/meta/llama-3.1-8b-instruct', {
    messages: [{ role: 'user', content: prompt }],
  });
  return c.json(response);
});

export default app;

// Queue consumer handler
export default {
  ...app,
  async queue(batch: MessageBatch, env: Bindings): Promise<void> {
    for (const message of batch.messages) {
      const { to, subject, template } = message.body as EmailJob;
      await sendEmail(to, subject, template); // your email sending logic
      message.ack();
    }
  },
};
3. D1 Migrations
bash
# Create migration
wrangler d1 migrations create my-app-db create_products

# Write SQL migration
# migrations/0001_create_products.sql
sql
CREATE TABLE products (
  id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
  name TEXT NOT NULL,
  price REAL NOT NULL CHECK(price >= 0),
  description TEXT DEFAULT '',
  active INTEGER DEFAULT 1,
  created_at TEXT DEFAULT (datetime('now')),
  updated_at TEXT DEFAULT (datetime('now'))
);

CREATE INDEX idx_products_active ON products(active);
CREATE INDEX idx_products_created ON products(created_at DESC);
bash
# Apply migration
wrangler d1 migrations apply my-app-db
4. Durable Objects (Stateful Edge)
typescript
export class RateLimiter implements DurableObject {
  private requests: number[] = [];
  private readonly limit = 100;
  private readonly windowMs = 60_000;

  constructor(private state: DurableObjectState, private env: Bindings) {}

  async fetch(request: Request): Promise<Response> {
    const now = Date.now();
    this.requests = this.requests.filter(t => now - t < this.windowMs);
    
    if (this.requests.length >= this.limit) {
      return new Response('Rate limit exceeded', { status: 429 });
    }
    
    this.requests.push(now);
    await this.state.storage.put('requests', this.requests);
    
    return new Response('OK', {
      headers: {
        'X-RateLimit-Remaining': String(this.limit - this.requests.length),
        'X-RateLimit-Limit': String(this.limit),
      },
    });
  }
}
5. Hyperdrive (External Database Connection)
typescript
import { Client } from 'pg';

app.get('/api/users', async (c) => {
  const client = new Client({ connectionString: c.env.HYPERDRIVE.connectionString });
  await client.connect();
  
  const { rows } = await client.query('SELECT id, email, name FROM users LIMIT 100');
  await client.end();
  
  return c.json(rows);
});

Performance Best Practices

  1. Use D1 for read-heavy workloads — SQLite at edge with automatic read replicas.
  2. KV for hot cache — Sub-millisecond reads for configuration, feature flags, and session data.
  3. R2 for assets — Zero egress fees, S3-compatible API.
  4. Queues for async work — Decouple request handling from background processing.
  5. Hyperdrive for external DBs — Connection pooling eliminates cold connection latency.
  6. Workers AI for inference — Run models at edge without managing GPU infrastructure.
  7. Use waitUntil() — For fire-and-forget operations (logging, analytics) after response is sent.

Anti-Patterns to Avoid

  1. Storing large blobs in KV — Use R2 for files >25MB. KV is for small values (<25MB).
  2. Opening new DB connections per request without Hyperdrive — Cold connections add 50-200ms latency.
  3. Not using prepared statements with D1 — Always use .prepare().bind() to prevent SQL injection.
  4. Synchronous heavy computation — Workers have a CPU time limit (10-30ms for free, 30s for paid). Offload to Queues.
  5. Ignoring wrangler dev --remote — Use remote mode to test D1, R2, and KV with real data.

Sovereign Execution, Token Efficiency & Invariants

DimensionSovereign Mandate & Deterministic Contract
Frontier Model CascadeMedium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast)
Availability FallbackGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Zero unhandled missing-model errors)
KV-Cache & Token ProtocolPin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out
SaaT CLI & MCP DispatchCLI: vibes skill exec cloudflare-workers-expert <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
NFR & Anti-Slop InvariantsP99 API Gateway Latency < 85ms, OpenAPI 3.1 / TypeSpec strict schema parity, RFC 9457 Problem Details error contracts, Idempotency-Key enforcement; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict


Bahasa Indonesia

Integrasi Orkestrasi

Terhubung dan mengorkestrasi bersama skill domain:

  • Backend Edge & API: js-backend-expert (Hono v4 di Workers, V8 isolates), api-design-expert (endpoint REST & RPC di edge), dan sse-websocket-streaming-expert (WebSocket Durable Objects).
  • Penyimpanan Edge & Database: database-orm-expert (Drizzle dengan D1, pooling Hyperdrive), file-upload-media-expert (presigned URL R2), dan vector-db-rag-expert (Vectorize & Workers AI).
  • Frontend & Cloud: cloud-hosting-expert (custom domain, aturan CDN), senior-frontend (Workers Static Assets), dan anti-slop (arsitektur edge bersih tanpa jebakan polyfill node:fs).
  • Siklus Hidup & DevOps: ci-cd-devops-architect (deployment Wrangler via GitHub Actions), brainstorming, dan zero-to-prod-orchestrator (Fase 4: Backend & APIs).

Deskripsi

Panduan ahli untuk membangun aplikasi full-stack edge menggunakan ekosistem Cloudflare Workers. Mencakup runtime Workers, D1 (SQLite di edge), KV (key-value store), R2 (object storage kompatibel S3), Queues (antrean pesan), Durable Objects (stateful edge), Hyperdrive (connection pooling database), Workers AI (inferensi di edge), dan Wrangler CLI untuk pengembangan dan deployment.

Kondisi Pemicu

  • Membangun aplikasi edge serverless di Cloudflare Workers.
  • Menggunakan D1 sebagai database SQLite di edge.
  • Menyimpan file dengan R2 (kompatibel S3, tanpa biaya egress).
  • Mengimplementasikan KV untuk caching key-value terdistribusi.
  • Membangun aplikasi stateful dengan Durable Objects.
  • Menyiapkan Queues untuk pemrosesan job async di edge.

Pola Arsitektur Inti

1. Ekosistem Cloudflare Workers
LayananFungsiAnalogi
WorkersRuntime serverless di edge (V8 isolates)AWS Lambda@Edge
D1Database SQLite di edgePlanetScale / Turso
KVKey-value store terdistribusiRedis (read-heavy)
R2Object storage (S3-compatible)AWS S3 (tanpa biaya egress)
QueuesAntrean pesanAWS SQS / BullMQ
Durable ObjectsState persisten di edgeStateful actors
HyperdriveConnection pooling ke DB eksternalPgBouncer di edge
Workers AIInferensi model AI di edgeReplicate / Together AI
2. Praktik Terbaik
  • Gunakan D1 untuk workload read-heavy di edge.
  • Gunakan KV untuk cache panas (konfigurasi, feature flags, sesi).
  • Gunakan R2 untuk aset (tanpa biaya egress, API kompatibel S3).
  • Gunakan Queues untuk pekerjaan async (email, notifikasi, pemrosesan gambar).
  • Gunakan Hyperdrive untuk koneksi ke database PostgreSQL/MySQL eksternal.
  • Gunakan waitUntil() untuk operasi fire-and-forget (logging, analitik) setelah respons dikirim.

Matriks Eksekusi Berdaulat, Efisiensi Token & Invarian

DimensiMandat Berdaulat & Kontrak Deterministik
Kaskade Model FrontierMedium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast)
Invarian Fallback KetersediaanGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Bebas gagal saat model belum tersedia/kuota penuh)
Protokol Hemat Token & KV-CacheKunci instruksi & skema statis di prefix awal (kv-cache-prefix-optimizer); kirim potongan CONTEXT_MAP.md (<250 token/panggilan) saat Fan-Out
Eksekusi SaaT CLI & MCPCLI: vibes skill exec cloudflare-workers-expert <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
Invarian NFR & Anti-SlopLatensi P99 API < 85ms, paritas skema ketat OpenAPI 3.1 / TypeSpec, kontrak error RFC 9457 Problem Details, penegakan Idempotency-Key; kode 100% tuntas tanpa placeholder diverifikasi melalui node scripts/check-anti-slop.js --strict

Frequently asked questions

What does the Cloudflare Workers Expert AI skill do?

Cloudflare Workers ecosystem: D1, KV, R2, Queues, Durable Objects / Ekosistem Cloudflare Workers: D1, KV, R2, Queues, Durable Objects.

Why use Cloudflare Workers Expert on TypingMind?

Because you install it once and use it with any model. Cloudflare Workers Expert is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cloudflare Workers Expert in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/roedyrustam/vibes-plug/tree/main/skills/cloudflare-workers-expert. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Cloudflare Workers Expert?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cloudflare Workers Expert?

As many as you like. As long as a model supports skills, you can use Cloudflare Workers Expert with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cloudflare Workers Expert AI skill free?

Yes. It is published on GitHub by roedyrustam under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇