Agent skill

Hono Idioms

by irahardianto in 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.

MITAuto-check passedDevelopment

Install Hono Idioms

skills CLI
$ npx skills add irahardianto/awesome-agv --skill hono-idioms -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install irahardianto/awesome-agv hono-idioms --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ 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-src

Use ~/.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/

Facts

Skill name
hono-idioms
GitHub stars
156
Token cost
~3k tokens
SKILL.md length
567 words
Files
2 (incl. references)
Skills in repo
34
Repo updated
First seen
Licence
MIT

At a glance

Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.

  • Works in 5 steps: Create apps with new Hono() and method… → Use app.route('/prefix', subApp) to… → app.basePath('/api/v1') for API… → …
  • Building Hono APIs
  • SKILL.md covers Hono Idioms and Patterns and When to Load References
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

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.

When your agent uses it

  • Building Hono APIs
  • Tasks that involve Forms and validation
  • Tasks that involve Type safety

Example prompts

  • “/hono-idioms”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Create apps with new Hono() and method routing
  2. Use app.route('/prefix', subApp) to compose sub-routers — each feature exports its own Hono instance.
  3. app.basePath('/api/v1') for API versioning — applied once at root level.
  4. app.all('*', handler) for catch-all fallback routes.
  5. Path parameters use :name syntax — accessed via c.req.param('name').

What it can do on your machine

Read from SKILL.md and the folder at commit 9e997ba. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    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.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

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.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.8k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from irahardianto/awesome-agv at commit 9e997ba, republished under its MIT licence (© irahardianto). 567 words, ~2,952 tokens.

Download SKILL.mdSave it as .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.
name
hono-idioms
description
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.

Hono Idioms and Patterns

Core Philosophy

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.md whenever hono appears in package.json. Do NOT load this skill for Express, Fastify, or NestJS — it is Hono-only.

When to Load References

Load these before writing code in the matching context — not after.

SituationReference to Load
Starting a Hono project or reviewing file layoutreferences/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
Router and Route Organization
  1. Create apps with new Hono() and method routing:

    typescript
    // ✅ 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);
  2. Use app.route('/prefix', subApp) to compose sub-routers — each feature exports its own Hono instance.

  3. app.basePath('/api/v1') for API versioning — applied once at root level.

  4. app.all('*', handler) for catch-all fallback routes.

  5. Path parameters use :name syntax — accessed via c.req.param('name').

Context (c)
  1. Response helpers — always use typed helpers, never raw Response:

    typescript
    // ✅ 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);
    });
  2. 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).

  3. Request-scoped typed variables with c.set() / c.get():

    typescript
    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 typed
Middleware
  1. Built-in middleware — cors(), logger(), secureHeaders(), compress(), timing(), prettyJSON() (each imported from hono/<name>):

    typescript
    app.use('*', logger(), secureHeaders(), compress());
  2. Global vs scoped middleware:

    typescript
    // ✅ Global — applies to all routes
    app.use('*', cors());
    
    // ✅ Scoped — applies only to /api/* routes
    app.use('/api/*', authMiddleware);
  3. Custom middleware with createMiddleware<>():

    typescript
    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();
    });
  4. Middleware ordering matters — auth before route handlers, logging outermost.

Validation
  1. @hono/zod-validator for type-safe request validation:

    typescript
    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);
    });
  2. Validate all input sources: zValidator('json', ...), zValidator('param', ...), zValidator('query', ...), zValidator('header', ...).

Error Handling
  1. app.onError() for global error handling:

    typescript
    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);
    });
  2. HTTPException for typed HTTP errors:

    typescript
    // ✅ Throw in handlers or middleware — caught by onError
    if (!task) throw new HTTPException(404, { message: `Task ${id} not found` });
  3. app.notFound() for custom 404 handling:

    typescript
    app.notFound((c) => c.json({ error: 'Not Found' }, 404));
RPC Client
  1. End-to-end type-safe API calls — no code generation:
    typescript
    // 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 typed
Show full SKILL.md (391 more words)Show less
Multi-Runtime
  1. Only the entry point differs — all handler/middleware code is runtime-agnostic:

    typescript
    // Node.js:             serve({ fetch: app.fetch, port: 3000 })  // @hono/node-server
    // Bun / CF Workers:    export default app;
    // Deno:                Deno.serve(app.fetch);
  2. Never use runtime-specific APIs in handlers — isolate them in platform/ adapters.

Testing

For universal testing principles, see .agents/rules/testing-strategy.md. Below: Hono-specific patterns only. Test-file naming: *.test.ts co-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).

  1. app.request() — test handlers without starting a server:

    typescript
    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' }),
    });
  2. Mock services via dependency injection — create the Hono app with test doubles in the test setup, not by mocking modules.

Streaming
  1. streamText for plain-text / LLM token streaming:

    typescript
    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);
        }
      })
    );
  2. streamSSE for Server-Sent Events:

    typescript
    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);
        }
      })
    );
  3. stream for binary or NDJSON (newline-delimited JSON):

    typescript
    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');
        }
      })
    );
  4. Always call stream.onAbort() to release resources when the client disconnects — without it, the generator keeps running after the connection drops.


Anti-Patterns
  • ❌ Business logic in handlers — extract to a service/logic layer; handlers only validate, delegate, respond
  • ❌ Manual JSON.parse(await c.req.text()) — use c.req.json() or zValidator('json', schema) for type-safe parsing
  • ❌ Untyped context variables — always use Hono<{ Variables: ... }> generics for c.set()/c.get()
  • ❌ Ignoring middleware ordering — auth must run before route handlers; logging outermost
  • ❌ app.use() without path scope — use app.use('/api/*', ...) when middleware should be scoped, not global
  • ❌ Runtime-specific code in handlers — use adapters at the entry point only; handlers must be portable
Formatting and Static Analysis

Same tooling as TypeScript. See @.agents/skills/typescript-idioms/SKILL.md.

  • Code Idioms and Conventions @.agents/rules/code-idioms-and-conventions.md
  • TypeScript Idioms @.agents/skills/typescript-idioms/SKILL.md
  • API Design Principles @.agents/rules/api-design-principles.md
  • Security Principles @.agents/rules/security-principles.md
  • Error Handling Principles @.agents/rules/error-handling-principles.md
  • Architectural Patterns @.agents/rules/architectural-pattern.md
  • Testing Strategy @.agents/rules/testing-strategy.md
  • Logging and Observability Mandate @.agents/rules/logging-and-observability-mandate.md
  • Logging Implementation @.agents/skills/logging-implementation/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

Files

SKILL.md and 1 other file (references) in .agents/skills/hono-idioms of irahardianto/awesome-agv.

  • SKILL.md
  • references/project-structure.md

Open the folder on GitHubat commit 9e997ba

Compare with similar skills

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.

Hono Idioms compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hono Idioms this skillirahardianto/awesome-agv156—~3kAutomated safety check: PassMIT
Hono Routingsecondsky/claude-skills227—~3.6kAutomated safety check: PassMIT
Typescript Patternssoftspark/ai-toolkit179—~1.6kAutomated safety check: PassApache-2.0
Type Safetyidavidov13/agentic-playwright225—~3.5kAutomated safety check: PassMIT
Zodjasonjgardner/blockbench-mcp-plugin5003 repos~1.4kAutomated safety check: PassGPL-3.0
Common Tasksidavidov13/agentic-playwright225—~2.5kAutomated safety check: PassMIT

Similar skills

  • Hono Routing

    secondsky/claude-skills

    Type-safe Hono APIs with routing, middleware, RPC. An agent skill from secondsky/claude-skills.

    227 GitHub stars~3.6k tokensUpdated 13 days ago
    DevelopmentAuto-check passed
  • Typescript Patterns

    softspark/ai-toolkit

    TypeScript types: generics, discriminated unions, Zod, satisfies, branded types.

    179 GitHub stars~1.6k tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed
  • Type Safety

    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)…

    225 GitHub stars~3.5k tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • Zod

    jasonjgardner/blockbench-mcp-plugin

    Zod schema validation best practices for type safety, parsing, and error handling.

    500 GitHub starsUsed in 3 repos~1.4k tokens
    DevelopmentAuto-check passed
  • Common Tasks

    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.

    225 GitHub stars~2.5k tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • Data Strategy

    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…

    225 GitHub stars~3.4k tokensUpdated 3 days ago
    Testing & QAAuto-check passed

More from irahardianto/awesome-agv

All 34 skills in this repo
  • Distinctive Frontend Design Builder

    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.

    156 GitHub stars~2.4k tokensUpdated 6 days ago
    Auto-check passed
  • Perf Optimization

    irahardianto/awesome-agv

    Profile-driven performance optimization protocol. An agent skill from irahardianto/awesome-agv.

    156 GitHub stars~4.3k tokensUpdated 6 days ago
    Auto-check passed
  • Angular Idioms and Patterns

    irahardianto/awesome-agv

    Coding conventions for Angular 19 and later: standalone components, signals, OnPush change detection, lazy routes and where RxJS still belongs.

    156 GitHub stars~3.8k tokensUpdated 6 days ago
    Auto-check passed
  • CI/CD Pipeline Principles

    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.

    156 GitHub stars~2.7k tokensUpdated 6 days ago
    Auto-check: notes
  • Mobile Testing

    irahardianto/awesome-agv

    Mobile E2E testing patterns — Flutter integrationtest, Patrol, Maestro, golden testing, device matrix, and test data management.

    156 GitHub stars~1.8k tokensUpdated 6 days ago
    Auto-check: notes
  • Nextjs Idioms

    irahardianto/awesome-agv

    Next.js App Router architecture: React Server Components (RSC), Server Actions, nested layouts, route handlers, and streaming.

    156 GitHub stars~4.2k tokensUpdated 6 days ago
    Auto-check: notes

Questions about Hono Idioms

What does Hono Idioms do?

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.

When should I use Hono Idioms?

Hono Idioms fits situations like: building Hono APIs; tasks that involve Forms and validation; tasks that involve Type safety.

How do I install Hono Idioms in Claude Code?

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.

How do I install Hono Idioms in Codex?

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.

Can I use Hono Idioms in Cursor, Gemini CLI or GitHub Copilot?

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.

What does Hono Idioms need to run?

SKILL.md names no scripts, command-line tools or credentials: Hono Idioms is instructions for the agent only. Our summary lists: Node.js.

Does Hono Idioms access the network?

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.

Is Hono Idioms safe to install?

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.

What licence does Hono Idioms use?

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.

How many tokens does Hono Idioms use?

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.

What are the alternatives to Hono Idioms?

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.

Who maintains Hono Idioms?

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.