R&D / Developer Tooling
Typact
A lightweight layer for TypeScript APIs, for people and AI agents working in the same codebase. Every endpoint carries its meaning as well as its shape: what it is for, what it touches and what depends on it, written once and checked by tools.
- My role
- Architecture and product direction, with AI-assisted implementation and evaluation
- Focus
- TypeScript, Zod, TanStack Query
Problem
Types say what an endpoint accepts. They do not say what it is for, what else uses it, or what breaks when it changes. Developers carry that in their heads; an AI agent has to guess, or read the whole codebase.
Approach
An endpoint is more than its address
A typed API already says what an endpoint takes and returns. It does not say why the endpoint exists, what it must never do, which screens go stale when it runs, or what follows from it. A Typact contract records those too, in the same TypeScript file, where both a developer and an agent will read them.
POST /orders/:id/cancel
- Takes
- An order and a reason.
- Returns
- The cancelled order.
- Means
- A customer cancels an order before it ships.
- Must not
- Run once the order has shipped.
- Refreshes
- The order list and the order's own page.
- Leads to
- A refund.
what a typed API already sayswhat Typact adds
Mechanism
Ask first: what is this for, and what does it touch?
Before an endpoint is changed, its contract answers with a neighbourhood: the few things that depend on it, out of the whole API. Each of them becomes a line in the plan, and each line is checked when the work is done. Nothing related is overlooked, and nothing unrelated has to be read.
- PlanBefore changing an endpoint, ask what it means and what it touches. The answer is its neighbourhood, not the whole codebase.
- BuildEach related thing becomes a line in the plan. The contract goes on checking real requests and responses while the app runs.
- FinalizeOne deterministic check confirms nothing in that neighbourhood was left behind.
Kept small on purpose
Typed contracts, schema validation and query caching are established tools, and Typact is built on them, not in place of them. What it adds is deliberately light: a little metadata per endpoint and two commands, plan and finalize. It got that small by measurement. The same tasks were given to agents with and without it and judged on correctness first, then cost, then time; whatever made hard tasks worse was cut.
Scope
Where it came from, and how far it has got
It grew out of a validation pattern I had reused across several applications, which I then formalized into a package. I set the architecture and direction; the implementation was substantially AI-assisted. Typact is used in OEM Truck Parts, Servaro Auto Sales and JenyClean. It remains a private package.
Outcome
One description now does three jobs. It validates traffic while the app runs, it tells a developer or an agent what exists and how it connects, and it lets a deterministic check confirm the work at the end.