HeadlinesBriefing favicon HeadlinesBriefing.com

TriadJS unifies API specs, code and tests in TypeScript

Hacker News •
×

TriadJS, a TypeScript‑first framework, offers a single source of truth for API specs, implementation, validation and tests. Write one declarative schema and receive runtime validation, static inference, OpenAPI 3.1 docs, AsyncAPI 3.0 channel definitions, BDD scenarios and typed frontend hooks for React, Solid, Vue and Svelte. The approach removes duplicate Zod files and manual YAML.

Triad’s DSL generates artifacts automatically: OpenAPI files, Gherkin .feature files, Drizzle‑based database schemas and adversarial tests derived from schema constraints. A built‑in CLI supports commands like /triadjs:new or /triadjs:endpoint, and the Claude Code marketplace can scaffold a full petstore API with Fastify, with instant code generation, Swagger UI and live docs in seconds. All outputs remain fully deterministic projections of the original TypeScript definitions.

By keeping every API artifact in sync, Triad reduces cognitive load for engineers and enables AI assistants to reason about an entire service from a single file. The framework ships with adapters for Fastify, Express, Hono and AWS Lambda, plus integrations for Prisma, Drizzle and popular query libraries. It remains pre‑1.0 but already covers a full feature set through Phase 26.