Loading...
Loading...
DDD architecture documentation generation — C4 model diagrams (Context/Container/Component/Code), ADR (Architecture Decision Records), domain model documentation, API documentation, architecture decision log, and team communication templates. Use when user asks about architecture documentation, 架构文档, ADR, C4 diagram, domain model doc, 架构决策记录, or needs to document DDD architecture for team.
npx skill4agent add full-stack-skills/ddd-skills ddd-architecture-docStep 1: Understand Context — Project size, team, tech stack, domain
Step 2: Identify Audiences — Business / dev / ops
Step 3: Select C4 Level — L1 for business, L2 for ops, L3 for dev team
Step 4: Check Decisions — Any existing ADRs? Need to create new ones?
Step 5: Generate Output — Combine diagrams + ADRs + templates into one docddd-architecture-selectorddd-architecture-selectorddd-code-reviewerC4 Level | DDD Context | Audience
─────────────┼───────────────────────────────┼────────────────
L1 Context | All bounded contexts + externals | Business, Architects
L2 Container | Per-BC deployment units | Architects, DevOps
L3 Component | BC internal layers (Adapter/App/Domain/Infra) | Dev Team
L4 Code | Aggregate internals (entities, VOs, events) | Developersgraph TB
Customer["👤 Customer"] --> BC1["Bounded Context 1"]
Customer --> BC2["Bounded Context 2"]
Admin["👤 Admin"] --> BC3["Bounded Context 3"]
BC1 --> PaymentGW["💳 Payment Gateway"]graph TB
Web["Web App"] --> API["API (Spring Boot)"]
API --> DB[("Database (PostgreSQL)")]
API --> Queue["Event Queue (RabbitMQ)"]references/01-c4-examples.md# ADR-{NNN}: {Short Title}
## Status
{Proposed / Accepted / Deprecated / Superseded}
## Context / Decision / Alternatives / Consequences
- **Context**: Why is this decision needed?
- **Decision**: What did we decide?
- **Alternatives**: Options considered with pros/cons, mark chosen
- **Consequences**: Positive + negative impacts
- **Related**: ADR-{NNN}: {related}| ADR# | Title | Status | Date | Superseded By |
|------|-------|:------:|:----:|:----:|
| 001 | Choose COLA Architecture | Accepted | 2024-03-15 | — |
| 002 | CQRS Strategy L2 | Accepted | 2024-03-20 | — |
| 003 | MySQL over PostgreSQL | Deprecated | 2024-02-01 | ADR-005 |## Aggregate: {Name}
- **Root**: {ClassName} | **Id**: {IdType}
- **Entities**: Table of entity / owner / lifecycle
- **Value Objects**: Table of VO / fields / immutable
- **Domain Events**: Table of event / trigger / consumer
- **Invariants**: 1. {Invariant 1}
- **State Machine**: ```mermaid stateDiagram-v2```| API Type | Method | Example | CQRS Model |
|---|---|---|---|
| Command | POST/PUT/DELETE | | Command Model |
| Query | GET | | Query Model |
docs/adrs/
├── README.md ← Auto-generated ADL index
├── ADR-001-title.md
└── ...| 策略 | 频率 | 谁负责 |
|---|---|---|
| PR 时同步更新 ADR + 图 | 每次代码变更 | 开发者 |
| C4 图季度审计 | 每季度 | 架构师 |
| ADL 索引自动生成 | 每次 ADR 变更 | CI |
| 全量架构文档 Review | 每月 | 架构组 |
| File | Content | When to Reference |
|---|---|---|
| Full C4 L1-L4 Mermaid examples for e-commerce | User needs complete C4 diagrams to copy-paste |
| 3 ADR template variants (standard, lightweight, tech) | User needs to write a new ADR |
| 3 architecture doc templates (full, lightweight, onboarding) | User needs a document structure to start with |
| Tool recommendations (Structurizr, Mermaid, PlantUML, ArchUnit) | User asks about tools or automation |
| Team communication templates (review request, change notice) | User needs to notify or review with team |
| ADL index format + CI automation | User needs to maintain or automate ADR tracking |
| Aggregate/BC documentation patterns | User needs to document domain models |
| CQRS API documentation patterns + OpenAPI spec | User needs to document APIs with CQRS |
| Architecture doc anti-patterns (5 categories) | User needs to avoid common documentation mistakes |
| In-depth FAQ (microservices ADR, legacy systems, security) | User has advanced or edge-case questions |
ddd-architecture-selectornpx skills add full-stack-skills/ddd-skills --skill ddd-architecture-selectorddd-architecture-evaluatornpx skills add full-stack-skills/ddd-skills --skill ddd-architecture-evaluatorddd-code-reviewernpx skills add full-stack-skills/ddd-skills --skill ddd-code-reviewerddd-cqrs-architecturenpx skills add full-stack-skills/ddd-skills --skill ddd-cqrs-architectureddd-architecture-awesomenpx skills add full-stack-skills/ddd-skills --skill ddd-architecture-awesome