hono-patterns

hono-patterns is a skill for Claude Code from smicolon/ai-kit. It costs 42 tokens per session (2,258 once invoked), scanned A, original, MIT.

A set of patterns for building Hono applications, a lightweight framework for HTTP APIs and web servers.

In plain words
What is it for?
Use it to split routes into modules, protect groups of endpoints with shared middleware, define typed routes, and structure Hono code.
Why use it?
It shows how to organize routes, combine middleware, handle errors, and preserve TypeScript information as an application grows.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import type { Env } from '../types/bindings'.

Part of the hono plugin — 4 skills shipped together

Good fit Use it to split routes into modules, protect groups of endpoints with shared middleware, define typed routes, and structure Hono code.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit
agentmods
npx agentmods add skills/smicolon/ai-kit/hono-patterns

Made for: Claude Code.

Or install hono, the plugin that ships this one along with the rest of its 4 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hono-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/smicolon/ai-kit/hono-patterns/github.svg)](https://agentmods.dev/skills/smicolon/ai-kit/hono-patterns)
Your own site
<a href="https://agentmods.dev/skills/smicolon/ai-kit/hono-patterns"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/hono-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hono-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/smicolon/ai-kit/hono-patterns"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/hono-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,258 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.02258
Opus 5.5 $0.00017 $0.00903
Sonnet 5.5 $0.00008 $0.00452
Haiku 4.5 $0.00004 $0.00226

Measured 3mo ago against content hash 19acff18e467, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

hono-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packs/hono/skills/hono-patterns/SKILL.md · 390 lines

How it starts

The opening of the file, as written. The whole thing — 390 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hono Patterns

Core patterns for building Hono applications.

Routing Patterns

Modular Route Organization

Organize routes in separate files and compose with app.route():

// routes/users.ts
import { Hono } from 'hono'
import type { Env } from '../types/bindings'

const users = new Hono<Env>()

users.get('/', (c) => c.json({ users: [] }))
users.get('/:id', (c) => c.json({ id: c.req.param('id') }))
users.post('/', (c) => c.json({ created: true }, 201))

export { users }

// index.ts
import { users } from './routes/users'
import { posts } from './routes/posts'

app.route('/api/users', users)
app.route('/api/posts', posts)

Route Groups with Shared Middleware

const api = new Hono<Env>()

// Apply auth to all /api routes
api.use('*', authMiddleware)

api.route('/users', users)
api.route('/posts', posts)

app.route('/api', api)

// Public routes remain unprotected
app.get('/health', (c) => c.json({ status: 'ok' }))

Chained Route Definition (for RPC)

// Chain routes for proper type inference
const routes = app
  .get('/users', (c) => c.json({ users: [] }))
  .post('/users', (c) => c.json({ created: true }, 201))
  .get('/users/:id', (c) => c.json({ id: c.req.param('id') }))

export type AppType = typeof routes

Handler Patterns

Basic Handler

app.get('/users', async (c) => {
  const users = await fetchUsers()
  return c.json(users)
})

Handler with Validation

import { zValidator } from '@hono/zod-validator'
import { z } from 'zod'

app.post('/users',
  zValidator('json', z.object({
    email: z.string().email(),
    name: z.string().min(1)
  })),
  async (c) => {
    const data = c.req.valid('json')
    return c.json({ id: crypto.randomUUID(), ...data }, 201)
  }
)

Factory Pattern for External Handlers

Use when handlers need to be defined outside route files:

import { createFactory } from 'hono/factory'
import type { Env } from '../types/bindings'

const factory = createFactory<Env>()

// Define handler with proper types
export const listUsers = factory.createHandlers(
  zValidator('query', paginationSchema),
  async (c) => {
    const { page, limit } = c.req.valid('query')
    return c.json({ users: [], page, limit })
  }
)

// Use in routes
users.get('/', ...listUsers)

Read the full file on GitHub · 390 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago Changed · +80 lines 19acff18e467
  2. 3mo ago First seen · 310 lines · 42 tokens per session scan A b12426819436

Subscribe to this mod's changes

hono-patterns is a skill published in the GitHub repository smicolon/ai-kit (7 stars, last pushed 2mo ago), licensed MIT. It adds 42 tokens to every session and 2,258 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

hono-patterns compared with skills from other repositories

hono-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
hono-patternssmicolon/ai-kitSkill72mo agoMITA42Claude Code
add-dial-toolnanocoai/nanoclawSkill31ktodayMITA118Claude Code
add-telegramnanocoai/nanoclawSkill31ktodayMITA12Claude Code
add-gchatnanocoai/nanoclawSkill31ktodayMITA13Claude Code
add-signalnanocoai/nanoclawSkill31ktodayMITA22Claude Code
add-matrixnanocoai/nanoclawSkill31ktodayMITA19Claude Code
onecli-gatewaynanocoai/nanoclawSkill31ktodayMITA81Claude Code