_extra-skills/hono-api-architecture/SKILL.md
Core Skill. Hono API architecture guidelines for Cloudflare Workers with module boundaries, request validation, resource existence checks, Result-based error flow, layered caching, and testable route composition. Use when building or refactoring Hono APIs, edge image/data endpoints, or Worker-first backend services.
npx skillsauth add poko8nada/pj_docs hono-api-architectureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill as a reusable architecture baseline for Hono APIs running on Cloudflare Workers. It is abstracted from a production-shaped OGP generation service and generalized for broader API use.
tsc --noEmitsrc/
├── index.ts # Route entrypoint and orchestration
├── utils/
│ └── types.ts # Result<T, E> and helpers
├── [domain]/
│ ├── validate.ts # Input normalization and validation
│ ├── cache.ts # Cache read/write adapter
│ ├── error.ts # Error-to-response mapping
│ ├── render.ts # Domain core processing (optional)
│ ├── [domain].test.ts
│ └── ...
└── assets.d.ts # Static asset module declarations
Implement handlers as a clear pipeline:
c.req.query() / params / body).c.executionCtx.waitUntil.This keeps index.ts as orchestration, while domain modules remain focused and testable.
validate.ts; return Result<T, E> rather than throwing.trim, defaults) before checking constraints.R2Bucket.head) and map to 404.bad_request | not_found | internal).error.ts).console.error(error), and return internal error response.Use three layers when latency/cost matters:
Cache-Control: public, max-age=31536000, immutable) for repeat traffic.Rules:
getCached*, putCached*) and side-effect free beyond Cache API.font.ts).worker-configuration.d.ts.new Hono<{ Bindings: CloudflareBindings }>()rules for binary assets when needed (**/*.png as Data)..d.ts declarations for non-TS imports (Wasm/assets).true/false branches).app.request(...) to test full route flow.400)404)500)index.ts) from domain modules.Result<T, E> for recoverable domain failures.waitUntil.Content-Type and cache headers.pnpm run test, pnpm run typecheck, pnpm run lint.tools
Composite Skill. This skill is used for project planning. Users request that a project plan be created, particularly during the initial stages.
documentation
Core Skill. This skill is for document creation. User ask you to create planning documents, such as requirement and task breakdown.
development
Core Skill. Next.js 15+ App Router architecture guidelines including component patterns, state management with Zustand, server actions, and project structure. Use when developing Next.js applications.
development
Core Skill. HonoX architecture guidelines including file-based routing, Islands pattern, component types, performance optimization, and best practices for full-stack development.