saga
Use when a user runs saga or asks to autonomously build a sizable feature. Produces a spec tree, delegates to worker subagents in isolated worktrees, validates at each milestone, and gates user acceptance before VCS commit. Not for executing a given plan — use subagent-driven.
Install / Use
npx skills add OutlineDriven/outline-driven-developmentInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Skill content
View source on GitHubname: saga description: 'Use when a user runs saga or asks to autonomously build a sizable feature. Produces a spec tree, delegates to worker subagents in isolated worktrees, validates at each milestone, and gates user acceptance before VCS commit. Not for executing a given plan — use subagent-driven.'
Saga
Contract
| Field | Bound contract | |---|---| | Trigger | User runs saga or asks to autonomously build a sizable feature. | | Authority | Orchestrator writes specs to disk, delegates to workers via run_agents, and validates each task to its criteria before integration and user acceptance gate. All local writes happen in git worktrees (VCS-reversible). Milestone-level validation gates progression. User acceptance is the terminal gate before any VCS commit. | | Side effect | Creates a saga directory outside the repo and spawns workers in isolated git worktrees. | | Done | All tasks meet validation, milestones pass, user accepts. |
Inputs
- Feature request (user-provided prompt or description).
- Target repository path.
- Saga directory is confirmed with user before creation.
- Reference materials (saga-spec-template, validation-strategies, continuing-a-saga) are embedded in this skill and read before drafting specs or resuming.
Procedure
Phase 1 — planning (orchestrator + user)
-
Intake. Restate the request as a one-paragraph problem statement and the rough shape of the feature. Identify major unknowns. Pick a saga directory name under
~/.sagas/from a feature slug plus timestamp (e.g.~/.sagas/dark-mode-20260609-0028/). Confirm the path with the user before creating anything. -
Discover environment. By inspecting the repo first, determine:
- Program type (web app, native GUI, TUI, CLI/library, backend service).
- Whether computer use is available (local, remote only, or not available).
- Test runner, build, lint, and typecheck commands — confirm they run.
- How the program is launched for manual or interactive verification.
Record findings in
SAGA.mdunder the environment section.
-
Close ambiguity. Iterate with the user via
ask_user_question(with concrete options, recommended_option_index set) until behavior, scope boundaries, edge cases, data shapes, error handling, non-goals, and the acceptance bar are unambiguous. Batch up to 4 related questions per call. -
Write saga exit criteria. Before decomposing, define the concrete, checkable conditions that mean the feature is complete and correct. These are the Phase 3 contract.
-
Decompose into milestones and tasks. Break work into milestones (ordered by dependency, independently meaningful) and tasks (scoped for one worker in one focused effort). For each task, specify its scope, owned files/surfaces, dependencies, validation criteria, and validation method. Use the templates in the Reference files section below. Write the spec tree: milestone index and exit criteria in
SAGA.md, milestone detail inMILESTONE.md, task detail in each task spec. -
Get approval. Present the full spec tree to the user via
ask_user_question. Do not begin Phase 2 until approved.
Phase 2 — implementation (worker fleet)
-
Launch workers. Use
run_agentsto delegate tasks. The orchestrator never implements feature code. Immediately record each worker's agent/run ID, task, branch, and worktree inPROGRESS.md. -
Isolate local workers. Give each worker its own git worktree and branch following the convention
saga/<saga-name>/m<M>t<T>-<task-slug>. Create with:git worktree add ../saga-<saga-name>-m<M>t<T> -b saga/<saga-name>/m<M>t<T>-<task-slug> <base>Workers must never share a checkout.
-
Per-worker contract. Instruct each worker to: implement only its assigned task; self-validate against the task's criteria using the prescribed method (computer use, interactive CLI, or tests) in a fix→validate loop; create a durable handoff (commit to the task branch for local workers; pushed branch, draft PR, or patch for remote workers); remove the worktree only after the durable handoff exists (
git worktree remove <path> --force); report branch name, commit hash, changed files, validation evidence, and pass/blocked status. -
Collect and act on reports. Update
PROGRESS.mdwith per-task status and evidence. Handle blocked tasks: re-delegate with retained context, adjust the task spec, or escalate to the user viaask_user_questionwith options — only if the blocker is a genuine spec gap or external decision. -
Integrate each milestone. Merge the milestone's branches into an integration branch, resolve conflicts, run milestone-level validation, and remove any worktrees left behind before proceeding.
-
Maintain state. Update
PROGRESS.mdcontinuously. Re-read specs andPROGRESS.mdfrom disk rather than holding state in context.
Phase 3 — final validation
-
Run exit criteria. Execute all saga-level exit criteria using the strongest available method. Summarize evidence against each criterion.
-
Present completion report. What was built, how each exit criterion was validated, exact steps for manual verification.
-
Loop user for acceptance. Present via
ask_user_question(accept or report specific issues). If issues are reported, capture them as new tasks, run a focused Phase 2 mini-loop, and re-present. Repeat until the user accepts. Only then is the saga complete.
Continuing a saga
When asked to continue, resume, or pick up a saga:
- Locate. Find the saga directory under
~/.sagas/. If ambiguous, ask the user viaask_user_question. - Rebuild orientation. Read
SAGA.md(problem, environment, exit criteria, phase, milestone index) andPROGRESS.md(phase, current milestone, task statuses, worker run IDs, open questions, recent log). Open only the spec for the milestone about to be acted on. - Reconcile. Verify git state for done/in-progress tasks: check whether branches and worktrees exist, whether they have been merged. Spot-check validation evidence for done tasks. Update
PROGRESS.mdto match reality. - Resume. From the reconciled state, resume Phase 2 at the current milestone or Phase 3 if all milestones are integrated. Follow the Phase 2/3 procedure above.
- Keep the contract. Do not silently re-scope. If the spec is wrong, update the relevant spec file and note it in
PROGRESS.mdunder Decisions & Deviations; escalate to the user if agreed behavior or exit criteria change.
Failure and recovery
- Spec gap: ambiguity unresolved in Phase 1 blocks delegation. Escalate to user via
ask_user_questionwith options; do not proceed until resolved. - Worker blocked: collect the report, update
PROGRESS.md, re-delegate with retained context or adjust the task spec; escalate to user if the blocker is not resolvable from the spec. - Milestone validation failure: revert to pre-integration state (branches and commits are preserved in git history); re-delegate affected tasks.
- Phase 3 rejection: capture reported issues as new tasks; run a focused Phase 2 mini-loop; re-present.
- Unachievable validation: if a criterion cannot be checked with available tools, update the spec and note the finding; escalate to the user.
- Partial-result rule: never remove a worktree while validated or useful partial work is still inside it.
- Non-rollback rule: once a durable handoff exists (commit pushed, draft PR opened, patch returned), the work is preserved regardless of subsequent failures.
- Non-converged result: if a task cannot be completed despite re-delegation and spec adjustment, record the blocker in
PROGRESS.mdand escalate to the user. Do not silently declare done.
Output
A completed feature meeting all saga exit criteria. A completion report listing what was built, how each criterion was validated, and exact steps for manual verification. Terminal state is user acceptance.
Related Skills
claude-howto
41.4kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
ai-job-search
40.9kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
guizang-ppt-skill
25.7kAI-agent Skill for generating polished HTML slide decks: editorial magazine and Swiss layouts, image prompts, social covers, and a WebGL/low-power presentation runtime.
reactive-resume
42.2kA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
Security Score
Audited on Invalid Date
