hono-idioms
Learn idiomatic Hono patterns for building type-safe HTTP APIs across any runtime. This skill covers router composition, middleware ordering, request validation with Zod, error handling, and end-to-end typed RPC clients—all without code generation.
hono-idioms teaches you Hono routing, middleware composition, and Zod validation for building type-safe HTTP APIs.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-17
hono-idioms teaches you Hono routing, middleware composition, and Zod validation for building type-safe HTTP APIs. Learn idiomatic Hono patterns for building type-safe HTTP APIs across any runtime. This skill covers router composition, middleware ordering, request validation with Zod, error handling, and end-to-end typed RPC clients—all without code generation.
Use it when
- hono-idioms shows how to build typed RPC clients by defining your server routes with strict types.
- hono-idioms covers middleware composition by chaining handlers with app.use() and organizing them in order.
Verify before relying
Read SKILL.md below before installing (2 files). Open directory: indexed for reading, not audited.
Install
irahardianto/awesome-agv/hono-idioms · repository language: JavaScript
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What are the core hono routing patterns for type-safe HTTP APIs?
hono-idioms teaches you to build type-safe HTTP APIs using Hono's routing system. Start with basic routes (app.get, app.post) and progress to composable sub-routers via app.route(). Use path parameters with type inference, organize handlers with middleware chains, and leverage TypeScript's type system throughout. Hono infers types from your handler signatures automatically—no code generation needed.
How do you implement end-to-end type-safe RPC without code generation?
hono-idioms shows how to build typed RPC clients by defining your server routes with strict types, then deriving client types directly from those definitions. Use Hono's type exports to create a client that mirrors your server's shape. This approach eliminates code generation overhead while maintaining full type safety across the network boundary.
How to use hono with typescript for middleware composition?
hono-idioms covers middleware composition by chaining handlers with app.use() and organizing them in order. Each middleware can set context variables via c.set() and read them with c.get(), passing typed data down the chain. Compose custom middleware with createMiddleware(), apply request validation using zValidator with Zod schemas, and handle errors with HTTPException for consistent responses.
What does hono streaming SSE implementation look like?
hono-idioms teaches streaming responses and Server-Sent Events by using c.streaming() to send data over time. Return a ReadableStream or async generator to emit tokens or events incrementally. This pattern works across Hono's multi-runtime support (Node.js, Deno, Cloudflare Workers, etc.), letting you build real-time features without runtime-specific code.
What hono handler anti-patterns should you avoid?
hono-idioms highlights common mistakes: forgetting middleware order (validation before handlers), mixing sync and async without proper error boundaries, mutating context incorrectly, and ignoring type inference. Follow idiomatic practices: order middleware logically, use c.set/c.get for typed context, validate early, throw HTTPException for errors, and let TypeScript catch type mismatches before runtime.
How do you organize multi-feature Hono applications with sub-routers?
hono-idioms shows building composable sub-routers by creating separate router instances for each feature (e.g., users, posts) and mounting them with app.route('/prefix', router). Each sub-router has its own middleware and handlers. Use basePath for API versioning, organize by domain, and keep middleware scoped to relevant routes. This scales cleanly across large applications.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
Hono Idioms and Patterns
Core Philosophy
Hono rewards thin handlers, middleware composition, multi-runtime portability, and end-to-end type safety. Idiomatic Hono = typed routes, validator middleware, RPC client — no code generation needed.
> Scope: Hono-specific patterns. For TypeScript fundamentals: @.agents/skills/typescript-idioms/SKILL.md. For project structure: @.agents/skills/hono-idioms/references/project-structure.md.
Router and Route Organization
- Create apps with
new Hono()and method routing: ```typescript // ✅ Group by resource, compose with app.route() const tasks = new Hono() .get('/', listTasks) .post('/', createTask) .get('/:id', getTask) .put('/:id', updateTask) .delete('/:id', deleteTask);
const app = new Hono() .route('/api/tasks', tasks) .route('/api/users', users); ```
- Use
app.route('/prefix', subApp)to compose sub-routers — each feature exports its ownHono
(truncated - see the full file via the links below)
File tree — 2 files
.agents/skills/hono-idioms/SKILL.md
.agents/skills/hono-idioms/references/project-structure.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Learn Hono routing, middleware, and validation patterns for type-safe HTTP APIs”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
Learn TypeScript's type system as your specification: enable strict mode, use type guards over casts, and validate all external data with Zod. This skill covers discriminated unions for state machines, immutability patterns, null safety, and the critical rule that all HTTP calls route through a centralized client for consistent auth and error handling.
Learn idiomatic Angular through signals, standalone components, and reactive patterns. This skill covers modern Angular 19+ practices including OnPush change detection, signal-based state management, functional guards and resolvers, and template control flow syntax. Covers components, services, directives, pipes, and routing for TypeScript-based Angular projects.
Learn idiomatic .NET 8+ development through minimal APIs, dependency injection, and async-first patterns. Covers Entity Framework Core configuration, middleware design, and testing with xUnit. Build clean, performant, cloud-native applications aligned with modern .NET best practices.
Learn Django conventions that emphasize model-centric design, clean separation of concerns, and test-driven development. This skill covers best practices for the ORM, views, migrations, and testing frameworks like pytest-django, helping you write maintainable, DRY code aligned with Django's philosophy.
Learn Laravel's idiomatic approach to building maintainable applications through Eloquent query scopes, service-oriented architecture, and Form Request validation. Covers testing with Pest, code formatting with Pint, and static analysis via PHPStan to enforce framework best practices.
This skill covers core Kotlin idioms that make code safer and more expressive. Learn null-safety techniques, sealed hierarchies for type-safe results, structured concurrency with coroutines, and naming conventions. Includes practical examples and tooling guidance for formatting and static analysis.