Skip to content

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.

FileKindSize
SKILL.ko.mdmarkdown19.9 KB
SKILL.mdskill md18.4 KB
assets/evals/astro-cases.jsonlother17.1 KB
assets/evals/axum-cases.jsonlother13.7 KB
assets/evals/electron-cases.jsonlother14.6 KB
assets/evals/expo-cases.jsonlother18.3 KB
assets/evals/hono-cases.jsonlother22.2 KB
assets/evals/hyper-architecture-cases.jsonlother26.0 KB
assets/evals/lynx-cases.jsonlother17.9 KB
assets/evals/nextjs-cases.jsonlother21.5 KB
assets/evals/rust-cases.jsonlother17.8 KB
assets/evals/tanstack-start-cases.jsonlother21.0 KB
assets/evals/tauri-cases.jsonlother18.6 KB
assets/evals/vite-cases.jsonlother18.6 KB
assets/templates/setup/repo/editorconfigother357 B
assets/templates/setup/repo/gitattributesother714 B
assets/templates/setup/repo/lefthook.ymlconfig843 B
assets/templates/setup/rust/clippy.tomlconfig110 B
assets/templates/setup/rust/rust-toolchain.tomlconfig86 B
assets/templates/setup/rust/rustfmt.tomlconfig200 B
assets/templates/setup/rust/workspace-lints.tomlconfig809 B
assets/templates/setup/typescript/oxlintrc.jsonconfig929 B
assets/templates/setup/typescript/oxlintrc.react.jsonconfig1.1 KB
assets/templates/setup/typescript/prettierignoreother316 B
assets/templates/setup/typescript/prettierrc.jsonconfig263 B
assets/templates/setup/typescript/tsconfig.base.jsonconfig551 B
references/official/astro/astro-2026-11-07.ko.mdmarkdown18.6 KB
references/official/astro/astro-2026-11-07.mdmarkdown17.0 KB
references/official/axum/axum-docs.ko.mdmarkdown5.7 KB
references/official/axum/axum-docs.mdmarkdown4.8 KB
references/official/axum/ecosystem-docs.ko.mdmarkdown3.8 KB
references/official/axum/ecosystem-docs.mdmarkdown3.5 KB
references/official/axum/sqlx-docs.ko.mdmarkdown5.5 KB
references/official/axum/sqlx-docs.mdmarkdown4.7 KB
references/official/axum/tower-docs.ko.mdmarkdown4.2 KB
references/official/axum/tower-docs.mdmarkdown3.7 KB
references/official/axum/utoipa-docs.ko.mdmarkdown4.1 KB
references/official/axum/utoipa-docs.mdmarkdown3.7 KB
references/official/electron/electron-2026-11-08.ko.mdmarkdown15.7 KB
references/official/electron/electron-2026-11-08.mdmarkdown14.1 KB
references/official/expo/expo-react-native-2026-11-04.ko.mdmarkdown23.0 KB
references/official/expo/expo-react-native-2026-11-04.mdmarkdown21.5 KB
references/official/hono/drizzle-docs.ko.mdmarkdown7.0 KB
references/official/hono/drizzle-docs.mdmarkdown6.6 KB
references/official/hono/hono-docs.ko.mdmarkdown15.8 KB
references/official/hono/hono-docs.mdmarkdown14.8 KB
references/official/lynx/lynx-2026-11-07.ko.mdmarkdown14.3 KB
references/official/lynx/lynx-2026-11-07.mdmarkdown14.0 KB
references/official/nextjs/current-docs-2026-11-04.ko.mdmarkdown13.1 KB
references/official/nextjs/current-docs-2026-11-04.mdmarkdown12.0 KB
references/official/nextjs/drizzle-docs.ko.mdmarkdown6.7 KB
references/official/nextjs/drizzle-docs.mdmarkdown6.3 KB
references/official/nextjs/nextjs-docs.ko.mdmarkdown13.6 KB
references/official/nextjs/nextjs-docs.mdmarkdown13.9 KB
references/official/rust/rust-crates-2026-11-07.ko.mdmarkdown22.6 KB
references/official/rust/rust-crates-2026-11-07.mdmarkdown22.0 KB
references/official/tanstack-start/current-docs-2026-11-04.ko.mdmarkdown16.0 KB
references/official/tanstack-start/current-docs-2026-11-04.mdmarkdown14.7 KB
references/official/tanstack-start/tanstack-router-2026-11-04.ko.mdmarkdown10.5 KB
references/official/tanstack-start/tanstack-router-2026-11-04.mdmarkdown9.6 KB
references/official/tanstack-start/tanstack-start-2026-11-04.ko.mdmarkdown25.8 KB
references/official/tanstack-start/tanstack-start-2026-11-04.mdmarkdown23.9 KB
references/official/tauri/tanstack-vite-react-2026-11-04.ko.mdmarkdown14.1 KB
references/official/tauri/tanstack-vite-react-2026-11-04.mdmarkdown13.1 KB
references/official/tauri/tauri-v2-2026-11-04.ko.mdmarkdown18.5 KB
references/official/tauri/tauri-v2-2026-11-04.mdmarkdown17.6 KB
references/official/tooling/tooling-2026-11-07.ko.mdmarkdown21.0 KB
references/official/tooling/tooling-2026-11-07.mdmarkdown20.5 KB
references/official/vite/current-docs-2026-11-04.ko.mdmarkdown11.2 KB
references/official/vite/current-docs-2026-11-04.mdmarkdown10.3 KB
rules/astro/actions-middleware-env.ko.mdmarkdown14.6 KB
rules/astro/actions-middleware-env.mdmarkdown12.9 KB
rules/astro/content.ko.mdmarkdown8.1 KB
rules/astro/content.mdmarkdown7.3 KB
rules/astro/performance.ko.mdmarkdown11.3 KB
rules/astro/performance.mdmarkdown10.0 KB
rules/astro/project-structure.ko.mdmarkdown11.2 KB
rules/astro/project-structure.mdmarkdown9.6 KB
rules/astro/rendering-and-islands.ko.mdmarkdown10.2 KB
rules/astro/rendering-and-islands.mdmarkdown8.7 KB
rules/astro/testing.ko.mdmarkdown10.4 KB
rules/astro/testing.mdmarkdown9.4 KB
rules/axum/conventions.ko.mdmarkdown5.3 KB
rules/axum/conventions.mdmarkdown4.8 KB
rules/axum/database.ko.mdmarkdown11.9 KB
rules/axum/database.mdmarkdown10.2 KB
rules/axum/errors.ko.mdmarkdown6.5 KB
rules/axum/errors.mdmarkdown6.0 KB
rules/axum/handlers.ko.mdmarkdown5.6 KB
rules/axum/handlers.mdmarkdown5.0 KB
rules/axum/middleware.ko.mdmarkdown5.4 KB
rules/axum/middleware.mdmarkdown4.9 KB
rules/axum/openapi.ko.mdmarkdown9.5 KB
rules/axum/openapi.mdmarkdown8.3 KB
rules/axum/performance.ko.mdmarkdown9.6 KB
rules/axum/performance.mdmarkdown8.6 KB
rules/axum/platform.ko.mdmarkdown6.9 KB
rules/axum/platform.mdmarkdown6.3 KB
rules/axum/project-structure.ko.mdmarkdown10.8 KB
rules/axum/project-structure.mdmarkdown9.9 KB
rules/axum/routes.ko.mdmarkdown7.3 KB
rules/axum/routes.mdmarkdown6.3 KB
rules/axum/testing.ko.mdmarkdown5.2 KB
rules/axum/testing.mdmarkdown4.6 KB
rules/axum/validation.ko.mdmarkdown4.8 KB
rules/axum/validation.mdmarkdown4.4 KB
rules/electron/packaging.ko.mdmarkdown7.9 KB
rules/electron/packaging.mdmarkdown7.0 KB
rules/electron/performance.ko.mdmarkdown5.8 KB
rules/electron/performance.mdmarkdown5.0 KB
rules/electron/processes-and-ipc.ko.mdmarkdown10.6 KB
rules/electron/processes-and-ipc.mdmarkdown9.7 KB
rules/electron/project-structure.ko.mdmarkdown8.8 KB
rules/electron/project-structure.mdmarkdown8.1 KB
rules/electron/renderer.ko.mdmarkdown10.8 KB
rules/electron/renderer.mdmarkdown9.8 KB
rules/electron/security.ko.mdmarkdown10.3 KB
rules/electron/security.mdmarkdown9.2 KB
rules/electron/testing.ko.mdmarkdown5.7 KB
rules/electron/testing.mdmarkdown5.0 KB
rules/expo/data-state-and-boundaries.ko.mdmarkdown4.7 KB
rules/expo/data-state-and-boundaries.mdmarkdown4.3 KB
rules/expo/native-platform-and-security.ko.mdmarkdown8.2 KB
rules/expo/native-platform-and-security.mdmarkdown7.5 KB
rules/expo/performance.ko.mdmarkdown11.2 KB
rules/expo/performance.mdmarkdown10.1 KB
rules/expo/project-structure.ko.mdmarkdown13.4 KB
rules/expo/project-structure.mdmarkdown13.2 KB
rules/expo/routing-and-navigation.ko.mdmarkdown8.6 KB
rules/expo/routing-and-navigation.mdmarkdown8.0 KB
rules/expo/testing-and-validation.ko.mdmarkdown5.1 KB
rules/expo/testing-and-validation.mdmarkdown4.8 KB
rules/hono/conventions.ko.mdmarkdown3.7 KB
rules/hono/conventions.mdmarkdown3.5 KB
rules/hono/database.ko.mdmarkdown11.7 KB
rules/hono/database.mdmarkdown10.8 KB
rules/hono/errors.ko.mdmarkdown3.9 KB
rules/hono/errors.mdmarkdown3.7 KB
rules/hono/handlers.ko.mdmarkdown2.5 KB
rules/hono/handlers.mdmarkdown2.2 KB
rules/hono/middleware.ko.mdmarkdown3.3 KB
rules/hono/middleware.mdmarkdown3.0 KB
rules/hono/openapi.ko.mdmarkdown11.7 KB
rules/hono/openapi.mdmarkdown10.9 KB
rules/hono/performance.ko.mdmarkdown8.9 KB
rules/hono/performance.mdmarkdown8.0 KB
rules/hono/platform.ko.mdmarkdown5.0 KB
rules/hono/platform.mdmarkdown4.7 KB
rules/hono/project-structure.ko.mdmarkdown10.4 KB
rules/hono/project-structure.mdmarkdown9.9 KB
rules/hono/routes.ko.mdmarkdown6.9 KB
rules/hono/routes.mdmarkdown6.6 KB
rules/hono/testing-rpc.ko.mdmarkdown5.6 KB
rules/hono/testing-rpc.mdmarkdown5.2 KB
rules/hono/validation.ko.mdmarkdown3.7 KB
rules/hono/validation.mdmarkdown3.5 KB
rules/lynx/native-and-platform.ko.mdmarkdown11.4 KB
rules/lynx/native-and-platform.mdmarkdown10.7 KB
rules/lynx/performance.ko.mdmarkdown11.6 KB
rules/lynx/performance.mdmarkdown10.6 KB
rules/lynx/project-structure.ko.mdmarkdown10.2 KB
rules/lynx/project-structure.mdmarkdown9.6 KB
rules/lynx/testing.ko.mdmarkdown7.0 KB
rules/lynx/testing.mdmarkdown6.4 KB
rules/lynx/threading.ko.mdmarkdown13.0 KB
rules/lynx/threading.mdmarkdown12.0 KB
rules/lynx/ui-and-data.ko.mdmarkdown11.8 KB
rules/lynx/ui-and-data.mdmarkdown10.8 KB
rules/nextjs/data-fetching.ko.mdmarkdown9.9 KB
rules/nextjs/data-fetching.mdmarkdown9.3 KB
rules/nextjs/db.ko.mdmarkdown8.1 KB
rules/nextjs/db.mdmarkdown7.3 KB
rules/nextjs/execution-model.ko.mdmarkdown5.0 KB
rules/nextjs/execution-model.mdmarkdown4.5 KB
rules/nextjs/hooks.ko.mdmarkdown5.8 KB
rules/nextjs/hooks.mdmarkdown5.3 KB
rules/nextjs/performance.ko.mdmarkdown12.5 KB
rules/nextjs/performance.mdmarkdown11.2 KB
rules/nextjs/platform.ko.mdmarkdown7.7 KB
rules/nextjs/platform.mdmarkdown7.0 KB
rules/nextjs/project-structure.ko.mdmarkdown9.4 KB
rules/nextjs/project-structure.mdmarkdown9.0 KB
rules/nextjs/route-handlers.ko.mdmarkdown4.7 KB
rules/nextjs/route-handlers.mdmarkdown4.3 KB
rules/nextjs/routes.ko.mdmarkdown5.0 KB
rules/nextjs/routes.mdmarkdown4.6 KB
rules/nextjs/server-actions.ko.mdmarkdown7.1 KB
rules/nextjs/server-actions.mdmarkdown6.4 KB
rules/nextjs/services.ko.mdmarkdown5.8 KB
rules/nextjs/services.mdmarkdown5.5 KB
rules/nextjs/validation.ko.mdmarkdown2.2 KB
rules/nextjs/validation.mdmarkdown2.3 KB
rules/rust/cli.ko.mdmarkdown13.6 KB
rules/rust/cli.mdmarkdown12.0 KB
rules/rust/crate-layout.ko.mdmarkdown11.4 KB
rules/rust/crate-layout.mdmarkdown10.1 KB
rules/rust/errors-and-logging.ko.mdmarkdown13.0 KB
rules/rust/errors-and-logging.mdmarkdown11.6 KB
rules/rust/mcp-server.ko.mdmarkdown15.2 KB
rules/rust/mcp-server.mdmarkdown13.8 KB

rules/hono/performance.md

View on GitHub
# Performance

> Measure on the deployed runtime, prefer the default SmartRouter, and cut wire bytes with `compress()`/`etag()`/`cache()` only where the platform does not already do it.

Read this when the request names latency, throughput, bundle size, cold start, caching, or "최적화" on a Hono app. This file owns the router choice, the response-byte middleware, and the shared-cache contract; `rules/hono/platform.md` owns which runtime you are measuring on.

## Measure first

The runtime decides what a number means, so name it before measuring. A local Node server, a Cloudflare Worker invocation, and a Deno Deploy isolate have different cold-start and CPU budgets.

```bash
# local Node/Bun/Docker target
node dist/index.js &            # or bun run start, or the repo's start script
wrk -t4 -c50 -d20s http://127.0.0.1:3000/<route>
curl -s -o /dev/null -w 'ttfb=%{time_starttransfer}s size=%{size_download}B\n' http://127.0.0.1:3000/<route>
```

- Record p50/p95 latency and requests per second for one read and one write route, at the concurrency the app actually serves.
- Record the response bytes before and after any compression or ETag change, and confirm the runtime is not already encoding the body.
- On a worker platform, measure the deployed target (`wrangler dev --remote` / `deploy` then a load run), not only `wrangler dev` locally, because the platform adds its own compression, cache, and CPU limits.
- As of 2026-11-07 the registry `latest` for `hono` is 4.13.17; 4.13.16 remains the security floor that fixes router and form-validation defects [L-70]. Record the installed version from `package.json` and do not measure a drift you have not identified.

A lever you cannot measure here is reported as not measured, never as a gain.

## Rules

Ordered by typical impact.

1. **`official` — Keep the default `SmartRouter` unless a measurement justifies a change.** `SmartRouter` composes routers and its source shows `new SmartRouter({ routers: [new RegExpRouter(), new TrieRouter()] })`; `RegExpRouter` compiles patterns into a single regex and is described as "the fastest router in the JavaScript world" [L-51]. Switching is one constructor option, `new Hono({ router: new RegExpRouter() })` [L-52]. Do not pin `RegExpRouter` globally before the route set is known, because it rejects patterns `TrieRouter` accepts [L-51].
2. **`official` — Choose a router for the runtime's actual cost model.** `LinearRouter` is for runtimes that initialize per request because registration is much faster there; `TrieRouter` supports all patterns and is slower than `RegExpRouter` but far faster than Express; `PatternRouter` is the smallest, and "an application using only PatternRouter is under 15KB in size" [L-51]. `hono/tiny` is the `PatternRouter` preset, so it buys size, not route throughput [L-56].
3. **`official` — Register middleware and routes in the order they must run.** "Handlers or middleware will be executed in registration order" [L-51]. Moving a broad middleware later changes both behavior and cost for every preceding route, so keep the mount table explicit and measure after any reorder.
4. **`official` — Do not compress on a platform that already compresses.** `compress()` responds to `Accept-Encoding`, supports only `'gzip'` and `'deflate'`, and defaults to a 1024-byte threshold; on Cloudflare Workers and Deno Deploy "the response body will be compressed automatically, so there is no need to use this middleware" [L-53]. On Node and other bare runtimes, add it with a `contentTypeFilter` (the exported `COMPRESSIBLE_CONTENT_TYPE_REGEX` is the default) so images and archives are skipped [L-53].
5. **`hypercore-default` — Return 304s on GET-heavy JSON routes.** The middleware behavior is official; adding it as a default is our policy. `etag()` adds the ETag header and answers matching conditional requests with `304`; extend `retainedHeaders` beyond the default retained set (`Cache-Control`, `Content-Location`, `Date`, `ETag`, `Expires`, `Vary`) when a custom header must survive a 304 [L-54].
6. **`official` — Register `cache()` after authentication and set the per-user cache headers.** The middleware uses the Web Cache API on Cloudflare custom domains and Deno 1.26+/Deno Deploy, and "the cache is shared by all clients… The middleware does not look at the `Cookie` header" [L-55]. Send `Cache-Control: private` or `no-store`, or `vary: 'Cookie'`, on any per-user response, and note that QUERY requests above `maxQueryBodySize` (64 KiB default) bypass the cache [L-55].
7. **`hypercore-default` — Gate HTML responses on Core Web Vitals when the Hono app serves pages.** LCP ≤ 2.5 s, INP ≤ 200 ms, CLS ≤ 0.1 at p75, reported for mobile and desktop separately [L-67]. For an API-only app this rule does not apply; measure latency instead.

## Do not

- Switch to `RegExpRouter` as a reflex. It is the fastest single router but rejects patterns the default composition falls back to `TrieRouter` for, so an unmeasured switch can turn a working route into a startup error [L-51][L-52].
- Adopt `hono/tiny` to make an existing API pass a latency budget. It trades route throughput for size [L-56].
- Add `compress()` on Cloudflare Workers or Deno Deploy and claim a byte reduction the platform already delivered [L-53].
- Enable `cache()` before auth, or leave the default `Cache-Control` on a per-user response. The cache ignores `Cookie` and will serve one user's payload to another [L-55].
- Put `cache()` in front of an endpoint whose QUERY bodies exceed `maxQueryBodySize` and expect a cache hit [L-55].
- Present `etag()` or `cache()` as free. ETag costs a body read or hash on every miss, and the shared cache needs correct private/no-store headers before it is safe [L-54][L-55].
- Quote a local `wrangler dev` number as the deploy result. The platform adds compression, caching, and CPU limits [L-53][L-55].

## Checklist

- [ ] The runtime was named and the measurement ran against that runtime, not only a local dev server.
- [ ] Before and after numbers exist for every claimed gain.
- [ ] The router choice is the default, or a measured reason names the route-set constraint that forced it.
- [ ] Middleware and route registration order is explicit and was not shuffled without re-measuring.
- [ ] `compress()` is absent on a compressing platform, or configured with a content-type filter elsewhere.
- [ ] `etag()` is applied where conditional GETs matter, with `retainedHeaders` covering custom headers.
- [ ] `cache()` sits after auth, and per-user responses carry `private`/`no-store` or `vary: 'Cookie'`.
- [ ] QUERY endpoints above `maxQueryBodySize` are known to bypass the cache.
- [ ] HTML responses meet the CWV thresholds at p75, or the app is API-only and the point is explicitly out of scope.
- [ ] The change keeps the gates in `stacks/hono/architecture-rules.md` and the checks from `rules/setup/typescript.md` passing.

## Sources

> Checked 2026-11-07. Router, middleware, and cache statements come from the Hono documentation and the `hono/tiny` preset source; current version comes from the npm registry.

| Claim | Source |
|---|---|
| Router inventory, `SmartRouter` composition, registration order, `RegExpRouter` speed claim | [Routers – Hono](https://hono.dev/docs/concepts/routers) |
| `new Hono({ router })` constructor option and default | [Hono API](https://hono.dev/docs/api/hono) |
| `hono/tiny` preset importing `PatternRouter` | [hono/tiny preset source](https://raw.githubusercontent.com/honojs/hono/main/src/preset/tiny.ts) |
| `compress()` codecs, default threshold, content-type filter, platform note | [Compress Middleware – Hono](https://hono.dev/docs/middleware/builtin/compress) |
| `etag()` 304 behavior and retained headers | [ETag Middleware – Hono](https://hono.dev/docs/middleware/builtin/etag) |
| `cache()` platform support, shared cache, `Cookie` caveat, `maxQueryBodySize` | [Cache Middleware – Hono](https://hono.dev/docs/middleware/builtin/cache) |
| Core Web Vitals thresholds at p75 | [Web Vitals](https://web.dev/articles/vitals) |
| `hono` 4.13.17 as registry `latest` | [npm registry: hono](https://registry.npmjs.org/hono) |
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: 469kUpdated Claude CodeCodexVerifiedInstall
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: 469kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall