Struggling to Implement DDD? Let AI Do the Work! - Introduction to cleanddd-skills
Domain-Driven Design (DDD) has been in an awkward position in recent years.
Many people recognize its value, but far fewer are willing to follow its approach to build business systems step by step from requirements, models, structure to code. It is commonly perceived as a concept-heavy, multi-step, layered methodology that seems to add unnecessary complexity to building business systems that could otherwise be coded directly.
This perception stems from both misunderstandings and practical challenges.
The misunderstanding is that the parts deemed “cumbersome” are actually essential steps to building stable, sustainable, and well-understood business systems.
The practical challenge is that without proper frameworks and methods, it is hard to stick to these steps. The end result is often a disconnect: understanding the DDD philosophy in theory, but implementing it in a completely different way in engineering practice.
On the tooling front, NetCorePal solves the problem of framework and engineering implementation. For hands-on practice, AI has now simplified the process significantly. We have compiled the core principles of CleanDDD practice into a set of skills, enabling AI Agents to participate in requirements analysis, domain modeling, project initialization, and code implementation in a fixed sequence. Thanks to the clear, actionable principles and methods of CleanDDD itself, AI Agents can integrate naturally into the process, making the entire workflow more organized.
Thus, cleanddd-skills was born.
CleanDDD Skill English version: README.en.md This skill set provides professional knowledge in Domain-Driven Design (DDD) modeling and the scaffolding of .NET projects adapted to CleanDDD.
Skills
| Skill | Description |
|---|---|
| cleanddd-requirements-analysis | Breaks down business requirements into an analytical process and structured output for CleanDDD modeling input |
| cleanddd-dotnet-init | Rapidly initializes a CleanDDD project using the NetCorePal.Template via dotnet new |
| cleanddd-modeling | A skill for software system analysis and modeling based on CleanDDD |
| cleanddd-dotnet-coding | Writes code (C# for the .NET platform) following the NetCorePal framework paradigm based on CleanDDD modeling results |
What cleanddd-skills Includes
cleanddd-skills consists of four core components:
cleanddd-requirements-analysiscleanddd-modelingcleanddd-dotnet-initcleanddd-dotnet-coding
Each component serves a distinct purpose:
requirements-analysis: Organizes raw requirements into a structured description.modeling: Converts the structured requirement description into a system model structure.dotnet-init: Initializes a new project skeleton based on modeling results when needed.dotnet-coding: Implements the system based on defined requirements, models, and project structures.
Workflow for New Projects
For greenfield projects, the full workflow is typically used:
requirements-analysis -> modeling -> dotnet-init -> dotnet-coding
Workflow for Existing Projects
For existing projects, the workflow can be simplified to:
requirements-analysis -> modeling -> dotnet-coding
The key value of cleanddd-skills lies not in just having four individual skills, but in organizing the CleanDDD practice into a continuous, end-to-end workflow.
cleanddd-requirements-analysis
This skill focuses exclusively on requirements processing—it does not involve modeling or coding.
Its core task is to transform unstructured raw requirements into a structured description that can be used in subsequent stages. Typical work includes identifying:
- Stakeholders
- Business objects
- The association of each requirement with specific business objects
- Actions, states, and constraints within requirements
- Triggers for subsequent business behaviors
- Explicit and implicit dependencies in the requirement descriptions
This step embodies a key CleanDDD practice principle: clarify the problem in business language first, then translate it into modeling language.
Disorganized natural language in the requirements phase often leads to modeling based on ad-hoc understanding. The requirements-analysis skill solves this by formatting inputs into a modeling-friendly structure.
The output of this step is not intended for polished documentation, but to provide a clear, unambiguous input for the modeling phase.
cleanddd-modeling
Following the requirements analysis phase, cleanddd-modeling converts the structured requirement description into a formal system model structure.
Typical deliverables of this step include the definition of:
- Aggregates
- Commands
- Events
- Queries
- API Endpoints
- Scheduled tasks
The focus here is not on explaining DDD terminology, but on defining structure and ownership:
- Which business behaviors belong to which Aggregates
- Which changes are represented as Commands
- Which changes are represented as Events
- Which operations are simple Queries
- Which capabilities are exposed externally via Endpoints
- Which behaviors are suitable for asynchronous or periodic processing
Key CleanDDD principles embodied in this step:
- Define boundaries first, then proceed to implementation
- Assign distinct roles to Commands, Events, and Queries
- Use models as an intermediate layer between requirements and implementation
- Delegate business rules to the corresponding domain models
Without this modeling layer, requirements tend to be directly translated into code, leading to a system that devolves into a patchwork of business processes over time. This step provides a clear foundation for subsequent project structure and code implementation.
cleanddd-dotnet-init
This is an optional step for initializing new projects.
It is used only when building a new .NET/NetCorePal project from scratch; for existing projects, it can be skipped, and the workflow proceeds directly to cleanddd-dotnet-coding.
The focus of this step is not just generic “project creation”, but initializing a project skeleton aligned with the preceding modeling results. Typical work includes:
- Initializing the project with the NetCorePal Template
- Defining the solution and project structure
- Selecting core technical options
- Preparing project directories and components for implementing Aggregates, Commands, Events, Queries, Endpoints, etc.
This step embodies a critical CleanDDD practice: models should not remain as abstract descriptions, but be materialized in the project structure.
NetCorePal plays a pivotal role as the engineering enabler here. The preceding requirements analysis and modeling steps are more about analysis and design; dotnet-init leverages NetCorePal to translate these design results into a concrete engineering structure.
This step is intuitive for greenfield projects and unnecessary for existing ones.
cleanddd-dotnet-coding
This step enters the implementation phase of the project.
It is not just “writing code”—it involves implementing the system based on the requirements, models, and existing project structure (or the skeleton created in dotnet-init). Typical implementation scope includes:
- Aggregate implementation
- Command handling
- Query handling
- Domain events
- API Endpoint implementation
- Repository implementation
- Configuration
- Testing
The core CleanDDD principle here is to maintain consistency between implementation, requirements, models, and project structure.
In other words, the code written is not isolated; it must align with:
- The structured requirements from the first phase
- The domain model defined in the modeling phase
- The existing project skeleton
- The implementation paradigms of the NetCorePal framework
For existing projects, this step follows directly after requirements analysis and modeling. For new projects, it builds on the project skeleton created in dotnet-init.
How to Use cleanddd-skills
Detailed installation and usage instructions are available in the project’s README: https://github.com/netcorepal/cleanddd-skills/blob/main/README.md
Basic Usage Steps
- Clone the code to your local machine:
git clone https://github.com/netcorepal/cleanddd-skills.gitcd cleanddd-skills- Run the installation script to sync the skills to the current user’s global directory:
- Windows PowerShell:
Terminal window ./scripts/install-skills.ps1 - macOS/Linux:
Terminal window chmod +x scripts/install-skills.sh./scripts/install-skills.sh
- After installation, interact with your AI Agent and use the skills in sequence:
- Requirement breakdown: Call
cleanddd-requirements-analysisto generate structured requirements and event flows (tabular output recommended) - Domain modeling: Call
cleanddd-modelingto design Aggregates, Commands, Queries, Events, and Endpoints based on the previous output - Project initialization: Call
cleanddd-dotnet-initto create a project skeleton with the NetCorePal Template - Code implementation: Call
cleanddd-dotnet-codingto generate code skeletons or complete implementations based on the domain model
- Requirement breakdown: Call
Example Prompts for AI Agents
The README provides sample prompts that can be sent directly to the AI Agent:
- “Please first use cleanddd-requirements-analysis to break down the [XXX] requirements and provide a tabular output, then use cleanddd-modeling to generate the domain model design.”
- “Use cleanddd-dotnet-init to create a CleanDDD project integrated with RabbitMQ and MySql.”
- “Based on the above model, implement the corresponding code skeleton.”
Script Behavior
The installation script syncs each skill in the project’s skills/ directory to the target global directory. If a skill with the same name already exists, it will be deleted and recreated to ensure version consistency.
The Relationship Between cleanddd-skills and NetCorePal
The two tools have a clear division of labor and are highly complementary:
- cleanddd-skills: Organizes the CleanDDD practice into a coherent, actionable workflow.
- NetCorePal: Translates this workflow into a concrete .NET engineering implementation (the “carrier” of the CleanDDD practice).
A simple way to understand their collaboration:
requirements-analysisandmodelingextract and formalize business logic and domain models from raw requirements.dotnet-initanddotnet-codingtranslate these models into a tangible .NET project.- NetCorePal provides the foundational framework and engineering patterns to support this translation.
Without a structured workflow (cleanddd-skills), even with the NetCorePal framework, developers may struggle to organize work in line with CleanDDD principles. Conversely, without a robust engineering carrier (NetCorePal), the analysis and modeling results will likely remain as static documentation and discussions, never being fully implemented.
Together, they create a seamless connection between requirements, models, project skeletons, and final code implementation.
Project Link
cleanddd-skills GitHub Repository: https://github.com/netcorepal/cleanddd-skills