[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72YAXVFDSHPCHTSZ32GZN3V":3,"skill-same:01M72YAXVFDSHPCHTSZ32GZN3V":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M72YAXVFDSHPCHTSZ32GZN3V","hono",null,"Use when building Hono web applications or when the user asks about Hono APIs, routing, middleware, JSX, validation, testing, or streaming. TRIGGER when code imports from 'hono' or 'hono\u002F*', or user mentions Hono. Use `npx hono request` to test endpoints.","marcioaltoe\u002Fskills","marcioaltoe","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1562865?v=4","01M72Y3750J2CG00P0H2AHDRSZ","Marcio Altoé","01M72Y37642F46H36R4E4S7BNA",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F05-implementation-loop\u002Fhono\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: hono\ndescription: Use when building Hono web applications or when the user asks about Hono APIs, routing, middleware, JSX, validation, testing, or streaming. TRIGGER when code imports from 'hono' or 'hono\u002F*', or user mentions Hono. Use `npx hono request` to test endpoints.\n---\n\n# Hono Skill\n\nBuild Hono web applications. This skill provides inline API knowledge for AI. Use `npx hono request` to test endpoints. If the `hono-docs` MCP server is configured, prefer its tools for the latest documentation over the inline reference.\n\n## Hono CLI Usage\n\n### Request Testing\n\nTest endpoints without starting an HTTP server. Uses `app.request()` internally.\n\n```bash\n# GET request\nnpx hono request [file] -P \u002Fpath\n\n# POST request with JSON body\nnpx hono request [file] -X POST -P \u002Fapi\u002Fusers -d '{\"name\": \"test\"}'\n```\n\n**Note:** Do not pass credentials directly in CLI arguments. Use environment variables for sensitive values. `hono request` does not support Cloudflare Workers bindings (KV, D1, R2, etc.). When bindings are required, use `workers-fetch` instead:\n\n```bash\nnpx workers-fetch \u002Fpath\nnpx workers-fetch -X POST -H \"Content-Type:application\u002Fjson\" -d '{\"name\":\"test\"}' \u002Fapi\u002Fusers\n```\n\n---\n\n## Hono API Reference\n\n### App Constructor\n\n```ts\nimport { Hono } from 'hono'\n\nconst app = new Hono()\n\n\u002F\u002F With TypeScript generics\ntype Env = {\n  Bindings: { DATABASE: D1Database; KV: KVNamespace }\n  Variables: { user: User }\n}\nconst app = new Hono\u003CEnv>()\n```\n\n### Routing Methods\n\n```ts\napp.get('\u002Fpath', handler)\napp.post('\u002Fpath', handler)\napp.put('\u002Fpath', handler)\napp.delete('\u002Fpath', handler)\napp.patch('\u002Fpath', handler)\napp.options('\u002Fpath', handler)\napp.all('\u002Fpath', handler) \u002F\u002F all HTTP methods\napp.on('PURGE', '\u002Fpath', handler) \u002F\u002F custom method\napp.on(['PUT', 'DELETE'], '\u002Fpath', handler) \u002F\u002F multiple methods\n```\n\n### Routing Patterns\n\n```ts\n\u002F\u002F Path parameters\napp.get('\u002Fuser\u002F:name', (c) => {\n  const name = c.req.param('name')\n  return c.json({ name })\n})\n\n\u002F\u002F Multiple params\napp.get('\u002Fposts\u002F:id\u002Fcomments\u002F:commentId', (c) => {\n  const { id, commentId } = c.req.param()\n})\n\n\u002F\u002F Optional parameters\napp.get('\u002Fapi\u002Fanimal\u002F:type?', (c) => c.text('Animal!'))\n\n\u002F\u002F Wildcards\napp.get('\u002Fwild\u002F*\u002Fcard', (c) => c.text('Wildcard'))\n\n\u002F\u002F Regexp constraints\napp.get('\u002Fpost\u002F:date{[0-9]+}\u002F:title{[a-z]+}', (c) => {\n  const { date, title } = c.req.param()\n})\n\n\u002F\u002F Chained routes\napp\n  .get('\u002Fendpoint', (c) => c.text('GET'))\n  .post((c) => c.text('POST'))\n  .delete((c) => c.text('DELETE'))\n```\n\n### Route Grouping\n\n```ts\n\u002F\u002F Using route()\nconst api = new Hono()\napi.get('\u002Fusers', (c) => c.json([]))\n\nconst app = new Hono()\napp.route('\u002Fapi', api) \u002F\u002F mounts at \u002Fapi\u002Fusers\n\n\u002F\u002F Using basePath()\nconst app = new Hono().basePath('\u002Fapi')\napp.get('\u002Fusers', (c) => c.json([])) \u002F\u002F GET \u002Fapi\u002Fusers\n```\n\n### Error Handling\n\n```ts\napp.notFound((c) => c.json({ message: 'Not Found' }, 404))\n\napp.onError((err, c) => {\n  console.error(err)\n  return c.json({ message: 'Internal Server Error' }, 500)\n})\n```\n\n---\n\n## Context (c)\n\n### Response Methods\n\n```ts\nc.text('Hello') \u002F\u002F text\u002Fplain\nc.json({ message: 'Hello' }) \u002F\u002F application\u002Fjson\nc.html('\u003Ch1>Hello\u003C\u002Fh1>') \u002F\u002F text\u002Fhtml\nc.redirect('\u002Fnew-path') \u002F\u002F 302 redirect\nc.redirect('\u002Fnew-path', 301) \u002F\u002F 301 redirect\nc.body('raw body', 200, headers) \u002F\u002F raw response\nc.notFound() \u002F\u002F 404 response\n```\n\n### Headers & Status\n\n```ts\nc.status(201)\nc.header('X-Custom', 'value')\nc.header('Cache-Control', 'no-store')\n```\n\n### Variables (request-scoped data)\n\n```ts\n\u002F\u002F In middleware\nc.set('user', { id: 1, name: 'Alice' })\n\n\u002F\u002F In handler\nconst user = c.get('user')\n\u002F\u002F or\nconst user = c.var.user\n```\n\n### Environment (Cloudflare Workers)\n\n```ts\nconst value = await c.env.KV.get('key')\nconst db = c.env.DATABASE\nc.executionCtx.waitUntil(promise)\n```\n\n### Renderer\n\n```ts\napp.use(async (c, next) => {\n  c.setRenderer((content) =>\n    c.html(\n      \u003Chtml>\u003Cbody>{content}\u003C\u002Fbody>\u003C\u002Fhtml>\n    )\n  )\n  await next()\n})\n\napp.get('\u002F', (c) => c.render(\u003Ch1>Hello\u003C\u002Fh1>))\n```\n\n---\n\n## HonoRequest (c.req)\n\n```ts\nc.req.param('id') \u002F\u002F path parameter\nc.req.param() \u002F\u002F all path params as object\nc.req.query('page') \u002F\u002F query string parameter\nc.req.query() \u002F\u002F all query params as object\nc.req.queries('tags') \u002F\u002F multiple values: ?tags=A&tags=B → ['A', 'B']\nc.req.header('Authorization') \u002F\u002F request header\nc.req.header() \u002F\u002F all headers (keys are lowercase)\n\n\u002F\u002F Body parsing\nawait c.req.json() \u002F\u002F parse JSON body\nawait c.req.text() \u002F\u002F parse text body\nawait c.req.formData() \u002F\u002F parse as FormData\nawait c.req.parseBody() \u002F\u002F parse multipart\u002Fform-data or urlencoded\nawait c.req.arrayBuffer() \u002F\u002F parse as ArrayBuffer\nawait c.req.blob() \u002F\u002F parse as Blob\n\n\u002F\u002F Validated data (used with validator middleware)\nc.req.valid('json')\nc.req.valid('query')\nc.req.valid('form')\nc.req.valid('param')\n\n\u002F\u002F Properties\nc.req.url \u002F\u002F full URL string\nc.req.path \u002F\u002F pathname\nc.req.method \u002F\u002F HTTP method\nc.req.raw \u002F\u002F underlying Request object\n```\n\n---\n\n## Middleware\n\n### Using Built-in Middleware\n\n```ts\nimport { cors } from 'hono\u002Fcors'\nimport { logger } from 'hono\u002Flogger'\nimport { basicAuth } from 'hono\u002Fbasic-auth'\nimport { prettyJSON } from 'hono\u002Fpretty-json'\nimport { secureHeaders } from 'hono\u002Fsecure-headers'\nimport { etag } from 'hono\u002Fetag'\nimport { compress } from 'hono\u002Fcompress'\nimport { poweredBy } from 'hono\u002Fpowered-by'\nimport { timing } from 'hono\u002Ftiming'\nimport { cache } from 'hono\u002Fcache'\nimport { bearerAuth } from 'hono\u002Fbearer-auth'\nimport { jwt } from 'hono\u002Fjwt'\nimport { csrf } from 'hono\u002Fcsrf'\nimport { ipRestriction } from 'hono\u002Fip-restriction'\nimport { bodyLimit } from 'hono\u002Fbody-limit'\nimport { requestId } from 'hono\u002Frequest-id'\nimport { methodOverride } from 'hono\u002Fmethod-override'\nimport { trailingSlash, trimTrailingSlash } from 'hono\u002Ftrailing-slash'\n\n\u002F\u002F Registration\napp.use(logger()) \u002F\u002F all routes\napp.use('\u002Fapi\u002F*', cors()) \u002F\u002F specific path\napp.post('\u002Fapi\u002F*', basicAuth({ username: 'admin', password: 'secret' }))\n```\n\n### Custom Middleware\n\n```ts\n\u002F\u002F Inline\napp.use(async (c, next) => {\n  const start = Date.now()\n  await next()\n  const elapsed = Date.now() - start\n  c.res.headers.set('X-Response-Time', `${elapsed}ms`)\n})\n\n\u002F\u002F Reusable with createMiddleware\nimport { createMiddleware } from 'hono\u002Ffactory'\n\nconst auth = createMiddleware(async (c, next) => {\n  const token = c.req.header('Authorization')\n  if (!token) return c.json({ error: 'Unauthorized' }, 401)\n  await next()\n})\n\napp.use('\u002Fapi\u002F*', auth)\n```\n\n### Middleware Execution Order\n\nMiddleware executes in registration order. `await next()` calls the next middleware\u002Fhandler, and code after `next()` runs on the way back:\n\n```\nRequest → mw1 before → mw2 before → handler → mw2 after → mw1 after → Response\n```\n\n```ts\napp.use(async (c, next) => {\n  \u002F\u002F before handler\n  await next()\n  \u002F\u002F after handler\n})\n```\n\n---\n\n## Validation\n\nValidation targets: `json`, `form`, `query`, `header`, `param`, `cookie`.\n\n### Zod Validator\n\n```ts\nimport { zValidator } from '@hono\u002Fzod-validator'\nimport { z } from 'zod'\n\nconst schema = z.object({\n  title: z.string().min(1),\n  body: z.string()\n})\n\napp.post('\u002Fposts', zValidator('json', schema), (c) => {\n  const data = c.req.valid('json') \u002F\u002F fully typed\n  return c.json(data, 201)\n})\n```\n\n### Valibot \u002F Standard Schema Validator\n\n```ts\nimport { sValidator } from '@hono\u002Fstandard-validator'\nimport * as v from 'valibot'\n\nconst schema = v.object({ name: v.string(), age: v.number() })\n\napp.post('\u002Fusers', sValidator('json', schema), (c) => {\n  const data = c.req.valid('json')\n  return c.json(data, 201)\n})\n```\n\n---\n\n## JSX\n\n### Setup\n\nIn `tsconfig.json`:\n\n```json\n{\n  \"compilerOptions\": {\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"hono\u002Fjsx\"\n  }\n}\n```\n\nOr use pragma: `\u002F** @jsxImportSource hono\u002Fjsx *\u002F`\n\n**Important:** Files using JSX must have a `.tsx` extension. Rename `.ts` to `.tsx` or the compiler will fail.\n\n### Components\n\n```tsx\nimport type { PropsWithChildren } from 'hono\u002Fjsx'\n\nconst Layout = (props: PropsWithChildren) => (\n  \u003Chtml>\n    \u003Chead>\n      \u003Ctitle>My App\u003C\u002Ftitle>\n    \u003C\u002Fhead>\n    \u003Cbody>{props.children}\u003C\u002Fbody>\n  \u003C\u002Fhtml>\n)\n\nconst UserCard = ({ name }: { name: string }) => (\n  \u003Cdiv class=\"card\">\n    \u003Ch2>{name}\u003C\u002Fh2>\n  \u003C\u002Fdiv>\n)\n\napp.get('\u002F', (c) => {\n  return c.html(\n    \u003CLayout>\n      \u003CUserCard name=\"Alice\" \u002F>\n    \u003C\u002FLayout>\n  )\n})\n```\n\n### jsxRenderer Middleware\n\nUse `jsxRenderer` middleware for layouts. See `npx hono docs \u002Fdocs\u002Fmiddleware\u002Fbuiltin\u002Fjsx-renderer` for details.\n\n### Async Components\n\n```tsx\nconst UserList = async () => {\n  const users = await fetchUsers()\n  return (\n    \u003Cul>\n      {users.map((u) => (\n        \u003Cli>{u.name}\u003C\u002Fli>\n      ))}\n    \u003C\u002Ful>\n  )\n}\n```\n\n### Fragments\n\n```tsx\nconst Items = () => (\n  \u003C>\n    \u003Cli>Item 1\u003C\u002Fli>\n    \u003Cli>Item 2\u003C\u002Fli>\n  \u003C\u002F>\n)\n```\n\n---\n\n## Streaming\n\n```ts\nimport { stream, streamText, streamSSE } from 'hono\u002Fstreaming'\n\n\u002F\u002F Basic stream\napp.get('\u002Fstream', (c) => {\n  return stream(c, async (stream) => {\n    stream.onAbort(() => console.log('Aborted'))\n    await stream.write(new Uint8Array([0x48, 0x65]))\n    await stream.pipe(readableStream)\n  })\n})\n\n\u002F\u002F Text stream\napp.get('\u002Fstream-text', (c) => {\n  return streamText(c, async (stream) => {\n    await stream.writeln('Hello')\n    await stream.sleep(1000)\n    await stream.write('World')\n  })\n})\n\n\u002F\u002F Server-Sent Events\napp.get('\u002Fsse', (c) => {\n  return streamSSE(c, async (stream) => {\n    let id = 0\n    while (true) {\n      await stream.writeSSE({\n        data: JSON.stringify({ time: new Date().toISOString() }),\n        event: 'time-update',\n        id: String(id++)\n      })\n      await stream.sleep(1000)\n    }\n  })\n})\n```\n\n---\n\n## Testing with app.request()\n\nTest endpoints without starting an HTTP server:\n\n```ts\n\u002F\u002F GET\nconst res = await app.request('\u002Fposts')\nexpect(res.status).toBe(200)\nexpect(await res.json()).toEqual({ posts: [] })\n\n\u002F\u002F POST with JSON\nconst res = await app.request('\u002Fposts', {\n  method: 'POST',\n  body: JSON.stringify({ title: 'Hello' }),\n  headers: { 'Content-Type': 'application\u002Fjson' }\n})\n\n\u002F\u002F POST with FormData\nconst formData = new FormData()\nformData.append('name', 'Alice')\nconst res = await app.request('\u002Fusers', { method: 'POST', body: formData })\n\n\u002F\u002F With mock env (Cloudflare Workers bindings)\nconst res = await app.request('\u002Fapi\u002Fdata', {}, { KV: mockKV, DATABASE: mockDB })\n\n\u002F\u002F Using Request object\nconst req = new Request('http:\u002F\u002Flocalhost\u002Fapi', { method: 'DELETE' })\nconst res = await app.request(req)\n```\n\n---\n\n## Hono Client (RPC)\n\nType-safe API client using shared types between server and client.\n\n**IMPORTANT: Routes MUST be chained for type inference to work. Without chaining, the client cannot infer route types.**\n\n```ts\n\u002F\u002F Server: routes MUST be chained to preserve types\nconst route = app\n  .post('\u002Fposts', zValidator('json', schema), (c) => {\n    return c.json({ ok: true }, 201)\n  })\n  .get('\u002Fposts', (c) => {\n    return c.json({ posts: [] })\n  })\nexport type AppType = typeof route\n\n\u002F\u002F Client: use hc() with the exported type\nimport { hc } from 'hono\u002Fclient'\nimport type { AppType } from '.\u002Fserver'\n\nconst client = hc\u003CAppType>('http:\u002F\u002Flocalhost:8787\u002F')\nconst res = await client.posts.$post({ json: { title: 'Hello' } })\nconst data = await res.json() \u002F\u002F fully typed\n```\n\nType utilities:\n\n```ts\nimport type { InferRequestType, InferResponseType } from 'hono\u002Fclient'\n\ntype ReqType = InferRequestType\u003Ctypeof client.posts.$post>\ntype ResType = InferResponseType\u003Ctypeof client.posts.$post, 200>\n```\n\n---\n\n## Helpers\n\nHelpers are utility functions imported from `hono\u002F\u003Chelper-name>`:\n\n```ts\nimport { getConnInfo } from 'hono\u002Fconninfo'\nimport { getCookie, setCookie, deleteCookie } from 'hono\u002Fcookie'\nimport { css, Style } from 'hono\u002Fcss'\nimport { createFactory } from 'hono\u002Ffactory'\nimport { html, raw } from 'hono\u002Fhtml'\nimport { stream, streamText, streamSSE } from 'hono\u002Fstreaming'\nimport { testClient } from 'hono\u002Ftesting'\nimport { upgradeWebSocket } from 'hono\u002Fcloudflare-workers' \u002F\u002F or other adapter\n```\n\nAvailable helpers: Accepts, Adapter, ConnInfo, Cookie, css, Dev, Factory, html, JWT, Proxy, Route, SSG, Streaming, Testing, WebSocket.\n\nFor details, use `npx hono docs \u002Fdocs\u002Fhelpers\u002F\u003Chelper-name>`.\n\n### Factory\n\nUse `createFactory` to define `Env` once and share it across app, middleware, and handlers:\n\n```ts\nimport { createFactory } from 'hono\u002Ffactory'\n\nconst factory = createFactory\u003CEnv>()\n\n\u002F\u002F Create app (Env type is inherited)\nconst app = factory.createApp()\n\n\u002F\u002F Create middleware (Env type is inherited, no need to pass generics)\nconst mw = factory.createMiddleware(async (c, next) => {\n  await next()\n})\n\n\u002F\u002F Create handlers separately (preserves type inference)\nconst handlers = factory.createHandlers(logger(), (c) => c.json({ message: 'Hello' }))\napp.get('\u002Fapi', ...handlers)\n```\n\n---\n\n## Best Practices\n\n- Write handlers inline in route definitions for proper type inference of path params.\n- Use `app.route()` to organize large apps by feature, not Rails-style controllers.\n- Use `createFactory()` to share Env type across app, middleware, and handlers.\n- Use `c.set()`\u002F`c.get()` to pass data between middleware and handlers.\n- Chain validators for multiple request parts (param + query + json).\n- Export app type for RPC: `export type AppType = typeof routes`\n- Use `app.request()` for testing — no server startup needed.\n\n## Adapters\n\nHono runs on multiple runtimes. The default export works for Cloudflare Workers, Deno, and Bun. For Node.js, use the Node adapter:\n\n```ts\n\u002F\u002F Cloudflare Workers \u002F Deno \u002F Bun\nexport default app\n\n\u002F\u002F Node.js\nimport { serve } from '@hono\u002Fnode-server'\nserve(app)\n```\n","# Hono Skill\n\nBuild Hono web applications. This skill provides inline API knowledge for AI. Use `npx hono request` to test endpoints. If the `hono-docs` MCP server is configured, prefer its tools for the latest documentation over the inline reference.\n\n## Hono CLI Usage\n\n### Request Testing\n\nTest endpoints without starting an HTTP server. Uses `app.request()` internally.\n\n```bash\n# GET request\nnpx hono request [file] -P \u002Fpath\n\n# POST request with JSON body\nnpx hono request [file] -X POST -P \u002Fapi\u002Fusers -d '{\"name\": \"test\"}'\n```\n\n**Note:** Do not pass credentials directly in CLI arguments. Use environment variables for sensitive values. `hono request` does not support Cloudflare Workers bindings (KV, D1, R2, etc.). When bindings are required, use `workers-fetch` instead:\n\n```bash\nnpx workers-fetch \u002Fpath\nnpx workers-fetch -X POST -H \"Content-Type:application\u002Fjson\" -d '{\"name\":\"test\"}' \u002Fapi\u002Fusers\n```\n\n---\n\n## Hono API Reference\n\n### App Constructor\n\n```ts\nimport { Hono } from 'hono'\n\nconst app = new Hono()\n\n\u002F\u002F With TypeScript generics\ntype Env = {\n  Bindings: { DATABASE: D1Database; KV: KVNamespace }\n  Variables: { user: User }\n}\nconst app = new Hono\u003CEnv>()\n```\n\n### Routing Methods\n\n```ts\napp.get('\u002Fpath', handler)\napp.post('\u002Fpath', handler)\napp.put('\u002Fpath', handler)\napp.delete('\u002Fpath', handler)\napp.patch('\u002Fpath', handler)\napp.options('\u002Fpath', handler)\napp.all('\u002Fpath', handler) \u002F\u002F all HTTP methods\napp.on('PURGE', '\u002Fpath', handler) \u002F\u002F custom method\napp.on(['PUT', 'DELETE'], '\u002Fpath', handler) \u002F\u002F multiple methods\n```\n\n### Routing Patterns\n\n```ts\n\u002F\u002F Path parameters\napp.get('\u002Fuser\u002F:name', (c) => {\n  const name = c.req.param('name')\n  return c.json({ name })\n})\n\n\u002F\u002F Multiple params\napp.get('\u002Fposts\u002F:id\u002Fcomments\u002F:commentId', (c) => {\n  const { id, commentId } = c.req.param()\n})\n\n\u002F\u002F Optional parameters\napp.get('\u002Fapi\u002Fanimal\u002F:type?', (c) => c.text('Animal!'))\n\n\u002F\u002F Wildcards\napp.get('\u002Fwild\u002F*\u002Fcard', (c) => c.text('Wildcard'))\n\n\u002F\u002F Regexp constraints\napp.get('\u002Fpost\u002F:date{[0-9]+}\u002F:title{[a-z]+}', (c) => {\n  const { date, title } = c.req.param()\n})\n\n\u002F\u002F Chained routes\napp\n  .get('\u002Fendpoint', (c) => c.text('GET'))\n  .post((c) => c.text('POST'))\n  .delete((c) => c.text('DELETE'))\n```\n\n### Route Grouping\n\n```ts\n\u002F\u002F Using route()\nconst api = new Hono()\napi.get('\u002Fusers', (c) => c.json([]))\n\nconst app = new Hono()\napp.route('\u002Fapi', api) \u002F\u002F mounts at \u002Fapi\u002Fusers\n\n\u002F\u002F Using basePath()\nconst app = new Hono().basePath('\u002Fapi')\napp.get('\u002Fusers', (c) => c.json([])) \u002F\u002F GET \u002Fapi\u002Fusers\n```\n\n### Error Handling\n\n```ts\napp.notFound((c) => c.json({ message: 'Not Found' }, 404))\n\napp.onError((err, c) => {\n  console.error(err)\n  return c.json({ message: 'Internal Server Error' }, 500)\n})\n```\n\n---\n\n## Context (c)\n\n### Response Methods\n\n```ts\nc.text('Hello') \u002F\u002F text\u002Fplain\nc.json({ message: 'Hello' }) \u002F\u002F application\u002Fjson\nc.html('\u003Ch1>Hello\u003C\u002Fh1>') \u002F\u002F text\u002Fhtml\nc.redirect('\u002Fnew-path') \u002F\u002F 302 redirect\nc.redirect('\u002Fnew-path', 301) \u002F\u002F 301 redirect\nc.body('raw body', 200, headers) \u002F\u002F raw response\nc.notFound() \u002F\u002F 404 response\n```\n\n### Headers & Status\n\n```ts\nc.status(201)\nc.header('X-Custom', 'value')\nc.header('Cache-Control', 'no-store')\n```\n\n### Variables (request-scoped data)\n\n```ts\n\u002F\u002F In middleware\nc.set('user', { id: 1, name: 'Alice' })\n\n\u002F\u002F In handler\nconst user = c.get('user')\n\u002F\u002F or\nconst user = c.var.user\n```\n\n### Environment (Cloudflare Workers)\n\n```ts\nconst value = await c.env.KV.get('key')\nconst db = c.env.DATABASE\nc.executionCtx.waitUntil(promise)\n```\n\n### Renderer\n\n```ts\napp.use(async (c, next) => {\n  c.setRenderer((content) =>\n    c.html(\n      \u003Chtml>\u003Cbody>{content}\u003C\u002Fbody>\u003C\u002Fhtml>\n    )\n  )\n  await next()\n})\n\napp.get('\u002F', (c) => c.render(\u003Ch1>Hello\u003C\u002Fh1>))\n```\n\n---\n\n## HonoRequest (c.req)\n\n```ts\nc.req.param('id') \u002F\u002F path parameter\nc.req.param() \u002F\u002F all path params as object\nc.req.query('page') \u002F\u002F query string parameter\nc.req.query() \u002F\u002F all query params as object\nc.req.queries('tags') \u002F\u002F multiple values: ?tags=A&tags=B → ['A', 'B']\nc.req.header('Authorization') \u002F\u002F request header\nc.req.header() \u002F\u002F all headers (keys are lowercase)\n\n\u002F\u002F Body parsing\nawait c.req.json() \u002F\u002F parse JSON body\nawait c.req.text() \u002F\u002F parse text body\nawait c.req.formData() \u002F\u002F parse as FormData\nawait c.req.parseBody() \u002F\u002F parse multipart\u002Fform-data or urlencoded\nawait c.req.arrayBuffer() \u002F\u002F parse as ArrayBuffer\nawait c.req.blob() \u002F\u002F parse as Blob\n\n\u002F\u002F Validated data (used with validator middleware)\nc.req.valid('json')\nc.req.valid('query')\nc.req.valid('form')\nc.req.valid('param')\n\n\u002F\u002F Properties\nc.req.url \u002F\u002F full URL string\nc.req.path \u002F\u002F pathname\nc.req.method \u002F\u002F HTTP method\nc.req.raw \u002F\u002F underlying Request object\n```\n\n---\n\n## Middleware\n\n### Using Built-in Middleware\n\n```ts\nimport { cors } from 'hono\u002Fcors'\nimport { logger } from 'hono\u002Flogger'\nimport { basicAuth } from 'hono\u002Fbasic-auth'\nimport { prettyJSON } from 'hono\u002Fpretty-json'\nimport { secureHeaders } from 'hono\u002Fsecure-headers'\nimport { etag } from 'hono\u002Fetag'\nimport { compress } from 'hono\u002Fcompress'\nimport { poweredBy } from 'hono\u002Fpowered-by'\nimport { timing } from 'hono\u002Ftiming'\nimport { cache } from 'hono\u002Fcache'\nimport { bearerAuth } from 'hono\u002Fbearer-auth'\nimport { jwt } from 'hono\u002Fjwt'\nimport { csrf } from 'hono\u002Fcsrf'\nimport { ipRestriction } from 'hono\u002Fip-restriction'\nimport { bodyLimit } from 'hono\u002Fbody-limit'\nimport { requestId } from 'hono\u002Frequest-id'\nimport { methodOverride } from 'hono\u002Fmethod-override'\nimport { trailingSlash, trimTrailingSlash } from 'hono\u002Ftrailing-slash'\n\n\u002F\u002F Registration\napp.use(logger()) \u002F\u002F all routes\napp.use('\u002Fapi\u002F*', cors()) \u002F\u002F specific path\napp.post('\u002Fapi\u002F*', basicAuth({ username: 'admin', password: 'secret' }))\n```\n\n### Custom Middleware\n\n```ts\n\u002F\u002F Inline\napp.use(async (c, next) => {\n  const start = Date.now()\n  await next()\n  const elapsed = Date.now() - start\n  c.res.headers.set('X-Response-Time', `${elapsed}ms`)\n})\n\n\u002F\u002F Reusable with createMiddleware\nimport { createMiddleware } from 'hono\u002Ffactory'\n\nconst auth = createMiddleware(async (c, next) => {\n  const token = c.req.header('Authorization')\n  if (!token) return c.json({ error: 'Unauthorized' }, 401)\n  await next()\n})\n\napp.use('\u002Fapi\u002F*', auth)\n```\n\n### Middleware Execution Order\n\nMiddleware executes in registration order. `await next()` calls the next middleware\u002Fhandler, and code after `next()` runs on the way back:\n\n```\nRequest → mw1 before → mw2 before → handler → mw2 after → mw1 after → Response\n```\n\n```ts\napp.use(async (c, next) => {\n  \u002F\u002F before handler\n  await next()\n  \u002F\u002F after handler\n})\n```\n\n---\n\n## Validation\n\nValidation targets: `json`, `form`, `query`, `header`, `param`, `cookie`.\n\n### Zod Validator\n\n```ts\nimport { zValidator } from '@hono\u002Fzod-validator'\nimport { z } from 'zod'\n\nconst schema = z.object({\n  title: z.string().min(1),\n  body: z.string()\n})\n\napp.post('\u002Fposts', zValidator('json', schema), (c) => {\n  const data = c.req.valid('json') \u002F\u002F fully typed\n  return c.json(data, 201)\n})\n```\n\n### Valibot \u002F Standard Schema Validator\n\n```ts\nimport { sValidator } from '@hono\u002Fstandard-validator'\nimport * as v from 'valibot'\n\nconst schema = v.object({ name: v.string(), age: v.number() })\n\napp.post('\u002Fusers', sValidator('json', schema), (c) => {\n  const data = c.req.valid('json')\n  return c.json(data, 201)\n})\n```\n\n---\n\n## JSX\n\n### Setup\n\nIn `tsconfig.json`:\n\n```json\n{\n  \"compilerOptions\": {\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"hono\u002Fjsx\"\n  }\n}\n```\n\nOr use pragma: `\u002F** @jsxImportSource hono\u002Fjsx *\u002F`\n\n**Important:** Files using JSX must have a `.tsx` extension. Rename `.ts` to `.tsx` or the compiler will fail.\n\n### Components\n\n```tsx\nimport type { PropsWithChildren } from 'hono\u002Fjsx'\n\nconst Layout = (props: PropsWithChildren) => (\n  \u003Chtml>\n    \u003Chead>\n      \u003Ctitle>My App\u003C\u002Ftitle>\n    \u003C\u002Fhead>\n    \u003Cbody>{props.children}\u003C\u002Fbody>\n  \u003C\u002Fhtml>\n)\n\nconst UserCard = ({ name }: { name: string }) => (\n  \u003Cdiv class=\"card\">\n    \u003Ch2>{name}\u003C\u002Fh2>\n  \u003C\u002Fdiv>\n)\n\napp.get('\u002F', (c) => {\n  return c.html(\n    \u003CLayout>\n      \u003CUserCard name=\"Alice\" \u002F>\n    \u003C\u002FLayout>\n  )\n})\n```\n\n### jsxRenderer Middleware\n\nUse `jsxRenderer` middleware for layouts. See `npx hono docs \u002Fdocs\u002Fmiddleware\u002Fbuiltin\u002Fjsx-renderer` for details.\n\n### Async Components\n\n```tsx\nconst UserList = async () => {\n  const users = await fetchUsers()\n  return (\n    \u003Cul>\n      {users.map((u) => (\n        \u003Cli>{u.name}\u003C\u002Fli>\n      ))}\n    \u003C\u002Ful>\n  )\n}\n```\n\n### Fragments\n\n```tsx\nconst Items = () => (\n  \u003C>\n    \u003Cli>Item 1\u003C\u002Fli>\n    \u003Cli>Item 2\u003C\u002Fli>\n  \u003C\u002F>\n)\n```\n\n---\n\n## Streaming\n\n```ts\nimport { stream, streamText, streamSSE } from 'hono\u002Fstreaming'\n\n\u002F\u002F Basic stream\napp.get('\u002Fstream', (c) => {\n  return stream(c, async (stream) => {\n    stream.onAbort(() => console.log('Aborted'))\n    await stream.write(new Uint8Array([0x48, 0x65]))\n    await stream.pipe(readableStream)\n  })\n})\n\n\u002F\u002F Text stream\napp.get('\u002Fstream-text', (c) => {\n  return streamText(c, async (stream) => {\n    await stream.writeln('Hello')\n    await stream.sleep(1000)\n    await stream.write('World')\n  })\n})\n\n\u002F\u002F Server-Sent Events\napp.get('\u002Fsse', (c) => {\n  return streamSSE(c, async (stream) => {\n    let id = 0\n    while (true) {\n      await stream.writeSSE({\n        data: JSON.stringify({ time: new Date().toISOString() }),\n        event: 'time-update',\n        id: String(id++)\n      })\n      await stream.sleep(1000)\n    }\n  })\n})\n```\n\n---\n\n## Testing with app.request()\n\nTest endpoints without starting an HTTP server:\n\n```ts\n\u002F\u002F GET\nconst res = await app.request('\u002Fposts')\nexpect(res.status).toBe(200)\nexpect(await res.json()).toEqual({ posts: [] })\n\n\u002F\u002F POST with JSON\nconst res = await app.request('\u002Fposts', {\n  method: 'POST',\n  body: JSON.stringify({ title: 'Hello' }),\n  headers: { 'Content-Type': 'application\u002Fjson' }\n})\n\n\u002F\u002F POST with FormData\nconst formData = new FormData()\nformData.append('name', 'Alice')\nconst res = await app.request('\u002Fusers', { method: 'POST', body: formData })\n\n\u002F\u002F With mock env (Cloudflare Workers bindings)\nconst res = await app.request('\u002Fapi\u002Fdata', {}, { KV: mockKV, DATABASE: mockDB })\n\n\u002F\u002F Using Request object\nconst req = new Request('http:\u002F\u002Flocalhost\u002Fapi', { method: 'DELETE' })\nconst res = await app.request(req)\n```\n\n---\n\n## Hono Client (RPC)\n\nType-safe API client using shared types between server and client.\n\n**IMPORTANT: Routes MUST be chained for type inference to work. Without chaining, the client cannot infer route types.**\n\n```ts\n\u002F\u002F Server: routes MUST be chained to preserve types\nconst route = app\n  .post('\u002Fposts', zValidator('json', schema), (c) => {\n    return c.json({ ok: true }, 201)\n  })\n  .get('\u002Fposts', (c) => {\n    return c.json({ posts: [] })\n  })\nexport type AppType = typeof route\n\n\u002F\u002F Client: use hc() with the exported type\nimport { hc } from 'hono\u002Fclient'\nimport type { AppType } from '.\u002Fserver'\n\nconst client = hc\u003CAppType>('http:\u002F\u002Flocalhost:8787\u002F')\nconst res = await client.posts.$post({ json: { title: 'Hello' } })\nconst data = await res.json() \u002F\u002F fully typed\n```\n\nType utilities:\n\n```ts\nimport type { InferRequestType, InferResponseType } from 'hono\u002Fclient'\n\ntype ReqType = InferRequestType\u003Ctypeof client.posts.$post>\ntype ResType = InferResponseType\u003Ctypeof client.posts.$post, 200>\n```\n\n---\n\n## Helpers\n\nHelpers are utility functions imported from `hono\u002F\u003Chelper-name>`:\n\n```ts\nimport { getConnInfo } from 'hono\u002Fconninfo'\nimport { getCookie, setCookie, deleteCookie } from 'hono\u002Fcookie'\nimport { css, Style } from 'hono\u002Fcss'\nimport { createFactory } from 'hono\u002Ffactory'\nimport { html, raw } from 'hono\u002Fhtml'\nimport { stream, streamText, streamSSE } from 'hono\u002Fstreaming'\nimport { testClient } from 'hono\u002Ftesting'\nimport { upgradeWebSocket } from 'hono\u002Fcloudflare-workers' \u002F\u002F or other adapter\n```\n\nAvailable helpers: Accepts, Adapter, ConnInfo, Cookie, css, Dev, Factory, html, JWT, Proxy, Route, SSG, Streaming, Testing, WebSocket.\n\nFor details, use `npx hono docs \u002Fdocs\u002Fhelpers\u002F\u003Chelper-name>`.\n\n### Factory\n\nUse `createFactory` to define `Env` once and share it across app, middleware, and handlers:\n\n```ts\nimport { createFactory } from 'hono\u002Ffactory'\n\nconst factory = createFactory\u003CEnv>()\n\n\u002F\u002F Create app (Env type is inherited)\nconst app = factory.createApp()\n\n\u002F\u002F Create middleware (Env type is inherited, no need to pass generics)\nconst mw = factory.createMiddleware(async (c, next) => {\n  await next()\n})\n\n\u002F\u002F Create handlers separately (preserves type inference)\nconst handlers = factory.createHandlers(logger(), (c) => c.json({ message: 'Hello' }))\napp.get('\u002Fapi', ...handlers)\n```\n\n---\n\n## Best Practices\n\n- Write handlers inline in route definitions for proper type inference of path params.\n- Use `app.route()` to organize large apps by feature, not Rails-style controllers.\n- Use `createFactory()` to share Env type across app, middleware, and handlers.\n- Use `c.set()`\u002F`c.get()` to pass data between middleware and handlers.\n- Chain validators for multiple request parts (param + query + json).\n- Export app type for RPC: `export type AppType = typeof routes`\n- Use `app.request()` for testing — no server startup needed.\n\n## Adapters\n\nHono runs on multiple runtimes. The default export works for Cloudflare Workers, Deno, and Bun. For Node.js, use the Node adapter:\n\n```ts\n\u002F\u002F Cloudflare Workers \u002F Deno \u002F Bun\nexport default app\n\n\u002F\u002F Node.js\nimport { serve } from '@hono\u002Fnode-server'\nserve(app)\n```\n",{"name":5,"description":7},"main","dea450cfd9df78b5cf721964ef178a75cea55cbb","skills\u002F05-implementation-loop\u002Fhono",2,"https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills","https:\u002F\u002Fmarcioaltoe.github.io\u002Fskills\u002F","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe","Senior Software Engineer · Backend, Systems & AI","2026-11-14 18:29:56",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add marcioaltoe\u002Fskills --skill hono",{"tool":39,"command":40},"bunx","bunx skills add marcioaltoe\u002Fskills --skill hono",{"tool":42,"command":43},"pnpm","pnpm dlx skills add marcioaltoe\u002Fskills --skill hono","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F05-implementation-loop\u002Fhono\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"agents\u002Fopenai.yaml","REFERENCE","参考文档",156,"https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F05-implementation-loop\u002Fhono\u002Fagents\u002Fopenai.yaml",[54,62,69,76,83,90],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":61},"01M72YNVSF4JTTQG3YTR9QNT4Z","startup-validator","Comprehensive startup idea validation and market analysis tool. Use when users need to evaluate a startup idea, assess market fit, analyze competition, validate problem-solution fit, or determine market positioning. Triggers include requests to \"validate my startup idea\", \"analyze market opportunity\", \"check if there's demand for\", \"research competition for\", \"evaluate business idea\", or \"see if my idea is viable\". Provides data-driven analysis using web search, market frameworks, competitive research, and positioning recommendations.","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F10-marketing\u002Fstartup-validator\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":61},"01M72YNN34B4MYKEX1X6BB1NS1","positioning-icp","When the user wants to define their ideal customer profile, position an AI product, build messaging architecture, or validate product-market fit. Also use when the user mentions 'ICP,' 'ideal customer profile,' 'positioning,' 'PMF,' 'product-market fit,' 'messaging,' 'buyer persona,' 'enrichment signals,' 'market positioning,' or 'competitive positioning.' This skill covers market positioning, ICP definition, messaging architecture, and PMF validation for AI-native products. Do NOT use for technical implementation, code review, or software architecture.","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F10-marketing\u002Fpositioning-icp\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":61},"01M72YNG8XJ4RHRB5DQMCY9C1N","copywriting","When the user wants to write or rewrite page copy (homepage, landing, pricing, feature), or asks which headline, promise, or message to lead with. Diagnoses the input first (blank brief, real voice, or point edit) and changes only what it calls for. Claims must be supportable; a declined claim names the evidence that would unlock it. No AI tells like 'it's not X, it's Y' or 'no X, no Y, no Z'. For editing, see copy-editing. For emails, see emails. For the offer, see offers.","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F10-marketing\u002Fcopywriting\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":61},"01M72YNBF4JMQ4VCFHTW0WS6SD","business-storyteller","Transforms technical work into persuasive business-language documents for non-technical stakeholders, including internal announcements, approval proposals, incident explainers, technical-debt cases, product explainers, and investor or partner memos. Use when the user asks to present technical work to the company, explain software to business teams, write a business case, make an approval document, or convert a technical artifact into stakeholder communication in the requested language. Do not use for READMEs, specs, ADRs, external marketing pages, or customer-facing sales copy.","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F10-marketing\u002Fbusiness-storyteller\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":61},"01M72YN8NQ6QR0GHX2A8YW2K4T","brand-storytelling","Help users craft compelling brand narratives. Use when someone is defining brand strategy, writing company positioning, creating pitch narratives, developing messaging frameworks, or trying to make their company story more memorable.","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F10-marketing\u002Fbrand-storytelling\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":94,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":61},"01M72YN3CJH7CKPF4AXNY79Q9S","skill-creator","Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F09-learning-loop\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fmarcioaltoe\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002F09-learning-loop\u002Fskill-creator\u002FSKILL.md",[],[]]