Skip to content

Base Template — Architecture (agents)

Agent intent

Before moving any class between projects, decide: DomainApplicationInfrastructureServiceModel. Wrong placement breaks architecture tests and reviewer trust.

Canonical narrative: Architecture — public

Mandatory rules

  1. DomainModel — no references to EF/NH, ASP.NET, HTTP clients, IServiceProvider.
  2. ApplicationModel / Application — orchestration; depends on domain + abstractions.
  3. PersistenceModel.* — adapters; implements interfaces owned by application/domain.
  4. ServiceModel.* — transport; maps DTOs/commands to application layer.

Web host DI (three stacks)

Order Type Agent notes
1 ApplicationModelRegistrationBase Shared packages—do not duplicate in product
2 MicroserviceRegistrationBase Kernel—patch in Base repo, not copy-paste
3 Template registration Identity / Gateway / … only here

MSBuild conditions

Optional features exclude whole directories at scaffold time. If an agent “does not see” Orleans/OpenAI files, check symbols in .template.config/template.json / build/*.props—do not re-add by hand without aligning symbols.

Anti-patterns (reject in codegen)

Bad Good
Domain entity referencing HttpClient Application service + port interface
Product-specific aggregate in ConnectSoft.BaseTemplate.DomainModel Layer 3 ConnectSoft.{Product}.DomainModel
Duplicate Program.cs kernel in submodule only Upstream fix + submodule bump

Canonical technical documentation

Architecture — ConnectSoft.Documentation