| name | app-architecture |
| description | Define and maintain clean architecture for the .NET 8 WPF widget host app. Use when shaping solution structure, layer boundaries, dependency rules, DI wiring, and project layout to keep UI, application, domain, and infrastructure separated. |
App Architecture
Overview
Keep a clean, scalable structure that supports a widget host with a single shell and optional secondary windows.
Constraints
- .NET 8
- WPF UI layer with MVVM
- Clean architecture boundaries
Layering rules
- Domain: entities, value objects, invariants, domain services.
- Application: use cases, DTOs, interfaces, orchestration.
- Infrastructure: persistence, external services, OS integration.
- UI: WPF views, view models, shell, resources.
Dependency rules
- Dependencies flow inward only.
- Domain has no dependencies on UI or infrastructure.
- Application depends on domain.
- Infrastructure depends on application/domain.
- UI depends on application/domain (and optionally infrastructure via DI).
Project layout (suggested)
3SC.Domain3SC.Application3SC.Infrastructure3SC.UI
Workflow
- Identify the change scope (UI, application, domain, infrastructure).
- Create or move types into the correct layer.
- Define interfaces in Application/Domain, implement in Infrastructure.
- Wire DI at the composition root (UI startup).
- Validate boundaries before adding new references.
References
references/layering.mdfor boundary and dependency rules.references/solution-structure.mdfor project layout guidance.references/di-composition.mdfor DI setup and module wiring.