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/validation.md
View on GitHub# Validation
> Request validation rules/hono for Hono
---
## Stable Package Baseline
As verified on 2026-11-04: `@hono/zod-validator` 0.9.1 supports Hono `>=4.11.2` and Zod `^3.25.0 || ^4.0.0`; `@hono/standard-validator` 0.4.1 supports Hono `>=4.11.2` and Standard Schema `^1.0.0`. The Hono floor for this file is `4.13.16`, because earlier releases skip `validator('form')` validation for `multipart/form-data` requests that carry an extra parameter such as `charset`. Inspect the installed lockfile before using APIs or syntax.
- Validate every externally controlled `param`, `query`, `header`, `cookie`, `json`, or `form` value that influences behavior.
- Consume validator output only through `c.req.valid(target)`; do not parse the same body again.
- Header schema keys must be lowercase.
- JSON validation requires an appropriate `Content-Type`; test missing/wrong content types and malformed bodies.
- Form and multipart validation must be run against a real `multipart/form-data` request that includes a `charset` or boundary parameter. On Hono below 4.13.16 the validator sees an empty object while the handler still reads every field, so a normal test passes while validation is bypassed.
- Define hook/error behavior once per API surface so validation errors share a stable, non-sensitive envelope.
- Keep coercion and defaults intentional. Query/path inputs start as strings and must not acquire surprising domain semantics.
- Do not add or swap validation libraries merely to match this skill.
## Core Rule
Validate request data before service logic consumes it.
## Approved options
- `validator()` for narrow built-in checks
- `@hono/zod-validator` when the repo uses Zod
- `@hono/standard-validator` when the repo already standardizes on Standard Schema libraries
`@hono/standard-validator` 0.4.0 adds `flattenErrors`, which sorts form-level and field-level errors by path. 0.4.1 stops echoing the `cookie` header in the default 400 body of `header` validation, so do not re-add raw request headers to a custom error payload.
## Example
```ts
import { z } from 'zod'
import { zValidator } from '@hono/zod-validator'
const createUserSchema = z.object({
email: z.email(),
name: z.string().min(1),
})
const app = new Hono().post(
'/',
zValidator('json', createUserSchema),
async (c) => {
const payload = c.req.valid('json')
return c.json({ payload }, 201)
}
)
```
## Review Checklist
- Params/query/json/form use validator middleware when non-trivial
- Form and multipart routes have a regression test with an extra content-type parameter
- Validation happens before domain logic
- One feature does not mix unrelated validation styles without reason
- No new dependency is added without need
- Hono is at least 4.13.16 wherever `validator('form')` is used
## Sources
> Checked 2026-11-04.
| Claim | Source |
|---|---|
| Validator package versions and peer ranges | [npm registry: `@hono/zod-validator`](https://registry.npmjs.org/@hono/zod-validator), [npm registry: `@hono/standard-validator`](https://registry.npmjs.org/@hono/standard-validator) |
| `validator('form')` multipart bypass and its 4.13.16 fix | [`hono` v4.13.16 release](https://github.com/honojs/hono/releases/tag/v4.13.16) |
| `flattenErrors` and the `cookie` header removal from the 400 body | [`@hono/standard-validator` releases](https://github.com/honojs/middleware/releases) |
| Middleware-based validation and the third-party validator recommendation | [Validation Guide](https://hono.dev/docs/guides/validation) |
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: 469k | 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: 469k | 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: 469k | 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 |