structurizr-c4
Write, review, and explain C4 architecture diagrams in Structurizr DSL, including system context, container, component, dynamic, and deployment views.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write, review, and explain C4 architecture diagrams in Structurizr DSL, including system context, container, component, dynamic, and deployment views.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Work with Jira and Confluence using the Atlassian CLI (`acli`). Use this skill for authentication, Jira work items, projects, boards, sprints, filters, Confluence spaces, and Atlassian API-oriented CLI workflows.
Work with GitHub using the GitHub CLI (`gh`). Use this skill for pull requests, issues, repositories, Actions workflows, releases, search, and GitHub API operations.
Deeply explore a repository and explain what it literally is, how users use it, how it works, and what similar popular projects it resembles.
基于 SOC 职业分类
| name | structurizr-c4 |
| description | Write, review, and explain C4 architecture diagrams in Structurizr DSL, including system context, container, component, dynamic, and deployment views. |
| compatibility | opencode |
| metadata | {"format":"structurizr-dsl","domain":"software-architecture"} |
Use this skill when you need to:
workspace.dsl files!identifiers hierarchical for any non-trivial workspace, especially when child names like api, web, or db repeat under different parents.When reading diagrams, separate:
Do not confuse styles, groups, or filtered views with additional architecture elements.
include * is view-type specific, not global.!impliedRelationships true, false, or a fully qualified Java strategy class.group boundaries can only group elements at the same abstraction level.validate and export, and related local tooling support the full DSL.!docs, !adrs, !plugin, or !script.!include and workspace extends ... only support HTTPS URLs, not local files or directories.When asked to read an existing Structurizr workspace or diagram:
When summarizing, answer these questions in order:
When asked to create or update diagrams:
Prefer the smallest useful set of views:
softwareSystem, systemContext, and autoLayout for readability even though keywords are case-insensitive.this inside nested element blocks when it makes relationships clearer.!include to split large workspaces into fragments, and workspace extends ... when layering additional views or model content onto a base workspace.configuration { scope softwaresystem } for the common case of a single software-system workspace, or scope landscape for landscape-only workspaces.include *? on system context, container, and component views when you want the default elements but only relationships that touch the scoped system, containers, or components.autoLayout is enabled.include and exclude expressions rather than deleting useful model relationships.workspace "Acme Platform" "C4 model for the Acme platform" {
!identifiers hierarchical
model {
customer = person "Customer" "Uses the platform"
acme = softwareSystem "Acme Platform" "Customer-facing product" {
web = container "Web App" "Delivers the user interface" "Next.js"
api = container "API" "Handles business operations" "Kotlin + Spring Boot"
db = container "Database" "Stores operational data" "PostgreSQL" {
tags "Database"
}
}
payment_gateway = softwareSystem "Payment Gateway" "External payment processor"
customer -> acme.web "Uses"
acme.web -> acme.api "Calls"
acme.api -> acme.db "Reads from and writes to"
acme.api -> payment_gateway "Processes payments via"
}
views {
systemContext acme "acme-system-context" {
include *
autoLayout lr
}
container acme "acme-containers" {
include *
autoLayout lr
}
dynamic acme "checkout-flow" {
title "Checkout flow"
customer -> acme.web "Starts checkout"
acme.web -> acme.api "Submits basket"
acme.api -> payment_gateway "Authorizes payment"
acme.api -> acme.db "Stores order"
autoLayout lr
}
styles {
element "Element" {
background #1168bd
color #ffffff
shape RoundedBox
}
element "Person" {
shape Person
}
element "Database" {
shape Cylinder
}
}
}
}
workspace {
!identifiers hierarchical
model {
platform = softwareSystem "Platform" {
api = container "API"
}
admin = softwareSystem "Admin" {
api = container "API"
}
platform.api -> admin.api "Publishes events to"
}
}
Good:
workspace {
model {
a = softwareSystem "A"
b = softwareSystem "B"
a -> b "Uses"
}
}
Bad:
workspace {
model {
a = softwareSystem "A"
a -> b "Uses"
b = softwareSystem "B"
}
}
this inside nested scopesworkspace {
!identifiers hierarchical
model {
a = softwareSystem "A" {
api = container "API"
}
b = softwareSystem "B" {
worker = container "Worker" {
a.api -> this "Sends jobs to"
}
}
}
}
container acme "acme-focused" {
include "->acme.api->"
exclude "relationship.tag==Async"
autoLayout lr
}
container acme "acme-containers-reluctant" {
include *?
autoLayout lr
}
filtered "acme-containers" include "Element,Relationship,PCI" "acme-containers-pci"
workspace {
!identifiers hierarchical
model {
acme = softwareSystem "Acme Platform" {
api = container "API"
db = container "Database"
}
prod = deploymentEnvironment "Production" {
deploymentNode "Kubernetes" {
containerInstance acme.api
deploymentNode "PostgreSQL" {
containerInstance acme.db
}
}
}
}
views {
deployment acme prod "acme-production" {
include *
autoLayout lr
}
}
}
1:, 2:, and so on when the sequence needs to be controlled.{} blocks or by reusing the same step number for concurrent interactions.dynamic acme "parallel-checkout" {
1: customer -> acme.web "Starts checkout"
2: acme.api -> fraud_service "Checks fraud"
2: acme.api -> pricing_service "Calculates price"
3: acme.api -> acme.db "Stores order"
autoLayout lr
}
include * and assuming it means the same thing on every view type.Preferred workflow when tooling is available:
workspace.dsl in version control.workspace.json in version control too.Use the installed Structurizr CLI wrapper available on the machine, commonly structurizr or ./structurizr.sh. For example:
structurizr validate -workspace workspace.dsl
structurizr export -workspace workspace.dsl -format mermaid
structurizr export -workspace workspace.dsl -format plantuml/c4plantuml -output diagrams
For local interactive viewing and layout editing:
docker pull structurizr/structurizr
docker run -it --rm -p 8080:8080 -v PATH:/usr/local/structurizr structurizr/structurizr local
When writing diagrams:
When reading diagrams:
If key scope information is missing and cannot be inferred from the repo or prompt, ask for the minimum clarification needed. Otherwise, choose a reasonable default and note the assumption.