hono-api-scaffolder

Solid

Scaffold Hono API routes for Cloudflare Workers. Produces route files, middleware, typed bindings, Zod validation, error handling, and API_ENDPOINTS.md documentation. Use after a project is set up with cloudflare-worker-builder or vite-flare-starter, when you need to add API routes, create endpoints, or generate API documentation.

API & Backend 813 stars 84 forks Updated 2 weeks ago MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
97
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Hono API Scaffolder Add structured API routes to an existing Cloudflare Workers project. This skill runs AFTER the project shell exists (via cloudflare-worker-builder or vite-flare-starter) and produces route files, middleware, and endpoint documentation. ## Workflow ### Step 1: Gather Endpoints Determine what the API needs. Either ask the user or infer from the project description. Group endpoints by resource: ``` Users: GET /api/users, GET /api/users/:id, POST /api/users, PUT /api/users/:id, DELETE /api/users/:id Posts: GET /api/posts, GET /api/posts/:id, POST /api/posts, PUT /api/posts/:id Auth: POST /api/auth/login, POST /api/auth/logout, GET /api/auth/me ``` ### Step 2: Create Route Files One file per resource group. Use the template from [assets/route-template.ts](assets/route-template.ts): ```typescript // src/routes/users.ts import { Hono } from 'hono' import { zValidator } from '@hono/zod-validator' import { z } from 'zod' import type { Env } from '../types' const app = new Hono<{ Bindings: Env }>() // GET /api/users app.get('/', async (c) => { const db = c.env.DB const { results } = await db.prepare('SELECT * FROM users').all() return c.json({ users: results }) }) // GET /api/users/:id app.get('/:id', async (c) => { const id = c.req.param('id') const user = await db.prepare('SELECT * FROM users WHERE id = ?').bind(id).first() if (!user) return c.json({ error: 'Not found' }, 404) return c.json({ user }) }) // POST /api/users cons...

Details

Author
jezweb
Repository
jezweb/claude-skills
Created
7 months ago
Last Updated
2 weeks ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category