Execute task per plan
Act as the orchestrator. Detect the input shape, pick a mode, and run that
mode's procedure from its reference file. The flow is grill → do → PR: every
run ends by finishing per reference/finish.md — the pull request(s) are the
deliverable.
Principle: the developer starts the run and returns on notification.
Input
$ARGUMENTS — one of:
- empty — no input; work from the current conversation (inline)
- a plain task description — chat text, no ticket (inline)
- a single issue URL, a bare
<slug>, or a *-task.md path (sub-agents)
- a
*-plan.md path — a pre-built plan (sub-agents, back-compat)
- a PRD issue that has GitHub sub-issues (team)
- a Draft PR URL, or a bare
<slug> whose .yoke/ai/<slug>/<slug>-draft.md exists (draft execution)
Optional flag --update-docs enables the documentation step. Without it, /do
skips docs unless the plan's frontmatter sets update_docs: true.
Router
Detect the mode from $ARGUMENTS. First match wins:
$ARGUMENTS is a path ending -plan.md → sub-agents mode. A plan
already exists, so skip planning. Read the file's **Mode:** header for
back-compat — an agent-team header maps to team mode instead. Then read
and follow reference/mode-sub-agents.md (or reference/mode-team.md when
the header says agent-team).
$ARGUMENTS is a GitHub pull-request URL (path contains /pull/), or a
bare <slug> for which .yoke/ai/<slug>/<slug>-draft.md exists →
draft execution mode: a /draft run marked the code and opened the
Draft PR; implement it per the review. Read and follow
reference/mode-draft-execution.md.
$ARGUMENTS is a single issue URL, a bare <slug>, or a *-task.md
path → sub-agents mode (investigate → plan → pause → execute). Read and
follow reference/mode-sub-agents.md.
$ARGUMENTS points at a PRD issue that HAS sub-issues (detect via
gh api) → team mode. Read and follow reference/mode-team.md.
- empty / a plain chat description / no ticket → inline mode. Read and
follow
reference/mode-inline.md.
Each mode's full procedure lives in its reference file. Read only the one this
ladder selects, then execute it.
Modes
| Mode |
Input |
Behavior |
| inline |
empty / plain chat description |
Brief plan in chat, execute in-session, then finish per reference/finish.md. |
| sub-agents |
issue URL / <slug> / *-task.md / *-plan.md |
Write the plan, pause only on cold start, executor → reviewer → validator, then finish. |
| draft execution |
Draft PR URL / drafted <slug> |
Implement the Markup per the review (comments > markers > plan), reply in the threads, flip the PR to ready, then finish. |
| team |
PRD issue with sub-issues |
Write the plan, pause only on cold start, dispatch sub-agents per sub-issue, then finish. |
Principles
These hold for every mode run:
- Worktree on default branch. Before touching code (after the cold-start
pause, if any), enter a worktree per
reference/finish.md §2 when the run
starts on the default branch.
- Finish at PR. Once the tasks are done, hand off to
reference/finish.md
§3-§7: finish each repo by its finish policy from the flow map, comment on
the ticket, and send the notify carrying the PR link(s).
- Pause only on cold start. The plan-confirmation pause fires only when no
grill preceded in the session and no approved plan was handed in. A plan
already agreed in grill runs straight through.
- Never merge, except one signal. An explicit "straight to main" from the
user is the single merge exception (
reference/finish.md §6). Otherwise do
finishes at the PR and never merges; it never runs deploy or release.
- Artifacts under
.yoke/. Every file do writes lives under .yoke/.
- Commits by convention. Format, ticket ID, and git initiative — from
${CLAUDE_PLUGIN_ROOT}/skills/gca/reference/commit-convention.md (see its
"Git initiative and defaults"). Do not ask "commit?" mid-run.
- Read the git memory first. Before modifying a file, read its recent
commit history per
${CLAUDE_PLUGIN_ROOT}/skills/gca/reference/history-reading.md. A
Constraint: or Directive: that conflicts with the plan is surfaced,
not silently overridden; a Rejected: approach is not re-proposed
without new evidence.
- Review after each task. Spec compliance → code quality. Mandatory.
- Context isolation. A sub-agent receives only its own task text, not the
whole plan.
- CLI output. Run commands with long output (formatter, lint, build, test)
with
2>&1 | tail -20.
- Language: match the ticket/input language, or follow the project-level
definition in CLAUDE.md / AGENTS.md.
Report
Sub-agents and team modes write .yoke/ai/<slug>/<slug>-report.md and append the finish block from reference/finish.md §7; inline prints its summary in chat. Full template: reference/report-format.md.
1---2name: do3description: Executes a task per plan. Triggered when the user writes "execute", "do", "run the plan", "implement", or passes a path to a plan file and asks to execute it.4---56# Execute task per plan78Act as the orchestrator. Detect the input shape, pick a mode, and run that9mode's procedure from its reference file. The flow is **grill → do → PR**: every10run ends by finishing per `reference/finish.md` — the pull request(s) are the11deliverable.1213**Principle:** the developer starts the run and returns on notification.1415---1617## Input1819`$ARGUMENTS` — one of:2021- **empty** — no input; work from the current conversation (inline)22- **a plain task description** — chat text, no ticket (inline)23- **a single issue URL**, a bare `<slug>`, or a `*-task.md` path (sub-agents)24- **a `*-plan.md` path** — a pre-built plan (sub-agents, back-compat)25- **a PRD issue that has GitHub sub-issues** (team)26- **a Draft PR URL**, or a bare `<slug>` whose `.yoke/ai/<slug>/<slug>-draft.md` exists (draft execution)2728Optional flag `--update-docs` enables the documentation step. Without it, /do29skips docs unless the plan's frontmatter sets `update_docs: true`.3031---3233## Router3435Detect the mode from `$ARGUMENTS`. First match wins:36371. **`$ARGUMENTS` is a path ending `-plan.md`** → **sub-agents** mode. A plan38 already exists, so skip planning. Read the file's `**Mode:**` header for39 back-compat — an `agent-team` header maps to **team** mode instead. Then read40 and follow `reference/mode-sub-agents.md` (or `reference/mode-team.md` when41 the header says `agent-team`).422. **`$ARGUMENTS` is a GitHub pull-request URL (path contains `/pull/`), or a43 bare `<slug>` for which `.yoke/ai/<slug>/<slug>-draft.md` exists** →44 **draft execution** mode: a `/draft` run marked the code and opened the45 Draft PR; implement it per the review. Read and follow46 `reference/mode-draft-execution.md`.473. **`$ARGUMENTS` is a single issue URL, a bare `<slug>`, or a `*-task.md`48 path** → **sub-agents** mode (investigate → plan → pause → execute). Read and49 follow `reference/mode-sub-agents.md`.504. **`$ARGUMENTS` points at a PRD issue that HAS sub-issues** (detect via51 `gh api`) → **team** mode. Read and follow `reference/mode-team.md`.525. **empty / a plain chat description / no ticket** → **inline** mode. Read and53 follow `reference/mode-inline.md`.5455Each mode's full procedure lives in its reference file. Read only the one this56ladder selects, then execute it.5758---5960## Modes6162| Mode | Input | Behavior |63| ------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |64| **inline** | empty / plain chat description | Brief plan in chat, execute in-session, then finish per `reference/finish.md`. |65| **sub-agents** | issue URL / `<slug>` / `*-task.md` / `*-plan.md` | Write the plan, pause only on cold start, executor → reviewer → validator, then finish. |66| **draft execution** | Draft PR URL / drafted `<slug>` | Implement the Markup per the review (comments > markers > plan), reply in the threads, flip the PR to ready, then finish. |67| **team** | PRD issue with sub-issues | Write the plan, pause only on cold start, dispatch sub-agents per sub-issue, then finish. |6869---7071## Principles7273These hold for every mode run:7475- **Worktree on default branch.** Before touching code (after the cold-start76 pause, if any), enter a worktree per `reference/finish.md` §2 when the run77 starts on the default branch.78- **Finish at PR.** Once the tasks are done, hand off to `reference/finish.md`79 §3-§7: finish each repo by its finish policy from the flow map, comment on80 the ticket, and send the notify carrying the PR link(s).81- **Pause only on cold start.** The plan-confirmation pause fires only when no82 grill preceded in the session and no approved plan was handed in. A plan83 already agreed in grill runs straight through.84- **Never merge, except one signal.** An explicit "straight to main" from the85 user is the single merge exception (`reference/finish.md` §6). Otherwise `do`86 finishes at the PR and never merges; it never runs deploy or release.87- **Artifacts under `.yoke/`.** Every file `do` writes lives under `.yoke/`.88- **Commits by convention.** Format, ticket ID, and git initiative — from89 `${CLAUDE_PLUGIN_ROOT}/skills/gca/reference/commit-convention.md` (see its90 "Git initiative and defaults"). Do not ask "commit?" mid-run.91- **Read the git memory first.** Before modifying a file, read its recent92 commit history per93 `${CLAUDE_PLUGIN_ROOT}/skills/gca/reference/history-reading.md`. A94 `Constraint:` or `Directive:` that conflicts with the plan is surfaced,95 not silently overridden; a `Rejected:` approach is not re-proposed96 without new evidence.97- **Review after each task.** Spec compliance → code quality. Mandatory.98- **Context isolation.** A sub-agent receives only its own task text, not the99 whole plan.100- **CLI output.** Run commands with long output (formatter, lint, build, test)101 with `2>&1 | tail -20`.102- Language: match the ticket/input language, or follow the project-level103 definition in CLAUDE.md / AGENTS.md.104105---106107## Report108109Sub-agents and team modes write `.yoke/ai/<slug>/<slug>-report.md` and append the finish block from `reference/finish.md` §7; inline prints its summary in chat. Full template: `reference/report-format.md`.