nodejs-hono
Use when the user asks about Hono, Hono RPC client (hc), zValidator, Hono middleware, Hono on Cloudflare Workers or Bun, or c.set/c.get context. Produces Hono…
от j4flmao★ 47 звёзд на GitHub
Установить nodejs-hono в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Node.js Hono
Purpose
Build Hono applications — lightweight, edge-ready web framework with Zod validation, RPC client, and cross-runtime (Node, Bun, Deno, Cloudflare Workers) support.
Agent Protocol
Trigger
User request includes: hono, hono app, hono middleware, hono rpc, hono zod, hono cloudflare, hono bun, ultralightweight, edge backend.
Input Context
- Runtime (Node.js, Bun, Deno, Cloudflare Workers)
- Hono version (4.x)
- Validation (Zod, TypeBox)
- Database (Drizzle, Prisma, D1)
- Auth (JWT, session, OAuth)
Output Artifact
App setup, route patterns, middleware chain, RPC client config, validation setup.
Response Format
Produce artifact directly. No preamble, no postamble, no explanations.
Completion Criteria
- Hono app created with correct runtime adapter
- Routes with Zod validation middleware
- RPC client configured for frontend type safety
- Middleware pipeline ordered correctly
- CORS and auth middleware registered
Max Response Length
4096 tokens
Architecture Decision Trees
Hono vs Express vs Fastify (for Node.js)
| Criterion | Hono | Express | Fastify |
|---|---|---|---|
| Performance | ~60k req/s | ~30k req/s | ~50k req/s |
| Bundle size | ~14KB | ~150KB | ~200KB |
| Edge support | Cloudflare, Deno, Bun, Lambda | Node only | Node + AWS Lambda |
| RPC type safety | Built-in (hono/client) | None | None |
| Validation | Zod/TypeBox middleware | Manual | Schema-first |
| Ecosystem | Small, growing | Largest | Medium |
Decision: Edge deployment or ultra-light → Hono. Full ecosystem → Express. Performance + schema → Fastify.
Runtime Selection
| Runtime | Adapter | Best For |
|---|---|---|
| Node.js | @hono/node-server |
Existing Node ecosystem |
| Cloudflare Workers | hono (native) |
Edge compute, D1, KV |
| Bun | hono (native) |
Fast startup, TypeScript native |
| Deno | hono (npm/JSR) |
Deno Deploy, permissions |
| Vercel | @hono/vercel |
Serverless, Next.js BFF |
| AWS Lambda | @hono/aws-lambda |
Lambda + API Gateway |
Workflow
Step 1: Project Bootstrap
// src/index.ts (Node.js)
import { serve } from '@hono/node-server';
import { createApp } from './app';
const app = createApp();
const port = parseInt(process.env.PORT || '3000');
serve({ fetch: app.fetch, port }, (info) => {
console.log(`Server running on port ${info.port}`);
});
// src/app.ts
import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { logger } from 'hono/logger';
import { secureHeaders } from 'hono/secure-headers';
import { userModule } from './modules/users';
import { errorHandler } from './middleware/error-handler';
export function createApp() {
const app = new Hono();
// Global middleware
app.use('*', cors({ origin: process.env.CORS_ORIGIN }));
app.use('*', logger());
app.use('*', secureHeaders());
app.use('*', errorHandler);
// Routes
app.route('/api/v1/users', userModule);
// Health
app.get('/health', (c) => c.json({ status: 'ok' }));
return app;
}
Step 2: Module Routes with Zod Validation
// src/modules/users/index.ts
import { Hono } from 'hono';
import { z } from 'zod';
import { zValidator } from '@hono/zod-validator';
import * as userService from './service';
export const userModule = new Hono()
.get('/', zValidator('query', z.object({
page: z.coerce.number().optional().default(1),
limit: z.coerce.number().optional().default(20),
})), async (c) => {
const { page, limit } = c.req.valid('query');
const result = await userService.findAll(page, limit);
return c.json(result);
})
.get('/:id', async (c) => {
const id = c.req.param('id');
const user = await userService.findById(id);
if (!user) return c.json({ error: 'Not found' }, 404);
return c.json({ data: user });
})
.post('/', zValidator('json', z.object({
name: z.string().min(2),
email: z.string().email(),
})), async (c) => {
const body = c.req.valid('json');
const user = await userService.create(body);
return c.json({ data: user }, 201);
})
.put('/:id', zValidator('json', z.object({
name: z.string().min(2).optional(),
email: z.string().email().optional(),
})), async (c) => {
const id = c.req.param('id');
const body = c.req.valid('json');
const user = await userService.update(id, body);
return c.json({ data: user });
})
.delete('/:id', async (c) => {
const id = c.req.param('id');
await userService.delete(id);
return c.body(null, 204);
});
Step 3: Auth Middleware (JWT)
// src/middleware/auth.ts
import { Hono, Context, Next } from 'hono';
import { getCookie } from 'hono/cookie';
import { verify } from 'hono/jwt';
import { HTTPException } from 'hono/http-exception';
// Type augmentation for context
declare module 'hono' {
interface ContextVariableMap {
userId: string;
userRole: string;
}
}
export async functio
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/hono-custom-middleware.md
- references/hono-deployment.md
- references/hono-middleware.md
- references/hono-rpc.md
- references/hono-setup.md
- references/hono-testing.md
FAQ
Что делает скилл nodejs-hono?
Use when the user asks about Hono, Hono RPC client (hc), zValidator, Hono middleware, Hono on Cloudflare Workers or Bun, or c.set/c.get context. Produces Hono apps that run on edge and Node runtimes. Not for Express (use nodejs-express-skill) or Workers platform setup (use cloud-native-cloudflare-workers).
Как установить скилл nodejs-hono?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nodejs-hono запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…