Cng Orchestrate
ASecurityWORKFLOW SKILL, ON DEMAND ONLY - Take every open sub-issue under one or more parent issues to a merged PR by running one Copilot CLI or Claude Code worker per issue in its own terminal workspace (cmux, tmux, herdr or Rex) and git worktree, on macOS, Linux or WSL, on a schedule or on events, until nothing is left. Writes no product code itself. USE FOR: nothing automatically. Run only when the user types /cng-orchestrate, names this skill, or explicitly asks to orchestrate issues under parents...
- 13 stars
- 0 votes
- 0 copies
- 0 views
- Added December 6, 2026
Works with
Security analysis
100/100Pro scans all 16 files and shows the line behind each finding
npx -y skills add macromania/canga-skills --skill cng-orchestrate --agent claude-codeAre you the author of Cng Orchestrate?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/macromania-cng-orchestrate)---
name: cng-orchestrate
description: >-
WORKFLOW SKILL, ON DEMAND ONLY - Take every open sub-issue under one or more
parent issues to a merged PR by running one Copilot CLI or Claude Code worker
per issue in its own terminal workspace (cmux, tmux, herdr or Rex) and git
worktree, on macOS, Linux or WSL, on a schedule or on events, until nothing is
left. Writes no product code itself.
USE FOR: nothing automatically. Run only when the user types /cng-orchestrate,
names this skill, or explicitly asks to orchestrate issues under parents and an
epic.
DO NOT USE FOR: working one issue yourself (use cng-plan and cng-implement),
reviewing one PR (use cng-review-pr), merging one PR (use cng-merge), status
reports (use cng-report), or reviewing or editing these instructions.
license: MIT
disable-model-invocation: true
user-invocable: true
metadata:
version: "0.1.0"
---
# Orchestrate
Take a set of issues from open to merged without doing the work yourself. Start
one worker per issue, each in its own workspace of a terminal multiplexer (cmux,
tmux, herdr or Rex; see `references/multiplexers.md`) and its own git worktree, in
Copilot CLI or Claude Code (see `references/harnesses.md`).
Keep a fixed number running, choose a sane default whenever a choice comes up,
collect whatever only a person can do in one checklist, and close each workspace
when its ticket closes. Use this workflow when the user explicitly asks to run it.
The orchestrator writes no product code. Each role has its own skill or file:
| Role | Runs | Owns |
|---|---|---|
| Orchestrator | this skill and `references/tick.md`, in one session | the queue, the workspaces, defaults, the human checklist |
| Worker | the `cng-plan` skill, then `cng-implement` | one issue: plan, code, PR, review fixes |
| Reviewer | the `cng-review-pr` skill, in a fresh session per PR head (`events: true`), or in a long-lived session; up to three | a full review of every PR in its epic |
| Merger | `orch.py`'s merge step (`merge.enabled`), or the `cng-merge` skill in its own session | the `check` label, CI (or, with `allow_merge_without_ci`, its own local run), and the squash-merge |
This skill's folder holds the script that does the mechanics and the reference
files below. Find the folder first: it is the directory of this `SKILL.md`,
after following symlinks (`npx skills` installs by symlink). Paths in this skill
are relative to it.
| Read | When |
|---|---|
| `references/harnesses.md` | before the first run, and whenever Copilot CLI and Claude Code behave differently |
| `references/multiplexers.md` | in preflight, to choose and probe the multiplexer, or to write an adapter for one that has none |
| `references/events.md` | when the run's config has `events: true` |
| `references/preflight.md` | before starting the first worker |
| `references/mechanics.md` | to set up `config.json`, or to look up a command, a config key, or what a tick does |
| `references/workers.md` | to start a worker by hand, read what its brief says, or message it |
| `references/shared-resources.md` | when setting the cap, ports, heavy-run slots, or a budget |
| `references/tick.md` | on every tick or wake: how to act on each output line |
## Inputs
- **Parents:** the issues whose open sub-issues are the work, for example #12
and #15.
- **Epic:** the ticket the Reviewers and Merger cover. A PR whose issue isn't in
that epic's sub-issue tree never gets reviewed or merged.
- **Cap:** how many workers run at once. Ten have run at once on a machine with 64 GB
of memory; three is a safe start on a 16 GB Mac.
- **Hard limits:** what no default may cross, for example "no production change"
or "no live write outside staging". These go in `hard_limits` in the config.
- **Goals:** what must work when the run ends, as URLs the tick checks, for
example a staging host answering 200.
Ask only for the parents and the epic when the request doesn't name them, and in
the same message ask the risk question in `references/preflight.md` step 10.
Take a sane default for everything else and say which in your first report.
## Nothing waits for the user
On the run this workflow grew from, the user said: "don't wait for my decision on any task.
choose a sane default and record the decision under a ticket. I'll review all the
decisions at the end of the implementation", and later "collect all human reviews
under a ticket with clean and simple instructions". The run is built that way:
- **Decisions.** When a choice would change scope, behavior, or safety, the
worker or the orchestrator takes the safest default that meets the ticket and
records it with `orch.py decide`. Each decision is its own sub-issue of a
decision index issue, with four sections: the question, the options and what
each costs, the default chosen, and why. The user reviews the index at the end.
GitHub allows 100 sub-issues per issue; `decide` opens a continuation index
before the current one fills (one run filled an index and went on in a second).
Never record a decision as a comment.
With `decisions.file` set instead of `decisions.index`, `decide` appends each
decision as a numbered section (`D-1`, `D-2`, ...) to a markdown log in the
run's session folder and touches nothing on GitHub. One user asked for that
log for their runs: "for decisions, instead of creating a ticket, this time
store it in the markdown at the session folder".
- **Things only a person can do.** A sign-in with a real identity, a real device,
an approval, a legal review, or a fact only the user knows goes in one held
human checklist issue, as a numbered section with plain steps and a checkbox.
A worker writes its question file starting with `HUMAN:`, and the orchestrator
adds the item with `orch.py human`. The work carries on and records that part
as pending; a ticket can close with it pending in the checklist.
- **Hard limits.** Only a conflict with a hard limit waits for the user. The
worker keeps doing whatever doesn't depend on it.
**The one exception: accepting the risks.** Every session runs without
permission prompts, as the user's `gh` login, and only the user can accept
that. Before the first session starts, ask the question in
`references/preflight.md` step 10 (`allow_unattended_workers`, `allow_public_repo`
on a public repository, `copy_files`, `allow_unchecked_removals` under Claude
Code, and `allow_merge_without_ci` with the scripted merge), and wait for the answer. Never set
those keys yourself, not even when `orch.py` refuses a start and names the key.
Don't rely on `ask_user` (`AskUserQuestion` in Claude Code) for anything the run needs: it reported the user
unavailable while the user was at the keyboard. When the user must act now, such
as approving a CLI's device-login URL, say so in your report, with
the exact steps.
## Check what's possible first
Before starting a worker, run every check in `references/preflight.md`, in
order, and report each result: the Reviewer and Merger, the branch rules, the
work and what is already underway, the issue groups, the owner's records, the
machine and the multiplexer, the disk, and the companion skills. Then ask the one question that
waits for the user, accepting the risks (step 10), and start nothing until the
user answers.
## Order the queue
- Put fixes for a red `main` first, then bugs, privacy, and security, then the
rest.
- Give each issue a lane, `code` or `ci`. Run at most one `ci` worker at a time.
- Give an issue `after: [n, ...]` when it edits the same files as another, or
when it's an umbrella that closes once others land. It waits until those close.
- Give it `early_start: true` as well when it can prepare while those finish, as
a staging acceptance ticket can plan and set up while the release it checks is
still being built. Its brief names the open items and says to finish after them.
- Give a small ticket, such as a two-file test fix, `light_plan: true`: it skips
`cng-plan` and gets one rubber-duck pass on the diff. On one run, full plans
with two review rounds took up to 40 minutes on such tickets.
## Keep the mechanics in a script
`scripts/orch.py` does the reconciling, and you act only on the lines that need
judgment. Keep the run folder in your session folder, never in a checkout, and
pass it to every command with `--dir`. `references/mechanics.md` lists the run
folder's files, every config key, what each tick does, and every command. Run
`tick --dry-run` once before the first real tick.
## Workers
`orch.py` starts each worker in its own worktree and multiplexer workspace, with
a brief in `prompts/<n>.md`, and messages it with `orch.py say`. Never type into a
workspace by hand without its exact id (`orch.py mux list`). `references/workers.md` has the exact commands, the
brief's rules, and how to answer a worker's question.
## Follow-ups and review rounds
Workers and Reviewers file follow-ups as sub-issues of the ticket they found them on. A ticket closes
when its own PR merges, and its follow-ups stay open: they need PRs of their own. On one
run, the nine stories closed with about 45 follow-ups open, because the run read only the
epic's direct sub-issues. Ten more stayed open after every round had merged: a review files its
follow-ups under the follow-up ticket it reviewed, a level further down. The tick now reads every
level under the parents, below the decision records too.
- **The epic in `parents` is enough**: the tick reads every level under it, the tickets' follow-ups
included.
- **One worker per ticket's follow-ups**, with `light_plan`, so related fixes share one PR.
- **Rounds.** A follow-up PR's review files more follow-ups. Fix in that PR only what blocks it or
fails its own CI; queue the rest as the next round's item, `after` the current one. Each round finds
fewer and smaller problems. Adding them to the PR under review restarts its CI on every push, and on
one run a PR merged before its author pushed them, so those fixes needed a new branch.
- **Check every listed issue closed** when a follow-up PR merges, and queue any it missed.
## Keep it moving
Every check stays: `CI gate` on every PR, and every release's full verification.
What goes is waiting that buys nothing. The one exception is the user's yes to
`allow_merge_without_ci`: then the merge step runs `merge.verify_commands` on
each PR's head merged with `main`, in a fresh worktree, in place of `CI gate`
(`references/mechanics.md`). PRs that change CI still run it.
- **Review and CI run together.** The Merger may add `check` while a full review
is still running, and merges when `CI gate` passes and no blocking finding is
open. A full review at the pre-rebase head still counts when the PR's
`git patch-id --verbatim` is unchanged; the tick's review dealing uses the
same rule.
- **The orchestrator may merge a release blocker itself.** Label the PR
`orchestrator-merge` so the Merger skips it, tell the Merger, add `check`, and
when `CI gate` passes with no blocking finding open, merge with
`gh pr merge <n> --squash --match-head-commit <sha>`. Never use `--admin`.
- **Slow workers.** On a `SLOW` line, read the worker's screen. When it's doing
more proof or process than the change needs, tell it to stop and open the PR
with what it has.
- **One fix for a shared failure.** On `SHARED_FAILURE`, compare with `main` and
with the last passing run of the same job: a changed tool version or a new
dependency release shows there. Once, a setup action with no pinned version
installed a new tool release and one check failed on every PR that ran it; one
PR pinned the version. Fix it once, and tell the workers not to chase it.
- **Check a release's preconditions before dispatching it.** A release workflow
that refuses at its last step after a long verification costs an hour. On one
run, a release failed at its image step because the staging API
was older than the commit it needed; deploy the API first. Batch release
blockers so one release proves them all.
## Shared resources
Serialize fixed ports, cap heavy runs, keep the shared database to the main
checkout, and watch memory, disk and budgets: `references/shared-resources.md`.
## Run the loop
Keep the tick's rules in files, not in the schedule prompt. On one run, the
prompt grew to 8 KB and was replaced six times as the user's rules changed.
`references/tick.md` says how to act on each output line. The run's `policy.md` holds the user's rules for this run, quoted
and dated: the hard limits, what staging writes are allowed, the goal, and every
later instruction. A new instruction from the user goes into `policy.md` the
moment it arrives, and into `worker_rules` too when the workers must follow it.
With `events: true`, no schedule runs the tick. From the orchestrator's own
workspace, run `orch.py --dir <run folder> loop start`. It records that
workspace as the one to wake, and opens a workspace that runs `loop run`. Run
`orch.py loop run --once --dry-run` first to see each line marked `WAKE`,
`wake` (sent within the repeat window), or `info`; add `--local` for a local round. When the loop wakes you, read
`logs/wake-latest.txt` and act on its lines as tick.md says; re-read
`policy.md` only on `POLICY_CHANGED` or after your context was compacted. Keep
one watchdog schedule, every 60 minutes, with this prompt:
```text
Orchestrator watchdog: run `python3 <skill folder>/scripts/orch.py --dir <run folder> loop status`.
If it prints LOOP_STOPPED, run `loop stop` (an error is fine), then `loop start` from this workspace. Otherwise say nothing.
```
Without `events`, create the tick with `manage_schedule`, interval `10m` (under
Claude Code, `CronCreate` with cron `*/10 * * * *`, recurring), and this prompt,
with the paths filled in:
```text
Orchestrator tick for <parents>. Follow <skill folder>/references/tick.md
with run folder <run folder>, and the user's rules in <run folder>/policy.md.
```
A Claude Code recurring task deletes itself seven days after it's created, the
tick's included. Write the date you created it in `policy.md`, and create it
again before the seventh day. A Reviewer, Merger, or worker whose schedule
expires goes quiet, and the health check's nudge tells it to create its schedule
again.
## Finish
Stop the schedule on `ALL_DONE`, or on `ONLY_HELD` when every held item is the
user's (the decision indexes, the human checklist, and anything only the user may
release). Check every goal first; if one fails, find the ticket that owns it and
keep going. Then:
1. **Shut the sessions down.** Tell the Reviewers and Merger to stop their
schedules and delete their source snapshots (`say roles`), and tell any worker
still open to stop its schedule, close its browsers, and exit. With `events`,
run `orch.py loop stop`, delete the watchdog schedule, and close the Reviewer
and loop workspaces. Then run `orch.py mux cleanup`, which ends the run's own
tmux or Rex session once no tab is left in it.
2. **Clean up the worktrees.** The ticks removed each finished worker's clean
worktree. For any worktree a `CLOSED` or `ATTENTION` line kept, back up its
tracked changes and untracked files as in step 8 of `references/preflight.md`, push or note its unpushed
commits, and then remove it. Branches stay.
3. **Report**, using `orch.py report` for the numbers:
- the PRs merged and the issues closed, with links;
- the follow-up issues the workers and reviewers filed;
- anything held, and what each item needs from the user;
- the decisions recorded, with the index issues or the decision log to review;
- the human checklist issue;
- hours from start to finish, lines changed, and the AI credits with their
dollar value (under Claude Code, the tokens, and their dollars when `usage`
prices them).
Claim an issue done only after GitHub reports it closed.
Files in this skill
- LICENSE.txt
- README.md
- SKILL.md
- assets/config.example.json
- assets/mux_template.py
- references/events.md
- references/harnesses.md
- references/mechanics.md
- references/multiplexers.md
- references/preflight.md
- references/shared-resources.md
- references/tick.md
- references/workers.md
- scripts/mux.py
- scripts/orch_hook.py
- scripts/platform_probe.py
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.