Skip to main content
cf-common

Typed TypeScript wrappers and helpers for Cloudflare bindings and APIs — one tree-shakeable module per service.

worker.ts
import { getBinding } from '@rtorcato/cf-common/env'
import { createKvStore } from '@rtorcato/cf-common/kv'

export default {
async fetch(req, env) {
const users = createKvStore<User>(getBinding(env, 'USERS'))
const hit = await users.get('u:42') // User | null
if (!hit) await users.put('u:42', { id: 42 }, { ttl: 3600 })
return Response.json(hit ?? { id: 42 })
},
}
npm install @rtorcato/cf-common

Use with AI

A skill ships with the package so coding agents use cf-common correctly — whichever tool you're in.

Read the rules →
Any coding agent
Pull the skill into any tool the skills CLI supports.
npx skills add https://github.com/rtorcato/cf-common --skill cf-common
Claude Code
The repo is its own plugin marketplace — add it, then install the skill.
/plugin marketplace add rtorcato/cf-common
/plugin install cf-common@cf-common
Cursor, Copilot, Codex
They read AGENTS.md. It ships in the npm tarball, so it is already in your node_modules.
node_modules/@rtorcato/cf-common/AGENTS.md
Typed end-to-end
Typed end-to-end
Strict types over every binding — no `any` at the edges.
Tree-shakeable
Tree-shakeable
Named subpath exports — ship only the service you import.
Thin, not a framework
Thin, not a framework
A convenience layer over Cloudflare, never a wrapper you fight.
Zero required deps
Zero required deps
Pure helpers over the Workers runtime APIs you already have.

One module per Cloudflare service

Shipped modules open their guide. The rest are on the roadmap.

Sibling projects

More from @rtorcato — same conventions, same release pipeline.