A validating compiler for agent and human-in-the-loop workflows.
Loom is for workflows where prompts, state transitions, and execution modes need to be explicit and safe. You define the workflow once, validate it before anything runs, and generate typed code that your runtime can consume directly.
Use Loom when you have:
- Multi-step agent workflows with real state, not one prompt at a time
- Prompt outcomes that should route to known states
- Multiple execution modes such as autopilot and human-gated review
- A need to catch broken transitions, missing prompts, and bad overrides before runtime
Loom is not a workflow engine. It does not execute work. It compiles workflow definitions into validated artifacts.
Install with the standard curl flow:
curl -fsSL https://raw.githubusercontent.com/acartine/loom/main/install.sh | shOr build from source:
git clone https://github.com/acartine/loom.git
cd loom
cargo install --locked --path crates/loom-cliUpdate an installed release in place:
loom update
loom update --checkList the bundled templates and scaffold the full Knots SDLC workflow:
loom templates list
loom init knots_sdlc
cd knots_sdlc
loom validate
loom build --lang rust > workflow.rs
loom graph --format mermaid > workflow.mmdloom init knots_sdlc creates the complete bundled workflow package: planning, implementation, review, shipment, six prompt files, and six execution profiles. If you want that same template under a different directory name, run loom init --template knots_sdlc my_team_flow instead.
For a fuller walkthrough, see docs/getting-started.md.
A workflow directory contains:
workflow.loom: states, actions, steps, phases, and optional inline profilesloom.toml: package metadata and default profileprompts/*.md: markdown prompts with YAML frontmatter for outcomes and paramsprofiles/*.loom: optional profile files included fromworkflow.loom
Minimal example:
my_workflow/
workflow.loom
loom.toml
prompts/
work.md
review.md
profiles/
Larger workflows typically move profiles into separate files:
knots_sdlc/
workflow.loom
loom.toml
prompts/
planning.md
plan_review.md
implementation.md
implementation_review.md
shipment.md
shipment_review.md
profiles/
autopilot.loom
semiauto.loom
- Define states and actions in
workflow.loom. - Put each action prompt in
prompts/<prompt-name>.md. - Declare success and failure routing in the prompt frontmatter.
- Group steps into phases.
- Select phases and executors with profiles.
- Run
loom validateuntil the graph is clean. - Generate code with
loom build.
The fastest evaluation loop is:
- Run
loom templates list. - Run
loom init knots_sdlc. - Run
cd knots_sdlc && loom validate. - Run
loom build --lang rust. - Run
loom graph --format mermaid. - If you want a smaller starter instead, run
loom init my_workflowto use the defaultminimaltemplate.
Example workflow fragment:
workflow my_workflow v1 {
action planning {
produce agent
}
action review {
gate review agent
}
terminal done
escape deferred
step plan -> planning
step plan_rev -> review
phase main_phase {
produce plan
gate plan_rev
}
}
Example prompt frontmatter:
---
accept:
- Implementation steps are concrete
- Risks are called out
success:
plan_complete: ready_for_review
failure:
insufficient_context: ready_for_planning
params:
complexity:
type: enum
values: ["small", "medium", "large"]
---| Command | Description |
|---|---|
loom init [--template <id>] <name> |
Scaffold a new workflow directory |
loom templates list |
List bundled workflow templates |
loom validate [dir] |
Parse, load prompts, validate the full graph, and print warnings |
loom build [dir] --lang rust|go|python |
Validate and generate code |
loom build [dir] --emit toml |
Emit TOML interchange output |
loom graph [dir] --format mermaid|dot|ascii |
Render the full graph or a profile subgraph |
loom sim [dir] --profile <name> |
Walk the workflow interactively |
loom diff <old-dir> <new-dir> |
Show structural changes between workflow versions |
loom check-compat <old-dir> <new-dir> |
Check backward compatibility and optionally emit a state map |
loom update [--check] [--force] |
Self-update an installed release binary using GitHub release asset redirects |
Without a compiler, workflow logic tends to sprawl across prompt templates, runtime handlers, and application code. Loom keeps the routing model in one place and validates:
- Dead or unreachable states
- Missing or orphaned prompt files
- Invalid outcome targets
- Bad profile overrides
- Phase composition errors
- Per-profile graph issues
- Getting started guide
- Configure and install a custom Knots workflow
- Under the hood: Knots and Loom
- How to prompt an agent to build a workflow
- Release guide
- Language specification
- Contributing guide
The current repo is feature-complete enough to evaluate end-to-end: the reference fixture parses, validates, renders, diffs, checks compatibility, and generates Rust, Go, Python, and TOML output. The repository now also includes CI, tagged GitHub release automation, release tarballs, and a curl-based installer.