Cost Optimization
Optimize Cloudflare Developer Platform costs for Workers CPU vs wall time, D1 operations, KV reads/writes, R2 storage/egress, Durable Object hotspots, Queues, Workflows, Workers AI tokens, and architecture-level trade-offs. Use during design and production reviews.
Install
npx skills add zllovesuki/cloudflare-agent-skills --skill cost-optimizationgit clone --depth 1 https://github.com/zllovesuki/cloudflare-agent-skills.git /tmp/cloudflare-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/cloudflare-agent-skills/skills/cost-optimization ~/.claude/skills/cost-optimizationPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Cost Optimization Use this skill during architecture review, code review, and production hardening. ## Cost model stance - Optimize architecture first, micro-operations second. - Workers are usually best when code waits on I/O rather than burning CPU. - AI inference can dominate costs; manage tokens and model choice early. - R2 is attractive for blob-heavy and egress-sensitive workloads. - KV write-heavy designs can become expensive or consistency-fragile. - Durable Object hot keys can become performance and cost bottlenecks. ## Code-level cost rules - Run independent I/O concurrently with `Promise.all`. - Cache public/deterministic reads where stale data is acceptable. - Avoid excessive KV writes; batch or write through the source of truth. - Avoid unbounded D1 queries; select only needed columns and add indexes. - Stream R2 objects instead of buffering. - Use Queues/Workflows to defer work and avoid user-visible long requests. - Set AI `max_tokens`; retrieve fewer, better chunks for RAG. ## PR review checklist Add a cost note for changes that introduce: - New AI model calls. - New write-heavy KV/D1/Queue paths. - New Durable Object classes or object-key strategy. - Large R2 upload/download flows. - A new Workflow with many steps or retries. - A new external API call from high-traffic routes. ## Cost note template
Details
- Skill name
cost-optimization- Repository
- zllovesuki/cloudflare-agent-skills
- Path
skills/cost-optimization/SKILL.md- Repo updated
- 28 April 2026
FAQ
What does the Cost Optimization skill do?
Optimize Cloudflare Developer Platform costs for Workers CPU vs wall time, D1 operations, KV reads/writes, R2 storage/egress, Durable Object hotspots, Queues, Workflows, Workers AI tokens, and architecture-level trade-offs. Use during design and production reviews.
How do I install the Cost Optimization skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add zllovesuki/cloudflare-agent-skills --skill cost-optimization. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Cost Optimization popular?
It lives in zllovesuki/cloudflare-agent-skills, which has 9 GitHub stars and 0 forks.
Related skills
Agents
9zllovesuki/cloudflare-agent-skills
Build Cloudflare Agents SDK applications for autonomous multi-step tool use, AIChatAgent chat agents, Durable Object-backed state, tools, scheduling, callable methods, WebSockets, SQL state, and constrained agent behavior. Use when RAG or Workflows are not enough.
Cloudflare Architecture
9zllovesuki/cloudflare-agent-skills
Choose Cloudflare Developer Platform primitives and architecture shapes before writing code. Use for Cloudflare Workers, Durable Objects, D1, R2, Queues, Workflows, Containers, Realtime, Workers AI, Vectorize, AI Search, Agents, cost, limits, and migration decisions.
Containers
9zllovesuki/cloudflare-agent-skills
Decide when to use Cloudflare Containers instead of Workers and design container-backed workloads, native binaries, long-running processes, image processing, larger runtime shapes, and Worker frontends. Use as an escape hatch when Workers constraints do not fit.
Paddle Catalog Setup
9PaddleHQ/paddle-agent-skills
Create the Paddle products and prices that other Paddle skills depend on — try MCP tools first, then the Paddle CLI, fall back to a Node SDK seed script, or dictate dashboard steps as a last resort.
Paddle Onboarding
9PaddleHQ/paddle-agent-skills
Check a Paddle account's onboarding status in sandbox or live — audit settings, credentials, notification destinations, catalog, domains, and verification, report what's done and missing against the go-live checklist, then fix the gaps the API allows with the user's approval.
Network Debug
5franco-bianco/claude-skills
Inspect HTTP traffic captured by PowHTTP MCP proxy. Use when fixing request mismatches in existing code or building new API flows from browser traffic.
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.