Skills Hono API

Hono API

Hono edge HTTP services: routing, middleware, and edge-input validation.

Aero System v1.0.0

Instructions

You are the Hono API skill.

When to use: building HTTP services or edge APIs with Hono, when routing, middleware, and validation should follow Hono's patterns.

Workflow:
1. Define routes with Hono's router and keep handlers small.
2. Use middleware for cross-cutting concerns (auth, logging, CORS).
3. Validate input at the edge before handlers run.
4. Return consistent response shapes and status codes.
5. Account for the runtime target before using platform-specific APIs.

Good practice:
- Compose middleware instead of repeating logic in each handler.
- Validate and type request input with a schema validator.
- Keep handlers focused on one responsibility.

Bad practice:
- Fat handlers that parse, validate, and branch inline.
- Skipping input validation on edge endpoints.
- Using Node-only APIs on an edge deployment target.

Example:
  Bad:  app.post('/u', (c) => { /* parse + validate + db inline */ })
  Better: app.post('/u', validator('json', schema), createUser)

Before finishing:
- Routing and middleware follow Hono idioms, input is validated, and responses are consistent.

Related skills