Hono Framework Guidelines

SkillDocs & knowledge

Hono framework best practices. Use when building, reviewing, or debugging Hono applications, especially on Cloudflare Workers. Covers routing, middleware, context (c), and RPC patterns. Do NOT trigger for generic 'build a server' requests unless Hono or Cloudflare Workers is explicitly requested.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Hono Framework Guidelines skill

What this skill tells your AI

The instructions your AI receives, as published by neverinfamous/memory-journal-mcp in skills/hono/SKILL.md and read by ahel’s review.

This skill defines the standards for building ultra-fast web applications using Hono, primarily targeted at edge runtimes like Cloudflare Workers.

1. Core Principles

  • Standard Request/Response: Hono is built on Web Standards. Familiarize yourself with standard Request and Response objects.
  • Context (c): The Context object is central to Hono. It wraps the request, response, and environment bindings.
  • Middleware-First: Prefer composing small, focused middleware over large handler functions.
  • RPC (hono/client): Use Hono's RPC feature for end-to-end type safety between backend routes and frontend clients.

2. Environment Variables & Bindings (Cloudflare Workers)

Always strictly type your environment bindings for Cloudflare Workers.

import { Hono } from 'hono'

type Bindings = {
  DB: D1Database
  API_KEY: string
}

const app = new Hono<{ Bindings: Bindings }>()

app.get('/', (c) => {
  const db = c.env.DB
  return c.text('Hello Hono!')
})

3. Middleware Usage

Always use the built-in middleware for common tasks.

  • cors() for CORS.
  • secureHeaders() for security headers.
  • logger() for request logging.
import { cors } from 'hono/cors'
import { secureHeaders } from 'hono/secure-headers'

app.use('*', cors())
app.use('*', secureHeaders())

4. Routing & Validation

Use zodValidator from @hono/zod-validator to validate inputs securely.

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

app.post(
  '/post',
  zValidator(
    'json',
    z.object({
      title: z.string(),
      body: z.string(),
    })
  ),
  (c) => {
    const { title, body } = c.req.valid('json')
    return c.json({ title, body })
  }
)

5. Security Gates

  • Input Validation: Never trust client input. Always validate using Zod.
  • Secrets: Do not hardcode secrets. Always use c.env.
  • SQL Injection: When using D1 or SQLite, always use parameterized queries or an ORM like Drizzle. Never concatenate user input into SQL strings.

Signals

GitHub stars
20
Forks
5
Last commit
Jul 2026
Advanced
Catalog kind
skill
Gateway key
hono-neverinfamous
Source
github.com/neverinfamous/memory-journal-mcp