Advanced view features: styling (colors, shapes, style predicates), layout control (autoLayout, rank hints), and navigation (navigateTo, links).
Use this skill after the structure of a view is already correct. It adds polish and usability ā styling, layout control, drill-down navigation, and external links ā without rebuilding which elements belong in the view.
If the task requires changing includes, parent context, neighbors, or creating a new view, hand off to design-view first.
autoLayout direction optional, and add only a few rank hints for obvious anchors when needednavigateTo links to enable drill-down navigation between viewsDo not use for base view structure (includes/excludes, parent context, neighbors) ā use design-view first.
| If the user needs... | Use this skill? | Use instead |
|---|---|---|
style, autoLayout, limited rank, navigateTo, link |
ā Yes | ā |
| Better emphasis/de-emphasis while keeping the same structure | ā Yes | ā |
| A new C2/C3/deployment view | ā No | design-view |
| Different included elements or parent context | ā No | design-view |
| Sequence timing, retries, or temporal order | ā No | create-sequence-view |
Rule of thumb: customize the existing view; do not redesign it.
| Need | Primary Feature | Constraint |
|---|---|---|
| Highlight element type | style / kind style predicates |
Prefer shared-spec colors and shapes |
| Improve readability | Keep direction optional; use autoLayout only when it helps, then minimal rank if still needed |
Keep parent context visible |
| Enable drill-down | navigateTo |
Link only to stable, existing view IDs |
| Add external docs | link |
Use trusted and maintained URLs |
| De-emphasize noise | Opacity/style predicates | Never hide critical context boundaries |
Before customizing colors, shapes, or styles:
shared/spec-*.c4 filesspec-global.c4 color definitionsWhy: Shared specs ensure consistency, maintainability, and avoid proliferation of custom styles.
When customizing views, always preserve the parent/surrounding element context:
Start with autoLayout alone.
autoLayout direction is itself optional; do not force LeftRight unless the user asked for it or the preview clearly benefits from left-to-right reading.rank only if the preview is still hard to read after the structure is already correct.rank source.rank source, rank sink, and rank same across many elements; over-constraining the layout often produces brittle or broken views.design-view instead of forcing the layout here.Hard rule: Every view MUST be nested inside a category folder using the views 'FolderName' syntax, except the index view.
Index exception: The index view must live at the root:
views {
view index extends c1_context { }
}
Do not place any other views in the root views { } block.
Avoid duplicate prefixes: If a view is inside a category folder (e.g., views 'C1'), do not prefix the view title with the same category (e.g., avoid title 'C1 / System Context'). Use either folder name OR title prefix, not both.
Allowed categories (must use these exact folder names):
C1 (System Context)C2 (Containers)C3 (Components)Use Cases (Dynamic/sequence views)Deployment (Infrastructure views)Operations (Security/monitoring/DR/CI/CD)views 'Deployment' {
deployment view prod_overview { ... }
}
views 'Operations' {
deployment view security { ... }
}
See the design-view skill for full organization patterns and parent context requirements.
IMPORTANT: Use colors and shapes from shared spec (shared/spec-*.c4), not custom definitions.
Use only colors defined in shared/spec-global.c4:
primary - Primary brand colorsecondary - Secondary colorsuccess - Success/positive statewarning - Warning statedanger - Error/danger statemuted - Muted/inactiveDO NOT: Create new hex color definitions. If you need a color not in the spec:
spec-global.c4 firstShapes come from element kinds defined in spec-*.c4 files:
DO NOT: Define custom shapes. If a shape is needed:
view myView {
include cloud.backend with {
title 'Backend Services'
color primary // From shared spec
shape database // From kind definition
icon tech:java
}
}
view apiView {
include *
style * { color muted; opacity 10% } // spec-global color
style api.*, gateway.* { color primary; opacity 100% } // spec-global color
style element.tag = #deprecated { color muted } // spec-global color
style element.tag != #production { color secondary } // spec-global color
}
global {
styleGroup theme_production {
style * { color primary }
style element.tag = #external { color muted }
}
}
views {
global style theme_production
view myView {
include *
}
}
Style Properties:
Elements: color, shape, icon, opacity, border, size, textSize, multiple
Colors: primary, secondary, muted, amber, gray, green, indigo, red
Shapes: rectangle, storage, cylinder, browser, mobile, person, queue, bucket, document
Icons: tech:, aws:, gcp:, azure:
Treat rank as a scalpel, not wallpaper: autoLayout first, a tiny number of hints only when the preview clearly needs them.
view layered {
include *
autoLayout TopBottom // Example only; omit or change direction if the user prefers otherwise
}
Do not recommend autoLayout LeftRight by default. Use it mainly when the user explicitly wants left-to-right reading or when a pipeline-like flow is clearly easier to read that way.
view requestFlow {
include *
autoLayout TopBottom
// Optional: keep the most obvious entry point stable
include client with { rank source }
}
rank source for a user, browser, or other initiating element.rank sink only when an endpoint keeps drifting into a confusing position after autoLayout is already correct.rank same sparingly; it easily over-constrains the view and only works for siblings.design-view.view dataFlow {
include frontend, backend, database
include frontend -> backend -> // Direction hints
include -> database
// Optional: choose a direction only if it improves readability
autoLayout TopBottom
}
Layered (TopBottom):
view layered {
include *
autoLayout TopBottom
}
Request Flow (Direction optional):
view flow {
include *
// Optional only if the initiating actor keeps drifting
include client with { rank source }
}
Load Balanced:
view balanced {
include *
autoLayout TopBottom
}
autoLayout; add one targeted rank only if the preview is still unclearautoLayout before reaching for more rank hintsrank same; reduce noise first, then add one local hint only if sibling alignment is genuinely neededRule: When creating a new view, add a navigateTo link in the parent overview view so users can drill down from the higher level.
When the user asks for a customization block only, keep existing navigateTo targets stable instead of inventing a new view structure.
view systemOverview {
include *
include cloud.backend with {
navigateTo backendDetails
}
}
view backendDetails of cloud.backend {
include *
}
Drill-down: Context ā Container ā Component (navigateTo on parent elements)
view contextView {
include *
include cloud with { navigateTo cloudContainers }
}
view cloudContainers of cloud {
include *
include cloud.backend with { navigateTo backendComponents }
}
Hub-spoke: Central index with links to specialized views
Index views should extend c1_context (or c0_landscape if a landscape view exists) and always include braces.
view index extends c1_context {}
view epic12 {
title "System Changes - Epic 12"
description """
Implementation details.
See linked resources.
"""
link https://my.jira/epic/12 'Epic-12'
link https://docs.internal/spec 'Specification'
include *
}
view containers_overview {
include *
style * { color muted; opacity 20% }
style api, gateway { color primary; opacity 100% }
include user with { rank source }
include webApp with {
navigateTo webApp_details
}
link https://docs.example.internal/spec 'System specification'
}
What this example does not do:
view myView {
title "Clear, Descriptive Title"
description """
This view shows:
- **Component A**: Handles requests
- **Component B**: Processes data
See [deployment guide](https://docs.internal/deploy).
"""
#production, #deployment
include *
}
element.tag = #name syntaxautoLayout direction is specified, it matches the user's reading preference or an obvious flowMCP: Use open-view to preview layout and navigation interactively
Context7: Query /likec4/likec4 for syntax validation if uncertain
ā Custom hex colors ā never define new colors inline; use only palette names from spec-global.c4 (primary, muted, danger, etc.)
ā Custom shape definitions ā shapes come from element kinds; do not override with custom shape values
ā Rebuilding the whole view inside a customization answer ā keep the existing structure and adjust only styling, layout, navigation, or links
ā Hiding parent context with styling ā never exclude or fully opacity-hide the parent container/system boundary
ā Duplicate title prefix ā if a view is inside views 'C1', don't prefix the title with "C1 /"; use folder name OR title prefix, not both
ā navigateTo target doesn't exist ā always verify the target view ID exists before adding a navigateTo link
ā Letting customization drift into structure design ā if the right answer requires changing included elements or making a new view, say so and hand off to design-view
ā Over-constraining the layout with rank hints ā start with autoLayout, then add at most a few obvious anchors; stacking rank same/rank source/rank sink often breaks views
ā Conflicting rank hints ā an element cannot be both rank source and rank sink; also, rank same only works for siblings
Polished views with appropriate styling, logical layout, and clear navigation paths.