Skip to main content

kurotako

kurotako is a modular framework for keeping TypeScript schemas in sync — from the data model, through a validation layer, down to frontend types and forms. Its CLI is tako; every package is published under the @kurotako/* scope.

The name​

kurotako (Japanese 黒蛸, from kuro 黒 "black" and tako 蛸 "octopus") means "black octopus". The image mirrors the architecture: a central body — @kurotako/core — with semi-autonomous arms, the parsers and generators, each doing its own work while staying attached to the same trunk. The CLI keeps the short half of the word: tako.

The problem​

In a stack like NestJS + Prisma + Angular, the data schema is defined once (in Prisma), but the API validation DTOs and the frontend types and forms are either duplicated by hand or produced by tools locked onto a single technology combination — typically Prisma → Zod → React. Nothing exists as a generic, interchangeable pipeline.

The approach​

kurotako models code generation as a pipeline of two kinds of component:

  • Parsers read a schema source (a schema.prisma file, for example) and produce a slice of an intermediate representation (IR) under a namespace.
  • Generators consume the merged IR — plus the artifacts of the generators they depend on — and emit code (Zod schemas, Angular types and FormGroups, React form hooks, …).

There is no fixed middle stage and no dependency graph: generators run in declaration order, and a generator that needs another one declares it as a private dependency.

schema.prisma ──▶ parser-prisma ──▶ IR ──▶ gen-zod ──────▶ Zod schemas
│ │
│ ▼
└──────▶ gen-angular ─▶ types + typed FormGroups

MVP scope​

  1. @kurotako/parser-prisma — schema.prisma → IR.
  2. @kurotako/gen-zod — IR → Zod schemas.
  3. @kurotako/gen-angular — IR (+ Zod) → types, typed FormGroups and Validators aligned on the schema constraints.
  4. @kurotako/cli — the tako binary orchestrating the pipeline against a real project.

After the MVP, @kurotako/gen-react-tanstack (IR + Zod → typed React + TanStack Form hooks) joined the generators.

Supporting packages: @kurotako/ir (shared types and schemas), @kurotako/core (orchestration, private generator dependencies, IR merge) and @kurotako/config (the tako.config.ts loader).

Next steps​

The design documents (docs/vision.md, docs/architecture.md, docs/glossary.md) live in the repository and record the rationale behind these decisions.