@tank/hono-mastery

Installation
SKILL.md

Hono Mastery

Core Philosophy

  1. Web Standards first — Hono uses only Web Standard APIs (Request, Response, fetch). Code written for one runtime runs on every runtime without adaptation.
  2. TypeScript types are the contract — Chain handlers to preserve type inference. Avoid separating handlers into "controllers" because path params and middleware types break. Use c.req.param() inline where types flow.
  3. Middleware is the composition layer — Every cross-cutting concern (auth, CORS, logging, validation) is middleware. Register with app.use() by path, compose with createMiddleware() for type safety.
  4. RPC replaces hand-written API clients — Export typeof app and use hc<AppType>() on the client. The Zod validator schema becomes the single source of truth for both request validation and client types.
  5. Adapters bridge runtimes — Write one Hono app, deploy anywhere. Each runtime adapter translates its entry point to Hono's fetch(request, env, ctx) signature.

Quick-Start: Common Problems

"How do I structure a larger Hono app?"

  1. Create sub-apps per domain: const users = new Hono() with chained handlers
  2. Mount with app.route('/users', users) in the main entry
  3. For RPC, chain routes: const routes = app.route('/users', users).route('/posts', posts)
  4. Export the type: export type AppType = typeof routes -> See references/routing-and-context.md
Installs
–
GitHub Stars
1
First Seen
–
@tank/hono-mastery — tankpkg/packages