| name | dynamic-workflow |
| description | Use for complex work that benefits from a typed, auditable workflow with validation, compilation, durable trace, review, resume, and summary. The user-facing entry is dynamic-workflow; lifecycle commands are internal phases. Do not use for simple one-step tasks where orchestration costs more than execution. |
Dynamic Workflow
Use this skill when a user asks for a complex task to be decomposed, executed, reviewed, resumed, or summarized with durable evidence. Skip it for simple edits, quick questions, or tasks that cannot be usefully split into typed steps.
Required Flow
- Resolve the skill directory containing this
SKILL.md.
- Use
<skill_dir>/scripts/dw for all CLI operations. The wrapper prefers the bundled runtime at <skill_dir>/runtime/bin/dw.mjs.
- A source repository checkout is only a development fallback, not a user-install requirement.
- Write or select a typed plan from
<skill_dir>/templates/plan.yaml; for non-trivial plans, read <skill_dir>/references/plan.md for the supported step types and fields.
- Prefer explicit dataflow when a downstream
agent.review, agent.synthesize, or agent.execute needs upstream evidence: add consumes entries rather than relying on depends_on alone.
- Use
command.collect for evidence gathering and optional scans. Use strict command.verify for tests, builds, lint, schema checks, and final acceptance.
- For real local agent execution, keep
backend omitted/current and set input.agent_backend: paseo on the agent step. Follow it with strict command.verify because the agent artifact is not proof by itself.
- Treat JS-first examples with
command(...), agent.review(...), and StepHandle.output(...) as authoring guidance that captures to manifest IR; do not execute arbitrary JavaScript.
- Run
<skill_dir>/scripts/dw validate <plan> and fix structured validation errors before execution. Read warning lines too; revise brittle command shapes such as broad rg, nested shell, or optional searches under command.verify.
- Run
<skill_dir>/scripts/dw compile <plan> and show a concise manifest/risk summary, including warnings when present.
- For
dynamic-workflow <task> or a natural-language run request, continue in one user operation through <skill_dir>/scripts/dw run <plan>, then preserve the DW_* transcript markers.
- Run
status, review, and summarize for the resulting run id. Use resume when continuing an existing run.
- If
<skill_dir>/scripts/dw cannot find the bundled runtime, report the missing runtime path instead of reading src/ to infer behavior.
Safety Rules
- Typed plans are canonical; prompt prose is not an execution contract.
depends_on is scheduling only. Use consumes to pass selected artifact context forward.
- Backend defaults to
current; explicit codex, claude, acp, or remote backend names fail closed in the MVP.
- Runtime artifacts default to
.dynamic-workflow/runs/<run_id>/; when --root <dir> is passed, artifacts are written under <dir>/runs/<run_id>/.
- Command prompts may call the CLI or scripts wrapping the CLI, but must not duplicate divergent runtime logic.
- Summaries must omit secrets, raw internal prompts, token/debug details, and unnecessary local paths.
- Do not read runtime source files to infer the plan schema; use
<skill_dir>/templates/plan.yaml and <skill_dir>/references/plan.md.
- Do not mutate a workflow another agent is currently running. Inspect
status, review, summarize, and trace artifacts first; propose a repair plan or resume only after the running session is no longer active or the user asks for intervention.
Output Contract
Successful runs print DW_RUN_START, one or more DW_STEP_START / DW_STEP_VERIFY / DW_STEP_DONE groups, DW_REVIEW_START, DW_REVIEW_COMPLETE, and DW_RUN_COMPLETE. Failed runs must surface structured errors and preserve trace files for review.
Runtime Directory Resolution
Use .dynamic-workflow under the current repository by default. Pass --root <dir> only when the user asks for an alternate runtime location or tests need isolation; that alternate root contains its own runs/<run_id>/ directory.