c4-architect
Expert skill for creating C4 model architecture diagrams (Context, Container, Component) using Mermaid and structured markdown documentation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert skill for creating C4 model architecture diagrams (Context, Container, Component) using Mermaid and structured markdown documentation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Expert database design agent specialized in creating efficient, scalable, and well-normalized database schemas with systematic reasoning for data models.
Comprehensive software architecture skill for designing scalable systems using Clean Architecture/DDD. Includes dependency analysis for layer enforcement.
Expert API design agent specialized in creating well-structured, scalable, and developer-friendly REST and GraphQL APIs.
Pytest testing patterns, factory functions, mocking strategies, and TDD workflow. Use when writing unit tests, creating test factories, following TDD red-green-refactor cycle, or determining test coverage priorities.
Expert review of multi-tenant and branch isolation safety, ensuring no query data leaks or cross-tenant access.
Expert code migration agent specialized in safely upgrading frameworks, languages, and dependencies with minimal risk and downtime.
| name | c4-architect |
| description | Expert skill for creating C4 model architecture diagrams (Context, Container, Component) using Mermaid and structured markdown documentation. |
| skill_type | universal |
| version | 1.0.0 |
This skill enables the generation of comprehensive software architecture documentation following the C4 model (Context, Containers, Components, Code). It focuses on visualizing the system's static structure at different levels of abstraction using Mermaid C4 syntax.
Goal: Document who uses the system and what external systems it integrates with. Actions:
System Context Diagram using C4Context.Goal: Show the deployable units and data flow. Actions:
Container Diagram using C4Container.Goal: Show how the Backend API container is structured internally. Actions:
src/ directory — layers of the system (e.g. Clean Architecture, Domain Driven Design).Component Diagram using C4Component.C4Context
title System Context — SaaS Platform
Person(customer, "Customer", "Uses self-service portals and interfaces.")
Person(staff, "Staff / Manager", "Manages records, schedules, and operations.")
Person(sysadmin, "System Admin", "Configures platform, plans, and system rules.")
System(app, "Application System", "Multi-tenant SaaS platform (API + Frontend).")
System_Ext(payment, "Payment Gateway", "Card payment processing API.")
System_Ext(storage, "Object Storage", "Invoice and report file storage.")
System_Ext(email, "Email Service", "Transactional email delivery.")
System_Ext(proxy, "Reverse Proxy", "Reverse proxy and routing.")
Rel(customer, app, "Uses self-service functions", "HTTPS")
Rel(staff, app, "Admin workflows and reports", "HTTPS")
Rel(sysadmin, app, "Platform config", "HTTPS")
Rel(app, payment, "Processes card payments", "HTTPS API")
Rel(app, storage, "Stores documents / exports", "API")
Rel(app, email, "Sends transactional emails", "SMTP/API")
Rel(proxy, app, "Routes external traffic", "HTTP")
C4Container
title Container Diagram — Application Architecture
Person(staff, "Staff / Manager", "Admin dashboard interface")
Person(customer, "Customer", "User interface / mobile portal")
Container(proxy, "Reverse Proxy", "nginx", "Reverse proxy, routes external traffic to backend or frontend apps")
Container(frontend, "Frontend Application", "Framework Client", "Web application for administrative and customer workflows")
Container(api, "Backend API", "FastAPI / Node", "REST API — business logic, RBAC, background tasks")
ContainerDb(database, "Relational Database", "PostgreSQL", "Stores application data, accounts, settings, audit logs")
Container(storage, "Object Storage", "AWS S3 / GCP Cloud Storage", "File assets, exports, invoices")
Rel(staff, proxy, "HTTPS")
Rel(customer, proxy, "HTTPS")
Rel(proxy, frontend, "HTTP", "Internal routing")
Rel(proxy, api, "HTTP", "Internal routing")
Rel(frontend, api, "JSON/HTTP")
Rel(api, database, "SQL", "Database connection")
Rel(api, storage, "API", "Storage SDK")
C4Component
title Component Diagram — Backend Container (Clean Architecture)
Container_Boundary(api_container, "Backend API") {
Component(routers, "Controllers / Routers", "API framework routing", "HTTP endpoints — route only, no business logic")
Component(deps, "Dependency Injector", "DI engine", "Injects services, repositories, and auth context")
Component(services, "Application Services", "Service layer classes", "Use cases, workflow logic, transactions")
Component(interfaces, "Repository Interfaces", "Interface / Protocols", "Abstraction of data access layer")
Component(domain, "Domain Entities", "Plain Python / JS", "Pure business entities, domain models and invariants")
Component(repos, "Repositories", "ORM Implementation", "Implements repository interfaces for specific database")
Component(models, "ORM Models", "ORM library", "Database schema mapping/table classes")
Component(eventbus, "Event Bus", "Pub/Sub", "Decouples side effects from core application flow")
}
Rel(routers, deps, "Uses")
Rel(deps, services, "Injects dependencies")
Rel(services, interfaces, "Uses interfaces")
Rel(interfaces, repos, "Implemented by")
Rel(repos, models, "Queries/Mutates")
Rel(services, domain, "Uses/Returns entities")
Rel(services, eventbus, "Publishes events")
When asked to perform architectural work:
docs/architecture/c4-context.md) containing the Mermaid diagram and supporting text.# System Context
## Overview
[Description of the system]
## Personas
- **[Name]**: [Description]
## External Systems
- **[Name]**: [Description]
## Diagram
[Insert Mermaid C4Context]