Claude-skill-registry cloudflare-hono
Wire Cloudflare Workers Env typings into Hono apps. Use when working in Cloudflare Workers + Hono, when the user mentions wrangler types, worker-configuration.d.ts, or typing Bindings/Env in Hono.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/cloudflare-hono" ~/.claude/skills/majiayu000-claude-skill-registry-cloudflare-hono && rm -rf "$T"
manifest:
skills/data/cloudflare-hono/SKILL.mdsource content
Cloudflare Hono Env Typing
Quick start
Use the Env type generated by
wrangler types from apps/api/worker-configuration.d.ts, then pass it into Hono's generics.
import type { Env } from "../worker-configuration"; import { Hono } from "hono"; export const domainWorkersRouter = new Hono<{ Bindings: Env }>();
Workflow
- Generate or update typings:
- Run
inwrangler types
(this creates/updatesapps/api
).apps/api/worker-configuration.d.ts
- Run
- Import the Env type from
:apps/api/worker-configuration.d.tsimport type { Env } from "../worker-configuration";
- Thread Env into Hono:
new Hono<{ Bindings: Env }>()
- Use typed bindings via
:c.envconst db = c.env.ZEROSPIN_DATABASE
Notes
- Keep the Env import as a type-only import.
- The
file is generated; do not hand-edit it.worker-configuration.d.ts - If the file path changes, update the import path in routes/modules accordingly.
Example route snippet
import type { Env } from "../worker-configuration"; import { Hono } from "hono"; export const domainWorkersRouter = new Hono<{ Bindings: Env }>(); domainWorkersRouter.get("/", (c) => { const db = c.env.ZEROSPIN_DATABASE; return c.json({ ok: true, hasDb: Boolean(db) }); });