Extension tutorial
This tutorial walks through every part of Aliot Software Architect with one model: the window-lifter ECU of a car door. The door switch panel sends commands over LIN, the ECU drives the window motor, tracks the glass with a Hall sensor and reverses the motor when the current shows a trapped hand. You open the model, look at it in all seven views, change it from the diagrams, run its use cases and tests, simulate its schedule, fix a diagnostic, rename an element, export diagrams and call the command-line tools.
The current release on the Marketplace and Open VSX is 0.20.1, which bundles the swa.ml 3.2 language (language release 0.3.3). The screenshots were taken with a build of the next release, so a few behaviours are marked as coming in the next release: Add standing right after the view tabs, and "+ Kind" buttons on empty diagrams instead of extra "+" buttons on the toolbar. To learn the language itself, follow the swa.ml language tutorial, which builds the same model step by step.

1. Install and open the model
- In VS Code, open the Extensions view, search for Aliot Software Architecture by voidaliot and install it, or use the Marketplace page. The extension works in desktop VS Code 1.104 or newer and in browser VS Code; the command-line tools need desktop VS Code and Node.js.
- Get the model. The window-lifter example is an MIT-licensed example in the swa.ml repository. Download the same files as window-lifter.zip, unzip it and open the
window-lifterfolder with File > Open Folder. - Open
window-lifter.swaml. The editor colours the swa.ml keywords, and the swa.ml status bar item shows the language server state and versions; swa.ml: Language Server Status shows the same details with Restart, the server output and Copy details for a bug report. - Click the circular swa.ml diagram icon in the editor title bar, or run swa.ml: Show Diagram. The diagram opens beside the text. Right-click the file in the Explorer or its editor tab and choose Show swa.ml Diagrams to open the diagrams of the whole file.
The folder also holds steps/, seven files that build the model one topic at a time. They all declare the same package, so the archive's .swamlignore leaves steps/ out of the project: the project uses window-lifter.swaml, and a step file you open is checked on its own. The folder in the swa.ml repository has the same .swamlignore. Without a new model of your own at hand, swa.ml: New Model asks for a package name and a file, writes an empty package and opens it in General View. swa.ml: Browse Official Examples opens the public language examples, and swa.ml: Open Offline Help opens the editor, CLI, AI tools and language guides inside VS Code. The Get Started walkthrough "Model software architecture with swa.ml" covers the first two steps.
2. Find your way around the diagram
The diagram has one toolbar for every view. From left to right it holds:
- the Model toggle, which opens the Model browser;
- the path bar, which shows where you are as clickable segments; its last segment names the element the diagram is rooted at;
- the seven view tabs: GV, IV, FV, SV, CV, TV and GRV, also reachable with the digit keys 1 to 7;
- Add, the one creation control (coming in the next release: it stands right after the view tabs);
- the options of the current view only, in a fixed order: Layout, Lines, Arrange, Show, the view's own control, Run with its results pill, and the Depth stepper;
- on the right: search (Ctrl+F or Cmd+F), Undo, Redo, Save, Export and the Properties toggle.
On a narrow editor the toolbar gives up captions first, then labels and whole option groups, into one More menu; nothing is reachable only by scrolling, down to a 320 px pane.
The diagram always shows a root. Selecting something, in the canvas, the Model browser or Properties, or switching views never changes it. Only a deliberate navigation does: the diagram icon of a Model browser row, Open in on an element's menu, a pick in the path bar, Go to parent, the tiles of an overview and Back. Switching from GV to IV therefore keeps the package or component you were looking at.
The Model browser
Click Model to open the Model browser (Browser View), the model tree of the current root. Its header names it "Model" with the element count and offers Go to parent, Expand all, Collapse all and Show current diagram elements only. Each row reads name : Type, such as controller : Controller, and shows its child count while collapsed. On hover a row offers Show diagrams and an eye that hides the element in the current view; elements the current diagram does not draw are dimmed, and hidden ones are struck through. Double-click a row or press F2 to rename it in place, and right-click it for the same element menu as on the canvas. Hiding is saved with the diagram, never in the model.

A large model stays navigable the same way: Interconnect, Flow and Sequence View open a package on an overview with one tile and thumbnail per diagram, the Model browser filters with the search field, and Depth decides how far components open. The picture shows the Interconnect overview of the AUTOSAR Classic door controller, a showcase model of about 4,000 lines in the swa.ml repository.

Properties and the element menu
Select an element and click the Properties toggle at the right end of the toolbar. Properties shows the element's own fields, its members in source order and what describes it from outside, such as the requirements a definition satisfies. Fields with suggestions open their list on a click, Ctrl+Space or Arrow Down. Its + lists the member kinds the element can hold and opens the same creation card as Add. Properties and the Model browser start closed and remember whether they are open per view kind; opening them writes nothing to the model.

Every element has one menu, the same on the canvas, in the Model browser and in the Properties header. It lists what the current view does with the element first (Add, Create relationship, presentation), then Show diagrams, Go to definition, Rename, the note and Delete. The menu works with the keyboard: the arrow keys move and Esc closes it.
3. Create and edit from the diagrams
Every view creates elements the same way:
- Add on the toolbar lists exactly the kinds the current root can hold. Right-clicking the empty canvas lists the same kinds.
- An empty diagram or overview says so in one grey line and shows one "+ Kind" button per top-level kind under it (coming in the next release): "+ Package" at the root of an empty file, "+ Component" in Interconnect and Timing View, "+ Component" and "+ Component definition" in General View, "+ Use case" and "+ Test" in Sequence and Case View, "+ Operation" or "+ Use case" and "+ Test" in Flow View.
- Properties + adds a member to the selected element.
Each opens the creation card. The card asks only for what the diagram does not already establish, with the key reference first (Type for components, ports and attributes; Subject for cases; Requirement for satisfy and verify). A kind that needs only a name opens as one typed line, and some kinds take a whole typed line such as level: int = 0 or read(x: int): int. Reference fields suggest names from the model: typing ecu. lists the members of ecu. Once the required fields are filled, the card's footer says what Apply also adds, such as "Also adds port def Flow.", from a dry run of the same edit, or why Apply would be refused.

Every graphical edit is validated as a complete workspace before it changes your file. An edit is refused only for an error it would add; errors elsewhere in the workspace do not block editing. A refused edit says why in the diagram's message line, in plain words, and offers the fix as a button where one exists, for example the next free name for a duplicate, or making a port optional when nothing connects it. Undo, Redo and Save are VS Code's own, for text and diagram changes alike.
Layouts (positions, Depth, Show choices, hidden elements) are saved beside the model in .vscode/swaml/diagrams/<file>.swaml.json and never change the model. Looking at a diagram writes nothing.
4. General View: the structure at a glance
General View (GV) shows definitions, occurrences, requirements and how they relate. Open the package WindowLifter as the root to see the enums, the nine port definitions, the component definitions from InputHandler to BodyController, the occurrences driver, passenger, ecu, window and body, and the three requirements.
The picture below shows the view rooted at ecu's definition, WindowLifterEcu: its ports and parts with the ECU's documentation note.

- Layout switches between Group and Tree. In Tree a member hangs from its owner under one (+) mark.
- Relations shows none, structure or all relations. A specialization, such as
DoorModule specializes Node, is a line with a hollow triangle; Delete on it removes thespecializesclause. - Show chips switch kinds on and off with the same icons as the Model browser.
- To create, use Add or the "+ Component" and "+ Component definition" buttons on an empty package. Double-click a name to edit it in place, or press F2.
5. Interconnect View: ports and wiring
Interconnect View (IV) shows typed ports and connections. A package opens on an overview with one tile and thumbnail per diagram; click the WindowLifterEcu tile, or root the view at ecu, to see the five parts of WindowLifterEcu wired to its LIN, motor, sensor and CAN ports. The package's own tile, WindowLifter, shows the top-level occurrences and the connections lin, motor, sensor, shunt and can.

- Components open closed. Depth or a component's chevron opens them. Inside chooses how a closed component is drawn: as a Preview, its Parts or its Name.
- Hover a port for its member signatures and effective direction.
- Connect ports: hover or select a port and drag from its round handle. Only compatible ports light up; release over one to write the
connect. Drop on a highlighted component boundary instead and the extension creates the matching port, with the oppositereversedflag, and the connection in one validated edit. A drop on empty canvas creates the component, port and connection. A drop that cannot work says why and offers the fix, such as "Reverse same in Sink and connect". - Run and the Case selector stand together on the toolbar. Choose a use case or test in Case to highlight the routes its messages take.
- Something added inside a part shown through a component, such as a port on
ecu.controller, is written there as an addition and leaves the definition unchanged.
6. Flow View: operations and state machines
Flow View (FV) follows an operation, use case or test step by step. A package or component opens on an overview with one tile per operation, state machine, use case and test. Open ecu.controller.control to see the controller's state machine: idle, closing, opening, autoClosing, autoOpening and reversing, each with its on entry region and its leaving lines.

- States are boxes with
on entryandon exitregions. A guarded leave such asif (pinch.active) to reversing;and a timer such asafter 200ms to idle;are lines between states. Drag a line from one state to another to draw a new reaction. - Every
ifis an empty diamond with its conditions on the outgoing lines; control lines are dotted, and steps that can never run are greyed out. - Every line has a + that inserts a step there. Edit a step from its menu, by double-clicking it or with F2, and move it with Alt+Up and Alt+Down.
- Data flow draws pins and data lines. "+ Operation", "+ Use case" and "+ Test" on an overview create a flow ready for its first step.
- A step edit always changes the operation where it is declared. Reached through an occurrence that uses the definition, the message line says it changed for every user.
7. Sequence View: messages of a use case or test
Sequence View (SV) follows the messages of a use case or test across components. A package opens on an overview with one tile per case, showing its participants, message count and last result. Open Close with one touch: the driver publishes pressed(autoUp) to the ECU, the messages travel through the input handler and controller, and the body controller receives windowStatus.

- An awaited message, such as the
on receive body.bus.windowStatus(…) … or after 200msof the use case, is one arrow with its time limit and its checks as notes. - Draw a message: drag from anywhere on a lifeline to another lifeline; the member you pick decides whether it is a send, a publish, a call, an awaited message or an answered call. A message from one part of the subject to another is written when it already travels between them; otherwise the message line says why and opens the operation or part where it is modelled.
- "+ Participant" adds a lifeline, and a lifeline's chevron opens it into its parts. The Model browser lists the lifelines with the eye to hide one.
- A
stateis astatefragment andparallelaparfragment.
8. Case View: use cases, tests, actors and requirements
Case View (CV) draws use cases and tests inside their subject's frame, actors joined by short trunks and requirement links bundled on the right. Rooted at WindowLifter, it shows the two use cases and three tests of ecu inside its frame, the actors driver, body and passenger on the left, and the three requirements on the right with the verify links of the tests. The satisfy claims of this model name the definitions AntiPinch and Controller; they appear in Grid View's Satisfied by column.

- Add lists use case, test, actor, requirement, satisfy and verify. With a case selected, Add actor joins that case; a new actor name creates its component definition and top-level occurrence in the same edit.
- Drag from an element's relation handle to draw an association, satisfaction or verification link; only valid targets light up.
- Double-click a use case or test to open its scenario in Sequence View, and double-click a requirement to edit its documentation.
- Show chips switch use cases, tests, actors, requirements and documentation.
9. Timing View: schedules, deadlines and simulation
Timing View (TV) shows when each operation runs, on the language's own run of the schedule: one row per schedule entry, with the deadline and a band per state. Root it at ecu.controller.control, or at ecu for every part of the ECU.

- Window offers Fit (about four periods of the slowest periodic entry), presets from 1 ms to 10 s and a typed window. The plain wheel scrolls the rows, Shift+wheel moves along time, Ctrl or Cmd+wheel zooms the time axis, and holding Space turns the pointer into a hand.
- Show chips switch trigger arrows, deadlines and unscheduled operations. Depth chooses top-level components, their parts or parts of parts.
- Edit the schedule: drag the period handle on a row's second activation to change its period, and drag the deadline flag to change its deadline; both have a live value tip and arrow keys. A row's trigger chip opens a menu with
on every,on start,on receiveoron callfor each input, andafteranother operation. "+ Schedule" schedules an unscheduled operation at once; Properties then edits its arguments. - The run is computed in the background within a budget. When a window reaches past what has been computed, the view continues the run and says so; Compute further continues a long run. A view of part of a package runs only the shown occurrences and what can trigger them, and says so with the package one click away.
swa.ml: Run Reference Simulation runs a package or one Package::component for a duration you choose, such as 100ms, shows the result as JSON and opens Timing View on the target. A simulation is evidence of one bounded, deterministic run, not a real-time guarantee.

10. Grid View: tables you can edit
Grid View (GRV) shows one kind of element at a time as a table. The icons on the toolbar choose the table: packages, items, ports, connections, components, operations, states, requirements, use cases, tests, views and others. The requirements table shows each requirement's typed attributes as columns, such as reactionMs and currentLimitMa, with Satisfied by and Verified by; the tests table shows Subject, Participants and Verifies.

Edit a cell in place; an edit to several selected rows is validated as one batch. Columns sort and filter, and each table keeps its own column order, widths, filters and selection. Add follows the shown table: in Requirements it adds a requirement. Export CSV writes the shown table with its columns, filters and selection.
11. Run use cases and tests
The model has two use cases and three tests. Each runs in a fresh, deterministic, bounded run of its package and reports pass, fail at the failing statement, inconclusive (the time or step limit came first) or no checks (a case without statements).
Run them from any of these places:
- the Testing view, which lists every package with use cases or tests and its cases;
- the Run Test or Run Use Case code lens above a case in the text;
- the commands swa.ml: Run Test, Run Use Case, Run Tests in Package and Run Use Case or Test;
- Run on the diagram toolbar. Run is a menu of what can run, the shown or selected case first, so Run then Enter runs it.
The pill beside Run counts the results: passed, failed, without a verdict and stale (from an older source revision). It opens the same menu, whose Results section lists each result with Clear. After a run, the diagrams show the evidence of that one run: Sequence View puts values and times on the arrows and assert results on their markers, Flow View shows the executed path, per-statement counts and states taken, Interconnect shows the routes used with message counts, and Timing View shows the activations of the last single case run. Results become stale when the model changes. swa.ml: Clear Run Results removes them, and swa.ml: Inspect Test shows a test's checks and last result without running it.


All five window-lifter cases pass. A passed test is evidence of one run, not a proof that the requirement holds.
12. Problems and diagnostics
The language server checks the model as you type: syntax, names, types, ports, schedules and cases. Diagnostics carry a stable code such as SW2001, appear in the editor and the Problems panel, and many offer quick fixes. Hover a keyword for a one-sentence explanation and a short example, with Open in the reference to its section of the keyword help.

Try it: in AntiPinch, change the schedule entry on every 10ms check() deadline 1ms; to deadline 20ms. The entry is underlined with error SW2007, "Periodic deadline cannot exceed its period.", and the Problems panel lists it with its file and line. Undo restores the model. (In Timing View, dragging the deadline flag stops at the period and its tip says why, so the diagram cannot make this mistake.)
One diagnostic is worth knowing about before you copy models around. When two files of a project declare the same package, each copy reports SW2001 once, says which copy the project uses and offers Leave .swamlignore. That is why the example's steps are left out.
More tools:
- swa.ml: Validate Workspace checks every source of the project and writes a report to an output channel.
- swa.ml: Show Diagnostic Reference lists every diagnostic code.
swaml.lint.profilechooses the advisory profile (default, quiet or strict), andswaml.validation.severitieschanges how a code is displayed; it never makes an invalid model valid.- While a file has a syntax error, the diagrams keep only the declarations that still validate and mark the picture as partial or stale; they accept no edits until the source is repaired.
13. Rename and refactor
Press F2 on a name in the text, on the canvas or in the Model browser, or choose Rename from the element menu. The rename is validated as a complete workspace and updates every reference: declarations, enum literals, ports, schedule entries, connections, cases, satisfy and verify links and views. The element keeps its places on the saved diagrams. A name that is already taken is refused with the next free name as a fix. Double-click a name on the canvas to edit it in place; Escape cancels without changing the source.

The text editor also offers completion of names and paths, signature help, references, go to definition, formatting (swaml.format.*), inlay hints, auto-imports on save (swaml.editor.autoImportOnSave) and inline suggestions. swa.ml: Migrate 2.2 State Machines to 3.0 rewrites older state machines as states in the flow as one validated edit.
14. Export diagrams and tables
Click Export on the toolbar. In the six drawing views it offers Diagram as SVG, the drawing as you see it, without the toolbar; Grid offers Table as CSV. A save dialog asks where to write the file. swa.ml: Export Model Projection JSON writes the model's projection as JSON.

15. Validate and export from the command line
The extension ships two self-contained Node.js tools. In desktop VS Code, run swa.ml: Copy Headless CLI Command and choose validation or export; it copies the command with the installed path. The same tools are published on npm as @voidaliot/swaml-cli with the commands swaml-validate and swaml-diagram. In the examples, <extension-folder> is the installed extension's folder.
node "<extension-folder>/out/cli.mjs" --version
node "<extension-folder>/out/validate.mjs" window-lifter.swaml
node "<extension-folder>/out/validate.mjs" . --format sarif > validation.sarif
node "<extension-folder>/out/cli.mjs" export --file window-lifter.swaml --view iv --anchor "WindowLifter::ecu" --out ecu.svg
node "<extension-folder>/out/cli.mjs" export --file window-lifter.swaml --view fv --anchor "WindowLifter::Controller::control" --out control.svg
node "<extension-folder>/out/cli.mjs" export --file window-lifter.swaml --view grv --out requirements.csv
node "<extension-folder>/out/cli.mjs" export --file window-lifter.swaml --all --out-dir export
The version line names the installed extension and language swa.ml 3.2 (language release 0.3.3), and validation prints Validated 1 swa.ml file(s), swa.ml 3.2 (language release 0.3.3). Export draws what the diagram file says, as the editor does. Flow and Sequence View of a package are overviews, so --all skips them and names the anchors to export one with --anchor. Validation supports text, JSON, SARIF and GitHub annotations; see Command-line tools for every option.
The extension's tools validate and export; they do not run cases. To run the use cases and tests outside VS Code, use the swaml test command of the swa.ml language, which prints one line per case and a summary and exits 1 when a case fails:
pass WindowLifter::Close with one touch
pass WindowLifter::Close manually
pass WindowLifter::Auto-up closes fully
pass WindowLifter::Pinch reverses within 100 ms
pass WindowLifter::Manual closing stops on release
5 case(s): 5 pass, 0 fail, 0 inconclusive, 0 no checks.

16. Work with an AI agent
The extension registers nine tools through VS Code's language-model API: eight read-only tools and swaml_run_tests, which runs use cases and tests. A compatible VS Code chat agent can use them; the extension supplies no model, account or subscription, and it is not an MCP server.
| Reference | What it does |
|---|---|
#swamlGuidance |
The pinned language rules and evidence boundaries, to read before writing a model. |
#swamlContext |
The source or selection with its diagnostics and real symbols. |
#swamlValidate |
Validates proposed swa.ml text against the complete workspace without changing it. |
#swamlSearch |
Finds real declarations in the workspace and libraries. |
#swamlResolve |
Resolves a name or source position to its declaration or occurrence path. |
#swamlTrace |
A requirement's text, attributes, satisfy and verify links and the last result of its tests. |
#swamlDiagnostic |
Explains a diagnostic code. |
#swamlRunTests |
Runs one case, a package or every case and returns each result. |
#swamlTestResults |
Reads the last recorded results without running anything. |
With window-lifter.swaml open, you could ask: Use #swamlTrace to show which tests verify 'Anti-pinch reversal', then #swamlRunTests to run them. Review every suggested change before applying it. AI authoring tools describes each tool's inputs and results.

17. Settings
Open the Settings editor and search for swaml. The most useful settings:
| Setting | Default | Effect |
|---|---|---|
swaml.preview.diagrams.defaultKind |
gv |
The view a diagram opens in. |
swaml.preview.diagrams.update |
live |
Refresh diagrams live, on save or manually. |
swaml.preview.diagrams.lineStyle |
straight |
Straight, orthogonal or curved lines; also remembered per view. |
swaml.preview.diagrams.showPortLabels |
true |
Port names beside port glyphs. |
swaml.preview.diagrams.showMultiplicities |
false |
Declared multiplicities where they apply. |
swaml.preview.diagrams.makeRoom |
on for IV, GV, FV | Move nearby content aside when opening or resizing elements. |
swaml.lint.profile |
default |
Advisory diagnostics: default, quiet or strict. |
swaml.validation.severities |
{} |
Display severity per diagnostic code. |
swaml.library.directories |
[] |
Extra source directories for explicit imports. |
swaml.format.indentStyle, indentSize, blankLines, lineWidth |
follow the editor | Formatting. |
swaml.inlayHints.enabled |
true |
Resolved defaults and effective signatures in the text. |
swaml.inlineCompletion.enabled |
true |
Grammar-valid inline suggestions. |
swaml.editor.autoImportOnSave |
false |
Insert unambiguous imports on save. |
swaml.languageVersion is 3.2, the only language version of this extension.
Where to go next
- swa.ml language tutorial: build the window-lifter model yourself, one construct at a time.
- Editor guide: walkthroughs per view and Markdown in requirements.
- Command-line tools and AI authoring tools.
- The swa.ml language guide and its source repository.
- Support and limits.