Diagram Creation
🤖 Generated with Claude Code
⚠️ Not yet reviewed
Co-Authored-By: Claude (noreply@anthropic.com)
Create D2 diagrams for TOGETHER/CCA documentation using brand colors and templates.
Quick Start
-
Import colors:
...@../../../assets/colors/_colors.d2 -
Use system colors:
${together}- Orange (#FF9900) für TOGETHER-Systeme${cca}- Blau (#0066B2) für CCA-Systeme${vu}- Grün (#69BA7A) für VU-Systeme${kundensystem}- Lila (#867FBB) für Kundensysteme${neutral}- Grau (#999999) für generische Komponenten
-
Use templates:
- Architecture:
../../brand-guide/diagrams/templates/architecture-template.d2 - Sequence:
../../brand-guide/diagrams/templates/sequence-template.d2 - Flowchart:
../../brand-guide/diagrams/templates/flowchart-template.d2 - Network:
../../brand-guide/diagrams/templates/network-template.d2
- Architecture:
Style Guide (MUST)
Diagrams MUST follow the Diagram Style Guide.
Color Modes
| Mode | Import | Use case |
|---|---|---|
| Internal (default) | _colors.d2 | Standard system diagrams |
| Analysis | _colors-analysis.d2 | Data flow / classification |
| Context | _colors-context.d2 | Domain boundary diagrams |
Common Patterns
Architecture Diagram
...@../../../assets/colors/_colors.d2
direction: right
together: TOGETHER Platform {
style.fill: ${together}
api: API Gateway
auth: Auth Service
}
vu: VU System {
style.fill: ${vu}
}
customer: Kunde {
icon: ../../../assets/icons/user.svg
}
customer -> together.api: HTTPS
together.api -> vu: REST
Sequence Diagram
...@../../../assets/colors/_colors.d2
shape: sequence_diagram
user: User { style.fill: ${kundensystem} }
frontend: Frontend { style.fill: ${together} }
backend: Backend { style.fill: ${cca} }
db: Database { style.fill: ${neutral} }
user -> frontend: Login Request
frontend -> backend: POST /auth
backend -> db: Validate Credentials
db -> backend: User Found
backend -> frontend: JWT Token
frontend -> user: Redirect to Dashboard
Flowchart
...@../../../assets/colors/_colors.d2
start: Start { shape: oval; style.fill: ${neutral} }
check: Valid Customer? { shape: diamond; style.fill: ${together} }
process: Process Order { shape: rectangle; style.fill: ${cca} }
error: Return Error { shape: rectangle; style.fill: "#E54040" }
end: End { shape: oval; style.fill: ${neutral} }
start -> check
check -> process: Yes
check -> error: No
process -> end
error -> end
Actor Icons
user: Kunde {
icon: ../../../assets/icons/user.svg
style.fill: ${kundensystem}
}
Rendering (MUST)
Both the source and the rendered output MUST be committed:
d2 diagram-name.d2 diagram-name.svg
Rules (MUST / SHOULD)
- Colors - MUST import the shared palette; MUST NOT hardcode hex values.
- Templates - SHOULD start from a template, for consistent structure.
- Connections - SHOULD be labelled with what flows over them.
- Icons - MUST be referenced by HTTPS URL; relative paths do not work.
Resources
- D2 Documentation
- Quick Reference
- Style Guide
- All Templates:
development/brand-guide/diagrams/templates/