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.

referencessecrets-storegotchas.md

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

Gotchas

Common Errors

".get() Throws on Error"

Cause: Assuming .get() returns null on failure instead of throwing
Solution: Always wrap .get() calls in try/catch blocks to handle errors gracefully

try {
  const key = await env.API_KEY.get();
} catch (error) {
  return new Response("Configuration error", { status: 500 });
}

"Logging Secret Values"

Cause: Accidentally logging secret values in console or error messages
Solution: Only log metadata (e.g., "Retrieved API_KEY") never the actual secret value

"Module-Level Secret Access"

Cause: Attempting to access secrets during module initialization before env is available
Solution: Cache secrets in request scope only, not at module level

"Secret not found in store"

Cause: Secret name doesn't exist, case mismatch, missing workers scope, or incorrect store_id
Solution: Verify secret exists with wrangler secrets-store secret list <store-id> --remote, check name matches exactly (case-sensitive), ensure secret has workers scope, and verify correct store_id

"Scope Mismatch"

Cause: Secret exists but missing workers scope (only has ai-gateway scope)
Solution: Update secret scopes: wrangler secrets-store secret update <store-id> --name SECRET --scopes workers --remote or add via Dashboard

"JSON Parsing Failure"

Cause: Storing invalid JSON in secret, then failing to parse during runtime
Solution: Validate JSON before storing:

# Validate before storing
echo '{"key":"value"}' | jq . && \
  echo '{"key":"value"}' | wrangler secrets-store secret create <store-id> \
    --name CONFIG --scopes workers --remote

Runtime parsing with error handling:

try {
  const configStr = await env.CONFIG.get();
  const config = JSON.parse(configStr);
} catch (error) {
  console.error("Invalid config JSON:", error);
  return new Response("Invalid configuration", { status: 500 });
}

"Cannot access secret in local dev"

Cause: Attempting to access production secrets in local development environment
Solution: Create local-only secrets (without --remote flag) for development: wrangler secrets-store secret create <store-id> --name API_KEY --scopes workers

"Property 'get' does not exist"

Cause: Missing TypeScript type definition for secret binding
Solution: Define interface with get method: interface Env { API_KEY: { get(): Promise<string> }; }

"Binding already exists"

Cause: Duplicate binding in dashboard or conflict between wrangler.jsonc and dashboard
Solution: Remove duplicate from dashboard Settings → Bindings, check for conflicts, or delete old Worker secret with wrangler secret delete API_KEY

"Account secret quota exceeded"

Cause: Account has reached 100 secret limit (beta)
Solution: Check quota with wrangler secrets-store quota --remote, delete unused secrets, consolidate duplicates, or contact Cloudflare for increase

Limits

Limit Value Notes
Max secrets per account 100 Beta limit
Max stores per account 1 Beta limit
Max secret size 1024 bytes Per secret
Local secrets Don't count toward limit Only production secrets count
Scopes available workers, ai-gateway Must have correct scope for access
Scope Account-level Can be reused across multiple Workers
Access method await env.BINDING.get() Async only, throws on error
Management Centralized Via secrets-store commands
Local dev Separate local secrets Use without --remote flag
Regional availability Global except China Network Unavailable in China Network

See: configuration.md, api.md, patterns.md

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.