hono-api-scaffolder

Scaffolds Hono API routes with Zod validation and middleware for Cloudflare Workers.

1|Updated Aug 18, 2026
One-click install
npx skills add https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent --skill hono-api-scaffolder-scsm-unrestrict
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hono-api-scaffolder
Source: https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent/tree/main/frontend-engineer/skills/hono-api-scaffolder
Command: npx skills add https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent --skill hono-api-scaffolder-scsm-unrestrict

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires hono, @hono/zod-validator, zod, and includes references (resource) and assets (resource) components.

What problem does it solve? Adding structured, validated API routes to an existing Cloudflare Workers project involves repetitive boilerplate: route files, middleware, typed bindings, error handling, and endpoint documentation. This Skill automates that scaffolding so you get consistent, typed Hono routes without writing the same patterns by hand. ## Core Features & Use Cases - Route File Generation: Creates one route file per resource group with full CRUD handlers, Zod validation via @hono/zod-validator, and typed Env bindings for D1, KV, and R2. - Middleware & Error Handling: Adds auth middleware, CORS configuration, and a standard JSON error handler so APIs never return HTML redirects to fetch clients. - Documentation & RPC Typing: Generates an API_ENDPOINTS.md file documenting every endpoint, and supports end-to-end type safety between Worker and client using Hono's hc client. - Use Case: After bootstrapping a Worker project, ask for a users and posts API. The Skill produces src/routes/users.ts and src/routes/posts.ts with validated CRUD endpoints, wires them into src/index.ts, and writes matching endpoint documentation. ## Quick Start Add CRUD API routes for users and posts with Zod validation and auth middleware to my existing Cloudflare Workers project, then generate the API_ENDPOINTS.md documentation.

Frequently Asked Questions about hono-api-scaffolder

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

FAQPage Schema
How do I add API routes to a Cloudflare Workers project with Hono?

Create one route file per resource group using Hono with typed Env bindings, then mount each group in src/index.ts with app.route('/api/resource', routes). Add Zod validation with @hono/zod-validator and a global error handler via app.onError.

How to validate request bodies in Hono with Zod?

Use zValidator from @hono/zod-validator with a Zod schema as route middleware. The validated body is accessed through c.req.valid('json') and is fully typed. Install both packages with pnpm add @hono/zod-validator zod.

Does Hono support end-to-end type safety between Worker and client?

Yes, through Hono's RPC feature. Export the route chain type as AppType from the Worker, then use hc<AppType> from hono/client on the frontend for fully typed requests. Routes must be chained on a variable, not mounted with app.route().

Why does my Hono API return HTML instead of JSON errors?

This happens when error handlers issue redirects instead of JSON responses, since fetch() follows redirects silently and the client then parses HTML as JSON. Use a global onError handler that always returns c.json() with the appropriate status code.

When should I split Hono routes into separate files?

Use a single index.ts for fewer than 10 endpoints, route files per resource for 10-30 endpoints, and route files plus shared middleware with typed context for 30 or more endpoints.