All skills
davila7 avatar

/cloudflare-deploy

@72b6736

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/davila7/claude-code-templates/cloudflare-deploy

This session only. Nothing lands on disk.

referencesanalytics-enginegotchas.md

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

Analytics Engine Gotchas

Critical Issues

Sampling at High Volumes

Problem: Queries return fewer points than written at >1M writes/min.

Solution:

// Pre-aggregate before writing
let buffer = { count: 0, total: 0 };
buffer.count++; buffer.total += value;

// Write once per second instead of per request
if (Date.now() % 1000 === 0) {
  env.ANALYTICS.writeDataPoint({ doubles: [buffer.count, buffer.total] });
}

Detection: npx wrangler tail → look for "sampling enabled"

writeDataPoint Returns void

// ❌ Pointless await
await env.ANALYTICS.writeDataPoint({...});

// ✅ Fire-and-forget
env.ANALYTICS.writeDataPoint({...});

Writes can fail silently. Check tail logs.

Index vs Blob

Cardinality Use Example
Millions Index user_id, api_key
Hundreds Blob endpoint, status_code, country
// ✅ Correct
{ blobs: [method, path, status], indexes: [userId] }

Can't Query from Workers

Query API requires HTTP auth. Use external service or cache in KV/D1.

No Custom Timestamps

Auto-generated at write time. Store original in blob if needed.

Common Errors

Error Fix
Binding not found Check wrangler.jsonc, redeploy
No data in query Wait 30s; check dataset name; check time range
Query timeout Add time filter; use index for filtering

Limits

Resource Limit
Blobs per point 20
Doubles per point 20
Indexes per point 1
Blob/Index size 16KB
Write rate (no sampling) ~1M/min
Retention 90 days
Query timeout 30s

Best Practices

✅ Pre-aggregate at high volumes
✅ Use index for high-cardinality (millions)
✅ Always include time filter in queries
✅ Design schema before coding

❌ Don't await writeDataPoint
❌ Don't use index for low-cardinality
❌ Don't query without time range
❌ Don't assume all writes succeed

Source: SKILL.md on GitHub

2 warnings1d4 checks · Risk SAFE
  • Gen Agent Trust Hub1d

    The skill is a comprehensive documentation and reference suite for deploying applications and infrastructure to the Cloudflare platform. It provides detailed technical guidance, code snippets, and architectural patterns for various services including Workers, Pages, D1, R2, and AI Gateway. No malicious patterns, obfuscation, or unauthorized data access were detected.

  • Socket1d

    1 alert: gptAnomaly

  • Snyk1d

    Risk: LOW · No issues

  • Runlayer7mo

    304/310 files flagged

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

Last checked against GitHub 15 hours ago.

Activeupdated 8 months ago
author
openai

README badge

README badge for davila7/claude-code-templates/cloudflare-deploy