Skip to content

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 integrates directly with IntelliJ’s color scheme system, so diagram colors always match your editor theme.

Requirement diagram syntax highlighting in Armada Dark theme

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

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).

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.

AbbreviationExpansion
reqGeneric requirement declaration
reqffunctionalRequirement
reqiinterfaceRequirement
reqperfperformanceRequirement
reqphyphysicalRequirement
reqdcdesignConstraint
AbbreviationExpansion
elemelement declaration with type and docRef

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.

AbbreviationExpansion
relRelationship with verb picker
relssatisfies relationship
relttraces relationship
relccontains relationship
reldderives relationship
relrrefines relationship
relcpcopies relationship
relvverifies relationship

Requirement types:

  • requirement - Functional requirement
  • functionalRequirement - Functional requirement (explicit)
  • performanceRequirement - Performance constraint
  • interfaceRequirement - Interface specification
  • physicalRequirement - Physical constraint
  • designConstraint - 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.