ddd-tactical-patterns
Apply DDD tactical patterns in code using entities, value objects, aggregates, repositories, and domain events with explicit invariants.
- License 许可
- Apache-2.0
- 最近更新
- 2026-06-23
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- ddd-tactical-patterns
- risk
- safe
- tags
- [ddd, tactical, aggregates, value-objects, domain-events]
- source
- self
- date_added
- 2026-02-27
- description
- Apply DDD tactical patterns in code using entities, value objects, aggregates, repositories, and domain events with explicit invariants.
02 资源文件 16
- 许可证LICENSE1.0 KB
- 参考文档references/capture-adapter.md3.3 KB
- 参考文档references/mobile-device-measurement.md9.6 KB
- 参考文档references/paired-device-measurement.md6.3 KB
- 参考文档references/performance-evidence.md4.6 KB
- 参考文档references/rendering-network.md3.6 KB
- 参考文档references/tactical-checklist.md611 B
- 脚本scripts/capture-extension-window.mjs16.9 KB
- 脚本scripts/paired-blocks.py2.2 KB
- 脚本scripts/profile-flame.py4.7 KB
- 脚本scripts/report.py8.2 KB
- 脚本scripts/tests/capture-extension-window.test.sh5.7 KB
- 脚本scripts/tests/paired-device.test.mjs6.4 KB
- 脚本scripts/tests/profile-flame.test.mjs2.7 KB
- 参考文档SOURCE.md369 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
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
- Identify invariants first and design aggregates around them.
- Model immutable value objects for validated concepts.
- Keep domain behavior in domain objects, not controllers.
- Emit domain events for meaningful state transitions.
- Keep repositories at aggregate root boundaries.
If detailed checklists are needed, open references/tactical-checklist.md.
Example
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.
04 同仓库更多 Skills
test_skill
暂无简介
zustand-store-ts
Create Zustand stores following established patterns with proper TypeScript types and middleware.
zoom-automation
Automate Zoom meeting creation, management, recordings, webinars, and participant tracking via Rube MCP (Composio). Always search tools first for current schemas.
zoho-crm-automation
Automate Zoho CRM tasks via Rube MCP (Composio): create/update records, search contacts, manage leads, and convert leads. Always search tools first for current schemas.
zod-validation-expert
Expert in Zod — TypeScript-first schema validation. Covers parsing, custom errors, refinements, type inference, and integration with React Hook Form, Next.js, and tRPC.
zeroize-audit
Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C/C++/Rust code handling secrets, keys, passwords, or other sensitive data.