Skip to content
Agentmart
Submit a tool

hono-ops

Hono on Cloudflare Workers - composition, middleware, typed bindings, validation, RPC, streaming, testing.

Skill by claude-mods

IndexedMIT★ 75
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/0xdarkmatter-hono-ops

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Hono on Cloudflare Workers - composition, middleware, typed bindings, validation, RPC, streaming, testing. Use for: hono, hono middleware, app.route, hono rpc, c.env bindings, onError, zValidator, vitest-pool-workers, spa fallback worker.

Use cases: testing, cloud

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/hono-ops

Tools it pre-approves 5

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Read
  • Write
  • Bash
  • Grep
  • Glob

What's inside

Skill name
hono-ops
Description
Hono on Cloudflare Workers - composition, middleware, typed bindings, validation, RPC, streaming, testing. Use for: hono, hono middleware, app.route, hono rpc, c.env bindings, onError, zValidator, vitest-pool-workers, spa fallback worker.
License
MIT
Allowed tools
Read, Write, Bash, Grep, Glob
Metadata
author: claude-mods · related-skills: cloudflare-ops, typescript-ops, sqlite-ops, rest-ops, testing-ops, auth-ops
Instructions
278 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts
  • Pre-approves any shell command
  • Instructions call the network

Files (20)

  • SKILL.md
  • hono-facts.json · assets/
  • vitest.config.template.ts · assets/
  • worker-template.ts · assets/
  • app-composition.md · references/
  • durable-objects.md · references/
  • errors-validation.md · references/
  • jsx-ssr.md · references/
  • middleware.md · references/
  • openapi.md · references/
  • routing-and-request.md · references/
  • rpc-clients.md · references/
  • runtime-adapters.md · references/
  • streaming-and-realtime.md · references/
  • testing.md · references/
  • workers-runtime.md · references/
  • check-hono-facts.py · scripts/
  • route-inventory.py · scripts/
  • sample-app.ts · tests/fixtures/
  • run.sh · tests/

SKILL.md (first lines)

# Hono Operations

Hono on Cloudflare Workers: composing multi-app APIs in one Worker, middleware
discipline, typed errors, validation at the HTTP boundary, SPA co-serving, RPC
clients, and testing under vitest-pool-workers. Patterns here are distilled from a
production multi-tenant Worker (one Hono app, 6+ mounted sub-apps, ~1350 tests).

> Verified against Hono v4 (2026). Workers-first; the Node/Bun/Deno deltas and
> porting checklist live in references/runtime-adapters.md.

**Staleness check:** `python scripts/check-hono-facts.py --offline` asserts the
version-bearing facts (Hono major, `@hono/zod-validator`,
`@cloudflare/vitest-pool-workers`) are still named in the prose and the dated
currency note above is present; `--live` confirms each package's npm major still
matches. Catalog: `assets/hono-facts.json`.

## Decision Tree

```
What are you doing with Hono?
│
├─ Structuring an app (generics, sub-apps, env typing)
│  └─ Below + references/app-composition.md
│
├─ Middleware (ordering, auth, headers, exclusion boundaries)
│  └─ Below + references/middleware.md
│
├─ Errors / 404s / request validation
│  └─ Below + references/errors-validation.md
│
├─ Path syntax, routers, c.req/c.res surface, cookies
│  └─ references/routing-and-request.md
│
├─ Serving a SPA / static assets from the same Worker
│  └─ references/workers-runtime.md
│
├─ Cron / queues alongside fetch; runtime gotchas
│  └─ references/workers-runtime.md
│
├─ Streaming / SSE / WebSockets / proxying / service bindings
│  └─ references/streaming-and-realtime.md
│
├─ Durable Objects (Hono in a DO, hibernated WS, alarms)
│  └─ references/durable-objects.md
│
├─ OpenAPI docs from routes (@hono/zod-openapi)
│  └─ references/openapi.md
│
├─ Server-rendered HTML / JSX / HTML emails
│  └─ references/jsx-ssr.md
│
├─ Running or porting to Node / Bun / Deno
│  └─ references/runtime-adapters.md
│
├─ Typed client (hc RPC vs hand-rolled)
│  └─ references/rpc-clients.md
│
├─ Testing (app.request, pool-workers, middleware isolation)
│  └─ references/testing.md + assets/vitest.config.template.ts
│
├─ Starting a new Worker from scratch
│  └─ assets/worker-template.ts (commented composition-root skeleton)
│
└─ Auditing an existing app's routes / middleware order
   └─ scripts/route-inventory.py (below)
```

## App Composition (the 80%)

Type the app once with `Bindings` (wrangler-provided env) and `Variables`
(per-request context you `c.set`):

```typescript
import { Hono } from 'hono';

interface Env {
  DB: D1Database;
  ASSETS: Fetcher;          // static assets binding (SPA)
  API_KEYS?: string;        // optional secret: gate features on presence, 503 when unset
}
type Vars = { identity: Identity; repo: ScopedRepository };

export const app = new Hono<{ Bindings: Env; Variables: Vars }>();
```

- `c.env.DB` — bindings, typed via `Bindings`.
- `c.set('identity', id)` / `c.get('identity')` / `c.var.identity` — per-request
  state, typed via `Variables`. Middleware writes it; handlers read it.
- Prefer the per-app `Variables` generic over global `ContextVariableMap`
  augmentation; the map is app-wide and leaks types across unrelated sub-apps
  (see [references/app-composition.md](references/app-composition.md)).

**Sub-app mounting** — one Worker, many feature apps, each its own file:

```typescript
// src/time/api.ts
export const timeApi = new Hono<{ Bindings: Env; Variables: Vars }>();
timeApi.get('/entries', (c) => { /* identity + repo already in context */ });

// src/index.ts — mounted under the auth middleware (see Middleware below)
app.route('/api/time', timeApi);       // timeApi sees paths relative to the mount
app.route('/api/time', billingApi);    // two sub-apps on one base is fine when
                                       // their paths are disjoint — Hono matches across both
```

The mounted sub-app inherits nothing implicitly except position: whatever
middleware was registered on a matching path *before* the mount runs first.
Position IS the security boundary — see Middleware.

## Middleware: Order Is the Contract

Hono middleware is an onion — code before `await next()` runs inbound, code
after runs outbound — and **registration order is matching order**. A middleware
registered after a matching handler never runs for it.

```typescript
app.use('*', securityHeaders());        // 1. outermost: response hardening
app.get('/api/health', (c) => c.json({ ok: true }));  // 2. before auth = unauthenticated

From 0xDarkMatter/claude-mods, MIT.

More from 0xDarkMatter/claude-mods

Signals

Stars
75
Forks
8
Open issues
0
Last commit (this folder)
Aug 8, 2026 (2 months ago)
Last release
Oct 14, 2026 (14 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from claude-mods

Cite this page

hono-ops skill. Agent Mart. https://agentmart.dev/skills/0xdarkmatter-hono-ops (last updated 2026-10-24)