[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6PT0SFBYDK9W6TWQRQ9EM4W":3,"skill-same:01M6PT0SFBYDK9W6TWQRQ9EM4W":137},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":14,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M6PT0SFBYDK9W6TWQRQ9EM4W","saga",null,"Run an autonomous, spec-driven development saga for a medium-to-large feature using an orchestrator and worker subagents. Use when the user invokes \u002Fsaga, asks to autonomously build a sizable feature end-to-end, wants a comprehensive milestone and task spec before parallel implementation, or asks to continue or resume a saga under the target repository's brain\u002Fsagas directory.","japurcell\u002Fskills","japurcell","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10947458?v=4","01M6GSJK1YAG95R6VHF47V30KY","Adam Purcell","01M6GSJK6817NVR5FVDMFFNJ6H",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"conversation","when","subagent dispatch","spec-driven","host","end","worker","brain","local","milestone","directory","worktrees","orchestrator","git worktrees","autonomous","ask","subagent","repository","run","tasks","2026-11-10 10:12:30",false,"---\nname: saga\ndescription: Run an autonomous, spec-driven development saga for a medium-to-large feature using an orchestrator and worker subagents. Use when the user invokes \u002Fsaga, asks to autonomously build a sizable feature end-to-end, wants a comprehensive milestone and task spec before parallel implementation, or asks to continue or resume a saga under the target repository's brain\u002Fsagas directory.\ncompatibility: Requires subagent dispatch. Local repository tasks require git worktrees. Use the host's user-input mechanism when available, or ask directly in conversation.\n---\n\n# Saga\n\nSaga 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.\n\nThe 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.\n\n## Core principles\n\n- **Airtight contracts over good intentions.** A task is only ready to delegate when its validation criteria are so explicit that meeting them leaves little-to-no possibility the task was done wrong. Ambiguity is the enemy; resolve it during planning, not during implementation.\n- **No whitespace.** During planning, make every requirement explicit. Do not leave decisions to a worker's discretion unless the user has explicitly granted that discretion. Workers should never have to guess what \"done\" means.\n- **Protect the orchestrator's context.** You are the long-lived coordinator. Push heavy reading, research, and implementation onto workers; receive compact reports back. Keep state on disk (in the saga directory's spec tree and `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.\n- **Validation is first-class.** Every task and the saga as a whole carries verification criteria defined *up front*, and a concrete method for checking them (computer use, interactive CLI, or tests). See `references\u002Fvalidation-strategies.md`.\n- **A few human touch points, not zero.** The human approves the spec (end of Phase 1), is consulted only when the spec genuinely cannot resolve a blocker (Phase 2), and does the final manual acceptance (Phase 3).\n\n## The saga directory\n\nResolve the target project root independently of the current working directory and skill install location: use the project path and local project guidance supplied by the user; otherwise, from the target project, use `git rev-parse --show-toplevel`. Ask only if the target root remains genuinely ambiguous. Store each saga under `\u003Crepo-root>\u002Fbrain\u002Fsagas\u002F` so it survives across orchestrator sessions and can be resumed by a fresh agent. Create `brain\u002Fsagas\u002F\u003Cfeature-slug>-\u003Ctimestamp>\u002F` and record the resolved path as the saga's stable identity.\n\nThe 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:\n\n```\n\u003Crepo-root>\u002Fbrain\u002Fsagas\u002F\u003Csaga-name>\u002F\n├── SAGA.md                      # overview, environment, saga-level exit criteria, milestone index\n├── PROGRESS.md                  # live, continuously-updated execution log and current state\n└── milestones\u002F\n    ├── 01-\u003Cslug>\u002F\n    │   ├── MILESTONE.md          # milestone spec + milestone-level validation criteria\n    │   └── tasks\u002F\n    │       ├── 01-\u003Cslug>.md      # task spec + task-level validation criteria\n    │       └── 02-\u003Cslug>.md\n    └── 02-\u003Cslug>\u002F\n        ├── MILESTONE.md\n        └── tasks\u002F ...\n```\n\n`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.\n\nUse the templates and field definitions in `references\u002Fsaga-spec-template.md` verbatim. Read it before drafting specs.\n\n---\n\n## Phase 1 - Planning & spec generation (orchestrator + user)\n\nGoal: produce a comprehensive, unambiguous saga spec tree. This phase is **fully collaborative** with the user. It ends only when the user approves the spec.\n\nWhen asking the user anything in this phase, use the host's structured user-input tool and **always use concrete options** (single- or multi-select) rather than open-ended questions. Provide your recommendation when there is a sensible default. Open-ended prose questions slow the user down and invite vague answers; options force crisp decisions.\n\n### 1. Intake and frame\n\nRestate 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 under `\u003Crepo-root>\u002Fbrain\u002Fsagas\u002F` (feature slug + timestamp). Tell the user the path and create it; everything below is written there.\n\n### 2. Establish machine & runtime capabilities\n\nYou 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:\n\n- **What kind of program is this?** Web app, native GUI, TUI, CLI\u002Flibrary, backend service, etc. This dictates the validation method (see `references\u002Fvalidation-strategies.md`).\n- **Is computer use available?** Check whether a computer-use \u002F browser-automation capability is available to you or to cloud workers. If GUI\u002Fweb validation is needed but computer use is only available remotely, plan to route that validation through remote workers.\n- **What is the test\u002Fbuild toolchain?** Discover the test runner, build, lint, and typecheck commands (e.g. from README, CI config, package manifests, project rules). Confirm they run.\n- **How is the program run\u002Flaunched** for manual or interactive verification?\n\nRecord these findings in `SAGA.md` under the environment section. Workers and future orchestrators rely on them.\n\n### 3. Close every gap of ambiguity\n\nIterate with the user using the host's structured input tool with concrete options when available, or concise direct questions otherwise. Provide your recommendation for each question. Close gaps in behavior, scope boundaries, edge cases, data shapes, error handling, non-goals, and acceptance bar. Batch related questions (no more than four at a time). Stop only when the remaining decisions are resolved or the user explicitly delegates them to your discretion.\n\n### 4. Define the saga exit criteria\n\nBefore 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.\n\n### 5. Decompose into milestones and tasks\n\nBreak the work into **milestones** (coherent, independently meaningful chunks, ordered by dependency) and within each, **tasks** scoped so a *single novice worker agent* can complete one in one focused effort. For each task specify: scope, owned files\u002Fsurfaces, 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.\n\nWrite 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\u002Fvalidation-strategies.md`. If you cannot write airtight criteria for a task, the task is under-specified. Split it or return to the user.\n\n### 6. Get approval\n\nPresent the saga spec by walking the user through `SAGA.md` and the milestone\u002Ftask specs. Ask them to approve or request changes using the host's user-input mechanism, or directly in conversation when no such tool is available. **Do not begin Phase 2 until the user approves.** This is the primary human checkpoint.\n\n---\n\n## Phase 2 - Implementation & validation (worker fleet, looped)\n\nGoal: 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.\n\n### Orchestration mechanics\n\n- **Delegate, don't implement.** Before dispatching workers, activate the `delegate-to-subagents` skill and follow its dispatch loop. Route each assignment with the exact model and reasoning effort it selects, define ownership and acceptance criteria, and enforce the assignment deadline and checkpoint flow it requires. You coordinate; you do not write feature code yourself. This protects your context.\n- **Batch by parallelism.** Within a milestone, dispatch independent tasks together using the activated `delegate-to-subagents` workflow. Run dependent milestones in sequence. Use the task dependencies to determine the parallel groups.\n- **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`:\n  ```\n  saga\u002F\u003Csaga-name>\u002Fm\u003CM>t\u003CT>-\u003Ctask-slug>\n  ```\n  Example: `saga\u002Fdark-mode-20260609-0028\u002Fm1t2-setup-tokens`. Create with:\n  ```\n  git worktree add ..\u002Fsaga-\u003Csaga-name>-m\u003CM>t\u003CT> -b saga\u002F\u003Csaga-name>\u002Fm\u003CM>t\u003CT>-\u003Ctask-slug> \u003Cbase>\n  ```\n  If your team or repo has a branch-prefix convention (e.g. a per-user prefix like `\u003Cusername>\u002F`, or a required prefix enforced by CI), prepend it consistently while keeping the `saga\u002F\u003Csaga-name>\u002F...` 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.\n\n  To list all branches for a saga: `git branch --list '*saga\u002F\u003Csaga-name>\u002F*'`\n- **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\u002Fdiff) rather than leaving work only in the remote environment.\n\n### The per-task contract given to each worker\n\nPut shared rules in the dispatcher's shared prompt (repo path, base branch, toolchain commands, coding standards, validation method, and reporting format) and the specific task in each worker prompt. Instruct every worker to:\n\n1. Implement only its assigned task and owned files.\n2. Before editing source code, activate the `tdd` skill and follow its red-green-refactor workflow. **Self-validate in a loop** against the task's validation criteria using the prescribed method (computer use \u002F interactive CLI \u002F unit and integration tests). Iterate fix→validate until all criteria pass or it is genuinely blocked.\n3. **Create a durable handoff before cleanup.** For local git worktree tasks, commit the validated changes to the task branch and make sure the branch is visible to the orchestrator. For remote tasks, push the branch, open a draft PR, or return a complete patch\u002Fdiff; do not leave the only copy of the work in a remote checkout. If blocked with partial useful work, preserve it as a WIP commit or patch before reporting; if no partial work is worth preserving, say so explicitly.\n4. **Remove the worktree only after the durable handoff exists**: `git worktree remove \u003Cworktree-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.\n5. Report back compactly: branch name, commit hash or patch\u002Fpushed-branch artifact, changed files, validation evidence (test output, screenshots, CLI transcript), and a clear pass\u002Fblocked status. Keep findings terse to protect context.\n\nSee `references\u002Fvalidation-strategies.md` for choosing and applying the validation method and for what counts as sufficient evidence.\n\n### The orchestration loop\n\nFor each milestone, in order:\n\n1. Dispatch the milestone's parallelizable tasks as workers using the activated `delegate-to-subagents` workflow. Immediately record each worker's addressable agent\u002Frun ID in `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.\n2. Collect reports as they arrive (read the worker's message content; don't rely on lifecycle success alone). Update `PROGRESS.md` in the saga directory with per-task status and evidence pointers.\n3. **Handle blocked tasks.** If a worker can't meet its criteria, decide: re-scope and re-delegate to the same worker (it retains context), adjust the task in its task spec file, or, only if the blocker is a genuine spec gap or external decision, escalate to the user with options. Prefer not to escalate; the spec should usually have the answer.\n4. **Integrate and run milestone-level validation.** Merge the milestone's branches into the integration branch, resolve conflicts, and verify the milestone holds together (run the relevant tests\u002Fvalidation across the integrated result). If any worker left a worktree behind despite instructions, remove it now (`git worktree remove \u003Cpath> --force`) before proceeding.\n5. Move to the next milestone.\n\nRe-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 it 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.\n\n---\n\n## Phase 3 - Final validation (orchestrator + user)\n\nGoal: confirm the saga's exit criteria are met, then hand off to the user for manual acceptance.\n\n1. Run the full saga-level exit criteria using the strongest available method (computer use for GUI\u002Fweb, interactive CLI for TUIs, the full test\u002Fintegration suite otherwise). Summarize the evidence against each exit criterion.\n2. Present the user a concise completion report: what was built, how each exit criterion was validated, and exact steps for them to manually verify (how to run\u002Flaunch, what to look for).\n3. **Loop in the user for manual acceptance** using the host's structured input tool when available, or directly in conversation otherwise: 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.\n\nOnly consider the saga complete when the user confirms acceptance.\n\n---\n\n## Resuming a saga\n\nBecause the saga directory and `PROGRESS.md` live in the target repository 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\u002Fcontinuing-a-saga.md` and follow it.**\n\n## Practical notes\n\n- Never commit or open PRs unless the user asks; follow the repo's version-control rules when you do.\n- Keep the spec tree current. If implementation forces a change to scope or criteria, update the relevant spec file rather than letting it drift.\n- For very large sagas (≈10+ concurrent workers), prefer remote execution so you don't exhaust the user's machine.\n- Don't expose internal worker agent IDs in user-facing summaries unless asked.\n\n## Reference files\n\n- `references\u002Fsaga-spec-template.md` - the saga directory layout and exact templates for `SAGA.md`, `MILESTONE.md`, task specs, and `PROGRESS.md`. Read before drafting specs.\n- `references\u002Fvalidation-strategies.md` - how to choose a validation method, write airtight criteria, and gather sufficient evidence. Read during Phase 1 (criteria) and Phase 2 (execution).\n- `references\u002Fcontinuing-a-saga.md` - how a fresh orchestrator picks up an existing saga directory and resumes safely. Read when asked to continue\u002Fresume a saga.\n","# Saga\n\nSaga 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.\n\nThe 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.\n\n## Core principles\n\n- **Airtight contracts over good intentions.** A task is only ready to delegate when its validation criteria are so explicit that meeting them leaves little-to-no possibility the task was done wrong. Ambiguity is the enemy; resolve it during planning, not during implementation.\n- **No whitespace.** During planning, make every requirement explicit. Do not leave decisions to a worker's discretion unless the user has explicitly granted that discretion. Workers should never have to guess what \"done\" means.\n- **Protect the orchestrator's context.** You are the long-lived coordinator. Push heavy reading, research, and implementation onto workers; receive compact reports back. Keep state on disk (in the saga directory's spec tree and `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.\n- **Validation is first-class.** Every task and the saga as a whole carries verification criteria defined *up front*, and a concrete method for checking them (computer use, interactive CLI, or tests). See `references\u002Fvalidation-strategies.md`.\n- **A few human touch points, not zero.** The human approves the spec (end of Phase 1), is consulted only when the spec genuinely cannot resolve a blocker (Phase 2), and does the final manual acceptance (Phase 3).\n\n## The saga directory\n\nResolve the target project root independently of the current working directory and skill install location: use the project path and local project guidance supplied by the user; otherwise, from the target project, use `git rev-parse --show-toplevel`. Ask only if the target root remains genuinely ambiguous. Store each saga under `\u003Crepo-root>\u002Fbrain\u002Fsagas\u002F` so it survives across orchestrator sessions and can be resumed by a fresh agent. Create `brain\u002Fsagas\u002F\u003Cfeature-slug>-\u003Ctimestamp>\u002F` and record the resolved path as the saga's stable identity.\n\nThe 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:\n\n```\n\u003Crepo-root>\u002Fbrain\u002Fsagas\u002F\u003Csaga-name>\u002F\n├── SAGA.md                      # overview, environment, saga-level exit criteria, milestone index\n├── PROGRESS.md                  # live, continuously-updated execution log and current state\n└── milestones\u002F\n    ├── 01-\u003Cslug>\u002F\n    │   ├── MILESTONE.md          # milestone spec + milestone-level validation criteria\n    │   └── tasks\u002F\n    │       ├── 01-\u003Cslug>.md      # task spec + task-level validation criteria\n    │       └── 02-\u003Cslug>.md\n    └── 02-\u003Cslug>\u002F\n        ├── MILESTONE.md\n        └── tasks\u002F ...\n```\n\n`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.\n\nUse the templates and field definitions in `references\u002Fsaga-spec-template.md` verbatim. Read it before drafting specs.\n\n---\n\n## Phase 1 - Planning & spec generation (orchestrator + user)\n\nGoal: produce a comprehensive, unambiguous saga spec tree. This phase is **fully collaborative** with the user. It ends only when the user approves the spec.\n\nWhen asking the user anything in this phase, use the host's structured user-input tool and **always use concrete options** (single- or multi-select) rather than open-ended questions. Provide your recommendation when there is a sensible default. Open-ended prose questions slow the user down and invite vague answers; options force crisp decisions.\n\n### 1. Intake and frame\n\nRestate 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 under `\u003Crepo-root>\u002Fbrain\u002Fsagas\u002F` (feature slug + timestamp). Tell the user the path and create it; everything below is written there.\n\n### 2. Establish machine & runtime capabilities\n\nYou 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:\n\n- **What kind of program is this?** Web app, native GUI, TUI, CLI\u002Flibrary, backend service, etc. This dictates the validation method (see `references\u002Fvalidation-strategies.md`).\n- **Is computer use available?** Check whether a computer-use \u002F browser-automation capability is available to you or to cloud workers. If GUI\u002Fweb validation is needed but computer use is only available remotely, plan to route that validation through remote workers.\n- **What is the test\u002Fbuild toolchain?** Discover the test runner, build, lint, and typecheck commands (e.g. from README, CI config, package manifests, project rules). Confirm they run.\n- **How is the program run\u002Flaunched** for manual or interactive verification?\n\nRecord these findings in `SAGA.md` under the environment section. Workers and future orchestrators rely on them.\n\n### 3. Close every gap of ambiguity\n\nIterate with the user using the host's structured input tool with concrete options when available, or concise direct questions otherwise. Provide your recommendation for each question. Close gaps in behavior, scope boundaries, edge cases, data shapes, error handling, non-goals, and acceptance bar. Batch related questions (no more than four at a time). Stop only when the remaining decisions are resolved or the user explicitly delegates them to your discretion.\n\n### 4. Define the saga exit criteria\n\nBefore 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.\n\n### 5. Decompose into milestones and tasks\n\nBreak the work into **milestones** (coherent, independently meaningful chunks, ordered by dependency) and within each, **tasks** scoped so a *single novice worker agent* can complete one in one focused effort. For each task specify: scope, owned files\u002Fsurfaces, 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.\n\nWrite 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\u002Fvalidation-strategies.md`. If you cannot write airtight criteria for a task, the task is under-specified. Split it or return to the user.\n\n### 6. Get approval\n\nPresent the saga spec by walking the user through `SAGA.md` and the milestone\u002Ftask specs. Ask them to approve or request changes using the host's user-input mechanism, or directly in conversation when no such tool is available. **Do not begin Phase 2 until the user approves.** This is the primary human checkpoint.\n\n---\n\n## Phase 2 - Implementation & validation (worker fleet, looped)\n\nGoal: 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.\n\n### Orchestration mechanics\n\n- **Delegate, don't implement.** Before dispatching workers, activate the `delegate-to-subagents` skill and follow its dispatch loop. Route each assignment with the exact model and reasoning effort it selects, define ownership and acceptance criteria, and enforce the assignment deadline and checkpoint flow it requires. You coordinate; you do not write feature code yourself. This protects your context.\n- **Batch by parallelism.** Within a milestone, dispatch independent tasks together using the activated `delegate-to-subagents` workflow. Run dependent milestones in sequence. Use the task dependencies to determine the parallel groups.\n- **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`:\n  ```\n  saga\u002F\u003Csaga-name>\u002Fm\u003CM>t\u003CT>-\u003Ctask-slug>\n  ```\n  Example: `saga\u002Fdark-mode-20260609-0028\u002Fm1t2-setup-tokens`. Create with:\n  ```\n  git worktree add ..\u002Fsaga-\u003Csaga-name>-m\u003CM>t\u003CT> -b saga\u002F\u003Csaga-name>\u002Fm\u003CM>t\u003CT>-\u003Ctask-slug> \u003Cbase>\n  ```\n  If your team or repo has a branch-prefix convention (e.g. a per-user prefix like `\u003Cusername>\u002F`, or a required prefix enforced by CI), prepend it consistently while keeping the `saga\u002F\u003Csaga-name>\u002F...` 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.\n\n  To list all branches for a saga: `git branch --list '*saga\u002F\u003Csaga-name>\u002F*'`\n- **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\u002Fdiff) rather than leaving work only in the remote environment.\n\n### The per-task contract given to each worker\n\nPut shared rules in the dispatcher's shared prompt (repo path, base branch, toolchain commands, coding standards, validation method, and reporting format) and the specific task in each worker prompt. Instruct every worker to:\n\n1. Implement only its assigned task and owned files.\n2. Before editing source code, activate the `tdd` skill and follow its red-green-refactor workflow. **Self-validate in a loop** against the task's validation criteria using the prescribed method (computer use \u002F interactive CLI \u002F unit and integration tests). Iterate fix→validate until all criteria pass or it is genuinely blocked.\n3. **Create a durable handoff before cleanup.** For local git worktree tasks, commit the validated changes to the task branch and make sure the branch is visible to the orchestrator. For remote tasks, push the branch, open a draft PR, or return a complete patch\u002Fdiff; do not leave the only copy of the work in a remote checkout. If blocked with partial useful work, preserve it as a WIP commit or patch before reporting; if no partial work is worth preserving, say so explicitly.\n4. **Remove the worktree only after the durable handoff exists**: `git worktree remove \u003Cworktree-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.\n5. Report back compactly: branch name, commit hash or patch\u002Fpushed-branch artifact, changed files, validation evidence (test output, screenshots, CLI transcript), and a clear pass\u002Fblocked status. Keep findings terse to protect context.\n\nSee `references\u002Fvalidation-strategies.md` for choosing and applying the validation method and for what counts as sufficient evidence.\n\n### The orchestration loop\n\nFor each milestone, in order:\n\n1. Dispatch the milestone's parallelizable tasks as workers using the activated `delegate-to-subagents` workflow. Immediately record each worker's addressable agent\u002Frun ID in `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.\n2. Collect reports as they arrive (read the worker's message content; don't rely on lifecycle success alone). Update `PROGRESS.md` in the saga directory with per-task status and evidence pointers.\n3. **Handle blocked tasks.** If a worker can't meet its criteria, decide: re-scope and re-delegate to the same worker (it retains context), adjust the task in its task spec file, or, only if the blocker is a genuine spec gap or external decision, escalate to the user with options. Prefer not to escalate; the spec should usually have the answer.\n4. **Integrate and run milestone-level validation.** Merge the milestone's branches into the integration branch, resolve conflicts, and verify the milestone holds together (run the relevant tests\u002Fvalidation across the integrated result). If any worker left a worktree behind despite instructions, remove it now (`git worktree remove \u003Cpath> --force`) before proceeding.\n5. Move to the next milestone.\n\nRe-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 it 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.\n\n---\n\n## Phase 3 - Final validation (orchestrator + user)\n\nGoal: confirm the saga's exit criteria are met, then hand off to the user for manual acceptance.\n\n1. Run the full saga-level exit criteria using the strongest available method (computer use for GUI\u002Fweb, interactive CLI for TUIs, the full test\u002Fintegration suite otherwise). Summarize the evidence against each exit criterion.\n2. Present the user a concise completion report: what was built, how each exit criterion was validated, and exact steps for them to manually verify (how to run\u002Flaunch, what to look for).\n3. **Loop in the user for manual acceptance** using the host's structured input tool when available, or directly in conversation otherwise: 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.\n\nOnly consider the saga complete when the user confirms acceptance.\n\n---\n\n## Resuming a saga\n\nBecause the saga directory and `PROGRESS.md` live in the target repository 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\u002Fcontinuing-a-saga.md` and follow it.**\n\n## Practical notes\n\n- Never commit or open PRs unless the user asks; follow the repo's version-control rules when you do.\n- Keep the spec tree current. If implementation forces a change to scope or criteria, update the relevant spec file rather than letting it drift.\n- For very large sagas (≈10+ concurrent workers), prefer remote execution so you don't exhaust the user's machine.\n- Don't expose internal worker agent IDs in user-facing summaries unless asked.\n\n## Reference files\n\n- `references\u002Fsaga-spec-template.md` - the saga directory layout and exact templates for `SAGA.md`, `MILESTONE.md`, task specs, and `PROGRESS.md`. Read before drafting specs.\n- `references\u002Fvalidation-strategies.md` - how to choose a validation method, write airtight criteria, and gather sufficient evidence. Read during Phase 1 (criteria) and Phase 2 (execution).\n- `references\u002Fcontinuing-a-saga.md` - how a fresh orchestrator picks up an existing saga directory and resumes safely. Read when asked to continue\u002Fresume a saga.\n",{"name":5,"description":7,"compatibility":44},"Requires subagent dispatch. Local repository tasks require git worktrees. Use the host's user-input mechanism when available, or ask directly in conversation.","main","d780499db4f8a16fdc74317b54bc44b5aa6df948","skills\u002Fdefault\u002Fsaga","https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills","https:\u002F\u002Fgithub.com\u002Fjapurcell","2026-11-13 07:27:52",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add japurcell\u002Fskills --skill saga",{"tool":57,"command":58},"bunx","bunx skills add japurcell\u002Fskills --skill saga",{"tool":60,"command":61},"pnpm","pnpm dlx skills add japurcell\u002Fskills --skill saga","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002FSKILL.md",true,[65,71,75,79,83,87,91,95,99,103,107,111,117,121,125,129,133],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"evals\u002Fevals.json","REFERENCE","参考文档",4065,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Fevals.json",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"evals\u002Ffiles\u002Fcache-refresh-repo\u002FAGENTS.md",351,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ffiles\u002Fcache-refresh-repo\u002FAGENTS.md",{"path":76,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":77,"sourceHtmlUrl":78},"evals\u002Ffiles\u002Fcache-refresh-repo\u002Fbrain\u002Findex.md",53,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ffiles\u002Fcache-refresh-repo\u002Fbrain\u002Findex.md",{"path":80,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":81,"sourceHtmlUrl":82},"evals\u002Ffiles\u002Fcache-refresh-repo\u002Fbrain\u002Fplans\u002Findex.md",23,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ffiles\u002Fcache-refresh-repo\u002Fbrain\u002Fplans\u002Findex.md",{"path":84,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":85,"sourceHtmlUrl":86},"evals\u002Ffiles\u002Fcache-refresh-repo\u002FREADME.md",471,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ffiles\u002Fcache-refresh-repo\u002FREADME.md",{"path":88,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":89,"sourceHtmlUrl":90},"evals\u002Ffiles\u002Fduplicate-avoidance\u002Fbrain\u002Fsagas\u002Flabel-copy\u002FPROGRESS.md",228,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ffiles\u002Fduplicate-avoidance\u002Fbrain\u002Fsagas\u002Flabel-copy\u002FPROGRESS.md",{"path":92,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":93,"sourceHtmlUrl":94},"evals\u002Ffiles\u002Fduplicate-avoidance\u002Fbrain\u002Fsagas\u002Flabel-copy\u002FSAGA.md",459,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ffiles\u002Fduplicate-avoidance\u002Fbrain\u002Fsagas\u002Flabel-copy\u002FSAGA.md",{"path":96,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":97,"sourceHtmlUrl":98},"evals\u002Ffiles\u002Fduplicate-avoidance\u002FREADME.md",224,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ffiles\u002Fduplicate-avoidance\u002FREADME.md",{"path":100,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":101,"sourceHtmlUrl":102},"evals\u002Ffiles\u002Fresume-saga\u002Fbrain\u002Fsagas\u002Fcache-refresh-20261105\u002FPROGRESS.md",640,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ffiles\u002Fresume-saga\u002Fbrain\u002Fsagas\u002Fcache-refresh-20261105\u002FPROGRESS.md",{"path":104,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":105,"sourceHtmlUrl":106},"evals\u002Ffiles\u002Fresume-saga\u002Fbrain\u002Fsagas\u002Fcache-refresh-20261105\u002FSAGA.md",616,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ffiles\u002Fresume-saga\u002Fbrain\u002Fsagas\u002Fcache-refresh-20261105\u002FSAGA.md",{"path":108,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":109,"sourceHtmlUrl":110},"evals\u002Ffiles\u002Fresume-saga\u002Fgit-state.txt",322,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ffiles\u002Fresume-saga\u002Fgit-state.txt",{"path":112,"resourceType":113,"resourceTypeDesc":114,"sizeBytes":115,"sourceHtmlUrl":116},"evals\u002Fgrade_evals.py","SCRIPT","脚本",10580,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Fgrade_evals.py",{"path":118,"resourceType":113,"resourceTypeDesc":114,"sizeBytes":119,"sourceHtmlUrl":120},"evals\u002Ftest_grade_evals.py",8441,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Fevals\u002Ftest_grade_evals.py",{"path":122,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":123,"sourceHtmlUrl":124},"README.md",5457,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002FREADME.md",{"path":126,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":127,"sourceHtmlUrl":128},"references\u002Fcontinuing-a-saga.md",3999,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Freferences\u002Fcontinuing-a-saga.md",{"path":130,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":131,"sourceHtmlUrl":132},"references\u002Fsaga-spec-template.md",6618,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Freferences\u002Fsaga-spec-template.md",{"path":134,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":135,"sourceHtmlUrl":136},"references\u002Fvalidation-strategies.md",4782,"https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fsaga\u002Freferences\u002Fvalidation-strategies.md",[138,164,185,210,232,250],{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":39},"01M6PT0ZTYCN4DHK3SXWS79WSY","spec-create","Create or revise a portable behavioral SPEC for a feature or whole product. Use when specifying a new idea, documenting an existing system for reimplementation, or defining a change while preserving compatibility. Implementation planning is a separate task.","https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fspec-create\u002FSKILL.md",[],[145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163],"create","spec","spec create","feature","planning","for","system","use","Existing","task","output","change","product","implementation","revise","compatibility","behavioral","idea","path",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":39},"01M6GSVHQ4MY4R4SMS8RY6324Q","prd-ralph","Complete at most one eligible unfinished PRD task, verify it, log progress, and optionally create one scoped commit.","https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fprd-ralph\u002FSKILL.md",[],[171,172,173,145,174,175,176,177,178,179,154,180,181,182,183,184,163],"prd ralph","ralph","prd","progress","verify","at","complete","commit","it","log","scoped","false","file","id",{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":191,"publishedAt":39},"01M6GSYMGHE2FEGEFKD926EJH8","fsdp-style-guide","Mandatory for all UI\u002FUX design, implementation, review, audit, or visual regression tasks. Always use for any work that affects user-facing appearance, behavior, accessibility, branding, layout, navigation, forms, dialogs, alerts, tables, or visual design.","https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fforest-service\u002Ffsdp-style-guide\u002FSKILL.md",[],[192,193,194,195,196,197,198,199,152,200,38,201,202,203,204,205,206,207,208,209,150],"fsdp style guide","style guide","FSDP","style","guide","visual regression","regression","design","visual","review","visual design","alerts","work","branding","layout","audit","ux","behavior",{"skillNo":211,"name":212,"nameZh":6,"description":213,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":214,"categories":215,"keywords":216,"publishedAt":39},"01M6GSYHEQARNM7WN0RJA7K7T2","agency-priorities","Provide self-contained USDA strategic goals and Forest Service priorities for agency briefings, proposals, and work-plan alignment. Use when explaining agency direction or evaluating how a project contributes to USDA and Forest Service priorities.","https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fforest-service\u002Fagency-priorities\u002FSKILL.md",[],[217,218,219,220,221,204,222,223,224,225,226,227,228,229,152,150,20,230,231],"agency priorities","priorities","agency","self","alignment","plan","goals","proposals","direction","how","project","strategic","service","briefings","self-contained",{"skillNo":233,"name":234,"nameZh":6,"description":235,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":236,"categories":237,"keywords":238,"publishedAt":39},"01M6GSY9VVN8RSJ5QYM540ZJ1D","accomplishment-report","Create a concise Forest Service executive accomplishment report when all work in an ExecPlan is completed, or update its existing report. Use at ExecPlan closeout and when asked to report completed work, agency alignment, and estimated AI-assisted versus human-only time and cost savings.","https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fforest-service\u002Faccomplishment-report\u002FSKILL.md",[],[239,240,221,241,145,204,242,243,244,245,176,219,246,229,152,247,248,249,153,20],"report","accomplishment report","cost","concise","human","time","update","only","closeout","savings","execplan",{"skillNo":251,"name":252,"nameZh":6,"description":253,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":254,"categories":255,"keywords":256,"publishedAt":39},"01M6GSY7J8ZMCE319P8Y6JZ432","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fjapurcell\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdefault\u002Fwriting-for-agents\u002FSKILL.md",[],[257,258,150,152,259,260,20],"writing","writing for agents","documents","editing"]