An AI-powered onboarding guide for creating and validating Domain-Driven Design (DDD) .NET 9 solutions with layered architecture, Autofac DI, and comprehensive test projects.
This repository contains an AI agent onboarding guide (onboarding_guide.md) that systematically transforms empty or starter .NET projects into fully compliant DDD layered architecture solutions following best practices.
The onboarding_guide.md file serves as a comprehensive instruction manual for AI agents (like Claude, ChatGPT, etc.) to:
- Validate existing project structure - Checks for solution files, correct project naming, and proper DDD layer organization
- Enforce architectural rules - Ensures Domain-Driven Design principles with proper dependency flow (Presentation β Application β Domain, Infrastructure β Domain)
- Configure projects correctly - Sets up .NET 9 target frameworks, WPF configuration, nullable reference types, and platform targets
- Install required NuGet packages - Manages dependencies with version ranges for maintainability
- Create test projects - Generates NUnit test projects for all layers with proper configuration
- Set up Autofac DI - Implements dependency injection with module-per-layer pattern and assembly scanning
- Implement MVVM patterns - Creates ViewModels, Views, and proper data binding using DevExpress and MahApps.Metro
- Generate boilerplate code - Scaffolds initial verification tests, modules, and configuration files
- Autofac (8.*) - Dependency injection container
- Autofac.Extensions.DependencyInjection (10.*) - Microsoft DI integration
- DevExpressMvvm (*) - MVVM framework with ViewModelBase and commands
- MahApps.Metro (2.*) - Modern Metro-style UI framework
- Microsoft.Extensions.Logging (8.*) - Logging abstractions
- Microsoft.Extensions.Logging.Abstractions (8.*) - Logging interfaces
- NLog (6.*) - Logging implementation
- NLog.Extensions.Logging (6.*) - NLog integration with Microsoft.Extensions.Logging
- System.Reactive (6.*) - Reactive Extensions for event-driven programming
- Autofac (8.*) - Dependency injection
- Autofac.Extensions.DependencyInjection (10.*) - DI integration
- NLog (6.*) - Logging
- NLog.Extensions.Logging (6.*) - Logging integration
- Autofac (8.*) - Dependency injection
- Autofac.Extensions.DependencyInjection (10.*) - DI integration
- NLog (6.*) - Logging
- NLog.Extensions.Logging (6.*) - Logging integration
- System.Reactive (6.*) - Reactive Extensions
- No dependencies - Domain layer remains pure with no external NuGet packages
All test projects use the following NUnit-based testing stack:
- AutoFixture (4.*) - Auto-generating test data
- AutoFixture.AutoMoq (4.*) - Auto-mocking with Moq integration
- Microsoft.Bcl.TimeProvider (9.*) - Time abstraction for testing
- Microsoft.Extensions.TimeProvider.Testing (9.*) - Fake time provider for tests
- Microsoft.Reactive.Testing (6.*) - Testing utilities for Reactive Extensions
- Moq (4.*) - Mocking framework
- NUnit (4.*) - Testing framework
- NUnit3TestAdapter (5.*) - Visual Studio test adapter
- Microsoft.NET.Test.Sdk (17.*) - .NET test SDK
- NUnit.Analyzers (4.*) - Code analyzers for NUnit best practices
- Place
onboarding_guide.mdin your project folder (root directory of your .NET solution) - Paste
race_prompt.mdto your AI assistant (Claude, ChatGPT, etc.) - The AI will:
- Read the onboarding guide
- Validate your existing project structure
- Create missing projects and test projects
- Install required NuGet packages
- Set up Autofac modules
- Implement MVVM patterns
- Document any errors in
errors.md
YourProject/
βββ YourProject.sln
βββ (empty or incomplete project structure)
YourProject/
βββ YourProject.sln
βββ .gitignore
βββ .editorconfig
βββ YourProject/ (Presentation - WPF)
β βββ App.xaml
β βββ MainWindow.xaml
β βββ ViewModels/
β βββ Modules/PresentationModule.cs
β βββ NLog.config
βββ YourProjectApplication/
β βββ Modules/ApplicationModule.cs
βββ YourProjectInfrastructure/
β βββ Modules/InfrastructureModule.cs
βββ YourProjectDomain/
β βββ Content/
βββ YourProject.Tests/
β βββ InitialVerificationTests.cs
βββ YourProjectApplication.Tests/
β βββ InitialVerificationTests.cs
βββ YourProjectInfrastructure.Tests/
β βββ InitialVerificationTests.cs
βββ YourProjectDomain.Tests/
βββ InitialVerificationTests.cs
The guide enforces proper DDD layer dependencies:
Presentation Layer (WPF)
β
ββββ> Application Layer βββββ
β β
ββββ> Infrastructure Layer ββ€
β
βΌ
Domain Layer
(No Dependencies)
The errors.md file is an error log and learning document that the AI agent creates during the onboarding process. It serves multiple purposes:
- Error Documentation - Records every error encountered during project transformation
- Resolution History - Documents how each error was resolved
- Guide Improvement - Identifies gaps or unclear sections in the onboarding guide
- Troubleshooting Reference - Helps developers understand common issues
Each error entry contains:
- Phase - Which onboarding phase the error occurred in
- Guide Section - Reference to the specific guide section
- Severity - Critical, Warning, or Info
- What Failed - Description of the error
- Expected State - What the guide requires
- Actual State - What was found in the project
- Root Cause - Why the error happened
- Resolution Taken - Step-by-step fix
- Verification - How the fix was confirmed
- Guide Improvement Suggestion - Recommendations for making the guide clearer
The AI automatically creates and updates errors.md as it encounters issues. You can monitor this file in real-time to see what problems are being fixed.
Review errors.md to understand:
- What problems were automatically fixed
- How the AI resolved each issue
- Whether any manual intervention is needed
Use errors.md as a reference for common issues in your environment (e.g., network restrictions, missing SDKs, corporate proxy settings).
Submit suggestions from the "Guide Improvement Suggestion" sections to improve the onboarding guide for future projects.
If the AI agent encounters an error during transformation:
1. AI detects: "Missing NuGet package 'Autofac' in Presentation layer"
2. AI writes to errors.md:
### Error 1: Missing Autofac Package in Presentation Layer
**Phase:** Phase 3 - NuGet Packages Installation
**Guide Section:** Presentation Layer Requirements > Required NuGet Packages
**Severity:** Critical
**What Failed:**
Package 'Autofac' not found in WpfAppExample.csproj
**Expected State (per guide):**
Autofac (Version="8.*") must be installed in Presentation layer
**Actual State:**
No Autofac package reference found
**Root Cause:**
Starter project template doesn't include dependency injection packages
**Resolution Taken:**
Ran: dotnet add WpfAppExample package Autofac --version "8.*"
**Verification:**
Package reference added to .csproj file
dotnet build succeeded
**Guide Improvement Suggestion:**
Add note about expected delay when installing packages for first time
3. AI continues with next step
4. You review errors.md to see what was automatically fixed
- Build fails - Check if a similar error was already encountered and how it was resolved
- Test failures - Look for test-related errors and their resolutions
- Package conflicts - Find version-related issues and how they were fixed
- Structural issues - Understand project organization problems and their fixes
- After transformation - Review the complete transformation history
- Before asking for help - Check if your issue is already documented with a solution
The errors.md file typically documents issues in these categories:
- Missing Dependencies - NuGet packages not installed
- Incorrect Target Frameworks - Framework version mismatches
- Project Reference Issues - Circular or missing references
- Configuration Problems - .csproj settings, platform targets
- Module Registration Errors - Autofac DI configuration issues
- MVVM Binding Errors - DataContext, command binding problems
- Build Failures - Compilation errors and their resolutions
onboarding_guide.md- Complete AI agent instruction manual (comprehensive DDD transformation guide)race_prompt.md- RACE-formatted prompt to activate the AI agenterrors.md- Example error log from successful WpfAppExample transformationerrors_template.md- Template for error documentation formatWpfAppExample/- Example project demonstrating the final structure after transformation
This project is provided as-is for educational and development purposes.
Note: This is a meta-project - the guide itself is the product. Use it to bootstrap DDD .NET 9 projects with AI assistance.


