Awesome-omni-skill cloudflare-edge-architect
Advanced architecture skill for Cloudflare. Covers Workers, Durable Objects, R2, D1, and Edge-first data strategies.
install
source · Clone the upstream repo
git clone https://github.com/diegosouzapw/awesome-omni-skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/devops/cloudflare-edge-architect" ~/.claude/skills/diegosouzapw-awesome-omni-skill-cloudflare-edge-architect && rm -rf "$T"
manifest:
skills/devops/cloudflare-edge-architect/SKILL.mdsource content
Cloudflare Edge Architect Skill
This skill (formerly
cloudflare-workers-ops) focuses on building scalable, stateful, and performant architectures on the Cloudflare global network.
Core Pillars
- Stateful Coordination (Durable Objects): Use Durable Objects for real-time multiplayer coordination, game engines state synchronization, and WebSockets.
- Edge Data (D1 & KV): Strategy for distributing relational data (D1) and low-latency configuration (KV).
- Object Storage (R2): Serve game assets and large binaries efficiently without egress fees.
- Compute-at-Edge (Workers): Offload API logic and game logic to the edge to minimize latency.
- AI-at-Edge (Workers AI): Integrate on-device inference for features like move suggestions or content moderation.
Architecture Patterns
Real-time Multiplayer with Durable Objects
// Durable Object implementation for Game Session export class GameSession { state: DurableObjectState; constructor(state: DurableObjectState) { this.state = state; } async fetch(request: Request) { // Handle game state updates and WebSocket connections } }
Best Practices Checklist
- Cross-Origin Isolation: Set
andCross-Origin-Opener-Policy: same-origin
to enableCross-Origin-Embedder-Policy: require-corp
for Wasm threads.SharedArrayBuffer - Smart Placement: Enable Cloudflare Smart Placement to minimize latency between Workers and backends.
- Bundling: Use
oresbuild
's built-in bundling to optimize script size.wrangler - Environment Secrets: Securely manage keys for external APIs using
.wrangler secret
Advanced Commands
pnpm wrangler d1 migrations create <db_name> <description>pnpm wrangler r2 bucket create <bucket_name>
: Test with real Cloudflare resources.pnpm wrangler dev --remote
Troubleshooting
- "Durable Object not found": Ensure the namespace is correctly defined in
.wrangler.toml - "Exceeded CPU limits": Optimize tight loops or offload heavy processing to asynchronous tasks.