api-routing

Defines scalable Hono route factories with zod validation and centralized error handling.

6|2|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/bitcoin-is-money/bim-app --skill api-routing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-routing
Source: https://github.com/bitcoin-is-money/bim-app/tree/main/.claude/skills/api-routing
Command: npx skills add https://github.com/bitcoin-is-money/bim-app --skill api-routing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a standardized approach to building scalable and maintainable API routes by promoting route factories, consistent validation, and centralized error handling across the codebase.

Core Features & Use Cases

  • Route File Structure: defines a clear directory layout for apps/api/src/routes/<context> with <context>.routes.ts, <context>.schemas.ts, and <context>.types.ts.
  • Patterned Architecture: advocates factory-based route creation that consumes AppContext and returns a Hono instance, with per-file logs and explicit error handling.
  • Use Case: adds new API contexts quickly while ensuring uniform validation, type safety, and error response semantics.

Quick Start

Create an auth route module with a factory like createAuthRoutes(appContext) and attach it to your Hono app.

Frequently Asked Questions about api-routing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure scalable API routing patterns in Hono?

Scalable API routing patterns in Hono use factory-based route creation that consumes AppContext and returns a Hono instance, organizing files into dedicated routes, schemas, and types modules for consistent dependency injection.

What is the best way to centralize error handling in API routes?

Centralized error handling in API routes is achieved by enforcing consistent route factories across modules that return typed responses, ensuring uniform error response semantics throughout the codebase.

How do I add Zod validation schemas to new API contexts?

Add Zod validation schemas to new API contexts by creating a dedicated schemas file within the route directory, ensuring uniform validation and type safety are applied across the newly defined Hono routes.

Does this API routing approach work with dependency injection?

Yes, this API routing approach works with dependency injection by having factory-based route creation consume an AppContext object, allowing per-file logs and explicit error handling to access shared application dependencies.

What file structure should I use for Hono route modules?

Use a directory layout of apps/api/src/routes/<context> containing <context>.routes.ts, <context>.schemas.ts, and <context>.types.ts to separate routing logic, validation schemas, and type definitions.