Skip to main content

c4-architecture-modeling

Standards for modeling and rendering software architecture using Simon Brown's C4 Model and standard Mermaid.js C4 syntax.

跳到安装

来源信息

仓库
dandgabr/autodoc
最近来源活动
2026年9月8日 16:33
检测到的 SKILL.md 语言
英语
星标
1
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
c4-architecture-modeling
description
Standards for modeling and rendering software architecture using Simon Brown's C4 Model and standard Mermaid.js C4 syntax.
metadata
{"type":"modeling","phase":"design"}
# C4 Architecture Modeling Skill This skill defines the technical standards for visual software architecture documentation based on the **C4 Model** (Context, Containers, Components, Code) using official **Mermaid.js C4 syntax**. --- ## 1. Abstraction Levels 1. **Level 1: System Context (`C4Context`)**: - Focus: System scope, human users/personas, external third-party software, and high-level boundaries. 2. **Level 2: Containers (`C4Container`)**: - Focus: Separately deployable executable units (APIs, workers, web applications, databases, file stores). 3. **Level 3: Components (`C4Component`)**: - Focus: Modular groupings within a single container (controllers, repositories, services, analyzers). - AutoDoc dynamically derives Level 3 components directly from SQLite WAL `symbols` and `edges`, weighting high cyclomatic complexity ($CC$) modules and rendering actual internal call relationships. 4. **Level 4: Code (`C4Code` / Class Diagrams)**: - Focus: In-depth code relationships, interfaces, and design patterns. --- ## 2. Standard Mermaid.js C4 Syntax Rules All architectural diagrams must use standard Mermaid C4 directives: ### System Context Example (Level 1) ```mermaid C4Context title System Context Diagram Person(user, "User", "Interacts with the client application.") System(app, "Core System", "Primary application service.") System_Ext(external_api, "Third-Party API", "External data provider.") Rel(user, app, "Uses", "HTTPS") Rel(app, external_api, "Fetches data", "REST / JSON") ``` ### Container Diagram Example (Level 2) ```mermaid C4Container title Container Architecture Diagram Person(developer, "Developer", "Submits requests via IDE.") Container_Boundary(b1, "System Boundary") { Container(api, "API Service", "TypeScript", "Handles incoming JSON-RPC calls.") Container(engine, "Core Engine", "Rust", "Processes compute-intensive operations.") ContainerDb(db, "Database", "SQLite WAL", "Persists indices and graph edges.") } Rel(developer, api, "Invokes tools", "stdio") Rel(api, engine, "Dispatches tasks", "Node-API FFI") Rel(engine, db, "Reads & writes", "SQL / r2d2") ``` --- ## 3. Diagram Quality Checklist 1. **Explicit Roles & Types**: Every element must define an identifier, a descriptive label, and its role. 2. **Documented Technologies**: Container and component elements must declare their primary runtime or language. 3. **Action-Oriented Relationships**: Every `Rel()` directive must state a descriptive action verb and the transport protocol.
在 GitHub 查看