likec4-dsl
SKILL.md
LikeC4 DSL Skill
Architecture-as-code tool. Describe systems in .c4/.likec4 files and LikeC4 generates interactive diagrams.
Rules
- Projects - it is possible to have multiple likec4 projects in a workspace, project is determined by presence of a config file (
.likec4rc,likec4.config.{ts,js,json}). LikeC4 files belong to the project of the nearest config file in the directory hierarchy. - Top-level statements — only
import,specification,model,deployment,views,globalare allowed. Blocks can repeat, but at least one per file must be present. - Multi-file merge — Top-level blocks across files are merged. For example,
model { ... }blocks present in multiple files, parsed separately, and then merged into a single model. - Strings —
'single',"double"— all support multi-line. Escape quotes with backslash:\'or\". - Markdown — properties like
summary/description/notescan contain Markdown. Use triple quotes'''or""". Begin a new line after opening quotes and indent Markdown content for better formatting and syntax highlighting. - Comments —
// single lineand/* multi-line */comments supported anywhere. - Identifier — letters, digits, hyphens, underscores only. No dots (dots are FQN separators). Can't start with a digit. Examples:
customer,payment-service,frontendApp,queue-1. Critical:payment-apiis valid;payment.apiis NOT an identifier (dots separate FQN hierarchy). Seereferences/identifier-validity.md. - FQN — Fully Qualified Name (FQN) is a dot-separated path to an element, MUST be unique within the project. Examples:
customer,saas.backend.payment-service.paymentsApi,infra.eu.zone1.node1. - References — LikeC4 has lexical scoping with hoisting, nested scope may shadow outer, like in JavaScript. That scope does not carry across files: even with imports/includes in the same project, cross-file references must use full FQNs. Tiny reminder:
backend.apidoes not survive a file boundary; across files write the full path such ascloud.backend.api.