English · Français
Why ddd-ts-kit
Domain-Driven Design and Clean Architecture erode one shortcut at a time: a new Date() in a
handler, an import across two contexts, a rule checked in a controller. Under a deadline, and even
more with an AI agent that writes a hundred files an hour, a guideline in a wiki does not hold.
ddd-ts-kit turns the architecture into rules with ids, and checks them at every file write, before
every merge and on every push.
- Rules, not guidelines. Each rule has an id, a reason and a fix
(
npx ddd-ts-kit explain <rule-id>), checked by a zero-dependency CLI, an ESLint plugin and
dependency-cruiser.
- Generate, do not type.
ddd-ts-kit generate writes 45 kinds of building blocks with their
spec, fake and registration, and leaves TODO(domain) where a business decision is expected.
- Made for coding agents. A plugin for Claude Code, Codex and GitHub Copilot: skills that
conduct the work step by step, agents for parallel work and review, and a hook that checks each
TypeScript file the agent writes and names the broken rule at once.
- Your stack, not ours. Express, Fastify, Hono or NestJS; zod, class-validator, TypeBox or any
Standard Schema library; tsyringe, InversifyJS, Awilix, NestJS or manual wiring; Drizzle, Knex, Prisma or TypeORM;
RabbitMQ, Kafka, NATS JetStream or Redis Streams; JWT or Keycloak; roles, attributes or
relationships.
- Production concerns built in. Transactional outbox and idempotent consumers, a permission
per use case, audit trail, OpenTelemetry, multitenancy, OpenAPI and AsyncAPI contracts, a CI
pipeline for GitHub and GitLab.
- Personal data, by construction. What a table or an event keeps of a person is declared
once; from it the erasure, the export, the nightly purge of what outlived its retention, the
register of personal data and the
privacy/* rules, on the four ORMs, every request of a person
audited. The mechanisms of GDPR article 25, built in by default: the lawful basis, the purposes
and the answer to a person stay the decisions of the controller
(Personal data).
- Ready to split. Every bounded context owns its data and talks to the others by events: it
can run as its own service the day the team needs it.
The story behind it, on Medium:
Your AI writes code fast. Your architecture decides whether it lasts.
(in French).
The documentation is also a website, with search, in English and in French:
https://ddd-ts-kit.github.io/ddd-ts-kit/. Every page has its French translation next to it,
starting from README.fr.md.
Quick start
You do not run ddd-ts-kit yourself: your coding agent does. You describe the business, answer its
questions and review what it writes; the agent runs the generators, the checks and the gate, and
the hook of the plugin checks each TypeScript file it writes, names the broken rule at once and
refuses once to stop while an error remains.
1. Install the plugin in the agent you use. This repository is its marketplace: