Syntax Reference
Comments
Section titled “Comments”Lines starting with # are comments:
# This is a commentsystem "MySystem": # inline comment version = "1.0.0"Indentation
Section titled “Indentation”SODL uses 2-space indentation. Blocks are introduced with a colon (:).
system "MySystem": stack: language = "TypeScript"String values
Section titled “String values”All string values are double-quoted:
primary = "Marketing website for my product"Array values
Section titled “Array values”Arrays use bracket syntax with double-quoted items:
outcomes = [ "Hero section with CTA", "Feature grid", "Contact form"]Key-value pairs
Section titled “Key-value pairs”Simple assignments use =:
version = "1.0.0"language = "TypeScript"Block declarations
Section titled “Block declarations”Blocks use a name followed by colon on the same line:
stack: language = "TypeScript" framework = "Astro"Named blocks (like policy, module, pipeline, step) include an identifier:
policy Security: rule "Validate all inputs" severity=high
module AuthModule: owns = ["Authentication logic"]Policy blocks
Section titled “Policy blocks”A policy groups rules under a named concern. Each rule has a severity:
policy Security: rule "All API endpoints require JWT validation" severity=critical rule "Rate limit authentication endpoints" severity=high rule "Log all authentication attempts" severity=medium
policy CodeQuality: rule "All public functions have docstrings" severity=medium rule "Variable names are descriptive" severity=lowSeverity levels
Section titled “Severity levels”| Level | Meaning |
|---|---|
critical | Must not be violated — blocks generation |
high | Required constraint |
medium | Strong recommendation |
low | Suggestion |
Extends and implements
Section titled “Extends and implements”Inheritance uses the extends keyword:
template "Base": stack: language = "TypeScript"
system "MySystem" extends "Base": ...
interface MyComponent extends AstroComponent: ...Module dependencies use implements, requires, and exports:
module UIComponents: implements = [HeroComponent, FeatureCard] exports = [HeroComponent, FeatureCard] requires = [ThemeConfig]Method signatures
Section titled “Method signatures”Interfaces declare methods with typed parameters:
interface HeroComponent: method render(tagline: str, subtitle: str) -> strPrimitive types: str, int, float, bool, bytes, UUID, datetime
Generic types — both bracket and angle-bracket syntax are accepted:
method get_all(page: int) -> List[Post]method find(id: UUID) -> Optional[User]method get_stats() -> Result<Success, Error>API response types (used in endpoint declarations):
endpoint "GET /posts" -> List[PostCard]endpoint "GET /post/{id}" -> HTMLendpoint "POST /action" -> Redirectendpoint "GET /stream" -> SSEendpoint "DELETE /item/{id}" -> Empty (204)Naming conventions
Section titled “Naming conventions”| Element | Convention | Example |
|---|---|---|
| Systems, Templates | PascalCase string | "MySystem" |
| Interfaces, Modules, Policies | PascalCase | UserRepository |
| Pipelines | string | "Production" |
| Steps | PascalCase | StepName |
| Methods, fields | snake_case | get_by_id |
| Endpoints | HTTP verb + path | "GET /api/path" |
Invariants
Section titled “Invariants”Invariants are string assertions that must hold:
invariants: invariant "Logo links to home /" invariant "All images have alt text"Pipeline output types
Section titled “Pipeline output types”The output field in a step block is an identifier that declares what the step produces. The conventional values are:
| Value | What it produces |
|---|---|
design | Architecture decisions, diagrams, data models |
code | Application source code |
tests | Test files and test suites |
diff | Code changes for review |
docs | Documentation files |
pipeline "Development": step Design: output = design require = "Define architecture and data models" step Implement: modules = ["AuthModule", "UserModule"] output = code gate = "Unit tests pass" step Test: output = tests gate = "Coverage >= 85%"Artifacts
Section titled “Artifacts”The artifacts key lists file system paths that a module owns:
module UIComponents: artifacts = ["src/components/", "src/layouts/"]