Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help


title: "Requirements" weight: 31 summary: "Model functional and non‑functional requirements directly in Sruja DSL."

Requirements

Use requirement to capture functional, performance, security, and constraint requirements. Requirements are declared at the architecture root only.

Syntax

import { * } from 'sruja.ai/stdlib'


// Requirements using flat syntax
R1 = requirement functional "Support 10k concurrent users"
R2 = requirement performance "p95 < 200ms for /checkout"
R3 = requirement security "PII encrypted at rest"
R4 = requirement constraint "Only PostgreSQL managed service"
R5 = requirement nonfunctional "System must be maintainable"

view index {
  include *
}

Guidance

  • Keep requirement titles concise and testable.
  • Reference requirements in ADRs and scenarios where relevant.
  • Validate with sruja lint to surface unmet or conflicting requirements.
  • Declarations at system/container/component level are deprecated and ignored by exporters and UI.
  • scenario for behavior walkthroughs
  • slo for targets and windows
  • adr for decision records