hashgraph-online/awesome-codex-plugins / plugins/alpoxdev/hypercore/skills/hyper-architecture
hyper-architecture
Verified[Hyper] Use this skill when the user asks for architecture, project setup, or performance work - building, auditing, restructuring, or reviewing project structure, routes, data or server boundaries, the lint/format/type tooling baseline (oxlint, Prettier, tsconfig, rustfmt, clippy), or build and runtime performance - in a Next.js App Router, TanStack Start, Vite with TanStack Router, Astro, Expo, Lynx (ReactLynx), Hono, Axum, Tauri v2, Electron, or Rust CLI, WASM, or MCP server project. It detects the stack from manifests and config files, routes each touched package of a monorepo separately, and applies the matching bundled stack guide, the shared setup baseline, and that stack's performance rules. Do not use it for stacks outside those eleven or for work that crosses no architecture, setup, or performance boundary, such as copy edits, a plain dependency bump, or one build failure.
rules/hono/handlers.md
View on GitHub# Handlers
> Keep extracted handlers type-safe and composition-friendly
---
## Stable Hono 4.13 Baseline
`createFactory<Env>()`, `factory.createApp()`, `factory.createHandlers()`, and `createMiddleware()` are official type-preserving helpers. Use one factory per compatible `Env` surface instead of restating bindings and variables in every file.
- `createFactory()` also accepts `defaultAppOptions` for the `HonoOptions` every `factory.createApp()` inherits, such as `{ strict: false }`, and `initApp` for initializing an app created by `createApp()`.
- `createHandlers()` returns a handler tuple; spread it into the route call.
- Keep validator middleware and the handler in the same typed chain when the handler reads `c.req.valid()`.
- Return a `Response` on every terminal branch and use literal status arguments when RPC clients need status unions.
- Pass transport-neutral primitives to services; do not pass `Context` through domain or repository layers.
- Do not annotate handlers with a broad `Context` type that erases route input, output, or variable inference.
## Core Rule
- Inline handlers are acceptable for small routes
- Once handlers are extracted, preserve typing with `createFactory()` / `factory.createHandlers()`
- Prefer `factory.createApp()` when a feature module needs its own typed sub-app or shared factory options
- Keep handler files focused on transport orchestration, not domain persistence
## Preferred Pattern
```ts
import { createFactory } from 'hono/factory'
import type { AppEnv } from '@/lib/types'
const factory = createFactory<AppEnv>()
const listUsers = factory.createHandlers(async (c) => {
return c.json({ users: [] })
})
export const usersApp = factory.createApp().get('/', ...listUsers)
```
## Review Checklist
- Extracted handlers keep context typing
- Extracted handlers preserve `c`, `c.req`, and `c.var` typing
- Handler modules do not duplicate `Env` / `Bindings` / `Variables` definitions unnecessarily
- `Variables` and `Bindings` are not implicit
- Handlers are not giant controller objects
- Services own business logic
## Sources
> Checked 2026-11-04.
| Claim | Source |
|---|---|
| `createFactory()`, `createApp()`, `createHandlers()`, `defaultAppOptions`, `initApp` | [Factory Helper](https://hono.dev/docs/helpers/factory) |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |