typescript

Validate TypeScript request inputs and enforce tenant-scoped database access in Hono routes.

1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/antonyfmunoz/OS --skill typescript-antonyfmunoz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/antonyfmunoz/OS/tree/main/skills/tools/typescript
Command: npx skills add https://github.com/antonyfmunoz/OS --skill typescript-antonyfmunoz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Prevents TypeScript bugs in the EOS SaaS stack by enforcing type-safe HTTP routes, tenant-safe database access, and runtime-validated mutations before they hit the intelligence layer.

Core Features & Use Cases

  • Type-safe Hono routes: Strongly typed Env context ensures orgId/userId are correctly threaded through handlers.
  • Zod-gated mutations: Uses safeParse to validate and safely narrow request bodies without turning malformed input into 500s.
  • RLS-correct Drizzle access: Requires withOrg(orgId, fn) so tenant-scoped queries behave correctly under Postgres RLS.
  • Typed Python bridge calls: Sends structured payloads from TypeScript routes to the Python eos_ai layer without calling LLMs directly in TS.

Quick Start

Use the typescript skill when you are adding a new Hono route or debugging a failing EOS endpoint, and ask it to describe the required Hono Env typing, the Zod safeParse pattern, and the withOrg() RLS guardrails for the specific route you’re implementing.

Frequently Asked Questions about typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce type-safe Hono routes and thread the orgId context correctly?

Type-safe Hono routes require a strongly typed Env context to ensure orgId and userId are correctly threaded through handlers. This prevents TypeScript bugs by strictly validating request inputs before they reach downstream logic.

How do I validate request bodies in Hono without returning 500 errors on malformed input?

Use Zod safeParse to validate and safely narrow request bodies. This Zod-gated mutation pattern catches malformed input gracefully, preventing unexpected 500 errors and ensuring only validated data proceeds.

What is the best way to enforce tenant-scoped database access with Drizzle ORM under Postgres RLS?

Tenant-scoped Drizzle access requires the mandatory withOrg(orgId, fn) wrapper. This RLS-correct pattern guarantees tenant-scoped queries behave properly under Postgres Row Level Security by scoping database execution.

Can I call Python AI layers directly from TypeScript Hono routes?

TypeScript routes should not call LLMs directly. Instead, use a typed Python bridge to send structured payloads from TypeScript routes to the Python eos_ai layer, ensuring execution remains type-safe across languages.

Does this TypeScript approach support strict TypeScript 5.8 patterns for Drizzle schema typing?

Yes, it satisfies strict TypeScript 5.8 patterns including typed Hono contexts and Drizzle schema typing using $inferSelect and $inferInsert usage, ensuring robust type inference for database operations.

When should I use safeParse instead of parse for Zod runtime validation in API routes?

Use safeParse for Zod runtime validation in API routes to safely narrow request bodies without throwing exceptions. This prevents malformed input from turning into unhandled 500 errors.