CRITICAL: This skill should ONLY be triggered when the user explicitly mentions creating a ddd4j project. Do NOT trigger for generic DDD project creation requests without ddd4j context.
For New DDD4j Project Creation
- Identify the project type from user requirements:
- Single-module monolith → single-module
- Multi-module monolith → multi-module
- Microservices → microservices
- Load the appropriate example from the
examples/ directory:
- examples/single-module.md - Single-module monolith structure
- examples/multi-module.md - Multi-module monolith structure
- examples/microservices.md - Microservices structure
- examples/architecture-patterns.md - DDD, Hexagonal, Clean, COLA V5 patterns
- Collect project information:
- groupId: Maven group ID (e.g., com.github.hiwepy or io.ddd4j.base)
- artifactId: Maven artifact ID (e.g., ddd4j-douyin or my-ddd4j-service)
- version: Project version (e.g., 1.0.0-SNAPSHOT)
- parentVersion: Parent POM version (e.g., 2023.0.x.20251205-SNAPSHOT or reference to ddd4j-boot-parent)
- packageBase: Base package name (e.g., io.ddd4j.douyin or com.example.service)
- modules: List of business modules (for multi-module/microservices)
- architecture: Architecture pattern (DDD Classic, Hexagonal, Clean, COLA V5)
- ddd4jBootVersion: DDD4j Boot version (if using ddd4j-boot-bom)
- Generate project structure:
- Create directory structure based on selected type
- Generate pom.xml files (parent and modules)
- Create package-info.java files for each module
- Generate .gitignore, LICENSE, mvnw, mvnw.cmd
- Create basic directory structure with src/main/java and src/test/java
- Save to project directory:
- Default location: Save directly to the command execution directory (same level as the command)
- Directory creation: Automatically create the project directory structure if it doesn't exist
- File naming: Use descriptive names based on project type and module names
For Existing Project Validation
- Analyze project structure:
- Scan project directory for Maven modules
- Identify layer structure (interfaces, application, domain, infrastructure)
- Check package naming conventions
- Verify directory organization
- Identify project type:
- Single-module: Single pom.xml at root, all layers in one module
- Multi-module: Parent pom.xml with multiple modules, each module has complete layers
- Microservices: Multiple services, each with independent structure
- Validate against standards:
- Check DDD layer compliance
- Verify dependency direction (interfaces → application → domain ← infrastructure)
- Validate package naming ({basePackage}.{module}.{layer})
- Check for required directories (src/main/java, src/test/java)
- Verify package-info.java files exist
- Generate validation report:
- List identified issues
- Provide recommendations
- Suggest fixes for non-compliant structures