hono_skill

This skill helps you implement high performance Hono endpoints with type-safe RPC, edge-ready middleware, and runtime validation across runtimes.
  • TypeScript

8

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill joncrangle/.dotfiles --skill hono

  • SKILL.md2.3 KB

Overview

This skill specializes in Hono (v4+) — an ultrafast, standards-based web framework for Edge and Node runtimes. It focuses on type-safe RPC, middleware patterns, and multi-runtime deployment (Cloudflare Workers, Bun, Deno). The guidance emphasizes predictable request handling, validators, and test-friendly patterns for reliable edge services.

How this skill works

The skill inspects code and intent to identify target runtime and recommends correct adapters and binding usage. It favors Hono RPC (client + AppType) to share types between server and client, and enforces @hono/zod-validator usage for runtime-safe inputs. It flags runtime anti-patterns for Edge environments and suggests app.request() for fast integration testing.

When to use it

  • Building edge-first APIs for Cloudflare Workers, Bun, or Deno.
  • Creating type-safe RPC endpoints shared between frontend and backend.
  • Adding middleware that needs request-scoped state or validation.
  • Writing fast integration tests without running a full server.
  • Migrating Express-style code to Web Standards-based Hono handlers.

Best practices

  • Detect the runtime (Cloudflare/Bun/Deno/Node) first and pick the correct adapter and bindings.
  • Use Hono RPC (client + AppType) to auto-share types and reduce runtime errors.
  • Always validate inputs with @hono/zod-validator and prefer c.req.valid('json') over raw parsing.
  • Avoid Node-only APIs (fs, path, process) when targeting Edge runtimes.
  • Return responses with c.json()/c.text() or a Response object; do not use Express patterns like res.send.
  • Keep no global mutable state; use c.set/c.get for request-scoped variables and c.env for config/bindings.

Example use cases

  • Implementing a type-safe RPC endpoint that auto-generates client methods for a SPA.
  • Deploying a tiny edge function on Cloudflare that uses bindings from c.env and no filesystem access.
  • Writing middleware to attach request-scoped auth info via c.set and reading it later in handlers.
  • Converting Express controllers to Hono-style inline handlers or factory.createHandlers for better type inference.
  • Running unit and integration tests using app.request() and testClient instead of spinning up a server.

FAQ

No. Avoid fs/path/process when targeting Cloudflare, Deno, or other Edge runtimes; use bindings and c.env instead.

How should I parse and validate JSON input?

Use @hono/zod-validator and call c.req.valid('json') or zValidator so you get runtime checks and type inference; do not call c.req.json() raw.

Why avoid controller classes?

OOP controller classes break Hono RPC type inference. Use inline handlers or factory.createHandlers to keep types intact.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
hono skill by joncrangle/.dotfiles | VeilStrat