
Control Session Orchestrator
- 18 installs
- 272 repo stars
- Updated June 12, 2026
- pskoett/pskoett-ai-skills
Helps with ai & agent building tasks.
About
control-session-orchestrator is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- control-session-orchestrator
- AI & Agent Building
- AI-coding skill
Control Session Orchestrator by the numbers
- 18 all-time installs (skills.sh)
- +3 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #10,736 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/pskoett/pskoett-ai-skills --skill control-session-orchestratorAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 18 |
|---|---|
| repo stars | ★ 272 |
| Last updated | June 12, 2026 |
| Repository | pskoett/pskoett-ai-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
Control Session Orchestrator
Use the current session as the control plane for project work that is too broad, risky, or stateful for one conversation. The control session owns intent, decomposition, routing, status, verification, and consolidation. Worker sessions own scoped execution. Worker subagents are local implementation/research/audit helpers inside each worker session.
Mental model
User
-> Control session (strategy, dispatch, tracking, integration)
-> Worker project session A (persistent branch/workstream)
-> Subagents for research, implementation, review, tests
-> Worker project session B (persistent branch/workstream)
-> Subagents for local fan-out
-> Verifier/reviewer session (optional independent gate)This is similar to dynamic workflows, but the orchestration is human-readable and session-native instead of a runtime script. Use it when persistence, branches, PRs, human steering, or cross-session continuity matter more than fully automated fan-out.
A code runtime gets reliability for free (validated results, barriers, budgets, dedup, resume). A prompt-driven control plane only gets it if you make state machine-checkable. Two contracts do that without a runtime: a required worker result block and a durable control-state manifest (see Machine-checkable contracts). Everything else in this skill keys off those two artifacts — without them, "is this worker done and passing?" is a guess, not a field read.
Supported control apps
This skill is app-agnostic. First discover which orchestration tools are available in the current session, then adapt the same control workflow to that surface.
| Capability | Codex app | GitHub Copilot app | Fallback |
|---|---|---|---|
| Find worker sessions | List/search project threads | List/search app sessions | Ask user for target session links/IDs |
| Create persistent workstreams | Create or reuse Codex threads/worktrees when available | Create or reuse Copilot app sessions/workspaces when available | Use local subagents only |
| Steer an existing workstream | Send a follow-up prompt to the thread | Send a follow-up prompt to the session | Ask user to paste the prompt into the worker |
| Local fan-out | Spawn subagents from this session or ask workers to spawn their own | Use Copilot's available agent/session tools | Keep work local |
| Tracking | Thread titles, pins, branches, PRs, canvas nodes, compact status tables | Session names, branches, PRs, issues, canvas nodes, compact status tables | Markdown status table |
Do not assume the GitHub Copilot or Codex tool names. Use the tools exposed in the current environment, and say which control surface is active before dispatching workers.
When to use
Use this skill for:
- Codebase-wide audits, migrations, or parity checks
- Parallel investigation across modules, services, features, or PRs
- Work that benefits from independent implementer and verifier sessions
- Large features where design, implementation, testing, and review should be split
- Project-control prompts like "coordinate agents", "spin up sessions", "run a workflow",
"make workers handle this", "monitor the other sessions", or "act as control"
- Situations where worker sessions may themselves use subagents for local research, coding, or review
Do not use it for a simple one-file fix, a quick answer, or a task where a single local subagent is enough. Orchestration has overhead; spend it only when coordination reduces risk or increases throughput.
Machine-checkable contracts
These are the session-native analog of a runtime's typed results and durable run state. They stay human-readable, but they are required, not advisory — the control session parses them instead of re-reading prose.
Worker result block
Every worker MUST end its report with a fenced `json block tagged control-result. The control session reads this block (never the surrounding prose) to update state, dedup, and decide routing.
```json control-result { "worker_id": "auth-api", "wave_id": "w1", "unit_key": "service/auth", "scope": "src/auth/** — refresh-token rotation", "status": "complete", "files_changed": ["src/auth/rotate.ts"], "verification": { "command": "pnpm test auth", "result": "pass", "evidence": "42 passed" }, "subagents_used": "2 — one research, one test author", "risks": ["rotation interacts with logout; covered by test"], "next_step": "ready for review session", "report_ref": "thread/PR/path to the full report" }
The block must be **strict JSON** (no comments/trailing commas) so it parses. `status` is one of
`complete | blocked | needs-decision | failed`; `verification.result` is one of `pass | fail | not-run`.
### Control-state manifest
One durable artifact that **is** the source of truth for the mission — a pinned control thread, a
tracking-issue body, a canvas node, or a committed `control/state.json`. Re-read and update it every
turn; keep the conversation for decisions, not state. One row per **unit** (unit-keyed, so the same
unit is never dispatched twice — this is the dedup ledger).
{ "mission": "MCP tool parity audit", "non_goals": ["no behavior changes"], "success_criteria": ["every tool present in server, HTTP, SDK, docs or flagged"], "budget": { "max_concurrent_workers": 5, "max_total_workers": 25, "spawned": 0, "in_flight": 0 }, "convergence": { "rule": "single-pass", "k_empty": 2, "empty_streak": 0, "target": null, "current": 0 }, "workers": [ { "unit_key": "surface/http", "worker_id": "http-audit", "session_ref": "thread-or-session id/link", "scope": "HTTP API surface", "branch_or_pr": "—", "status": "pending", "wave_id": "w1", "last_update": "ISO-8601", "evidence_ref": "report_ref from the result block", "verification": "not-run", "blocker": null } ], "decisions": [], "open_followups": [] }
Rules:
- **Worker status** (what a worker self-reports in its result block): `complete | blocked |
needs-decision | failed`.
- **Manifest unit status** (the superset the control session maintains): `pending | dispatched |
needs-decision | blocked | stalled | complete | failed | dropped`. Worker-reported values are a
subset of these, so setting a unit's status from a worker block (Step 5) is always valid.
- **Terminal** states — a unit is closed — are `complete | failed | dropped`. Everything else is
non-terminal and must be resolved, or explicitly converted to `dropped` with a reason, before the
mission closes (Step 8).
- `budget.in_flight` is the number of rows currently `dispatched`. Increment `spawned` and `in_flight`
on dispatch; decrement `in_flight` when a unit leaves `dispatched`; recompute it from the rows on
rehydrate.
- `convergence.rule` is one of `single-pass | loop-until-dry | loop-until-budget |
accumulate-to-target`. `k_empty`/`empty_streak` are used only by `loop-until-dry`; `target`/`current`
only by `accumulate-to-target` (`target` = the count or coverage goal, `current` = progress so far).
- dropped/failed units MUST carry a reason in `open_followups`.
This manifest is what a fresh control session rehydrates from (Step 0).
## Control workflow
### 0. Rehydrate (resume an in-flight mission)
On session start, look for an existing control-state manifest for this mission. If one exists:
- Load it; treat it as the source of truth.
- Re-attach to workers by `session_ref` and reconcile each worker's *real* status (read the thread/PR)
before any new dispatch.
- Recompute `budget.in_flight` from the rows still marked `dispatched`.
- Do NOT re-dispatch a unit whose status is `dispatched` or `complete` — route a follow-up instead.
If no manifest exists, this is a new mission — create one during Step 1.
### 1. Frame the mission
Before spawning anything, capture (and write into the manifest):
- Objective and non-goals
- Repositories, branches, PRs, or issues in scope
- File or subsystem boundaries for each workstream
- Success criteria and verification gates
- Merge/integration expectations
- Any "do not touch" constraints
Also set explicit limits up front (manifest `budget` and `convergence`):
- `max_concurrent_workers` (default ~4–6) — never more in flight at once
- `max_total_workers` — a lifetime backstop for the whole mission (e.g. 25)
- optional token / cost / time ceiling
- the convergence rule: `single-pass` for bounded missions; `loop-until-dry`, `loop-until-budget`,
or `accumulate-to-target` for open-ended audits/migrations/parity sweeps
If any boundary is ambiguous and could cause conflicting edits, ask before dispatch.
### 2. Detect the control surface
Before dispatch, identify the available app tools:
- Codex app: thread/session tools such as list, create/read, send-message, rename, pin/archive, plus
optional local subagent tools.
- GitHub Copilot app: session or workspace tools exposed by the app connector, plus any available
GitHub issue/PR/branch controls.
- Generic agent app: any combination of session, task, subagent, branch, issue, PR, or automation
tools.
If no persistent-session tools are available, downgrade to a local multi-agent plan and explain the
limitation. Do not invent a backend.
### 3. Choose the topology
Pick the smallest useful topology:
- **One worker**: isolated implementation or bug fix that should live in its own project session
- **Parallel workers**: independent modules, packages, endpoints, tests, or docs
- **Research then implementation**: exploratory sessions report findings before coding starts
- **Implementer + verifier**: one session changes code, another reviews or verifies independently
- **Control-only**: no workers yet; just inspect state, list sessions, or plan the dispatch
Prefer separate sessions when workers may edit overlapping history, need different branches, or need
long-running context. Prefer local subagents inside one session when the task is exploratory and does
not need persistent branch state.
### 4. Dispatch workers with complete prompts
Respect the budget: **never dispatch while `in_flight >= max_concurrent_workers`** — queue the unit
(`status: pending`) and log it. On reaching `max_total_workers` or a token/cost ceiling, STOP
dispatching and surface a *Decision needed* rather than spawning more. Dispatch is an **atomic
manifest update**: set the unit's row to `status: dispatched` (with `session_ref`, `worker_id`,
`wave_id`, `last_update`) and increment `spawned` and `in_flight` together; if the dispatch fails to
start, leave the row `pending` and advance neither counter. Decrement `in_flight` when a unit leaves
`dispatched` (it reaches a terminal state, or returns to `needs-decision`/`blocked`/`stalled`) so
queued units can start. This keeps `in_flight` equal to the count of `dispatched` rows that Step 0
recomputes.
Each worker prompt should be self-contained. Include:
- The mission and exact scope (and its `unit_key`)
- Files, subsystems, issue/PR links, and branch expectations
- What the worker may and may not change
- Verification commands or acceptance criteria
- Whether it may create commits, PRs, or only report back
- The required result block
Worker prompt template:
You are worker <name> for <project>.
Mission: <specific outcome> unit_key / wave_id: <key> / <wave> Scope: <files/subsystems/issue/PR> Do not touch: <boundaries> Approach: <expected plan or constraints> Verification: <commands/checks/evidence>
You MAY use your own subagents for local research, implementation, and review, but you remain accountable for this scope and the final report. Do NOT create or steer further persistent project sessions — if the work needs another full workstream, say so in next_step.
End your report with a fenced ```json control-result block (see the contract). Populate every field; record subagents you used in subagents_used. The control session reads only that block.
When using Codex app controls, prefer to rename and pin important worker/control threads so the
session graph stays legible. When using GitHub Copilot app controls, use the corresponding session or
workspace labels if exposed.
### 5. Track state centrally
The control-state manifest is the single source of truth — update it every turn, not the
conversation. From each worker's result block, set the unit's `status`, `evidence_ref` (= the block's
`report_ref`), `verification` (= the block's `verification.result`), and — when `status` is `blocked`
or `needs-decision` — `blocker` (the block's blocking reason; otherwise `null`). The control session
records the remaining fields itself: stamp `last_update` from its own clock, and set `branch_or_pr`
from the worker's session/PR metadata when known (workers don't self-report it in the block). Keep the
control session's context focused on summaries and decisions, not full transcripts; the full report
lives at `report_ref`.
Track at least, per unit: `unit_key`, `worker_id`, `session_ref`, scope, status, branch/PR, last
update, blocker, and verification state — matching the row schema above. Canvas nodes or a SQL/todo
table are good backends for the manifest when the app exposes them.
### 6. Route follow-ups (result-gate)
When a worker reports, first run the **result-gate**:
- Parse the `control-result` block. If a required field is missing or malformed, or the status is
inconsistent with evidence (e.g. `status: complete` with `verification.result != pass`), do NOT
accept it — send exactly one standardized re-prompt asking only for the corrected block. Cap at 2
retries, then escalate to the user.
- Accept completed work only when the block validates AND meets the success criteria.
Then route:
- Send targeted follow-ups for missing verification, scope drift, or blockers.
- Avoid duplicating a worker's investigation unless its result is incomplete or suspect (check the
unit ledger first).
- If two or more workers conflict, pause integration and resolve ownership before more edits happen.
### 7. Iterate waves to convergence
For multi-wave missions, after routing a wave's follow-ups, apply the declared `convergence.rule`
before consolidating:
- **single-pass** — one wave; skip to consolidate.
- **loop-until-dry** — keep opening units until `k_empty` consecutive waves produce zero *new*
(deduped) units; maintain `empty_streak` in the manifest.
- **loop-until-budget** — stop when a budget cap is hit.
- **accumulate-to-target** — stop when the target count/coverage is reached.
"New" and "dry" are measured against the manifest's set of `unit_key`s, not memory. Never stop
silently — write why iteration ended (`open_followups` / `decisions`).
### 8. Verify and consolidate
Before declaring the mission done:
- Run or delegate the agreed verification gate.
- Review diffs or ask an independent reviewer session for high-signal findings.
- Ensure worker outputs are integrated in the right branch/session.
**Wave-join / completeness gate:** the mission is complete only when **every** manifest worker row is
in a **terminal** state — `complete`, `failed`, or `dropped`. Non-terminal rows (`pending`,
`dispatched`, `needs-decision`, `blocked`, `stalled`) must first be resolved; a unit that cannot be —
e.g. a worker that never reported by its checkpoint, marked `stalled` — must be explicitly converted
to `dropped` with a reason. Only then may the mission be declared *"complete with N dropped: <ids +
reasons>"*. Never close with a non-terminal row, and never drop silently. Enumerate every dispatched
unit in the final summary.
**Pull cadence (no push signal):** a session-native control plane has no "worker done" event to wake
it. After dispatching a wave, define the next checkpoint trigger — a follow-up turn, a status-table
poll, or a user ping — and never leave a wave un-joined.
For PR-bound work, keep the control session responsible for final PR readiness and review routing.
## Safety rules
- Do not spawn workers for trivial tasks.
- Do not let multiple workers edit the same files unless explicitly coordinated.
- Do not assume a named app connector exists; discover it and fall back honestly.
- Do not silently create branches, commits, pushes, or PRs; follow the user's consent and repo rules.
- Do not ask workers to share secrets or sensitive data across sessions.
- Worker subagents are leaf helpers — they MUST NOT create or steer further persistent sessions. The
hierarchy is exactly two levels (control -> worker -> subagents); a worker that needs another full
workstream reports that need to control.
- Enforce the concurrency and total-fan-out caps; never exceed them silently. Dropped, skipped, or
failed units MUST be recorded with a reason (no silent truncation).
- If using an in-place checkout, be extra careful: other user-owned changes may already exist.
- If the plan changes materially, update the user and the workers before continuing.
## Recommended reporting format
Use a compact control-plane update (rows derived from the manifest):
Status: <on track | blocked | needs decision | complete> Budget: in-flight <X/Y> · spawned <A/B> · wave <N> (empty-streak <E>)
| Workstream | Session | Scope | State | Evidence |
|---|---|---|---|---|
| <name> | <id/name> | <scope> | <state> | <test/report/PR> |
Decision needed: <only if blocked>
Keep user-facing updates concise. The control session should make coordination legible, not flood the
user with every worker's transcript.
{
"skill_name": "control-session-orchestrator",
"evals": [
{
"id": 1,
"name": "multi-session-audit",
"prompt": "Act as the pmx-canvas control session and coordinate a workflow to audit MCP tool parity across server, HTTP API, SDK, and docs. Spin up whatever worker sessions make sense and keep track of their results.",
"expected_output": "The agent should use the control-session-orchestrator skill, define a control-plane topology, assign scoped worker sessions for independent surfaces, specify reporting and verification expectations, and track status centrally instead of trying to audit everything inline.",
"files": []
},
{
"id": 2,
"name": "implementer-and-verifier",
"prompt": "We need a safe parallel workflow for a risky canvas refactor: one agent should implement, another should independently review and verify. Please coordinate it from this session.",
"expected_output": "The agent should use the skill to frame mission, create or route to separate implementer and verifier sessions, prevent overlapping scope drift, require verification evidence, and consolidate the final decision in the control session.",
"files": []
},
{
"id": 3,
"name": "codex-control-thread",
"prompt": "Use this Codex app thread as the pmx-canvas control session. Find the related worker threads, pin/rename the control thread if needed, and steer each worker with scoped prompts while they can spawn their own subagents.",
"expected_output": "The agent should use the control-session-orchestrator skill, identify Codex app thread/session tools as the active control surface, avoid assuming GitHub Copilot-only tool names, define worker ownership and reporting, and keep central status in the control thread.",
"files": []
},
{
"id": 4,
"name": "avoid-over-orchestration",
"prompt": "Fix the typo in the README heading.",
"expected_output": "The agent should not use heavyweight control-session orchestration. It should handle the simple task directly or with the normal lightweight workflow.",
"files": []
},
{
"id": 5,
"name": "rehydrate-after-handover",
"prompt": "You're taking over as the control session for an in-progress multi-session migration. A previous control session already framed the mission and dispatched several worker sessions before it ended. Pick up where it left off.",
"expected_output": "The agent should run Step 0 (Rehydrate): locate and load the control-state manifest as the source of truth, re-attach to workers by session_ref, and reconcile each worker's real status before any new dispatch. It must NOT re-dispatch a unit whose status is already dispatched/complete (route a follow-up instead), and must not reconstruct the plan from scratch or duplicate running work.",
"files": []
},
{
"id": 6,
"name": "result-gate-rejects-unverified-report",
"prompt": "A worker session you dispatched just reported back: 'Done, the refactor looks good and tests should pass.' Decide whether to accept it and mark the workstream complete.",
"expected_output": "The agent should NOT accept the report. Per the result-gate (Step 6), it requires the machine-parseable control-result JSON block with verification evidence; prose like 'tests should pass' is not a pass result, and status:complete without verification.result:pass is inconsistent. It should send one standardized re-prompt asking only for the corrected control-result block (capped retries, then escalate to the user), and accept only when the block validates and meets the success criteria.",
"files": []
},
{
"id": 7,
"name": "respect-concurrency-and-total-caps",
"prompt": "Coordinate a parity audit across 20 independent endpoints; spin up worker sessions to cover them all.",
"expected_output": "The agent should set a budget in the manifest (max_concurrent_workers, e.g. 4-6, plus a max_total_workers backstop), dispatch only up to the concurrency cap at once and queue the rest as pending, and update in_flight/spawned as workers complete — not fan out 20 persistent sessions simultaneously. All 20 should be tracked as unit-keyed ledger rows, and it should surface a 'Decision needed' if the total backstop is reached rather than exceeding it silently.",
"files": []
},
{
"id": 8,
"name": "wave-join-completeness-gate",
"prompt": "Most of the audit workers have reported back. Two never responded. Can we call the audit complete and write up the result?",
"expected_output": "No. Per the wave-join/completeness gate (Step 8), the mission closes only when every manifest worker row is in a terminal state (complete/failed/dropped). The two non-responding workers are non-terminal: mark them 'stalled', define a checkpoint/pull cadence to chase them (there is no push 'done' signal), and if they still cannot be resolved, explicitly convert them to 'dropped' with a reason. Only then may the agent declare 'complete with N dropped: <ids + reasons>'. It must never close with a non-terminal row or drop work silently.",
"files": []
},
{
"id": 9,
"name": "convergence-stop-rule",
"prompt": "Run an open-ended workflow to find and fix every flaky test across the repo — keep going until they are all handled.",
"expected_output": "The agent should declare an explicit convergence rule up front (e.g. loop-until-dry: stop after K consecutive waves that surface zero new deduped units), track empty_streak across waves measured against the manifest's unit_key set, and stop on that rule — not loop indefinitely on judgment nor do a single pass and declare done. It should record why iteration ended and never stop silently.",
"files": []
},
{
"id": 10,
"name": "two-level-hierarchy-guard",
"prompt": "One of your worker sessions reports that the task is bigger than expected and wants to spin up its own set of persistent project sessions to parallelize further. How should that be handled?",
"expected_output": "Per the safety rule, worker subagents are leaf helpers: a worker MUST NOT create or steer further persistent sessions — the hierarchy is exactly two levels (control -> worker -> subagents). The worker should report the need (e.g. in next_step) back to the control session, which decides whether to open new workstreams itself. Workers may use local subagents for research/implementation/review, but not spawn new control-level workstreams.",
"files": []
},
{
"id": 11,
"name": "malformed-control-result-json-rejected",
"prompt": "A worker ended its report with this block:\n```json control-result\n{\n \"worker_id\": \"auth-api\",\n \"status\": \"complete\",\n \"files_changed\": [\"src/auth/rotate.ts\",],\n}\n```\nProcess it and update state.",
"expected_output": "The agent must NOT parse or accept this. The block violates the strict-JSON contract (trailing comma after the array element and after the last property) and is missing required fields (unit_key, wave_id, verification, report_ref). Per the result-gate (Step 6) it should send one standardized re-prompt asking only for a corrected, strictly-valid control-result block, and must not update the manifest from unparseable output. It should not 'best-effort' read the values out of the broken JSON or the surrounding prose.",
"files": []
},
{
"id": 12,
"name": "status-enum-exactness",
"prompt": "A worker returned a well-formed JSON control-result with \"status\": \"done\" and \"verification\": { \"command\": \"pnpm test\", \"result\": \"passed\", \"evidence\": \"ok\" }. Update the unit and decide routing.",
"expected_output": "The agent must reject the block as enum-invalid: worker status must be one of complete|blocked|needs-decision|failed ('done' is not valid) and verification.result must be one of pass|fail|not-run ('passed' is not valid). It should not silently coerce 'done'->complete or 'passed'->pass; instead re-prompt for a corrected block with exact enum values, and only then map status onto the manifest's superset (pending|dispatched|complete|failed|dropped) and set verification from verification.result.",
"files": []
},
{
"id": 13,
"name": "manifest-row-provenance",
"prompt": "You received a valid control-result block: { unit_key: 'service/auth', status: 'complete', verification: { result: 'pass', evidence: '42 passed' }, report_ref: 'PR #88', files_changed: [...] }. Show how you update the manifest row for this unit.",
"expected_output": "The agent should set ONLY the worker-sourced fields from the block: status=complete, evidence_ref=report_ref ('PR #88'), verification=pass, and blocker=null (status is not blocked/needs-decision). It must record the control-side fields itself: stamp last_update from the control clock and set branch_or_pr from session/PR metadata — NOT read those two from the worker block (the block does not contain them). It should not invent fields outside the row schema, and must keep the row unit-keyed (one row per unit, never duplicated).",
"files": []
},
{
"id": 14,
"name": "in-flight-decrement-and-reconcile",
"prompt": "Two things: (a) a dispatched worker just reported a terminal result; and (b) on rehydrate you find a manifest row stuck at status 'dispatched' whose session is actually dead. Update the budget counters correctly.",
"expected_output": "(a) When a worker reaches a terminal state (complete/failed/dropped), the agent must decrement budget.in_flight by one (spawned stays as the cumulative count) so a freed concurrency slot can admit a queued pending unit. (b) On rehydrate (Step 0), it must reconcile in_flight to the count of genuinely live workers, not the stale ledger value: a 'dispatched' row with a dead session is converted to a terminal state (failed/dropped with a reason) and in_flight is corrected downward. in_flight must never be left over-counted (which would deadlock new dispatch) or under-counted (which would breach the concurrency cap).",
"files": []
}
]
}