/tgc-skills:orchestrate-plan [plan-path] [agent=claude|codex]from tgc-skills
Executes a locked, reviewed PLAN.md by delegating implementation phases to worker agents (Orca, herdr, cmux), preserving pristine context per phase and supporting parallel workers for independent repos.
Ships in tgc-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are the orchestrator. You do NOT write the implementation. You split a locked plan into context-window-sized phases and drive one or more worker agents in other terminals: hand each worker one phase, give it a pristine context before every phase, verify each phase, then move on, while keeping your own context clean enough to run the whole plan.
When the plan touches independent repos (e.g. an api service and a web frontend that both
code to a contract the plan already fixes), run one worker per repo in parallel and babysit
them all from one monitor loop.
Three non-negotiables:
/clear (never /compact) on herdr and
cmux, a fresh worker process on Orca. The worker re-grounds from disk (plan, brief, git log).Prerequisites: a locked plan (written AND reviewed; if there is none, write one and get it
approved first), and a session inside Orca, herdr, or cmux. Orca users also need Orca's own
skills: orca skills install --skill orca-cli --skill orchestration.
sh "${CLAUDE_PLUGIN_ROOT}/scripts/detect-backend.sh"
It prints orca, herdr, cmux, or none. On none, tell the user and stop (see Fallback).
Otherwise read only this skill's references/<backend>.md and references/templates.md, run
the backend's Gate section, and use that file for every backend command below: worktree, start,
send, read, wait, answer, next phase, close.
Resolve the inputs: PLAN_FILE as an ABSOLUTE path (every phase prompt hands it to a worker),
the target repo(s), and the worker engine (agent=claude by default, agent=codex on request).
Read the plan and any companion docs ONCE to derive the phases, then rely on disk, not memory.
| Claude Code (default) | Codex (on request) | |
|---|---|---|
| Launch | claude --model sonnet --effort high | codex -c model_reasoning_effort=medium |
| Effort | Launch flag; /clear reverts to it, so it survives every phase | Launch flag, process-level; Codex has no /effort |
| Fresh context | /clear | /clear |
The backend file has the exact launch for each engine. The plain launch is the default:
workers pause on permission prompts and Phase 4 answers them. Skip-permission launchers
(claude --dangerously-skip-permissions, codex --dangerously-bypass-approvals-and-sandbox) let a
worker run any command unattended, so a malicious repo instruction or hook can delete data or leak
credentials. Use them only on the user's explicit opt-in, in a sandboxed or disposable
environment. Never pick them silently.
If the user has shell aliases, check what they expand to first (type claude codex): a
plain-looking claude aliased to a skip-permissions flag defeats the default. Never pass a flag
the alias already sets; Codex rejects a duplicated flag and the launch dies at the shell prompt.
Confirm the banner shows the intended model and effort before sending any work.
Parse the plan into an ordered list of phases, each sized to ONE worker context. Don't over-fragment into one-commit tasks, and don't bundle unrelated areas. For each phase record:
Detect parallel lanes. Group phases by repo. Repos that progress independently, each coding to a contract the plan already pins down, become parallel lanes, one worker per repo. If a phase in repo B needs a not-yet-built phase in repo A, keep them sequential or start lane B later. When unsure, stay sequential and say why.
Track progress. One todo per phase, in execution order; inside a lane each phase blocks the
next, and lanes do not block each other. On Orca the backend file turns this into tasks with
--deps. If a list already exists because you were resumed, reuse it.
Name the change, not the run. Derive ONE kebab-case change slug from the plan's goal, two
to five words saying what the branch delivers (invoice-pdf-export, oauth-token-refresh). Every
branch and worktree uses it, and every lane shares it, so the pieces of one change stay
recognizable across repos. Two lanes in the SAME repo get <slug>-<what-differs>. Never name a
branch after the machinery (lane-*, worker-*, phase-*, the repo name, the plan file). Pane
and tab titles are the exception: lane-<repo> is right there. A branch name in the plan wins; a
name from the user wins over both.
Present the phase list and the lane plan (sequential or N parallel workers) and get the user's
confirmation before starting any worker. Mark a phase in_progress when you hand it over and
completed only after V1 passes; at most one in_progress per lane.
Pick the base by topology, not by label. Resolve the default branch with
gh repo view --json defaultBranchRef --jq .defaultBranchRef.name and fetch it. If the plan names
another base, compare it with git rev-list --count A..B in both directions; a candidate far ahead
and zero behind is the live trunk whatever its name.
For EACH lane:
git status --porcelain shows nothing but known untracked planning
files. Anything else → stop and ask the user to commit or stash. Run git config push.default;
if it prints upstream, set it to current for this repo, since upstream sends a plain push
to whatever the branch tracks.--no-track (or upstream unset afterwards). One worktree
per lane is the default: dev servers and watchers run from the user's primary checkout, and a
worker there would live-mutate what they serve. Work in the primary checkout only when the user
says so and nothing long-running serves from it. A worktree does not protect the remote; the
push rules still apply.git -C '<worktree>' rev-parse HEAD, written as the LITERAL hash into
the lane ledger along with the worktree path and the worker handles. Shell variables do not
survive between your tool calls.WORKER-BRIEF.md in the worktree root, untracked.For parallel lanes, prepare every lane before Phase 3 so all workers are armed.
worker_done), and STOP.working state, not the prompt sitting in the input box.A wait or monitor return is a wakeup, not a verdict. On every wake, read each active lane yourself and classify what you actually see. A worker waiting on a question is a persistent state, not a fresh event, so a monitor can sit on it forever; if you catch yourself waiting for one to re-fire, sweep every lane now. Keep a ledger: before you rest, every lane is BUSY or serviced this cycle. Two lanes needing you in the same window is normal; handle them all.
Check in this priority order:
(y/n), or a question with an empty
input box. Act first: the worker is fully stalled. If the plan, the brief, or obvious convention
answers it, answer with the backend's Answer section. Deny any push, merge, or action outside the
lane's scope. A real decision, a gated step, or anything irreversible → escalate to the user,
pause the lane, and keep its phase in_progress. A quiet lane with a pending prompt is never
DONE.worker_done) and idle → V1, then advance the lane.BLOCKED: line (Orca: --outcome failed or an escalation) → resolve from the plan
or brief if you safely can, else escalate.BLOCKED: → send please continue. If it lost
its task, re-send the phase prompt.Loop until every lane is complete or a hard escalation. Report progress in a few lines.
When every lane is verified, ask the user once: "all lanes verified, ship them?". On yes, ship
each lane yourself. First delete the lane's untracked brief (rm '<worktree>/WORKER-BRIEF.md')
and require git -C '<worktree>' status --porcelain to print nothing, because ship refuses a
dirty tree. Then one fresh general-purpose subagent per lane reads and follows
${CLAUDE_PLUGIN_ROOT}/skills/ship/SKILL.md from that lane's worktree. Ship is explicit-only, so
it cannot be invoked as a skill, and a read file keeps its placeholders: tell the subagent to
replace each CLAUDE_PLUGIN_ROOT placeholder in it, and in every plugin file it points to, with ${CLAUDE_PLUGIN_ROOT}. Its output stays out of your context. At most 2 ships at a time; queue the
rest. Relay every PR URL and review outcome in one final report. Workers never run ship: a ship
started in a worker races the orchestrator's push.
| tail -N (8–40 lines), never full scrollback.=== PHASE <N> DONE ===. Keep that
text out of any busy regex. Match it as a whole line, allowing only the agent's bullet or indent
before it (^[^[:alnum:]=]*=== PHASE [0-9]+ DONE ===[[:space:]]*$), because the echoed prompt quotes it
mid-line.BLOCKED: push requested instead. Pushing
happens after the Phase 5 gate, through tgc-skills:ship. Any push you make yourself uses an
explicit refspec, git push origin HEAD:refs/heads/<lane branch>, never a bare git push whose
destination depends on tracking and push.default.git revert
(never force-push shared history), rebuild the feature branch on top of the revert, and tell the
user immediately.On none, tell the user and stop. Suggest /tgc-skills:orchestrate instead: each phase becomes
one fresh in-session subagent (a new subagent is a pristine context), and independent lanes run as
parallel subagents. It loses live visibility and mid-phase intervention, so prefer a real backend
when one is available.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
14 skills in this plugin
/checkpointUse when the user wants current work saved to the branch mid-flow without ending the task — "checkpoint", "commit and push", "save and push", "push what we have", optionally with a review ask ("checkpoint and review")./cmux-orchestrateUse when orchestrating cmux terminal panes, splits, tabs, worker sessions, or agents in other cmux panes, including reading screens, sending commands, answering prompts, jumping to unread activity, or setting AFK check-ins. Do not use for tmux, IDE/browser tabs, deployment replicas, or plain command execution./explain-prUse before shipping, when the user wants to understand their own branch — "explain what we did", "walk me through this branch", "what am I about to ship", "why did we change that", or any ask to account for the current diff before running tgc-skills:ship. Explains the change back to the user and flags anything it cannot justify. Read-only; not a PR description writer, not a code review.npx claudepluginhub eternalllight/tgc-skills --plugin tgc-skillsOther plugins' skills for the same job