← ClaudeAtlas

hono-pipelinelisted

Implementation discipline for Hono with a typed RPC/contract stack — discover local conventions, then move contract → resource error → pure service Result → exhaustive unwrap → thin router → wiring.
g-bastianelli/nuthouse · ★ 1 · Data & Documents · score 67
Install: claude install-skill g-bastianelli/nuthouse
# subroutine — Hono pipeline discipline Apply this only to Hono backend/contracts/domain code. First read the scoped `AGENTS.md` and one complete neighboring resource; reuse its stack and commands. ## Implement the whole vertical slice 1. **Contract** — input/output schemas plus every transport error code. 2. **Resource error** — discriminated variants for expected failures. 3. **Service** — framework-pure `Promise<Result<T, ResourceError>>`; pass tenant/auth values explicitly. 4. **Unwrap** — exhaustive translation to framework errors. 5. **Router** — contract validation → service → unwrap → return. 6. **Wiring** — mount a new resource/domain only; an existing router is wired. ```ts // contract.ts export const ordersContract = oc.router({ get: oc .route({ method: "GET", path: "/orders/{id}" }) .input(z.object({ id: z.uuid() })) .output(OrderSchema) .errors({ NOT_FOUND: { data: z.object({ orderId: z.uuid() }) } }), }); // errors.ts + service.ts export type OrdersError = { code: "NOT_FOUND"; orderId: string }; export function createOrdersService(tenantId: string) { return { async get(id: string): Promise<Result<Order, OrdersError>> { const order = await findOrder(tenantId, id); return order ? ok(order) : err({ code: "NOT_FOUND", orderId: id }); }, }; } // _unwrap.ts + router.ts export const ordersRouter = { get: os.orders.get.handler(async ({ input, context }) => unwrap(await createOrdersService(context.tenantId).get(inp