app-architecture
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.
📖 中文导读: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. 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
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
Definition of done (DoD)
- Dependencies flow inward only (verified via project references)
- Domain has zero external NuGet references (except test frameworks in test projects)
- Interfaces live in Application/Domain; implementations in Infrastructure/UI
- DI wiring is explicit in composition root (App.xaml.cs or equivalent)
- No "shortcut" references that bypass layers
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.