Requirement Diagram
Last updated:
Mermaid Studio provides language support for SysML-style requirement diagrams inside IntelliJ IDEA and other JetBrains IDEs. Requirement diagrams document and visualize system requirements, their relationships, and how they are satisfied by design elements, which is valuable for requirements traceability in engineering projects.
Syntax Highlighting
Section titled “Syntax Highlighting”Syntax highlighting integrates directly with IntelliJ’s color scheme system, so diagram colors always match your editor theme.
IDE Support
Section titled “IDE Support”Requirement diagrams have full IDE support:
- Syntax highlighting - Color-coded requirements, elements, and relationships
- Code completion - Suggestions for requirement types and verification methods. Relationship-type completion in the verb slot is a plain text list (no leading icon), so it doesn’t visually compete with the other identifier completions.
- Live templates - 15 abbreviations covering the six requirement variants, element blocks, and the seven relationship verbs (plus a generic verb-picker).
- Refactoring - Rename requirements and elements across the diagram
- Find usages - Track where requirements are referenced
- Code Vision - See relationship counts at a glance
- Color provider - Preview and pick colors for styling
- Navigation bar - Quick access to requirements in large documents
- Structure view - Hierarchical overview of requirements
- Code folding - Collapse requirement definitions
- Formatting - Auto-format your diagram code
- Inspections - Detect undefined references and missing properties
- Brace matching - Navigate between requirement boundaries
Live templates
Section titled “Live templates”A set of 15 context-aware live templates scaffolds the six requirement variants, element blocks, and the seven relationship verbs. Type a short abbreviation, accept it from the completion popup, and tab through the template variables.
Individual abbreviations can be toggled under Settings > Tools > Mermaid Studio > Live Templates in the Requirement Diagram group. See Live Templates for the cross-cutting mechanics (triggering, contextual visibility, configuration).
Requirement declarations
Section titled “Requirement declarations”The six requirement-variant templates share the same body shape (id, text, risk, verifymethod).
risk and verifymethod are populated from enum() pickers, so Tab walks you through valid values.
| Abbreviation | Expansion |
|---|---|
req | Generic requirement declaration |
reqf | functionalRequirement |
reqi | interfaceRequirement |
reqperf | performanceRequirement |
reqphy | physicalRequirement |
reqdc | designConstraint |
Elements
Section titled “Elements”| Abbreviation | Expansion |
|---|---|
elem | element declaration with type and docRef |
Relationships
Section titled “Relationships”The generic rel template uses a verb picker so you can choose any of the seven relationship verbs on insert.
The seven hard-coded templates pre-pick the verb for you.
| Abbreviation | Expansion |
|---|---|
rel | Relationship with verb picker |
rels | satisfies relationship |
relt | traces relationship |
relc | contains relationship |
reld | derives relationship |
relr | refines relationship |
relcp | copies relationship |
relv | verifies relationship |
Quick Syntax Reference
Section titled “Quick Syntax Reference”Requirement types:
requirement- Functional requirementfunctionalRequirement- Functional requirement (explicit)performanceRequirement- Performance constraintinterfaceRequirement- Interface specificationphysicalRequirement- Physical constraintdesignConstraint- Design limitation
Requirement properties:
requirementDiagram requirement Example { id: REQ-002 text: Description of the requirement risk: low verifymethod: analysis }Risk levels: low, medium, high
Verification methods: analysis, inspection, test, demonstration
Relationship types:
- satisfies ->- Element satisfies requirement- traces ->- Requirement traces to another- contains ->- Requirement contains sub-requirements- derives ->- Requirement derives from another- refines ->- Requirement refines another- copies ->- Requirement copies another- verifies ->- Element verifies requirement
For the complete syntax reference, see the Mermaid.js Requirement Diagram documentation.