All skills
openai avatar

/cloudflare-deploy

@bf9e226 official
by openaiopenai/skills28k stars
1,891

Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.

Use this Skill: https://skilld.dev/gh/openai/skills/cloudflare-deploy

This session only. Nothing lands on disk.

referenceshyperdriveREADME.md

≈730 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Hyperdrive

Accelerates database queries from Workers via connection pooling, edge setup, query caching.

Key Features

  • Connection Pooling: Persistent connections eliminate TCP/TLS/auth handshakes (~7 round-trips)
  • Edge Setup: Connection negotiation at edge, pooling near origin
  • Query Caching: Auto-cache non-mutating queries (default 60s TTL)
  • Support: PostgreSQL, MySQL + compatibles (CockroachDB, Timescale, PlanetScale, Neon, Supabase)

Architecture

Worker → Edge (setup) → Pool (near DB) → Origin
         ↓ cached reads
         Cache

Quick Start

# Create config
npx wrangler hyperdrive create my-db \
  --connection-string="postgres://user:pass@host:5432/db"

# wrangler.jsonc
{
  "compatibility_flags": ["nodejs_compat"],
  "hyperdrive": [{"binding": "HYPERDRIVE", "id": "<ID>"}]
}
import { Client } from "pg";

export default {
  async fetch(req: Request, env: Env): Promise<Response> {
    const client = new Client({
      connectionString: env.HYPERDRIVE.connectionString,
    });
    await client.connect();
    const result = await client.query("SELECT * FROM users WHERE id = $1", [123]);
    await client.end();
    return Response.json(result.rows);
  },
};

When to Use

✅ Global access to single-region DBs, high read ratios, popular queries, connection-heavy loads ❌ Write-heavy, real-time data (<1s), single-region apps close to DB

💡 Pair with Smart Placement for Workers making multiple queries - executes near DB to minimize latency.

Driver Choice

Driver Use When Notes
pg (recommended) General use, TypeScript, ecosystem compatibility Stable, widely used, works with most ORMs
postgres.js Advanced features, template literals, streaming Lighter than pg, prepare: true is default
mysql2 MySQL/MariaDB/PlanetScale MySQL only, less mature support

Reading Order

New to Hyperdrive Implementing Troubleshooting
1. README (this) 1. configuration.md 1. gotchas.md
2. configuration.md 2. api.md 2. patterns.md
3. api.md 3. patterns.md 3. api.md

In This Reference

  • configuration.md - Setup, wrangler config, Smart Placement
  • api.md - Binding APIs, query patterns, driver usage
  • patterns.md - Use cases, ORMs, multi-query optimization
  • gotchas.md - Limits, troubleshooting, connection management

See Also

  • smart-placement - Optimize multi-query Workers near databases
  • d1 - Serverless SQLite alternative for edge-native apps
  • workers - Worker runtime with database bindings

Source: SKILL.md on GitHub

2 warnings17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    This skill provides comprehensive guidance for deploying and managing infrastructure on the Cloudflare platform. It includes extensive educational material on secure development practices, such as preventing SQL injection and managing secrets effectively. No malicious patterns or security risks were identified.

  • Socket17d

    2 alerts: gptAnomaly

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    310/310 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at bf9e226. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Activeupdated 8 months ago

README badge

README badge for openai/skills/cloudflare-deploy

Deploys applications and infrastructure to Cloudflare's platform, including Workers, Pages, D1, R2, Durable Objects, KV, and other services. Use decision trees to route to the right Cloudflare product based on compute, storage, AI, networking, security, or media needs.

Generated from the current SKILL.md.

Does this skill cover all Cloudflare products?
The skill is a consolidated index covering compute, storage, AI, networking, security, media, and developer tools on Cloudflare. It uses decision trees to route you to the right product reference, then loads detailed guidance for that product.
What authentication is required before deploying?
Run `npx wrangler whoami` to check if authenticated. For local deployment, use `wrangler login` (one-time OAuth). For CI/CD, set the `CLOUDFLARE_API_TOKEN` environment variable.
What should I do if deployment fails due to network issues?
Rerun the deploy with `sandbox_permissions=require_escalated` to grant elevated network access, which is required for outbound requests to Cloudflare during deployment.
How long does a Cloudflare deployment typically take?
Deployments may take several minutes. Use appropriate timeout values in your configuration or CI/CD environment.

Generated from the current SKILL.md. These answers refresh after source changes.