agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/frameworks/hono/SKILL.md

hono

Skill15 starsChanged 42 days agoMITView on GitHub

Expert Hono framework assistance covering ultra-fast routing, Web Standards, multi-runtime support (Cloudflare Workers, Deno, Bun, Node), and RPC. Use when developing edge APIs and lightweight microservices.

  • Reads credentials

22 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use turborepo, better-auth-best-practices and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    turborepo

    Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries.

    Also in 5 projects that use this

  • anasahmed07Skill

    better-auth-best-practices

    Skill for integrating Better Auth - the comprehensive TypeScript authentication framework.

    Also in 5 projects that use this

  • SentrySkill

    vercel-composition-patterns

    Also in 7 projects that use this

  • VercelSkill

    vercel-react-best-practices

    React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

    Also in 8 projects that use this

  • VercelSkill

    web-design-guidelines

    Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

    Also in 5 projects that use this

  • DatabricksSkill

    shadcn

    Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for "shadcn init", "create an app with --preset", or "switch to --preset".

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 21 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use @hono/zod-validator or @hono/valibot-validator to enforce strict validation at edges.

    line 141
  2. Very specific:

    Use Node-specific globals (process.env) without polyfills if targeting edge runtimes.

    line 147

“Common” is measured: kept by at least 6 in 10 of the 21 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Hono

Hono (Japanese for "Flame") is a small, simple, and ultrafast web framework built on Web Standards. It runs anywhere: Cloudflare Workers, Fastly, Deno, Bun, Node.js, and Vercel.

When to Use

  • Multi-Runtime Edge Web Applications: Running seamlessly on Cloudflare Workers, Deno, Bun, Fastly, AWS Lambda, or Node.js.
  • Ultrafast Microservices: Sub-millisecond routing with RegExpRouter and zero external dependencies.
  • End-to-End Type Safety (Hono RPC): Sharing API client types with frontend web applications without code generation.
  • Web Standard APIs: Building on native Request and Response web standard interfaces.

Quick Start

import { Hono } from "hono";
const app = new Hono();

app.get("/", (c) => c.text("Hello Hono!"));

app.get("/user/:name", (c) => {
  const name = c.req.param("name");
  return c.json({ message: `Hello ${name}!` });
});

export default app;

Core Concepts

Multi-Runtime API with RegExpRouter

Lightweight REST API with path parameter extraction:

import { Hono } from "hono";
import { logger } from "hono/logger";
import { cors } from "hono/cors";

const app = new Hono();

app.use("*", logger());
app.use("/api/*", cors());

app.get("/api/users/:id", (c) => {
  const id = c.req.param("id");
  const role = c.req.query("role") || "member";

  return c.json({
    id,
    role,
    runtime: "Cloudflare / Edge / Bun / Node",
    timestamp: Date.now(),
  });
});

export default app;

Type-Safe Request Validation with Zod Validator

Validating request bodies, headers, and query strings:

import { Hono } from "hono";
import { zValidator } from "@hono/zod-validator";
import { z } from "zod";

const app = new Hono();

const userSchema = z.object({
  username: z.string().min(3),
  email: z.string().email(),
  age: z.number().int().positive().optional(),
});

app.post("/api/users", zValidator("json", userSchema), (c) => {
  // c.req.valid('json') is fully typed according to userSchema
  const data = c.req.valid("json");
  return c.json({ success: true, user: data }, 201);
});

Hono RPC: Type-Safe Client Sharing

Exporting API routes for direct consumption in frontend clients:

// server.ts
import { Hono } from "hono";
const app = new Hono().get("/api/posts", (c) =>
  c.json([{ id: 1, title: "Hono Edge" }]),
);

export type AppType = typeof app;

// client.ts (In React / Next.js)
import { hc } from "hono/client";
import type { AppType } from "./server";

const client = hc<AppType>("https://api.example.com");
const res = await client.api.posts.$get();
const posts = await res.json(); // Fully typed!

Common Patterns

End-to-End Type-Safe RPC Client

Problem: Maintaining synchronized TypeScript API client contracts between edge backend and frontend.

Solution: Export Hono AppType and consume with hono/client:

// server.ts
import { Hono } from "hono";
const app = new Hono().get("/api/user/:id", (c) => {
  return c.json({ id: c.req.param("id"), name: "Alice" });
});
export type AppType = typeof app;

// client.ts
import { hc } from "hono/client";
import type { AppType } from "./server";

const client = hc<AppType>("https://api.example.com");
const res = await client.api.user[":id"].$get({ param: { id: "123" } });
const data = await res.json(); // Strictly typed { id: string, name: string }

Best Practices

Do:

  • Leverage Hono RPC (hc<AppType>) to achieve end-to-end type safety between backend and frontend without tRPC overhead.
  • Use @hono/zod-validator or @hono/valibot-validator to enforce strict validation at edges.
  • Target Web Standards so the same application code deploys to Cloudflare Workers, Bun, and Node.js without modification.
  • Chain router routes (new Hono().get().post()) to preserve full RPC type inference.

Don't:

  • Use Node-specific globals (process.env) without polyfills if targeting edge runtimes; use c.env.
  • Instantiate heavy global state that assumes persistent memory across serverless edge invocations.
  • Omit error boundary handlers (app.onError) in production apps.

Troubleshooting

ErrorCauseSolution
TypeError: c.req.json is not a functionAccessing body parsing as method rather than awaiting promise.Use const body = await c.req.json().
Route not matching on sub-pathRoute prefix mismatch in app.route('/prefix', subApp).Ensure subApp paths are relative to mount point (/ instead of /prefix).
Environment variables undefined on Cloudflare WorkersAccessing process.env instead of c.env.Extract bindings from context: c.env.MY_KV_STORE.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.