← 返回 Skills 市场
infamoustho

Cloudflare Developer Skill

作者 infamoustho · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
49
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cloudflare-developer-skill
功能描述
Expertise in Cloudflare Workers, Pages, D1, R2, KV storage, AI integration, security best practices, deployment, and performance optimization.
使用说明 (SKILL.md)

Cloudflare Developer Platform Skill

Description

Complete Cloudflare Developer Platform knowledge: Workers, Pages, D1, R2, KV, AI, security best practices, and deployment patterns.

Quick Actions

Deploy Workers

# Init new Worker
wrangler init my-worker

# Dev local
wrangler dev

# Deploy production
wrangler deploy

Setup D1 Database

# Create database
wrangler d1 create my-db

# Add to wrangler.toml
[[d1_databases]]
binding = "DB"
database_name = "my-db"
database_id = "xxx"

# Run migrations
wrangler d1 migrations apply my-db

Setup R2 Bucket

# Create bucket
wrangler r2 bucket create my-bucket

# Add to wrangler.toml
[[r2_buckets]]
binding = "MY_BUCKET"
bucket_name = "my-bucket"

Decision Trees

Storage Choice

  • Config, feature flags, session tokens → KV
  • Structured data (SQL tables) → D1
  • Files, uploads, backups → R2

SSL/TLS Mode

  • Origin has valid cert → Full (strict) ✅
  • Origin self-signed cert → Full
  • Origin HTTP only → Flexible (last resort)

Cache Strategy

  • Static assets (/assets/*, *.css, *.js) → Cache, long TTL
  • Public HTML (no session) → Cache, medium TTL
  • Dynamic HTML (session) → Bypass
  • API with auth → Bypass
  • Admin/checkout → Bypass

Best Practices

Workers

  • Always use bindings (env.KV, env.DB, env.MY_BUCKET) instead of REST API
  • Await all Promises or use ctx.waitUntil() for background tasks
  • Custom domain: Worker as origin, DNS record must be proxied (orange cloud)
  • Debug: wrangler tail

D1

  • Create indexes for columns in WHERE clause (email, user_id)
  • ONLY index frequently queried columns
  • Run migrations: wrangler d1 migrations apply

Security

  • WAF rollout: Log → Simulate (24-48h) → Block
  • SSL: Full (strict) when you have valid cert
  • DO NOT proxy MX records
  • Origin firewall: only allow Cloudflare IPs

Performance

  • Enable Tiered Cache (free)
  • DO NOT cache HTML with sessions → data leak
  • Bypass cache for /admin, /checkout, /api with cookies
  • Check CF-Cache-Status header

Common Mistakes & Fixes

Issue Cause Fix
Worker 404 Route missing DNS proxied Add DNS record + orange cloud
Email down MX record proxied Remove proxy from MX
Redirect loop SSL Flexible + HTTPS origin Change to Full (strict)
Data leak Cache HTML with session Bypass dynamic pages
KV inconsistent Eventually consistent model Use D1 for transactional data
D1 slow Missing index Index columns in WHERE

Architecture Patterns

Fullstack App

User → Pages (frontend) → Pages Functions (/api/*) → D1 + KV + R2

API with Workers

Client → Custom domain (Worker) → D1/KV/external API

RAG with Workers AI

User → Worker → AI Gateway → Workers AI (embedding) → Vectorize → LLM

Troubleshooting

Worker not running

  1. Check wrangler.toml routes
  2. Verify DNS record proxied (orange cloud)
  3. Check wrangler tail logs
  4. Test with wrangler dev local

D1 migration error

  1. Check SQL syntax
  2. Verify binding in wrangler.toml
  3. Dry run: wrangler d1 migrations list

Cache not hitting

  1. Check CF-Cache-Status header
  2. Verify Cache Rules
  3. Enable Tiered Cache
  4. Review bypass rules

Resources


Last updated: 2026-06-03
Source: Cloudflare Starter Hub complete learning path

安全使用建议
Install is reasonable if you want Cloudflare development guidance. Before running any `wrangler deploy`, `create`, or `migrations apply` command from the skill, confirm you are in the intended Cloudflare account and environment, preferably test first, and understand that those commands can create or modify live resources.
能力评估
Purpose & Capability
The content matches the stated Cloudflare Developer Platform purpose: Workers, Pages, D1, R2, KV, AI, security guidance, troubleshooting, and deployment patterns.
Instruction Scope
The skill includes live `wrangler` examples for deploying Workers and creating D1/R2 resources; these are purpose-aligned but not clearly labeled as mutating or potentially billable.
Install Mechanism
Installation is disclosed as ClawHub install or manual git clone into the OpenClaw skills directory; no executable installer or hidden setup script is present.
Credentials
Cloudflare account access and Wrangler authentication would be needed only when a user runs the documented commands; the skill itself does not collect credentials or access local sessions.
Persistence & Privilege
Persistence is limited to installed markdown and JSON skill files, with no background worker, privilege escalation, autorun, or broad local indexing behavior.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cloudflare-developer-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cloudflare-developer-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the Cloudflare Developer Platform Skill. - Covers comprehensive topics: Workers, Pages, D1, R2, KV, AI, security best practices, and deployment patterns. - Provides quick commands for deploying Workers, setting up D1 databases, and R2 buckets. - Includes decision trees for storage, SSL/TLS, and cache strategies. - Outlines best practices for Workers, D1, security, and performance. - Lists common mistakes with fixes, architecture patterns, troubleshooting steps, and helpful resource links.
元数据
Slug cloudflare-developer-skill
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Cloudflare Developer Skill 是什么?

Expertise in Cloudflare Workers, Pages, D1, R2, KV storage, AI integration, security best practices, deployment, and performance optimization. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 49 次。

如何安装 Cloudflare Developer Skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cloudflare-developer-skill」即可一键安装,无需额外配置。

Cloudflare Developer Skill 是免费的吗?

是的,Cloudflare Developer Skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Cloudflare Developer Skill 支持哪些平台?

Cloudflare Developer Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Cloudflare Developer Skill?

由 infamoustho(@infamoustho)开发并维护,当前版本 v1.0.0。

💬 留言讨论