/ddd-skills:ddd-architecture-docfrom ddd-skills
Generates DDD architecture documentation including C4 model diagrams (Context/Container/Component/Code), ADRs, domain model docs, API docs, decision logs, and team communication templates. Activates when users ask about architecture documentation, ADR, C4 diagrams, or domain model documentation.
Ships in ddd-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate comprehensive DDD architecture documentation: C4 model diagrams (L1-L4), ADRs, domain model docs, API docs, decision logs, and team communication templates.
Follow this 5-step workflow when generating architecture documentation:
Step 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 doc
When info is insufficient: give a best-guess version first based on common patterns (e.g., e-commerce) + list what specific information is still needed. Never just say "请提供更多信息".
ddd-architecture-selector)ddd-architecture-selectorddd-code-reviewerThis skill is designed for: Backend developers (implementing DDD architectures), Software architects (evaluating and selecting patterns), Tech leads (reviewing team implementations), and DDD beginners (learning domain-driven design fundamentals).
C4 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) | Developers
graph 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)"]
L3/L4 完整 Mermaid 代码示例见 references/01-c4-examples.md。
When to use each level: L1 for project kickoff, L2 for ops handover, L3 for daily dev reference, L4 for complex aggregates only.
# 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 |
Document each aggregate:
## 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 | POST /orders | Command Model |
| Query | GET | GET /orders?status=PAID | Query Model |
Command API: triggers domain behavior, publishes domain events, idempotent key required. Query API: reads from query model (may be separate read DB), no side effects.
Maintain a central index:
docs/adrs/
├── README.md ← Auto-generated ADL index
├── ADR-001-title.md
└── ...
Best practices: one ADR file = one decision; ADR in the same repo as code; CI auto-generates the index.
| 策略 | 频率 | 谁负责 |
|---|---|---|
| PR 时同步更新 ADR + 图 | 每次代码变更 | 开发者 |
| C4 图季度审计 | 每季度 | 架构师 |
| ADL 索引自动生成 | 每次 ADR 变更 | CI |
| 全量架构文档 Review | 每月 | 架构组 |
Golden rule: if code changes the architecture, the doc changes in the same PR.
Q1: 文档应该用什么工具? 先用 Mermaid,复杂度上升后考虑 Structurizr。
Q2: 需要画哪些 C4 层级? L1 + L2 是必须的,L3 视团队规模(>5 人推荐)。
Q3: 怎么保证文档不过期? PR 勾选框 + CI 检查 ADR 一致性 + 月度 Review。
Q4: 遗留系统没有文档怎么办? 先画 AS-IS 的 L1 图 → 记录关键 ADR → 每 sprint 完善一个 BC。
Q5: ADR 需要写多详细? 至少包含背景、决策、备选方案(≥2 个)和影响。
Q6: 多人同时改一个 BC 的文档怎么处理? Git 冲突解决机制即可,PR Review 时同步 Review 文档。
This skill is pure documentation. It does not collect user data, does not access external services or networks, and contains no executable scripts.
| File | Content | When to Reference |
|---|---|---|
references/01-c4-examples.md | Full C4 L1-L4 Mermaid examples for e-commerce | User needs complete C4 diagrams to copy-paste |
references/02-adr-templates.md | 3 ADR template variants (standard, lightweight, tech) | User needs to write a new ADR |
references/03-doc-templates.md | 3 architecture doc templates (full, lightweight, onboarding) | User needs a document structure to start with |
references/04-toolchain.md | Tool recommendations (Structurizr, Mermaid, PlantUML, ArchUnit) | User asks about tools or automation |
references/05-team-templates.md | Team communication templates (review request, change notice) | User needs to notify or review with team |
references/06-arch-decision-log.md | ADL index format + CI automation | User needs to maintain or automate ADR tracking |
references/07-domain-model-doc.md | Aggregate/BC documentation patterns | User needs to document domain models |
references/08-api-doc-patterns.md | CQRS API documentation patterns + OpenAPI spec | User needs to document APIs with CQRS |
references/09-trace-anti-patterns.md | Architecture doc anti-patterns (5 categories) | User needs to avoid common documentation mistakes |
references/10-faq-deep.md | In-depth FAQ (microservices ADR, legacy systems, security) | User has advanced or edge-case questions |
ddd-architecture-selector — Architecture selection (before you document, make decisions). Install: npx skills add full-stack-skills/ddd-skills --skill ddd-architecture-selector.ddd-architecture-evaluator — Periodic architecture health check. Install: npx skills add full-stack-skills/ddd-skills --skill ddd-architecture-evaluator.ddd-code-reviewer — Code-level DDD compliance check. Install: npx skills add full-stack-skills/ddd-skills --skill ddd-code-reviewer.ddd-cqrs-architecture — CQRS detail for API documentation. Install: npx skills add full-stack-skills/ddd-skills --skill ddd-cqrs-architecture.ddd-architecture-awesome — DDD concept overview. Install: npx skills add full-stack-skills/ddd-skills --skill ddd-architecture-awesome.agents/openai.yaml (opens in a new tab)examples/01-adr-examples.md (opens in a new tab)examples/02-c4-diagrams.md (opens in a new tab)examples/03-architecture-document.md (opens in a new tab)examples/04-domain-model-documentation.md (opens in a new tab)examples/05-maintenance-guide.md (opens in a new tab)examples/06-adr-examples.md (opens in a new tab)references/01-c4-examples.md (opens in a new tab)references/02-adr-templates.md (opens in a new tab)references/03-doc-templates.md (opens in a new tab)references/04-toolchain.md (opens in a new tab)references/05-team-templates.md (opens in a new tab)references/06-arch-decision-log.md (opens in a new tab)references/07-domain-model-doc.md (opens in a new tab)references/08-api-doc-patterns.md (opens in a new tab)references/09-trace-anti-patterns.md (opens in a new tab)references/10-faq-deep.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
16 skills in this plugin
/ddd-api-designerAPI design from domain model — CQRS command/query separation, REST API endpoint design, data object conversion chain (PO→DO→DTO→VO), unified response format, OpenAPI/Swagger generation, BFF pattern, API versioning, and security design. Use when user asks about API design, REST API, OpenAPI, BFF, DTO design, 接口设计, or data object conversion./ddd-architecture-awesomeProvides comprehensive guidance for Domain-Driven Design (DDD) concepts, strategic design, tactical design, and architecture patterns. Includes DDD applicability assessment, Pattern Boundaries table (what each pattern is and is NOT), Complexity Ladder (when to adopt each level), Core Concepts quick reference with Entity/ValueObject/Aggregate patterns, full architecture landscape overview, anti-patterns with fixes, multi-language reference implementations, and complete primary source references. Use when the user asks about DDD basics, needs to understand DDD concepts, evaluates DDD applicability, or wants an introduction to domain-driven design./ddd-architecture-cleanComprehensive guidance for Clean Architecture (整洁架构) — Robert C. Martin's Clean Architecture with Enterprise Business Rules, Use Cases, Interface Adapters, and Frameworks layers. Covers core entities, use case interactors, dependency rules, and full implementation steps with Java/Spring Boot examples. Use when user asks about Clean Architecture, 整洁架构, Robert Martin, Uncle Bob, use case driven architecture, or needs to implement DDD with clean architecture.Generated from the plugin's indexed repository (full-stack-skills/ddd-skills) — no native marketplace selected
npx claudepluginhub p/full-statck-skills-ddd-skillsOther plugins' skills for the same job