swarmkit · sdlc example ← Docs GitHub
SwarmKit · guided walkthrough

One requirement, from intake to shipped.

A video tour of the OMS delivery pipeline example — every screen and every artifact, shown running in the composer.

Recorded before SwarmKit 1.189.0 — sequencing is no longer built in. The StageGraph artifact, the swarmkit pipeline and swarmkit orchestrator commands, and the /pipelines composer page shown in chapter 05 were removed in 1.189.0. Sequencing belongs to the application, not the framework.

The concepts here are all still first-class: topologies, archetypes, skills, funnels, contracts and governed runs. Only the way stages are chained changed — what the composer used to draw, an application now does over the public HTTP API in about 270 lines.

The portal has moved on since this was filmed. It has gained a topology canvas, a Connections page for servers and credentials, OAuth login for remote MCP servers, and an event seam an application taps. The screens below are older than what you will see on 1.216.0 — the ideas hold, the pixels are behind.

The full walkthrough — ~4 min, seven chapters. Each section below has its own shorter clip and a written explanation. Every frame is captured live from the running UI.

12 archetypes 8 skills 2 funnels 1 StageGraph 2 contracts 7 topologies examples/sdlc-pipeline
00 The idea

What you're looking at

The example runs a single order-management requirement through the whole software lifecycle — intake, design, human sign-off, build, and system-integration test — with real governance: a design gate a judge scores and two human leads must approve, integration contracts that serialise conflicting work, and a saga that survives duplicate webhooks, dropped events, contention, and cancellation.

Topology is data
Every agent, gate, and the pipeline itself is a YAML file the runtime interprets. Nothing here is bespoke Python.
Determination, not orchestration
Agents produce artifacts and verdicts; deterministic code sequences the stages. The app owns the weeks-long state, SwarmKit owns the bounded, governed steps.
Governance is structural
The only exit from a design gate is a human approval — enforced by the compiler, not suggested by a prompt.

Base runtime, or just this example?

A fair question while reading this: which of these are SwarmKit, and which are the demo? The artifact kinds are all part of the runtime + schema base — including Funnel and Contract. Each has a canonical JSON Schema, a resolver in the runtime, a swarmkit serve endpoint, and an auto-generated composer form. (StageGraph was one of them when this was recorded; it was removed in 1.189.0 along with the rest of the bundled pipeline.) This example only authors instances of them.

First-class in the runtime + schema
  • Topology · Archetype · Skill — the core mental model.
  • RoleRegistry · ApprovalPolicy — human identity + approval rules.
  • Funnel — the reusable quality gate.
  • StageGraph — the pipeline-as-data spec. Removed in 1.189.0; sequencing is the application's.
  • Contract — the lock vocabulary. Not custom to this example.
  • Trigger · ExecutorAdapter — ingress + executor kinds.
Authored for this example
  • The instances — the OMS topologies, oms-pipeline, oms-design-gate, and the two contracts.
  • The pipeline controller (examples/sdlc-pipeline/controller/) and the Temporal orchestrator — application code that implemented the runtime's OrchestrationProvider seam, itself removed in 1.189.0. SwarmKit provided the StageGraph spec and the stage-run seam when this was recorded. Since 1.189.0 it provides the governed runs and the correlated audit, and the application owns the sequencing and the durable substrate both.

Each chapter below opens one part of the composer, explains what it achieves, and shows it running.

01 Topologies

The swarms, as data

Achieves: a whole delivery org — agents, roles, and who-delegates-to-whom — authored and inspected as files, with four ways to see the same topology.

A topology is a swarm: agents with roles, wired into a delegation tree. Opening one in the Composer gives you four views of the same document — Structure (the org chart), Relationships (a parent and its children), Network (the flat communication graph), and Canvas (an editable node-graph). Click any agent to see its resolved detail — archetype, model, IAM scopes — and its raw YAML.

Opening oms-stage-run, walking its four views, then drilling into the designer agent and its YAML.

Composer with the agent tree, the designer's model detail, and the live topology YAML
The Composer resolves the topology: the agent tree, the selected agent's model (openrouter · deepseek-v3), and the live YAML panel.
The topology as an editable node-graph on the canvas
The Canvas view — the same swarm as a node-graph, ready to edit.
02 Archetypes

Reusable agent templates

Achieves: define an agent once — role, executor, default skills — and reuse it across topologies; choose per archetype whether it thinks (model) or works a repo (harness).

An archetype is a template an agent instantiates. The interesting choice it captures is the executor. Most archetypes are model executors — they reason and return an artifact. Three (developer, architect-reviewer, security-consultant) are harness executors: they run a coding harness — a session that reads a repo and produces a diff — not a single model call. That distinction is one line of data on the archetype, not a code branch.

Opening developer (a harness executor) and business-analyst (a model executor), in both the form and the YAML.

workspace/archetypes/developer.yaml
executor:
  kind: harness        # a session-holding, diff-producing coding harness…
  ref: claude-code    # …resolved from the bundled adapter library
The developer archetype form
developer — a worker whose executor is a harness; it runs a coding session and returns a diff.
The business-analyst archetype
business-analyst — a model executor; it reasons and returns an artifact (intake + impact analysis).
03 Skills

The one extension primitive

Achieves: every capability an agent gains — a tool, a judgement, a coordination step, a memory — is expressed through one mental model instead of many parallel mechanisms.

SwarmKit has a single way to extend a swarm: the skill, tagged with a category — capability, decision, coordination, or persistence. The SDLC workspace ships eight. A decision skill like artifact-judge scores an artifact against a rubric and returns a verdict — a funnel's judge layer calls exactly this. A coordination skill like multi-party-approval-request gathers sign-offs from several human parties — which is what a funnel's approve layer runs.

Opening artifact-judge (a decision skill) and multi-party-approval-request (a coordination skill).

The artifact-judge skill form over the category-badged list
Each skill carries its category badge. artifact-judge is a decision skill — the judge layer of every gate.
The multi-party-approval-request skill
multi-party-approval-request — a coordination skill that gathers human sign-offs.
04 Funnels

Quality gates as data

Achieves: a reusable, four-layer approval gate with a structural guarantee — nothing reaches "done" except a human sign-off.

A funnel is a first-class gate artifact. It chains up to four layers over an artifact — deterministic validate, an LLM-as-judge judge, an investigative harness review, and a multi-party human approve — and there is exactly one way out: the approve layer. The compiler enforces that invariant; you cannot wire a funnel whose judge or review can reach the terminal on its own. Because it's referenced by id, the same gate can guard any stage in any pipeline.

The four-layer gate on the canvas, selecting the judge layer, and the terminal approve layer up close.

The funnel canvas showing draft to done through four layers
draft → validate → judge → review → approve → done, with retry and escalate loops.
The approve layer up close
The approve layer is the sole terminal — enforced by the compiler, not a prompt.
05 Pipelines

The delivery pipeline as a StageGraph

This chapter is historical. The StageGraph artifact and the canvas below were removed in 1.189.0. The reasoning is worth keeping — stages, the events between them, gates that block a stage, and locks on a contract are all still how you would model delivery — but SwarmKit no longer stores or runs the graph. An application drives the same sequence over POST /runs and the events API; see examples/pipeline-orchestrator.

Achieves: the whole intake→design→build→sit journey authored as one data file, sequenced by a durable saga that handles gates, contract locks, external events, defect loops, and cancellation.

A StageGraph wires stages by the events that enter and leave them. The design stage holds two contract locks and blocks on a gate; build's success is a genuinely external event — a CI webhook. The editor draws it on a canvas: hover a stage or an edge for a × to remove it, drop topologies from the palette, and configure each stage through a form generated from the schema — where topology, gate, and locks are pickers over real workspace values, not free text.

The StageGraph canvas, the design stage up close, edit mode with hover-delete, the schema form, and the ref dropdown.

workspace/pipelines/oms-pipeline.yaml
stages:
  - id: design
    topology: oms-design
    when: [design.kickoff]
    locks: [oms-inventory, oms-web]   # all-or-none, held across approval
    gate: oms-design-gate
    success: design.approved
    release_locks_on: design.approved
    compensation: oms-compensate-design
The stage form generated from the schema
The stage form is generated from the schema — Topology and Gate are workspace dropdowns.
The Topology ref dropdown open
Every ref is a real, pickable value from the workspace — a typo can't reach the runtime.

The saga, running

The reference controller sequences a requirement across those stages and survives everything the real world throws at it. This is the actual output of just demo-pipeline-controller — two requirements, a duplicate webhook, a dropped event, a contract collision, and a cancellation:

just demo-pipeline-controller
STEP 1 — OMS-101 enters (intake → design parks on the gate)
   OMS-101 status=parked  pending_gate=oms-design-gate  locks=['oms-inventory','oms-web']

STEP 3 — OMS-102 arrives, contends on the same contract
   OMS-102 status=parked  (contract held by OMS-101 → serialised)

STEP 4 — OMS-101 gate APPROVED → contract released → OMS-102 resumes
   OMS-101 status=active  locks=[]  (advanced to build)

STEP 6 — OMS-101's 'build.ready-in-qa' webhook was DROPPED; reconciliation recovers
   OMS-101 status=done  passed=['intake','design','build','sit']

STEP 7 — OMS-102 withdrawn mid-pipeline → compensations run in reverse
   OMS-102 status=cancelled

✓ pipeline-controller demo complete
Pluggable sequencing Sequencing is a provider seam, not a bespoke engine. The reference controller is the zero-infra option; a Temporal adapter implements the same interface for production — one data-driven workflow interprets any StageGraph. See design/details/orchestration-provider-seam.md.
06 Contracts

What the locks actually are

Achieves: turns a pipeline's abstract "locks" into a real, checked vocabulary — so two requirements touching the same integration interface can never design concurrently.

The design stage holds locks: [oms-inventory, oms-web]. Those aren't free strings — each is a Contract: a first-class artifact naming an integration interface and the apps it binds. Making locks real means a typo can't silently fail to serialise two requirements. Locks are acquired all-or-none in a fixed order (no deadlock), held across the approval, and released on design.approved; a second requirement that wants a held contract simply parks and resumes.

Opening oms-web and oms-inventory — the two contracts the design stage holds at once.

The oms-web contract with oms and web party chips
The oms + web parties — this lock serialises work on the order API.
The oms-inventory contract
The second contract — the OMS ↔ inventory interface.
07 See it run

The flow, actually running

Achieves: the determination-only shape in motion — a real requirement sequenced by a coordinator, delegated to a worker that produces real design artifacts, ending in a governed approval request.

Everything above is the authoring surface. This is a real runswarmkit run oms-stage-run against live models (openrouter/gpt-4o-mini), not a mock. Watch how the flow happens: the coordinator reads the requirement, builds a scope and a 3-task plan, and delegates two design tasks to the designer worker in parallel. Each produces a genuine ~4 KB solution design; the coordinator then reads both results and fires a multi-party-approval-request. Agents produce artifacts and verdicts — code sequences the work.

A faithful replay of a real run — plan → delegate → design ×2 → synthesize → approval, in ~14 s of agent time.

The artifacts are real too. A single-agent stage (swarmkit run oms-intake) has the business-analyst call its impact-analysis skill and return a structured analysis. Here's an excerpt — the full artifacts this run produced are downloadable just below:

swarmkit run … oms-intake --input "OMS-101: …"
[intake] thinking… (gpt-4o-mini)
[intake] calling impact-analysis → got results (403B)
[intake] done (6.9s)

### Affected Applications
- Order Management System (OMS) — new APIs for order submission + status.
- Web Storefront — integrates with those APIs to submit and poll.

### Open Questions
1. Which applications are in scope for impact?
2. Are there architectural constraints on the new endpoints?

Download the artifacts this run produced

Actual model output, committed to the repo verbatim — the impact analysis, plus the two ~4 KB solution designs the designer worker generated in the flow above:

The point This is the agent-determination-only shape: within a bounded run an agent thinks, calls a skill, and returns an artifact — and deterministic code (here the coordinator's plan; in production, the pipeline controller) sequences those runs. Governance rides along as skills, not as prompts.
08 Run it

Try it yourself

Everything above is in the repo, and the demos are self-contained — they use fakes for the model and harness seams, so none of them need an API key or a running server.

bash
just install                  # install both language workspaces

just demo-sdlc                # the bounded stage run + gate + an IAM-scope denial
just demo-pipeline-controller # the pipeline saga: dup · drop · contend · cancel
just demo-pipeline-temporal   # the same pipeline on Temporal (in-process, no server)

# the visual composer you just watched:
uv run swarmkit serve examples/sdlc-pipeline/workspace --port 8000
sdlc-pipeline-example.md
the example's build order, slice by slice
gate-funnel.md
the four-layer gate + single-exit invariant
pipeline-controller.md
the saga, locks, reconciliation, compensation
contract-registry.md
contracts as first-class lock vocabulary