YAML workflows
Rerun a multi-step routine from a YAML file.
What it does
- Runs a multi-step prompt routine from a YAML file with
/wf; each step goes to the agent in order. - Takes typed arguments (
string,choice,bool) so one file covers several variants. - Supports conditionals,
printsteps that cost no tokens, and subagent steps that fan out over a list. - Pauses at review gates until you resume, with optional feedback for the next step.
- Keeps run state in the session, so a paused or interrupted run can be resumed after a restart.
How to use
- Put a workflow file in
.agents/wf/in your project or in~/.agents/wf/. - Run
/wf-validate <file>to check it without running anything. - Start it with
/wf <file> key=value .... Text after the arguments becomes theinstructionsargument. - Follow progress in the workflow card in the chat.
- When a gate pauses the run, optionally type feedback in the prompt box, then click Resume. Click Discard to drop the run.
text
/wf review wait=true
/wf ./workflows/deploy.yaml environment=staging version="2.4.1"A minimal workflow with an argument, a print step and a gate:
yaml
name: 'Deploy to {{args.environment}}'
args: { environment: { type: choice, choices: [staging, production], default: staging } }
steps:
- print: 'Deploying to {{args.environment}}'
- prompt: 'Run migrations.'
gate: 'Check the migration logs.'
- prompt: 'Deploy.'Three example workflows live in the package examples/ folder. Copy one into ~/.agents/wf/ (or .agents/wf/ in a project) and run it with /wf <name>:
- review (
/wf review,/wf review fix=false <scope>): unified code review. Scopes the diff or folder, delegates a correctness review and an antipattern scan to subagents, triages the findings, optionally pauses at a gate (wait=true), then applies verified fixes (fix=true, default) or writes proposed PR comments (fix=false). Its prompts reference the optionalponytailandno-ai-slopskills. - socratic (
/wf socratic,/wf socratic packages/foo): context-free Socratic review. A subagent reads only the code or diff and asks up to 6 open questions, the parent agent answers them from code and history, pauses at a gate (wait=true, default), and applies accepted changes (fix=true). - write (
/wf write <notes or draft>): technical prose. Builds a grounded brief, drafts or extracts text, runs subagent substance and style audits, triages the edits, and writes the final text.
Step types at a glance (full schema in the README):
| Step | Written as | What happens |
|---|---|---|
| Prompt | prompt: "..." or a bare string | Sends the prompt and waits for the agent to finish |
print: "..." | Writes a message to the chat, no model call | |
| Gate-only | gate: "..." | The gate text is the prompt, then the run pauses |
| Subagent | subagent: true or a model string, plus output | Runs the prompt in a subagent and stores its last message |
| Foreach | subagent plus foreach: "{{outputs.list}}" | One subagent per list item, run concurrently |
| Conditional | if: "{{args.flag}}" on any step | Skips the step when the condition is false |
Run states shown on the workflow card:
| State | Badge | Meaning |
|---|---|---|
running | Running... | A step is executing |
paused | ❚❚ Paused | Stopped at a gate or interrupted; resume or discard |
completed | ✓ Done | All steps finished |
aborted | ✕ Aborted or ✕ Failed | Discarded, cancelled, or stopped by an error |
Controls & gestures
Slash commands
| Where | Gesture | Result |
|---|---|---|
| Composer | slash command /wf <file> [key=value ...] [instructions] | Queues and runs a workflow |
| Composer | slash command /wf-resume [instructions] | Resumes a paused or interrupted workflow; instructions go to the resumed step |
| Composer | slash command /wf-abort | Discards the active or paused workflow |
| Composer | slash command /wf-list | Lists valid workflows in .agents/wf and ~/.agents/wf with their parameters |
| Composer | slash command /wf-validate <file> [key=value ...] | Checks a workflow without running it |
Workflow UI
| Where | Gesture | Result |
|---|---|---|
| Composer toolbar Resume button (only while paused) | click | Sends /wf-resume; any text in the prompt box is sent as feedback and the draft clears once accepted |
| Composer toolbar Resume button | hover | Tooltip names the gate and the next step |
| Workflow card, command path | hover | Tooltip shows the full path |
Settings you might change
None needed; defaults work. The plugin has no config fields. The full workflow schema (arguments, outputs, subagent shorthand, foreach) is in the package README.
Works with
- Requires the standard DSH commands, subagent, tools and skills services; without them the plugin does not load.
- Steps that set
preset,llmProvider,modelorthinkingneed the agent preset registry or LLM service, and fail validation if it is missing.
Good to know
- A pending request keeps the command, not the YAML. The file is reloaded when the request starts, so edits made while it waits apply.
- Requests run one at a time in the order received; a paused workflow holds the queue.
- Arguments are validated before a run is accepted. An unresolved
{{args.*}}fails validation before any step runs. - Model Experience: each prompt step is one message with step instructions and rules; print steps and gates cost no tokens. A skill catalog entry and two tools (
wf_validate,save_output) are added while relevant.
Install
sh
dsh plugin --profile <web|desktop> add @lukstei/dsh-yaml-workflow