Day-2 safety · Generation Gap
Custom code survives regeneration. Generated partials stay refreshed, your hooks stay yours — no wipe on regen.
DomainCraft turns a single domain.yaml into fully working code — CRUD, auth, permissions, migrations, admin. Deterministic output, compiles clean, safe to regenerate.
project:
name: MyShop
database: postgresql
auth:
type: jwt
entity: User
roles: [Admin, User]
entities:
User:
fields:
id: uuid [primary]
email: string [email, unique]
password: string [hidden]
Product:
features: [audit, soft_delete]
fields:
id: uuid [primary]
title: string [required, min:3]
price: decimal [required, gte:0]
permissions:
read: ["*"]
create: [Admin]The stack it ships with
The problem
CRUD endpoints, repositories, DTOs, migrations, auth wiring, validation, permissions — days of repetitive work that is error-prone and tedious.
Write 50+ files per entity by hand
Define 1 entity in ~10 lines of YAML
Repeat CRUD logic on every project
Generate it consistently every time
Fix the same boilerplate bugs everywhere
Fix bugs in templates, fixed everywhere
Switch language? Rewrite everything
Switch bridges, keep the same domain
Permissions scattered across the codebase
Declared beside entities, wired end-to-end
How it works
Your domain.yaml flows through a deterministic compiler — not a black box.
Entities, fields, relations, permissions, features and seed data live in one readable, diffable domain.yaml.
A strict parser, lexer and validator catch logic errors before anything is generated; an intermediate representation links every relation.
Pluggable bridge templates translate the IR into idiomatic code for your target stack — with a file manifest and migration snapshot.
Features
Each feature is a few declarative words in domain.yaml. The template does the rest — consistently, every single time.
Custom code survives regeneration. Generated partials stay refreshed, your hooks stay yours — no wipe on regen.
read: ["*"], update: ["@Owner", Admin] — public, role and ownership rules compiled to auth policies.
Snapshots, old_name renames, orphan cleanup and --prune — domain refactors land safely.
Bridges are plain templates and a manifest — no Go code required. Add a language in an afternoon.
domaincraft generate --admin ships a CRUD admin panel for your API with zero extra config.
Declare queue, cache, secrets and storage — wire Dapr, event_sourced and enterprise plumbing declaratively.
The agent describes the domain, DomainCraft generates 40+ production files, the agent drops business logic into hooks — then docker compose up runs it. Zero forgotten wiring, nothing hand-built.
One file is the whole spec — entities, relations, permissions, features. Everything else the generator derives from it.
domaincraft generate emits a full ASP.NET Core solution — controllers, DTOs, repositories, migrations, tests, Docker — deterministic on every run.
The agent implements hooks in Services/<Entity>Service.cs (overwrite: false) — the exact files the generator never touches.
docker compose up boots API + Postgres. Change the model and regenerate — tables are renamed for you, your data survives.
You → agent
You are building an online store with DomainCraft.
1. Draft the domain: Product + Category entities with
relations, audit + soft_delete features and permissions
(public read, Admin create/delete, @Owner update).
2. I'll run: domaincraft generate
3. Then I'll write the custom business logic in the hooks.
4. And deploy it: docker compose up
Output only a valid domain.yaml.Agent → domain.yaml
entities:
Product:
features: [audit, soft_delete]
fields:
id: uuid [primary]
title: string [required, min:3]
price: decimal [required, gte:0]
categoryId: relation(Category) [optional]
permissions:
read: ["*"]
create: [Admin]
update: ["@Owner"]
Category:
fields:
id: uuid [primary]
name: string [required, unique]$ domaincraft generate
✓ Schema valid (2 entities)
✓ 42 files generated · compiles clean
src/WebApi/Controllers/ProductsController.g.cs
src/Application/Generated/ProductService.g.cs
tests/ApiTests.g.csAgent → business hooks
// ProductService.cs — your file, overwrite: false
protected override async Task<HookResult> OnBeforeCreateAsync(
Product entity, CancellationToken ct)
{
if (entity.Price <= 0)
return HookResult.Fail("Price must be positive");
return HookResult.Success();
}$ docker compose up
[+] Running 2/2
✔ Container postgres Started
✔ Container api Started
✓ API :8080 · Postgres · health readyDomainCraft Studio
Drag-and-drop entity diagrams, a permission matrix and a real-time YAML editor with WASM validation — everything you draw is a valid domain.yaml.

Bridges
Each bridge is a pluggable template pack. The core never knows a language — it ships the IR and constrains nothing.
ASP.NET Core REST API · clean architecture · EF Core + PostgreSQL + JWT + Dapr addons.
Spring Boot REST API for the JVM. On the roadmap.
TypeScript / Express / Prisma backend. On the roadmap.
Community
Read the source, run it yourself, fork it — no account, no gate, no lock-in, ever.
Permissive license — keep your generated code, no strings attached.
Clear contributing guides and a strict, tested core.
More databases, more API styles, more addons — tracked publicly on the repo.
Momentum signals real adoption. A star helps other developers find DomainCraft.