Rich DDD aggregates, a hand-rolled command pipeline that returns Results instead of throwing, a transactional outbox, Aspire orchestration and a Blazor UI. The rules are written twice: as architecture tests, and as instructions an AI agent follows.
terminal
$ dotnet new install Trellis.Templates
$ dotnet new trellis -n Acme.Shop -o Acme.Shop
# the AppHost needs Docker running
$ cd Acme.Shop && dotnet run --project tools/Acme.Shop.AppHost
Every card opens the page that explains the piece, rendered from the repository's own docs/.
A pipeline, no mediator
Commands and queries run through decorators: tracing, logging, validation, unit of work. Failures travel as a Result and reach the client as RFC 9457 problem details. A discarded Result fails the build. Paying an invoice is this whole handler:
Aggregates created through Create(...) that returns a Result, value objects as sealed records mapped as EF complex types, hand-rolled strongly typed ids. The Invoices slice is the reference: create, issue, pay, void, list, with a receipt e-mail after the commit.
Domain events are written in the same transaction and dispatched after it, at least once, with per-handler checkpoints. Idempotency keys and strong ETags on the API.
Architecture tests pin the layer rules, integration tests run on a real PostgreSQL in Testcontainers, API tests go through the real pipeline, and a Playwright suite is one toggle away.
AGENTS.md, path-scoped rules, skills for adding a feature or an integration, and a docs-drift gate in CI, so a person and an AI assistant read the same instructions.
Add a tenant seam: a tenant claim on the principal (ITenantContext), a TenantId shadow column and a "Tenant" EF query filter on every aggregate root. Regenerate the initial migration after enabling.
Include a browser-driven UI test project (Playwright). Tests are opt-in at run time via RUN_UI_TESTS=1.
Domain · SharedKernel
Application
Infrastructure
Persistence
Presentation
Architecture
The rule in one sentence
Dependencies point inward. The Domain knows nothing about EF, HTTP or DI; Application defines the ports; Infrastructure and Persistence are peers that implement them and never reference each other.
Grouped by ring on disk: src/Core, src/Infrastructure, src/Presentation, src/Shared. Features are vertical slices inside the layers. The architecture tests fail the build when a reference crosses the wrong way. Architecture →