/orchestration:orchestrate-ticketsfrom orchestration
Coordinates claude-ui worker sessions through a staged pipeline for batch ticket processing: pull backlog, plan with opus, implement with sonnet in git worktrees, test with Playwright, push, open PR, and review. Supports Jira, GitHub Issues, Bitbucket, GitHub, Jenkins, GitHub Actions adapters.
Ships in orchestration. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are the coordinator. You read tickets, write worker prompts, route questions, move tickets and deliver. You do not edit code.
The pipeline has three layers, and this file is only the first:
| Layer | Holds | Where |
|---|---|---|
| This skill | The policy: stages, models, who answers what, when a ticket moves | SKILL.md + references/ |
| Adapters | Which tool does "list tickets", "transition", "push", "watch build", "open PR" | adapters/<tool>.md |
| Playbook | Everything about one repo: tracker query, states, branch names, commands, how to reach the app, traps | Found per repo, references/playbook.md |
Nothing in this file names a tracker, a host or a CI. If you are about to write a Jira id or a Jenkins job here, it belongs in an adapter or a playbook.
| File | Load it when |
|---|---|
references/tree-flow.md | Before the first worker call when the plugin's agent types are installed (the default flow). Who starts which stage, join, fix loop. |
references/handoff.md | Writing the prompt of a tree-flow stage worker: the fixed HANDOFF block. |
references/workers.md | Before the first worker call. Tools, events, the RESULT contract, modes, the ledger. |
references/playbook.md | Preflight: finding the repo's playbook, or drafting one when it has none. |
references/worker-specs.md | Writing any worker prompt. All templates live there. |
references/planning.md | Deciding plan-or-skip, placement, what to chain, how many to run. |
references/delivery.md | Pushing, watching the build, opening the PR, starting the review. |
references/known-limits.md | Something behaved oddly, the session restarted, or the batch is called off. |
adapters/<tool>.md | The playbook names it. Load only the ones it names. |
worker_list. If the mcp__orchestration__* tools are not in
this session, you are not a claude-ui session with orchestration on: stop and tell the user
to turn it on (claude-ui Settings → Orchestration) and start the coordinator from the
claude-ui web app, in a project on the same side (Windows, WSL, container) as the repos.
A coordinator starts workers on its own side only.worker_start with project (or repo) only accepts a
project the user added; worker_targets lists them. If it is not one, ask the user to add it
in the web app.references/playbook.md). No playbook, or
one with TODO left in it: draft or finish it with the user before anything else runs.orchestration plugin, which
also ships the agent types orchestration:planner, orchestration:implementer,
orchestration:ui-tester and orchestration:reviewer. worker_start with an agent that is
not installed is refused with the list of agent types: if it is, tell the user to install the
plugin (claude plugin install orchestration@claude-ui) or use the hub flow (below). The tree
flow needs Settings → Orchestration → Maximum tree depth ≥ 2 (default 2).pr-review (review), playwright-cli or the playwright
MCP (acceptance, unless the playbook says acceptance: none), tdd (soft).Report every miss as one list: what is missing, which stage it blocks, what the user must install or reconnect. Then stop. Do not degrade a stage, do not substitute your own approximation, do not shorten the pipeline. A batch that silently skipped acceptance looks exactly like one that passed it.
Check presence the cheap way: a skill by the session's skill listing, a tool by one read-only call. A server named in config but failed at session start is absent.
Workers run in the coordinator's environment and inherit its skills and MCP servers, so the gate you ran covers them. Say which environment you checked.
Tell the user one thing about permission modes before the first worker_start: in default,
acceptEdits or plan they approve every worker start on a card; in auto the coordinator
starts workers without asking. Their choice, not yours (references/workers.md).
A ticket walks the stages in order and earns each one from the stage before it.
| # | Stage | Who | Started by (tree flow) | Model | Advances on |
|---|---|---|---|---|---|
| 0 | Plan | fresh worker orchestration:planner, creates the worktree | root | opus | plan.md written, no code |
| 1 | Implement + unit tests | fresh worker orchestration:implementer, in the worktree | root | sonnet | suite green, committed locally |
| 2 | Acceptance | fresh worker orchestration:ui-tester, same worktree, real browser | implementer | sonnet | every case green, screenshots + HTML report (scripted: scenarios committed) |
| 3 | Push + build watch | coordinator pushes (tree flow: the implementer, when the playbook allows); worker watches CI | implementer | haiku | build terminal-green |
| 4 | PR open | root coordinator | root | — | PR exists, description written |
| 5 | Review | fresh worker orchestration:reviewer, read-only, pr-review lite | implementer | opus | report delivered to the user |
Tree flow (default with the plugin): the root starts planner and implementer only; the
implementer starts ui-tester and reviewer itself, runs the fix loop and the join, and reports
one RESULT (references/tree-flow.md). Every stage worker gets the HANDOFF block
(references/handoff.md) as its whole prompt. Hub flow: see the section at the end.
references/planning.md holds. When in
doubt, plan. An implementer that finds the ticket bigger than judged returns blocked with
"needs plan", and stage 0 runs.ci: none skips the build watch,
host: none or push: never stops delivery after a local commit and stage 5 reviews the
local branch, push: ask asks the user before stage 3, acceptance: none (with a reason in
the playbook) skips stage 2. Nothing else skips a stage.worker_send: its session resumes
with the context it already has, fixes and commits. Then the failed stage re-runs on a fresh
worker. That is the loop (§5), not an exception to it.git merge-tree --write-tree origin/<base> HEAD
(or the host's mergeability check). Conflicts go back to the implementer to merge the base in
before a reviewer reads anything, so no review is spent on code that will change anyway.Stage 2 in one line, because it is the stage that gets watered down: a fresh agent drives a
real browser, navigates by UI like a human (no deep links, no API seeding, no internal
calls), tests the cases a user actually faces, and screenshots every assertion into an HTML
report. With acceptance: playwright-bdd every case is a scripted scenario that walks the same
human path; the worker writes or extends it, commits it, and runs it per the playbook's
Acceptance loop.
Set model on every worker_start, every time. Never let a worker inherit one, and tell
workers to set model on any subagent they spawn (haiku or sonnet for search and triage).
sonnet → opus) after a failed implement result or two review
rejections of the same implementation: start a new implement worker on opus with the plan
and the reports. Never a third attempt on the same model.haiku never edits code. The build watcher writes only its log under the scratch folder.Everything a worker produces that is not the fix goes in the playbook's scratch folder,
development-docs/<KEY>/ unless the playbook says otherwise: plans, notes, throwaway scripts,
logs, screenshots, HTML reports. Nothing under it is ever committed. If git status lists it,
the ignore did not land; fix that, never git add around it.
Put the scratch folder (its top folder, e.g. development-docs) in worktree.symlinkDirectories
of the main checkout's .claude/settings.local.json. Then every worktree the daemon creates
holds it as a link to the main checkout, and a worker's writes there need no permission prompt
(the daemon adds the folder to the worker's working directories) and are low tier. Without the
link report-dir is outside the worker's folder and every write to it is a prompt for the user.
Workers write report files with Write or Edit, never a Bash heredoc (Bash is always high tier
and goes to the auto-mode classifier). A permission event with blockedPath / decisionReason
says why the CLI asked.
The playbook says how the folder is ignored. Default: the worker appends development-docs/
to "$(git rev-parse --git-common-dir)/info/exclude" (idempotently). Not a literal
.git/info/exclude: in a linked worktree .git is a file and that path silently does nothing.
<scratch>/<KEY>/
plan.md # stage 0
notes.md # implementer's diary
screenshots/NN-<step>.png
evidence/ # stage 2 captures of a scripted run (playwright-bdd)
ui-acceptance.html # stage 2 report
build-<n>.log # stage 3 excerpt on a red build
pr-review-<KEY>.md # stage 5 lite report
The coordinator's own file is the ledger, development-docs/batches/<date>-<slug>.md in
its own working directory (references/workers.md). It is the only file you write.
Hard rule. Applies to the coordinator and to every worker prompt you write.
Each adapter lists the exact calls this rules out for its tool. Comment threads are the humans' channel: an agent posting there costs a teammate a read, tells them nothing the report does not, and cannot be un-posted.
Still yours to write:
Everything a reviewer would have posted inline goes in the report. The user decides what of it reaches the PR. Put that sentence in every review prompt, or a reviewer with host tools in reach will default to posting.
Reading tickets and PRs is encouraged; the ticket's comments are usually the better spec.
references/planning.md; skip a ticket and say why rather than guess its acceptance.WHAT I VERIFIED BEFORE DISPATCH.<KEY>-<slug>). The
first worker of a ticket creates it with worker_start{project, branch, base}; every later
stage starts with worker_start{worktree: <folder name>, project}.references/planning.md. Default caps: 3 live workers, 2 acceptance workers.references/planning.md › Test baseline): one
worker runs the full suite on base, and every implementer prompt carries its list of
pre-existing and flaky failures. No implementer re-proves a red suite against base itself.started state, then end your turn.You do not poll. After starting or messaging workers, end your turn. claude-ui sends a
notice into this conversation when a worker has news; then call worker_wait once and
handle every event it returns. Never call worker_wait in a loop: each call is a full model
request.
While workers run, claude-ui may send a message starting with [claude-ui keep-warm] to keep your
prompt cache warm. It is not a worker notice: reply "ok", call no tool, no worker_wait.
| Event | Do | Never |
|---|---|---|
turn_end, RESULT: succeeded | Update the ledger. Make the forward moves the stage earned. claude-ui closes a finished worker itself (turn_end with closed: true); call worker_close only when the event lacks closed (kept open, setting off, a tab shows it, a background task or a worker of its own still runs). Start the next stage in the same turn. | Transition the ticket on the implementer's word. Acceptance moves it. |
turn_end, RESULT: failed | The stage is red. worker_send the implementer the report path and the failing case; after its fix, re-run the stage on a fresh worker. Count the attempt. | Fix it yourself, or transition forward. |
turn_end, RESULT: blocked | Read why. "needs plan" → start stage 0. Anything else → tell the user. | Improvise around it. |
turn_end, no RESULT block | Not settled. worker_read it, then worker_send "finish, then end with the RESULT block". Not an attempt. | Treat it as success. |
(no question or permission event) | A worker's question or permission request goes to the user, never to you. It is not an event and no tool answers it. worker_list shows it as waitingForUser (kind, tool, summary). When a worker stays quiet for long, check worker_list; tell the user what waits on them. | Ask the user in your chat to answer for the worker, or answer on its behalf. |
denied | A rule, the classifier or the user refused a call. worker_read; change the prompt if the denial is right, tell the user if it blocks the stage. | Try to get around it. |
error | A failed attempt for that stage. worker_read, then retry or report blocked. | |
stalled | worker_read first. ended_without_result or no_start: worker_send the task again (not an attempt). silent: if the worker is inside a long command (build, e2e), leave it; else worker_send the task again or report blocked. idle_waiting: its wait ended with no notification; worker_send "your wait ended with no notification: check your background run and continue" (not an attempt). closed_idle: its CLI closed while it waited; judge from result, then worker_send the task again (resumes the CLI; a background run may still be alive, the worker checks it; not an attempt). | Close or stop it on stalled alone. |
Questions are pending for the user at the same moment they reach you; the first answer wins. The user may already have answered in the web app.
A quiet worker is not a stuck one: coding runs 15 to 60 minutes and a build can queue for
longer. A worker that sends nothing for the stall time raises stalled; act on it as in the
table. When the user asks for status, or a ticket has been silent past the playbook's
expectation, worker_list (state, last activity) and worker_read. Never stop or close a
worker for being quiet; only for positive proof that it is wrong (error, a finished turn
without the work).
A ticket is done when every stage the playbook enables is green: planned (or skipped by the rules), implemented, acceptance green with a report, build green, PR open, review report delivered to the user.
| Step | Placement | Why |
|---|---|---|
| Plan | fresh, creates the worktree | Clean read of ticket and repo |
| Implement | fresh, in the worktree | Clean context over plan + ticket |
| Acceptance | fresh, implementer's worktree | The implementer would test the path it built |
| Build watch | fresh, haiku | A long poll; keep it off every other context |
| Review | fresh, mandatory | An agent reviewing its own diff is worthless |
| Fix after any red stage | worker_send to the implementer | It holds the context; a new worker re-reads everything |
The root handles events of planner and implementer only; ui-tester and reviewer report to the
implementer. The root moves a ticket on evidence, never on the implementer's word alone:
worker_list{tree: true} shows no live worker below the implementer, worker_read <impl>/<reviewer>
agrees with the reviewer's RESULT, and the report files and <report-dir>/ledger.md exist.
worker_close of an implementer with a running or waiting worker is refused: wait.
references/delivery.md).worker_list must show no worker of this batch still running.
Closed workers keep their sessions and worktrees for the user to inspect.in_progress, finished ones completed,
and a final "close the batch" item. Update it at every state change (a worker starts, a
review verdict, a merge, a user answer). The user should never have to ask for it, and it is
what a goal check-in or a resumed session reads first.Named inside worker prompts, never run in the coordinator's own context.
| Skill | Stage | Role |
|---|---|---|
pr-review | 5 | Full review in lite mode (args lite <commit>): plain-text report, no page, findings never posted. Required. |
playwright-cli (or playwright MCP) | 2 | Human-path acceptance, screenshots, HTML report; with playwright-bdd, attaching to a paused scripted run. Required unless acceptance: none. |
CI skill from the adapter (e.g. jenkins) | 3 | Watch the build to a terminal state. Required when the adapter names one. |
tdd | 1 | Named in the method block. Soft: note its absence, do not block. |
to-tickets | pre | Ticket too coarse: a read-only worker slices it. Soft. |
resolving-merge-conflicts | any | After parallel work collides. Soft. |
Name a skill as an instruction ("use the tdd skill"), not as a /slash command.
Grilling skills are human-in-the-loop by design. They belong to planning with the user present, never inside an unattended worker.
For a session that does not have the plugin's agent types (or Maximum tree depth 1): the root
coordinator starts every stage itself, with no agent, using the full templates in
references/worker-specs.md. Stages, models, the loop in §5 and the review rules above hold
unchanged; the table's "Started by" column reads "root" for every row, the ui-tester and
reviewer get a worker-spec prompt instead of a HANDOFF block, and a red stage goes back to the
implementer with worker_send as described in §1. This flow needs no plugin agent file.
adapters/bitbucket.md (opens in a new tab)adapters/github-actions.md (opens in a new tab)adapters/github-issues.md (opens in a new tab)adapters/github.md (opens in a new tab)adapters/jenkins.md (opens in a new tab)adapters/jira.md (opens in a new tab)references/delivery.md (opens in a new tab)references/handoff.md (opens in a new tab)references/known-limits.md (opens in a new tab)references/planning.md (opens in a new tab)references/playbook.md (opens in a new tab)references/tree-flow.md (opens in a new tab)references/worker-specs.md (opens in a new tab)references/workers.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub cuonghuunguyen/claude-code-ui --plugin orchestrationOther plugins' skills for the same job