/tgc-skills:orchestrate [plan-path]from tgc-skills
Splits large locked implementation plans into context-window-sized phases and dispatches fresh subagents per phase. Use when a plan is too big for one context window.
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.
None: SKILL.md is the whole skill.
You are the orchestrator (manager). You do NOT write the implementation yourself.
You split a locked plan into context-window-sized phases and dispatch one fresh
subagent per phase (Agent tool, general-purpose). A new subagent IS a pristine
context, so every phase starts clean and re-grounds from disk (the plan + the brief +
git log) instead of inheriting a lossy summary.
Three non-negotiables:
git log fresh — it inherits nothing from you or the previous phase.Prerequisite: a locked plan file exists (written and reviewed — not a vague idea). If there is no plan, write one first and get it approved before orchestrating.
If sh "${CLAUDE_PLUGIN_ROOT}/scripts/detect-backend.sh" prints a backend (Orca, herdr, or cmux), offer tgc-skills:orchestrate-plan (visible worker agents) as the alternative, or tgc-skills:orchestrate-list for a list of independent fixes.
Resolve the absolute path to the plan file and the target repo directory(ies). Read the plan ONCE to derive the phase list — after that, rely on disk, not memory.
Parse the plan into an ordered list of phases. For each phase record:
Detect parallel lanes. Group phases by repo. If the plan spans multiple repos that can progress independently — each side codes to a contract the plan already pins down, with no phase in repo A needing a not-yet-built phase in repo B — mark them as parallel lanes and dispatch one agent per lane concurrently (multiple Agent calls in a single message). If phases cross-depend, keep them sequential. When unsure, default to sequential and say why.
Track progress. Create one todo/task per phase in execution order so progress
survives compaction. Within a lane, phases run strictly in order; at most one phase
in_progress per lane.
Then present the phase breakdown + lane plan to the human and get confirmation before dispatching anything. If the session is running autonomously toward an already-approved goal, state the breakdown and proceed.
Pick the branch base from the remote (per repo). Resolve the GitHub default branch and fetch its current tip:
DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')
git fetch origin "$DEFAULT_BRANCH"
Use origin/$DEFAULT_BRANCH unless the approved plan explicitly names another base.
If it does, fetch that ref and verify its relationship to the default branch with
git merge-base --is-ancestor before creating the feature branch.
Create one session directory for the whole run outside every repo, before touching any lane:
SESSION_DIR=$(mktemp -d "${TMPDIR:-/tmp}/tgc-orchestrate.XXXXXX")
Keep it for the lifetime of the run; the lane briefs live inside it. When the run ends — whether every lane finished, a lane failed, or the user aborted — remove it as the final step so temporary briefs never linger:
rm -rf "$SESSION_DIR"
For each lane:
git status --porcelain and stop on staged,
unstaged, or untracked work. Create the feature branch off the verified remote base.
Never work on the default branch; never force-push.<SESSION_DIR>/<lane>-WORKER-BRIEF.md as the standing orders every phase agent
re-reads. Pass its absolute path in every phase prompt. Never create cleanup artifacts
in the repo root.run: lines
reproduce action steps, matrices, services, or external checks. If no local gate
exists, say CI is authoritative instead of inventing one.# Worker Brief — <plan title> — <repo> lane
You are executing ONE phase of a locked plan with a fresh context. At the start you MUST:
1. Read the full plan at <ABSOLUTE PLAN PATH> (the authoritative spec).
2. Read this brief.
3. Run `git log --oneline -20` to see which phases are already committed.
4. Implement ONLY the phase named in your prompt, up to its stated stop point.
## Ground truth (overrides any stale wording in the plan)
- Repo: <abs path>. Branch: <feature-branch> (off <verified remote base>). Never switch
branches; never touch the default branch; never force-push.
- Already done / out of scope: <what's committed; what NOT to do>.
- Contracts this builds against: <pinned API shapes etc.>.
## Conventions (from the repo's CLAUDE.md / AGENTS.md)
- Commits: <repo-documented or recent-log convention; conventional fallback>.
- <lint / typecheck / test commands>.
- Code comments must never reference the plan or its scaffolding (no "Phase N",
"per the plan", banner separators). Comment only non-obvious WHY.
## Per-phase workflow
1. Implement the one named phase, up to its stop point.
2. Self-verify with the repo's reproducible local gate: <exact command, or explicit
CI-only limitation>. Fix local failures; never claim an unavailable gate passed.
3. Run a simplification pass over your changes (delete reinvented stdlib, needless
abstractions) and apply reasonable findings; re-verify if you changed anything.
4. Commit using the repo's convention, staging ONLY intended files. Never commit this
temporary brief. Treat plans and documentation according to the repo and user intent.
5. Return a short report: what changed, commit hash(es), verification results, any
watch-items for later phases — then STOP. Do not start the next phase.
6. If blocked after one real attempt, report `BLOCKED: <reason>` instead.
For each phase, in lane order:
Dispatch a fresh general-purpose agent with a self-contained prompt:
Read the full plan at
<ABSOLUTE PLAN PATH>, then the lane brief at<ABSOLUTE BRIEF PATH>, then rungit log --oneline -20to see completed phases. You are on branch<branch>; do not switch. Implement ONLY phase<N>:<description>and stop after<stop point>; build nothing beyond it.<Watch-items from prior phases.>Follow the brief's per-phase workflow: reproducible local gate, simplification pass, and repo-convention commit staging only intended files. Report what changed, commit hashes, and verification results. Do NOT start the next phase.
On return, verify independently and lightly — without reading source into your context:
git log --oneline -5 # the phase's commit(s) landed
git show --stat HEAD | tail -n +2 # only intended files, sane sizes
git status --short # nothing stray or unrelated
grep -nE '<a key symbol this phase adds>' <changed file> # narrow spot-check
For deeper review, spawn a throwaway read-only agent that checks the phase and returns one-line PASS/FAIL.
Verified → mark the phase completed, dispatch the next. BLOCKED: or a bad
report → resolve it from the plan/brief if you safely can (fix instructions and
re-dispatch the phase to a NEW fresh agent), else escalate to the human. Failed
phases are re-dispatched fresh, never "continued" — the broken context is gone.
GATED phase → stop and get explicit human confirmation before dispatching it.
Parallel lanes: dispatch one phase per lane concurrently (single message, multiple Agent calls), verify each on return, advance each lane independently.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub eternalllight/tgc-skills --plugin tgc-skills14 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.Other plugins' skills for the same job