Ddd Tactical Patterns
Apply DDD tactical patterns in code using entities, value objects, aggregates, repositories, and domain events with explicit invariants.
mkdir -p ./skills/ddd-tactical-patterns && curl -sfL https://raw.githubusercontent.com/mayurrathi/awesome-agent-skills/main/skills/ddd-tactical-patterns/SKILL.md -o ./skills/ddd-tactical-patterns/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# DDD Tactical Patterns
Use this skill when
- Translating domain rules into code structures.
- Designing aggregate boundaries and invariants.
- Refactoring an anemic model into behavior-rich domain objects.
- Defining repository contracts and domain event boundaries.
Do not use this skill when
- You are still defining strategic boundaries.
- The task is only API documentation or UI layout.
- Full DDD complexity is not justified.
Instructions
1. Identify invariants first and design aggregates around them.
2. Model immutable value objects for validated concepts.
3. Keep domain behavior in domain objects, not controllers.
4. Emit domain events for meaningful state transitions.
5. Keep repositories at aggregate root boundaries.
If detailed checklists are needed, open `references/tactical-checklist.md`.
Example
```typescript
class Order {
private status: "draft" | "submitted" = "draft";
submit(itemsCount: number): void {
if (itemsCount === 0) throw new Error("Order cannot be submitted empty");
if (this.status !== "draft") throw new Error("Order already submitted");
this.status = "submitted";
}
}
```
Limitations
- This skill does not define deployment architecture.
- It does not choose databases or transport protocols.
- It should be paired with testing patterns for invariant coverage.
🎯 Best For
- Claude users
- Software engineers
- Development teams
- Tech leads
💡 Use Cases
- Code quality improvement
- Best practice enforcement
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Ddd Tactical Patterns to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Is Ddd Tactical Patterns compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for Ddd Tactical Patterns?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install Ddd Tactical Patterns?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/ddd-tactical-patterns/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.