Zum Hauptinhalt springen

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​

  1. Import colors:

    ...@../../../assets/colors/_colors.d2
  2. 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
  3. 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

Style Guide (MUST)​

Diagrams MUST follow the Diagram Style Guide.

Color Modes​

ModeImportUse case
Internal (default)_colors.d2Standard system diagrams
Analysis_colors-analysis.d2Data flow / classification
Context_colors-context.d2Domain 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)​

  1. Colors - MUST import the shared palette; MUST NOT hardcode hex values.
  2. Templates - SHOULD start from a template, for consistent structure.
  3. Connections - SHOULD be labelled with what flows over them.
  4. Icons - MUST be referenced by HTTPS URL; relative paths do not work.

Resources​