Install
openclaw skills install skills-sh:warpdotdev/common-skills/sagaSaga Saga is an autonomous, spec-driven development workflow for medium-to-large features that should be implemented mostly without human intervention, except at a few discrete touch points. You act as the orchestrator: you turn a rough prompt into an airtight spec, then…
openclaw skills install skills-sh:warpdotdev/common-skills/sagaSaga is an autonomous, spec-driven development workflow for medium-to-large features that should be implemented mostly without human intervention, except at a few discrete touch points. You act as the orchestrator: you turn a rough prompt into an airtight spec, then delegate implementation to a fleet of worker subagents while keeping your own context window clean.
The whole method rests on one bet: if the spec defines every task with validation criteria tight enough to form a contract, then workers can execute in parallel and self-verify, and the saga succeeds with almost no human babysitting. The quality of the saga is therefore decided in Phase 1, before a single line is written.
PROGRESS.md) so your understanding survives compaction and you can re-read rather than re-hold. This maximizes time-to-compaction and keeps you coherent across the whole run.references/validation-strategies.md.Each saga lives in its own directory outside the repo, under ~/.sagas/, so it survives across orchestrator sessions and can be resumed by a fresh agent. Name it uniquely from a slug of the feature plus a timestamp, e.g. ~/.sagas/dark-mode-20260609-0028/. Confirm the exact path with the user and record it — it is the saga's stable identity.
The directory holds a tree of spec files plus a progress log. Each level carries its own validation criteria, so detail scales with the size of the saga instead of bloating one file:
~/.sagas/<saga-name>/
├── SAGA.md # overview, environment, saga-level exit criteria, milestone index
├── PROGRESS.md # live, continuously-updated execution log and current state
└── milestones/
├── 01-<slug>/
│ ├── MILESTONE.md # milestone spec + milestone-level validation criteria
│ └── tasks/
│ ├── 01-<slug>.md # task spec + task-level validation criteria
│ └── 02-<slug>.md
└── 02-<slug>/
├── MILESTONE.md
└── tasks/ ...
SAGA.md stays small — it indexes the milestones and holds only saga-wide content. Milestone and task specs hold the detail. This is what keeps your context clean: read only the spec for the milestone or task you are currently coordinating, and rely on PROGRESS.md for state rather than re-deriving it.
Use the templates and field definitions in references/saga-spec-template.md verbatim. Read it before drafting specs.
Goal: produce a comprehensive, unambiguous saga spec tree. This phase is fully collaborative with the user. It ends only when the user approves the spec.
When asking the user anything in this phase, always use the ask_user_question tool and provide concrete options (single- or multi-select) rather than open-ended questions. Set a recommended_option_index when there is a sensible default. Open-ended prose questions slow the user down and invite vague answers; options force crisp decisions.
Restate the request as a one-paragraph problem statement and the rough shape of the feature. Identify the major unknowns you will need to close. Pick a unique saga directory path under ~/.sagas/ (feature slug + timestamp), confirm it with the user, and create it; everything below is written there.
You cannot define realistic validation criteria without knowing what can actually be tested on this machine and against this program. Determine, by inspecting the repo and environment first and asking the user only for what you cannot discover:
references/validation-strategies.md).Record these findings in SAGA.md under the environment section — workers and any future orchestrator rely on them.
Iterate with the user, via ask_user_question with options, until there is no whitespace left in the requirements: behavior, scope boundaries, edge cases, data shapes, error handling, non-goals, and acceptance bar. Batch related questions (max 4 per call). Stop only when the remaining decisions are either resolved or explicitly delegated to your discretion by the user.
Before decomposing, write the saga-level exit criteria: the concrete, checkable conditions that mean the entire feature is done and correct. These are the contract for the whole saga and the basis for Phase 3.
Break the work into milestones (coherent, independently meaningful chunks, ordered by dependency) and within each, tasks scoped so a single worker agent can complete one in one focused effort. For each task specify: scope, owned files/surfaces, dependencies on other tasks, and validation criteria + validation method. Shape the topology pragmatically around the feature's real dependencies — maximize tasks that can run in parallel within a milestone, and sequence milestones where later work depends on earlier work.
Write this out as the spec tree in the saga directory: the milestone index and saga exit criteria in SAGA.md, each milestone's detail and milestone-level validation criteria in its MILESTONE.md, and each task's detail and validation criteria in its own task spec file. Each task's validation criteria must be airtight per references/validation-strategies.md. If you cannot write airtight criteria for a task, the task is under-specified — split it or go back to the user.
Present the saga spec — walk the user through SAGA.md and the milestone/task specs — and ask them to approve or request changes (via ask_user_question). Do not begin Phase 2 until the user approves. This is the primary human checkpoint.
Goal: execute every task to its validation criteria, milestone by milestone, delegating to workers and keeping yourself lean. The user is involved here only if a blocker cannot be resolved from the spec.
Delegate, don't implement. Use run_agents to launch workers. You coordinate; you do not write feature code yourself. This is what protects your context.
Batch by parallelism. Within a milestone, launch all independent tasks as one run_agents batch (shared base_prompt, per-task prompt). Run dependent milestones in sequence. Use a Mermaid/DAG mental model from the task dependencies.
Isolate local workers. When workers modify the same repo, give each its own git worktree and branch. Follow the saga branch naming convention so every branch is traceable back to its saga directory, milestone, and task without consulting PROGRESS.md:
saga/<saga-name>/m<M>t<T>-<task-slug>
Example: saga/dark-mode-20260609-0028/m1t2-setup-tokens. Create with:
git worktree add ../saga-<saga-name>-m<M>t<T> -b saga/<saga-name>/m<M>t<T>-<task-slug> <base>
If your team or repo has a branch-prefix convention (e.g. a per-user prefix like <username>/, or a required prefix enforced by CI), prepend it consistently while keeping the saga/<saga-name>/... structure intact so branches stay filterable. Workers must never share a checkout or work on the user's current branch. Decide the merge strategy up front (typically: integrate each milestone's branches at the milestone boundary). Worker changes must be committed, pushed, or otherwise durably handed off before any worktree is removed.
To list all branches for a saga: git branch --list '*saga/<saga-name>/*'
Remote workers for computer use. If a task's validation needs computer use and it is only available remotely, launch that worker (or its validation step) remotely with computer use enabled, and have it return a durable artifact (pushed branch, draft PR, or a compact patch/diff) rather than leaving work only in the remote environment.
Put shared rules in base_prompt (repo path, base branch, toolchain commands, coding standards, the validation method, how to report back) and the specific task in each per-worker prompt. Instruct every worker to:
git worktree remove <worktree-path> --force. The branch or patch persists; the worktree does not. Stale worktrees are unacceptable, but cleanup must never be allowed to discard the only copy of validated or useful partial work.See references/validation-strategies.md for choosing and applying the validation method and for what counts as sufficient evidence.
For each milestone, in order:
PROGRESS.md alongside its task, branch, and worktree. Display names are not sufficient for resume; a fresh orchestrator needs the run ID to message an in-progress worker.PROGRESS.md in the saga directory with per-task status and evidence pointers.git worktree remove <path> --force) before proceeding.Re-read the relevant spec files and PROGRESS.md from disk whenever you need state instead of holding it in context. Keep PROGRESS.md updated as you go — it is the source of truth a fresh orchestrator uses to resume the saga, so a stale log means a lost saga. If you sense your context filling, write a concise progress checkpoint to PROGRESS.md first.
Goal: confirm the saga's exit criteria are met, then hand off to the user for manual acceptance.
ask_user_question: accept, or report specific issues. If they report issues, capture them as new tasks, run a focused Phase 2 mini-loop (delegate → self-validate → integrate), and re-present. Repeat until the user accepts.Only consider the saga complete when the user confirms acceptance.
Because the saga directory and PROGRESS.md live outside the repo and capture full state, a saga can be picked up by a fresh orchestrator at any time (after compaction, a new session, or a handoff). When asked to continue, resume, or pick up a saga, read references/continuing-a-saga.md and follow it.
references/saga-spec-template.md — the saga directory layout and the exact templates for SAGA.md, MILESTONE.md, task specs, and PROGRESS.md. Read before drafting specs.references/validation-strategies.md — how to choose a validation method, write airtight criteria, and gather sufficient evidence. Read during Phase 1 (criteria) and Phase 2 (execution).references/continuing-a-saga.md — how a fresh orchestrator picks up an existing saga directory and resumes safely. Read when asked to continue/resume a saga.f589e224907e