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.

referencesobservabilitygotchas.md

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

Common Errors

"Logs not appearing"

Cause: Observability disabled, Worker not redeployed, no traffic, low sampling rate, or log size exceeds 256 KB Solution:

# Verify config
cat wrangler.jsonc | jq '.observability'

# Check deployment
wrangler deployments list <WORKER_NAME>

# Test with curl
curl https://your-worker.workers.dev

Ensure observability.enabled = true, redeploy Worker, check head_sampling_rate, verify traffic

"Traces not being captured"

Cause: Traces not enabled, incorrect sampling rate, Worker not redeployed, or destination unavailable Solution:

// Temporarily set to 100% sampling for debugging
{
  "observability": {
    "enabled": true,
    "head_sampling_rate": 1.0,
    "traces": {
      "enabled": true
    }
  }
}

Ensure observability.traces.enabled = true, set head_sampling_rate to 1.0 for testing, redeploy, check destination status

Limits

Resource/Limit Value Notes
Max log size 256 KB Logs exceeding this are truncated
Default sampling rate 1.0 (100%) Reduce for high-traffic Workers
Max destinations Varies by plan Check dashboard
Trace context propagation 100 spans max Deep call chains may lose spans
Analytics Engine write rate 25 writes/request Excess writes dropped silently

Performance Gotchas

Spectre Mitigation Timing

Problem: Date.now() and performance.now() have reduced precision (coarsened to 100μs) Cause: Spectre vulnerability mitigation in V8 Solution: Accept reduced precision or use Workers Traces for accurate timing

// Date.now() is coarsened - trace spans are accurate
export default {
  async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
    // For user-facing timing, Date.now() is fine
    const start = Date.now();
    const response = await processRequest(request);
    const duration = Date.now() - start;
    
    // For detailed performance analysis, use Workers Traces instead
    return response;
  }
}

Analytics Engine _sample_interval Aggregation

Problem: Queries return incorrect totals when not multiplying by _sample_interval Cause: Analytics Engine stores sampled data points, each representing multiple events Solution: Always multiply counts/sums by _sample_interval in aggregations

-- WRONG: Undercounts actual events
SELECT blob1 AS customer_id, COUNT(*) AS total_calls
FROM api_usage GROUP BY customer_id;

-- CORRECT: Accounts for sampling
SELECT blob1 AS customer_id, SUM(_sample_interval) AS total_calls
FROM api_usage GROUP BY customer_id;

Trace Context Propagation Limits

Problem: Deep call chains lose trace context after 100 spans Cause: Cloudflare limits trace depth to prevent performance impact Solution: Design for flatter architectures or use custom correlation IDs for deep chains

// For deep call chains, add custom correlation ID
const correlationId = crypto.randomUUID();
console.log({ correlationId, event: 'request_start' });

// Pass correlationId through headers to downstream services
await fetch('https://api.example.com', {
  headers: { 'X-Correlation-ID': correlationId }
});

Pricing (2026)

Workers Traces

  • GA Pricing (starts March 1, 2026):
    • $0.10 per 1M trace spans captured
    • Retention: 14 days included
  • Free tier: 10M trace spans/month
  • Note: Beta usage (before March 1, 2026) is free

Workers Logs

  • Included: Free for all Workers
  • Logpush: Requires Business/Enterprise plan

Analytics Engine

  • Included: 10M writes/month on Paid Workers plan
  • Additional: $0.25 per 1M writes beyond included quota

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.