Skip to content

YAML workflows ​

Rerun a multi-step routine from a YAML file.

@lukstei/dsh-yaml-workflow

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, print steps 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 ​

  1. Put a workflow file in .agents/wf/ in your project or in ~/.agents/wf/.
  2. Run /wf-validate <file> to check it without running anything.
  3. Start it with /wf <file> key=value .... Text after the arguments becomes the instructions argument.
  4. Follow progress in the workflow card in the chat.
  5. 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 optional ponytail and no-ai-slop skills.
  • 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):

StepWritten asWhat happens
Promptprompt: "..." or a bare stringSends the prompt and waits for the agent to finish
Printprint: "..."Writes a message to the chat, no model call
Gate-onlygate: "..."The gate text is the prompt, then the run pauses
Subagentsubagent: true or a model string, plus outputRuns the prompt in a subagent and stores its last message
Foreachsubagent plus foreach: "{{outputs.list}}"One subagent per list item, run concurrently
Conditionalif: "{{args.flag}}" on any stepSkips the step when the condition is false

Run states shown on the workflow card:

StateBadgeMeaning
runningRunning...A step is executing
paused❚❚ PausedStopped at a gate or interrupted; resume or discard
completed✓ DoneAll steps finished
aborted✕ Aborted or ✕ FailedDiscarded, cancelled, or stopped by an error

Controls & gestures ​

Slash commands
WhereGestureResult
Composerslash command /wf <file> [key=value ...] [instructions]Queues and runs a workflow
Composerslash command /wf-resume [instructions]Resumes a paused or interrupted workflow; instructions go to the resumed step
Composerslash command /wf-abortDiscards the active or paused workflow
Composerslash command /wf-listLists valid workflows in .agents/wf and ~/.agents/wf with their parameters
Composerslash command /wf-validate <file> [key=value ...]Checks a workflow without running it
Workflow UI
WhereGestureResult
Composer toolbar Resume button (only while paused)clickSends /wf-resume; any text in the prompt box is sent as feedback and the draft clears once accepted
Composer toolbar Resume buttonhoverTooltip names the gate and the next step
Workflow card, command pathhoverTooltip 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, model or thinking need 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

Released under the MIT License.