
Hono Routing
Stand up type-safe Hono APIs with routing, middleware, Zod or Valibot validation, RPC clients, SSE, WebSockets, and security headers on Workers or Node runtimes.
Overview
hono-routing is an agent skill for the Build phase that helps you implement type-safe Hono APIs with routing, middleware, validation, RPC, streaming, and WebSockets across edge and Node runtimes.
Install
npx skills add https://github.com/jezweb/claude-skills --skill hono-routingWhat is this skill?
- Production-ready guidance for Cloudflare Workers, Deno, Bun, and Node.js
- Typed routes, RPC client patterns, and c.req.valid validation hooks
- Streaming SSE and WebSocket patterns alongside standard JSON handlers
- Security middleware: CSRF and secureHeaders called out in scope
- Troubleshooting matrix for JWT verify algorithm (v4.11.4+), consumed bodies, and middleware typing
- Documented production-ready status with cross-runtime testing (Workers, Deno, Bun, Node)
Adoption & trust: 624 installs on skills.sh; 841 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are shipping an API on Workers or Bun but keep hitting untyped middleware, validation hook mistakes, or JWT and body-consumption errors in Hono.
Who is it for?
Solo developers building edge APIs, webhooks, or agent tool servers where Hono’s lightweight router and typed client RPC are the backbone.
Skip if: Teams standardized on NestJS-only patterns or front-end-only workflows with no HTTP surface to implement.
When should I use this skill?
Building Hono APIs, streaming SSE, WebSocket endpoints, validation, or RPC—and when troubleshooting validation hooks, RPC types, middleware chains, or JWT verify requirements.
What do I get? / Deliverables
You leave with working route modules, validated handlers, and patterns for RPC, SSE, WebSockets, and security middleware aligned to your runtime.
- Route and middleware modules with typed handlers
- Validation and error-handling patterns for RPC or REST clients
Recommended Skills
Journey fit
Build backend is the natural home for implementing HTTP routes, validators, and middleware chains before Ship testing and security hardening. Backend subphase reflects API construction, context typing, and cross-runtime deployment rather than frontend UI or launch SEO work.
How it compares
Skill-backed Hono recipes beat ad-hoc chat snippets when you need multi-runtime middleware and validator troubleshooting in one place.
Common Questions / FAQ
Who is hono-routing for?
Indie builders and agent coders implementing HTTP APIs on Cloudflare Workers, Deno, Bun, or Node who want Hono-specific routing and validation guidance.
When should I use hono-routing?
Use it during Build while defining routes and validators, and again before Ship if you add SSE, WebSockets, or JWT middleware that must pass security review.
Is hono-routing safe to install?
The skill is documentation and patterns; confirm repository trust via the Security Audits panel on this page before running generated code with network or secrets access.
SKILL.md
READMESKILL.md - Hono Routing
{ "name": "hono-routing", "description": "Build type-safe APIs with Hono for Cloudflare Workers, Deno, Bun, Node.js. Routing, middleware, validation (Zod/Valibot), RPC, streaming (SSE), WebSocket, security (CSRF, secureHeaders). Use when: building Hono APIs, streaming SSE, WebSocket, validation, RPC. Troubleshoot: validation hooks, RPC types, middleware chains, JWT verify algorithm required (v4.11.4+), body consumed errors.", "version": "1.0.0", "author": { "name": "Jeremy Dawes", "email": "jeremy@jezweb.net" }, "license": "MIT", "repository": "https://github.com/jezweb/claude-skills", "keywords": [] } # Hono Routing & Middleware **Status**: Production Ready ✅ **Last Updated**: 2025-10-22 **Production Tested**: Used across Cloudflare Workers, Deno, Bun, and Node.js applications --- ## Auto-Trigger Keywords Claude Code automatically discovers this skill when you mention: ### Primary Keywords - hono - hono routing - hono middleware - hono rpc - hono validator - @hono/hono ### Secondary Keywords - hono routes - hono typed routes - hono context - hono error handling - hono request validation - zod validator hono - valibot validator hono - hono client - type-safe api - hono middleware composition - c.req.valid - c.json - hono hooks ### Error-Based Keywords - "middleware response not typed" - "hono validation failed" - "hono rpc type inference" - "hono context type" - "HTTPException hono" - "hono route params" - "hono middleware chain" - "validator hook hono" - "hono error handler" --- ## What This Skill Does This skill provides comprehensive knowledge for building type-safe APIs with Hono, focusing on routing patterns, middleware composition, request validation, RPC client/server patterns, error handling, and context management. ### Core Capabilities ✅ **Routing Patterns** - Route parameters, query params, wildcards, route grouping ✅ **Middleware Composition** - Built-in middleware, custom middleware, chaining strategies ✅ **Request Validation** - Zod, Valibot, Typia, ArkType validators with custom error hooks ✅ **Typed Routes (RPC)** - Type-safe client/server communication with full type inference ✅ **Error Handling** - HTTPException, onError hooks, custom error responses ✅ **Context Extension** - c.set/c.get patterns, custom context types, type-safe variables --- ## Known Issues This Skill Prevents | Issue | Why It Happens | Source | How Skill Fixes It | |-------|---------------|---------|-------------------| | **RPC Type Inference Slow** | Complex type instantiation from many routes | [hono#guides/rpc](https://hono.dev/docs/guides/rpc) | Use route variable pattern: `const route = app.get(...)` | | **Middleware Response Not Typed** | RPC mode doesn't infer middleware responses | [hono#2719](https://github.com/honojs/hono/issues/2719) | Export specific route types for RPC client | | **Validation Hook Confusion** | Multiple validator libraries, different hook patterns | Context7 research | Provides consistent patterns for all validators | | **HTTPException Misuse** | Throwing errors without proper status/message | Official docs | Shows proper HTTPException patterns | | **Context Type Safety** | c.set/c.get without proper typing | Official docs | Demonstrates type-safe context extension | | **Error After Next** | Not checking c.error after middleware | Official docs | Shows proper error checking pattern | | **Query/Param Validation** | Direct access without validation | Official docs | Always use c.req.valid() after validation | | **Middleware Order** | Incorrect middleware execution order | Official docs | Explains middleware flow and chaining | --- ## When to Use This Skill ### ✅ Use When: - Building APIs with Hono (any runtime: Cloudflare Workers, Deno, Bun, Node.js) - Setting up request validation with Zod, Valibot, or other validators - Creating type-safe RPC client/server communication - Implementing custom middleware or middleware chains - Handling errors with HTTPException or custo