skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
oakoss/agent-skills94 installs

cloudflare

Cloudflare Workers, KV, D1, R2, Pages, and Wrangler CLI. Use when deploying to the edge, configuring Workers, managing storage bindings, or setting up Cloudflare Pages.

How do I install this agent skill?

npx skills add https://github.com/oakoss/agent-skills --skill cloudflare
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill is a comprehensive technical reference for Cloudflare Workers, Pages, and associated storage services like KV, D1, and R2. It provides documentation, CLI command references, and code examples for building and deploying serverless applications. The analysis found no malicious behavior; the skill consistently promotes security best practices, such as encrypted secrets management and SQL injection prevention via prepared statements.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

  • Runlayerwarn

    5/5 files flagged

What does this agent skill do?

Cloudflare

Overview

Cloudflare Workers is a serverless edge compute platform that runs JavaScript, TypeScript, and WebAssembly on Cloudflare's global network. Workers use the ES modules format with fetch, scheduled, and queue event handlers, and access platform services (KV, D1, R2, Durable Objects) through environment bindings.

When to use: Edge-first APIs, low-latency global apps, serverless functions, static site hosting with Pages, key-value caching, relational data at the edge, object storage without egress fees.

When NOT to use: Long-running compute exceeding CPU time limits, workloads requiring persistent TCP connections, applications needing full Node.js API compatibility, large monolithic applications better suited to containers.

Quick Reference

PatternAPI / ConfigKey Points
Fetch handlerexport default { fetch(request, env, ctx) }Entry point for HTTP requests
Scheduled handlerexport default { scheduled(controller, env, ctx) }Cron triggers via [triggers] in config
Environment variablesenv.VAR_NAMESet in wrangler.toml or dashboard
KV read/writeenv.KV.get(key) / env.KV.put(key, value)Eventually consistent, 25 MiB max value
D1 queryenv.DB.prepare(sql).bind(...params).all()SQLite at the edge, prepared statements
D1 batchenv.DB.batch([stmt1, stmt2])Atomic transaction, single round trip
R2 uploadenv.BUCKET.put(key, body)S3-compatible, no egress fees
R2 downloadenv.BUCKET.get(key)Returns R2ObjectBody with ReadableStream
Durable Objectsenv.DO.get(id) then stub.fetch(request)Single-instance stateful coordination
DO storagethis.ctx.storage.sql.exec(query)SQLite backend recommended for new DOs
Pages deploywrangler pages deploy <dir>Static + Functions, auto-generated routes
Worker deploywrangler deployReads wrangler.toml for config
Dev serverwrangler devLocal development with bindings
Secretswrangler secret put SECRET_NAMEEncrypted, not in wrangler.toml
Static assetsassets: { directory: "./dist" }Served without invoking Worker by default
Workflowsexport class MyWorkflow extends WorkflowEntrypointDurable multi-step execution engine
Hyperdriveenv.HYPERDRIVE.connectionStringConnection pooling for external PostgreSQL
Queues produceenv.QUEUE.send(message)Async message passing between Workers
Config formatwrangler.jsonc (recommended for new projects)JSON with comments; preferred over TOML

Common Mistakes

MistakeCorrect Pattern
Accessing bindings as globalsAccess via env parameter in module format
Storing secrets in wrangler.tomlUse wrangler secret put for encrypted values
Using KV for strong consistencyUse D1 or Durable Objects for consistent reads
Not binding parameters in D1 queriesAlways use .prepare().bind() to prevent SQL injection
Exceeding KV value size (25 MiB)Use R2 for objects larger than 25 MiB
Forgetting await on storage operationsKV, D1, R2 methods are all async
Using fetch() without passing signalPass request.signal for automatic cancellation
Creating D1 database in Worker codeCreate with wrangler d1 create, bind in config
Missing compatibility_date in configAlways set to avoid breaking changes
Returning non-Response from fetch handlerMust return a Response object
Using wrangler.toml for new projectsUse wrangler.jsonc for new projects; has better IDE support
Using KV for relational queriesUse D1 for SQL queries; KV is key-value only

Delegation

  • Architecture review: Use Task agent to evaluate edge vs origin patterns
  • Code review: Delegate to code-reviewer agent
  • Storage selection: Use Explore agent to compare KV vs D1 vs R2 vs DO

References

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/oakoss/agent-skills/cloudflare">View cloudflare on skillZs</a>