Hono Routing
secondsky/claude-skills
Type-safe Hono APIs with routing, middleware, RPC. An agent skill from secondsky/claude-skills.
Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.
$ npx skills add irahardianto/awesome-agv --skill hono-idioms -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install irahardianto/awesome-agv hono-idioms --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/irahardianto/awesome-agv.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/hono-idioms .claude/skills/hono-idioms && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "hono-idioms" agent skill from https://github.com/irahardianto/awesome-agv/tree/main/.agents/skills/hono-idioms into .claude/skills/hono-idioms/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hono-idioms", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/irahardianto/awesome-agv/tree/main/.agents/skills/hono-idiomsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add irahardianto/awesome-agv --skill hono-idioms -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install irahardianto/awesome-agv hono-idioms --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/irahardianto/awesome-agv.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/hono-idioms .agents/skills/hono-idioms && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "hono-idioms" agent skill from https://github.com/irahardianto/awesome-agv/tree/main/.agents/skills/hono-idioms into .agents/skills/hono-idioms/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hono-idioms", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add irahardianto/awesome-agv --skill hono-idioms -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install irahardianto/awesome-agv hono-idioms --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/irahardianto/awesome-agv.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/hono-idioms .cursor/skills/hono-idioms && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "hono-idioms" agent skill from https://github.com/irahardianto/awesome-agv/tree/main/.agents/skills/hono-idioms into .cursor/skills/hono-idioms/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hono-idioms", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/irahardianto/awesome-agv.git --path .agents/skills/hono-idioms--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add irahardianto/awesome-agv --skill hono-idioms -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install irahardianto/awesome-agv hono-idioms --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/irahardianto/awesome-agv.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/hono-idioms .gemini/skills/hono-idioms && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "hono-idioms" agent skill from https://github.com/irahardianto/awesome-agv/tree/main/.agents/skills/hono-idioms into .gemini/skills/hono-idioms/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hono-idioms", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install irahardianto/awesome-agv hono-idiomsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add irahardianto/awesome-agv --skill hono-idioms -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/irahardianto/awesome-agv.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/hono-idioms .github/skills/hono-idioms && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "hono-idioms" agent skill from https://github.com/irahardianto/awesome-agv/tree/main/.agents/skills/hono-idioms into .github/skills/hono-idioms/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hono-idioms", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add irahardianto/awesome-agv --skill hono-idioms -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install irahardianto/awesome-agv hono-idioms --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/irahardianto/awesome-agv.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/hono-idioms .opencode/skills/hono-idioms && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "hono-idioms" agent skill from https://github.com/irahardianto/awesome-agv/tree/main/.agents/skills/hono-idioms into .opencode/skills/hono-idioms/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hono-idioms", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
hono-idiomsHono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.
Hono Idioms is an agent skill from irahardianto/awesome-agv. Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun. Use when building Hono APIs. Pair with typescript-idioms.
Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/project-structure.md`).
It sits in Development, covering Forms and validation and Type safety. It works with Hono, TypeScript, Zod and Cloudflare Workers. The repository describes itself as: Comprehensive sets of standards and practices designed to elevate the capabilities of AI coding agents. The licence is MIT.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 9e997ba. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Hono Idioms loads about 3k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 58 tokens; SKILL.md has 567 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from irahardianto/awesome-agv at commit 9e997ba, republished under its MIT licence (© irahardianto). 567 words, ~2,952 tokens.
.claude/skills/hono-idioms/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.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.
Loading guard / auto-detection: Hono has no canonical marker file, so it is not reliably auto-detected by file glob (only
wrangler.toml— the Cloudflare Workers case — triggers this skill directly). For Node.js / Bun / Deno Hono projects, co-load this skill alongside@.agents/skills/typescript-idioms/SKILL.mdwheneverhonoappears inpackage.json. Do NOT load this skill for Express, Fastify, or NestJS — it is Hono-only.
Load these before writing code in the matching context — not after.
| Situation | Reference to Load |
|---|---|
| Starting a Hono project or reviewing file layout | references/project-structure.md |
| TypeScript type system, async, Zod, error types | @.agents/skills/typescript-idioms/SKILL.md (always co-load) |
Zod schemas / boundary validation (zValidator) | @.agents/skills/typescript-idioms/references/zod-patterns.md |
| Async / I/O / coercion / security pitfalls | @.agents/skills/typescript-idioms/references/ts-patterns-and-anti-patterns.md |
| Shared tooling (ESLint, Prettier, Vitest, tsconfig) | @.agents/skills/typescript-idioms/references/recommended-dependencies.md |
Create apps with new Hono() and method routing:
// ✅ 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 own Hono instance.
app.basePath('/api/v1') for API versioning — applied once at root level.
app.all('*', handler) for catch-all fallback routes.
Path parameters use :name syntax — accessed via c.req.param('name').
c)Response helpers — always use typed helpers, never raw Response:
// ✅ c.json(), c.text(), c.html(), c.redirect(), c.notFound()
app.get('/tasks/:id', async (c) => {
const task = await taskService.find(c.req.param('id'));
return c.json(task);
});Request data: c.req.param('id') (path), c.req.query('page') (query string), c.req.header('Authorization') (header), await c.req.json() (body — prefer zValidator instead).
Request-scoped typed variables with c.set() / c.get():
type Env = { Variables: { userId: string; requestId: string } };
const app = new Hono<Env>();
app.use(async (c, next) => {
c.set('requestId', crypto.randomUUID());
await next();
});
app.get('/me', (c) => c.json({ id: c.get('userId') })); // fully typedBuilt-in middleware — cors(), logger(), secureHeaders(), compress(), timing(), prettyJSON() (each imported from hono/<name>):
app.use('*', logger(), secureHeaders(), compress());Global vs scoped middleware:
// ✅ Global — applies to all routes
app.use('*', cors());
// ✅ Scoped — applies only to /api/* routes
app.use('/api/*', authMiddleware);Custom middleware with createMiddleware<>():
import { createMiddleware } from 'hono/factory';
type AuthEnv = { Variables: { userId: string } };
const authMiddleware = createMiddleware<AuthEnv>(async (c, next) => {
const token = c.req.header('Authorization')?.replace('Bearer ', '');
if (!token) throw new HTTPException(401, { message: 'Unauthorized' });
const payload = await verifyToken(token);
c.set('userId', payload.sub);
await next();
});Middleware ordering matters — auth before route handlers, logging outermost.
@hono/zod-validator for type-safe request validation:
import { zValidator } from '@hono/zod-validator';
import { z } from 'zod';
const CreateTaskSchema = z.object({
title: z.string().min(1).max(200),
priority: z.enum(['low', 'medium', 'high']),
});
// ✅ Compose multiple validators — validated data is fully typed
app.post('/tasks', zValidator('json', CreateTaskSchema), async (c) => {
const body = c.req.valid('json'); // { title: string; priority: 'low'|'medium'|'high' }
const task = await taskService.create(body);
return c.json(task, 201);
});
app.get('/tasks/:id', zValidator('param', z.object({ id: z.string().uuid() })), async (c) => {
const task = await taskService.find(c.req.valid('param').id);
return c.json(task);
});Validate all input sources: zValidator('json', ...), zValidator('param', ...), zValidator('query', ...), zValidator('header', ...).
app.onError() for global error handling:
import { HTTPException } from 'hono/http-exception';
app.onError((err, c) => {
if (err instanceof HTTPException) {
return c.json({ error: err.message }, err.status);
}
console.error(err);
return c.json({ error: 'Internal Server Error' }, 500);
});HTTPException for typed HTTP errors:
// ✅ Throw in handlers or middleware — caught by onError
if (!task) throw new HTTPException(404, { message: `Task ${id} not found` });app.notFound() for custom 404 handling:
app.notFound((c) => c.json({ error: 'Not Found' }, 404));// server.ts — chain routes and export the type
const routes = app
.get('/tasks', async (c) => c.json(await taskService.list()))
.post('/tasks', zValidator('json', CreateTaskSchema), async (c) => {
return c.json(await taskService.create(c.req.valid('json')), 201);
});
export type AppType = typeof routes;
// client.ts — fully typed, changes propagate compile errors automatically
import { hc } from 'hono/client';
import type { AppType } from './server';
const client = hc<AppType>('http://localhost:3000');
const res = await client.tasks.$post({ json: { title: 'New', priority: 'high' } });
const task = await res.json(); // fully typedOnly the entry point differs — all handler/middleware code is runtime-agnostic:
// Node.js: serve({ fetch: app.fetch, port: 3000 }) // @hono/node-server
// Bun / CF Workers: export default app;
// Deno: Deno.serve(app.fetch);Never use runtime-specific APIs in handlers — isolate them in platform/ adapters.
For universal testing principles, see
.agents/rules/testing-strategy.md. Below: Hono-specific patterns only. Test-file naming:*.test.tsco-located next to source (matches the generic-TS convention; see@.agents/skills/typescript-idioms/references/project-structure.md§Test Organization for the cross-framework rule).
app.request() — test handlers without starting a server:
import { describe, it, expect } from 'vitest';
import { app } from './app';
describe('GET /api/tasks/:id', () => {
it('returns 200 with task data', async () => {
const res = await app.request('/api/tasks/abc-123');
expect(res.status).toBe(200);
expect((await res.json()).id).toBe('abc-123');
});
it('returns 404 for unknown task', async () => {
const res = await app.request('/api/tasks/unknown');
expect(res.status).toBe(404);
});
});
// POST with body
const res = await app.request('/api/tasks', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ title: 'Test', priority: 'high' }),
});Mock services via dependency injection — create the Hono app with test doubles in the test setup, not by mocking modules.
streamText for plain-text / LLM token streaming:
import { streamText } from 'hono/streaming';
app.get('/stream/tokens', (c) =>
streamText(c, async (stream) => {
stream.onAbort(() => console.log('client disconnected'));
for (const chunk of ['Hello', ' ', 'World']) {
await stream.write(chunk);
await stream.sleep(100);
}
})
);streamSSE for Server-Sent Events:
import { streamSSE } from 'hono/streaming';
app.get('/sse', (c) =>
streamSSE(c, async (stream) => {
stream.onAbort(() => cleanup());
let id = 0;
while (true) {
await stream.writeSSE({
data: JSON.stringify({ ts: Date.now() }),
event: 'tick',
id: String(id++),
});
await stream.sleep(1000);
}
})
);stream for binary or NDJSON (newline-delimited JSON):
import { stream } from 'hono/streaming';
app.get('/stream/tasks', (c) =>
stream(c, async (stream) => {
stream.onAbort(() => cleanup());
const tasks = await taskService.list();
for (const task of tasks) {
await stream.write(JSON.stringify(task) + '\n');
}
})
);Always call stream.onAbort() to release resources when the client disconnects — without it, the generator keeps running after the connection drops.
JSON.parse(await c.req.text()) — use c.req.json() or zValidator('json', schema) for type-safe parsingHono<{ Variables: ... }> generics for c.set()/c.get()app.use() without path scope — use app.use('/api/*', ...) when middleware should be scoped, not globalSame tooling as TypeScript. See @.agents/skills/typescript-idioms/SKILL.md.
© irahardianto, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (references) in .agents/skills/hono-idioms of irahardianto/awesome-agv.
Open the folder on GitHubat commit 9e997ba
Hono Idioms next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Hono Idioms this skillirahardianto/awesome-agv | 156 | — | ~3k | Automated safety check: Pass | MIT | |
| Hono Routingsecondsky/claude-skills | 227 | — | ~3.6k | Automated safety check: Pass | MIT | |
| Typescript Patternssoftspark/ai-toolkit | 179 | — | ~1.6k | Automated safety check: Pass | Apache-2.0 | |
| Type Safetyidavidov13/agentic-playwright | 225 | — | ~3.5k | Automated safety check: Pass | MIT | |
| Zodjasonjgardner/blockbench-mcp-plugin | 500 | 3 repos | ~1.4k | Automated safety check: Pass | GPL-3.0 | |
| Common Tasksidavidov13/agentic-playwright | 225 | — | ~2.5k | Automated safety check: Pass | MIT |
secondsky/claude-skills
Type-safe Hono APIs with routing, middleware, RPC. An agent skill from secondsky/claude-skills.
softspark/ai-toolkit
TypeScript types: generics, discriminated unions, Zod, satisfies, branded types.
idavidov13/agentic-playwright
TypeScript type safety conventions for the Playwright scaffold — the "no any" rule, Zod 4 schema patterns (z.strictObject, top-level validators like z.uuid / z.email / z.url / z.int / z.enum)…
jasonjgardner/blockbench-mcp-plugin
Zod schema validation best practices for type safety, parsing, and error handling.
idavidov13/agentic-playwright
Copy-paste AI prompt templates for common Playwright scaffold development tasks — adding page objects, functional/E2E/API tests, Zod schemas, factories, fixtures, and components.
idavidov13/agentic-playwright
Test data strategy for the Playwright scaffold — Faker + Zod factories for dynamic happy-path data, static TS files (.ts with as const exports — never .json) for domain-specific curated invalid…
irahardianto/awesome-agv
Commits to one bold aesthetic direction, sets up a CSS token system for it, then builds the interface in Vue or plain HTML using those tokens.
irahardianto/awesome-agv
Profile-driven performance optimization protocol. An agent skill from irahardianto/awesome-agv.
irahardianto/awesome-agv
Coding conventions for Angular 19 and later: standalone components, signals, OnPush change detection, lazy routes and where RxJS still belongs.
irahardianto/awesome-agv
Rules for designing CI/CD pipelines in layers: universal lint, test and scan stages, container builds with SBOM attestation, and GitOps for orchestrated deployments.
irahardianto/awesome-agv
Mobile E2E testing patterns — Flutter integrationtest, Patrol, Maestro, golden testing, device matrix, and test data management.
irahardianto/awesome-agv
Next.js App Router architecture: React Server Components (RSC), Server Actions, nested layouts, route handlers, and streaming.
Works with
Categories
Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun. Hono Idioms is an agent skill from irahardianto/awesome-agv. Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.
Hono Idioms fits situations like: building Hono APIs; tasks that involve Forms and validation; tasks that involve Type safety.
Run `npx skills add irahardianto/awesome-agv --skill hono-idioms -a claude-code`. Or copy the skill folder (.agents/skills/hono-idioms in irahardianto/awesome-agv) into .claude/skills/hono-idioms in your project. Claude Code loads it when a task matches its description.
Run `npx skills add irahardianto/awesome-agv --skill hono-idioms -a codex`. Or copy the skill folder (.agents/skills/hono-idioms in irahardianto/awesome-agv) into .agents/skills/hono-idioms in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add irahardianto/awesome-agv --skill hono-idioms -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hono-idioms, .gemini/skills/hono-idioms, .github/skills/hono-idioms and .opencode/skills/hono-idioms in your project.
SKILL.md names no scripts, command-line tools or credentials: Hono Idioms is instructions for the agent only. Our summary lists: Node.js.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Hono Idioms is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 889 tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Hono Idioms: Hono Routing (secondsky/claude-skills, 227 stars), Typescript Patterns (softspark/ai-toolkit, 179 stars), Type Safety (idavidov13/agentic-playwright, 225 stars) and Zod (jasonjgardner/blockbench-mcp-plugin, 500 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
irahardianto (a GitHub user) maintains it in irahardianto/awesome-agv, which has 156 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on October 5, 2026.
Source: irahardianto/awesome-agv on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.