c4-container-diagram
Installation
SKILL.md
容器式分层图技能(C4 Container 实现 · D2)
本 skill 画容器式分层图("大容器套小容器、多层纵向嵌套"的图)。D2 是实现方式(d2lang.com)。 本 SKILL.md 是 router——主流程、铁律、分诊必读;详参下沉到
references/按需激活(见 §4 路由表)。
1. 画什么:C4 Container Diagram(先对齐目标)
1.1 定义:什么是容器式分层图(含 C4 Container)
本 skill 画的是"容器式分层图"——大容器套小容器、多层纵向嵌套、每层子容器等宽分布的图。最典型的形态是 C4 model Container Diagram(c4model.com 标准第 2 层图),但适用范围更广:
- C4 model Container Diagram:展示一个软件系统由哪些容器组成(C4 官方定义:"A container represents an application or data store... The container diagram shows the high-level technology choices and how the containers communicate with one another.")。
- 技术架构图 / 产品架构图 / 业务能力分层图 / 微服务架构图等:只要符合"多层大容器纵向嵌套 + 子容器分布"的形态,都适用本 skill。
- 产品能力架构图(Product Capability Architecture Map):容器式分层图的高频变体——在分层基础上叠加三通道编码(布局=分层、线型=状态、颜色=优先级热力)+ 图例,用于"能力在哪层、做到哪一步、先做哪个"。完整模板见 references/templates.md §5.6。
不在此范围(见 frontmatter description 完整清单):流程图、时序图、ER 图、UML 类图、C4 Component/Code 层。