kyoshi-command skill
✓ VerifiedOrchestrates long-running, multi-day projects by managing hundreds of subagents through a structured coordinator-worker hierarchy and a persistent state store.
- GitHub stars
- 113
- Files
- 1
- Last commit
- Nov 1, 2026
- License
- MIT
- Allowed tools
- —
What does the kyoshi-command skill do?
kyoshi-command orchestrates long-running, multi-day projects by managing hundreds of subagents through a structured coordinator-worker hierarchy and a persistent state store.
Summary generated from the skill's SKILL.md.
About the kyoshi-command skill
Managing multi-day engineering programs that require hundreds of subagents is what kyoshi-command enables. It allows a single coordinator chat to oversee complex migrations or large-scale pull request sequences by implementing a structured hierarchy of coordinators, sub-coordinators, and workers. Instead of constant human intervention, the system is designed for long-running workflows where a developer checks in periodically to review reports and make high-level decisions.
The skill relies on a persistent state store managed via the orch CLI to ensure progress survives session restarts. This store includes files like units.tsv for tracking work units, ledger.tsv for verification results, and preferences.md for standing orders. Users interact with the system by authoring detailed briefs that define scope, acceptance criteria, and verification commands. By using background subagents and dedicated verifiers, the coordinator can drain a queue of completed tasks and maintain a merge frontier without manually editing code.
What an agent can do with it
- 1Execute large-scale code migrationsHand a massive repository migration to a single coordinator to manage dozens of subagents over several days.
- 2Manage complex multi-track projectsDecompose a massive program into smaller tracks managed by sub-coordinators to prevent a single coordinator from becoming overwhelmed.
- 3Ensure high-quality code through verificationAssign different model families to act as verifiers to check the work produced by worker agents.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the kyoshi-command skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the kyoshi-command skill in Plugin
/plugin marketplace add tmcfarlane/team-avatar /plugin install team-avatar@team-avatar
Install the kyoshi-command skill in Claude Code
~/.claude/skills/kyoshi-command/SKILL.md
$ npx degit tmcfarlane/team-avatar/plugins/team-avatar/skills/kyoshi-command ~/.claude/skills/kyoshi-commandInstall the kyoshi-command skill in Claude Code (project)
.claude/skills/kyoshi-command/SKILL.md
$ npx degit tmcfarlane/team-avatar/plugins/team-avatar/skills/kyoshi-command .claude/skills/kyoshi-commandInstall the kyoshi-command skill in Codex
~/.agents/skills/kyoshi-command/SKILL.md
$ npx degit tmcfarlane/team-avatar/plugins/team-avatar/skills/kyoshi-command ~/.agents/skills/kyoshi-commandInstall the kyoshi-command skill in Gemini CLI
~/.gemini/skills/kyoshi-command/SKILL.md
$ npx degit tmcfarlane/team-avatar/plugins/team-avatar/skills/kyoshi-command ~/.gemini/skills/kyoshi-commandInstall the kyoshi-command skill in Claude.ai
npx degit tmcfarlane/team-avatar/plugins/team-avatar/skills/kyoshi-command kyoshi-command && zip -r kyoshi-command.zip kyoshi-command # claude.ai → Customize → Skills → + → Create skill → Upload a skill → kyoshi-command.zip
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachabletmcfarlane/team-avatar/plugins/team-avatar/skills/kyoshi-command is public and reachablegithub.com/tmcfarlane/team-avatar/tree/HEAD/plugins/team-ava ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-01github.com/tmcfarlane/team-avatar/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/tmcfarlane/team-avatar/blob/HEAD/plugins/team-ava ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/tmcfarlane/team-avatar/blob/HEAD/plugins/team-ava ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 168 linesgithub.com/tmcfarlane/team-avatar/blob/HEAD/plugins/team-ava ↗Pass
SKILL.md
View on GitHubSuki's Kyoshi command
When Suki commands the island's defense, she does not fight on the beach. She writes clear orders, posts warriors where they belong, reads every runner's report at set times, and keeps the front line holding. You own the program, never the code. Author briefs, drain the queue, keep the frontier green, and decide.
This skill is for a whole project handed to one standing coordinator chat. It runs for days, spans many stacked PRs, and uses dozens to hundreds of subagents, with the human checking in twice a day instead of every five minutes. One task driven to a predicate belongs to night-watch. One ambitious run that needs a bespoke workflow belongs to day-of-black-sun. Route here only when the work outlives any single agent. Work one agent could finish inside the session's budget is not a program, however program-shaped the request sounds.
Prove behavior with the project's verify skill (see vital-signs), or with Claude Code's run skill when the repo has none. Every brief names the resolved skill path or the exact commands.
On Codex, read avatar-mode/references/codex.md for tool equivalents.
Ceremony must scale with the program. On cheap, near-identical units, collapse it as each section directs.
Three rules carry the rest.
- Completions are queue events, not interrupts.
- Every spawn and every resume carries the standing orders verbatim.
- The brief is the product. A vague brief fails quietly, because a worker cannot ask you a question.
Roles and placement
- Coordinator (this chat). Frames, authors briefs, drains the inbox, owns the human report, and makes judgment calls. It never authors or edits code. Conflicted merges, chain rebases, and code changes are always tasks. Mechanically landing a verified unit (a fast-forward or clean cherry-pick of a worker's commit, then a push) is bookkeeping the coordinator may do itself on repos where local git is cheap. Queueing finished work behind an idle stacker is how a deadline harvests nothing. The loop is agentic end to end. Agents are spawned and drained only through the Agent tool. Pick each subagent's character, model, and reasoning effort for the job, as the dispatch rules in
avatar-modedescribe. State reads and writes go through theorchCLI at drain points, one command in and one line out. The CLI never spawns, waits, or wakes anything. - Sub-coordinator. Durable, one per track, and only when the program exceeds what one coordinator's drains can manage. A track the coordinator can drain itself needs no middle layer. Each nested layer re-pays a full orientation preamble, and a blocking sub-coordinator hides its children while the parent idles. It owns its track's units and boards, authors its workers' briefs, and spawns its own workers and verifiers where the runtime lets a subagent spawn one. Where it cannot, it owns its track's units directly with the same review separation. It rolls up aggregates at wave boundaries and never forwards raw child reports. Cap in-flight children at what one drain can process, roughly ten, as a rolling window. Never use blocking batches, which cost the slowest child of every batch.
- Worker and verifier. Background subagents (
run_in_background: true), each dispatched as the character whose discipline fits the unit (team-avatar:<character>). Claude Code has no remote worker environment, so isolation is a worktree or branch per writer, not a separate machine. A subagent never sees this chat, so its brief inlines what it needs or points at repo and store paths. Prefer fewer, broader workers. Keep one writer per worktree or branch, so no two actors share a file. Run a unit's verifier on a different model family from its worker, taking the family from the avatar-setup sheet'spanelline.
Depth stays at coordinator, track, worker. Author the track decomposition per project. Build, landing, and verification are common cuts, not a required shape. Hard-coded formation trees were tried and parked as too rigid.
The orch CLI
orch is bun ../../tools/orch/orch.ts from this file, under the installed plugin. It keeps the store's plain TSV and JSON files, which stay readable without the CLI. Pass the store with --store <dir> or the ORCH_STORE environment variable. Commands:
| Command | Does |
|---|---|
orch init |
Create the store files. |
orch standing show, orch standing add <line> |
Read or append the standing orders. |
orch unit add <id>, orch unit set <id>, orch unit get <id>, orch unit list, orch unit counts |
Keep units.tsv. |
orch ledger record <pr> <sha> <verdict> [--evidence PATH] [--verifier NAME], orch ledger check <pr> <sha>, orch ledger summary |
Keep ledger.tsv. |
orch inbox push <agent> <unit> <status> [--report PATH], orch inbox drain, orch inbox count |
Queue completion pointers. |
orch gate park <id>, orch gate list, orch gate resolve <id> |
Park human gates. |
orch frontier set --repo <dir> [--forge gh|origin] [--prs <n,...>], orch frontier show |
Compute the merge frontier. |
orch status |
Regenerate status.md and print a three-line summary. |
Run orch <command> --help for every option. Add --json for complete rows.
Store layout
Create ${CLAUDE_CONFIG_DIR:-~/.claude}/orchestrate/<project-slug>/ (on Codex, ${CODEX_HOME:-~/.codex}/orchestrate/<project-slug>/), outside the repo and outside the session. The store has to outlive this chat. The program runs for days, a session restart is expected (see Liveness and failure), and the store is the postmortem. The session scratchpad is not a candidate, however convenient. It is session-scoped and temporary, so a restart takes the program's only state with it. Every file has exactly one writer. Owners publish facts, and readers aggregate at read time.
preferences.mdis the standing-orders register. It holds numbered lines, one constraint each (model policy, stack shape and count, verification bar, forbidden paths, escalation policy). For a human ruling, keep the human's original wording and say who gave it and where. Label your own interpretations, and label a ruling whose original you cannot find. A copy of a ruling is not a new decision. Paste the register verbatim into every spawn and every resume. Directives decay across resumes, and each dropped one costs a human turn. When you catch yourself restating an instruction, append the line before you act (Encode Lessons in Structure, Fire infour-elements).overview.mdis the durable PR and issue database. Append. Never rewrite it wholesale per event.units.tsvhas one row per unit with its id, track, state, branch, PR, head SHA, and brief path. Update rows in place.frontier.jsonis the computed merge frontier, per Stack safety.ledger.tsvis the verification ledger, per Verification.inbox/holds completion pointers.gates.mdparks human gates (the question, the options, the default on no answer).decisions.tsvis the decision trail, kept withbattle-map.status.mdis derived fromunits.tsvandledger.tsvat each drain, never hand-maintained. Regenerate it from the tables instead of narrating events into it.
The brief
Your prompts to agents are your only product, and a sloppy brief compounds into slop across the whole tree. Every spawn carries all of it. A field you cannot fill is a unit you have not scoped yet.
GOAL one sentence, the outcome, executable by a stranger with no chat access
SCOPE paths this unit may write; paths it may not; its exclusive worktree or branch
CONTEXT pointers to files and PRs; upstream reports pasted in full when this unit
depends on them, because workers cannot see siblings
ACCEPTANCE checkable criteria, one per line
VERIFY exact commands or the resolved verify skill path, plus known gotchas
TIMEBOX rough cap on runtime; on expiry, return partial findings and stop rather than run on
FORBIDDEN no PR retargets or merges, no rebase, no force-push, no fixes outside scope,
plus unit-specific bans
REPORT status, branch, head SHA, PRs, verdict, what you actually ran, deviations,
suggested follow-ups
STANDING <preferences.md pasted verbatim>
Size the brief to the unit. A one-command unit gets the template collapsed to a paragraph that still names the goal, the scope, the verify command, and the report shape. A 4 KB scaffold around a two-line edit costs more to write and obey than the edit. A spawn may reference the standing-orders file by store path. Verbatim paste is for every resume and for any brief that has to stand alone.
A sub-coordinator brief adds its track boundary and unit list, its spawn budget, the drain protocol, and the rollup format. The rollup gives, per child, the name, status, PR, head SHA, verdict, and one line, plus the track status and the frontier delta.
A dependency is a context relay, not just ordering. Undeclared upstream context makes the worker guess. Missing fields are a refuse-to-spawn condition. Audit one sampled worker brief per sub-coordinator per wave, concurrently with the wave it samples, never as a gate in front of it. A failing brief stops that track and fixes the sub-coordinator's instructions, not just the worker, because brief quality decays late in a run. Never resume-chain a brief. Respawn fresh with consolidated scope.
Steps
- Frame. State the done predicate as something countable ("all 126 units merged, each ledger-verified
unit-test-verifiedor better"). Quantify the scope: units, rough effort, expected stacks, and the wall-clock budget. If one agent could finish inside that budget, stop here and runnight-watchinstead. Collapsing must not depend on another document being present. It means doing the work directly in this session, with plain workers where they help, verification inline, landing as you go, and none of the store, register, or pilot machinery below. Schedule landing against the budget. By roughly 70% of it, stop spawning and land what is verified. Name the tracks per project. A contested decomposition or a one-way door goes throughagni-kaibefore the pilot. Present the framing once. Reversible prep proceeds without waiting. - Install the runtime. Run
orch init. Open the trail withbattle-map, write the standing orders before any spawn, and seedfrontier.jsonfrom existing PRs withorch frontier set --repo <repo-dir>, adding--forge originwhen the forge is Origin. - Pilot. Push one unit through the whole path: brief, worker, verification, stack entry, ledger row, merge. The pilot exists to falsify the brief template, the verify recipe, and the unit size while that costs one agent instead of fifty. Fix the contract from pilot evidence before any fan-out. Scale the pilot to the unit. On programs of near-identical cheap units, the first unit is the pilot. Run it as a normal unit with its verify command inline, and start the fan-out the moment it lands. The dedicated pilot pipeline (a separate verifier agent, an audit gate) is for expensive or novel unit shapes, not for clone units where a serialized pilot has nothing to falsify.
- Scale. Spawn a rolling window of workers up to the in-flight cap, refilling as children finish. Blocking batches pay the slowest child of every batch. Spawn track sub-coordinators only past the one-drain threshold in Roles. Recompute ready work after each drain. Relay upstream reports into downstream briefs. Keep sibling communication upward only. The sampled brief audit runs alongside the wave it samples, and on failure it stops the next refill, not the current one. Use
kyoshi-formationfor a coverage or verifier fan-out inside a wave. - Drain. Run the queue discipline below at every drain point.
- Land. Landing is continuous, never a terminal phase. Integration starts with the first verified unit and runs alongside the remaining waves. On heavy repos the stacker is a standing role from wave one, integrating as units verify. On repos where local git is cheap, the coordinator lands verified units itself, per Roles. Keep the frontier green before upper-stack work. Stack safety governs. Advance
frontier.jsononly on a merge or on reported new head SHAs. - Close. Drain the final inbox. Reconcile every spawned agent to a terminal row (done, abandoned, zombie-reconciled). Confirm the predicate on the real artifact. Confirm every landed PR has a verdict for its current head SHA. Audit the trail per
battle-map, including its cross-model review. Encode recurring corrections intopreferences.mdor the brief template. Leave the store intact. It is the postmortem.
Queue and drain
- On a completion notification, run
orch inbox push <agent> <unit> <status> [--report PATH]and return to what you were doing. Never deep-review inline. A completion that needs review becomes a verifier unit. Never review a diff inside a drain. - Drain in batches at four points: the end of a critical section, a track rollup, a frontier watcher wake (arm it with Claude Code's
loopskill, with a long heartbeat fallback, or watch the stack withbun ../../tools/watch-pr/watch-prperlong-flight), and before a human report. Begin each batch withorch inbox drain. Arrivals during a drain wait for the next one. - Finish a critical section before you drain. Critical sections are authoring a brief, a stack operation, a conflict decision, writing a gate, and updating the ledger or the frontier.
- Each drain classifies every pointer (landed, needs-verify, failed, zombie, noise), writes the resulting rows through
orch unit add,orch unit set, andorch ledger record, runsorch status, then spawns the next wave in one message. - Account for every spawned child at its track's rollup: arrived, respawned, or its scope explicitly absorbed. Silently redoing a missing child's work hides both the wasted spend and the coverage gap its result existed to close.
- A drain turn ends with the three lines from
orch status: counts against the states, what changed, and gates open. Detail lives instatus.md. The full reply contract applies at checkpoints and at close.
Stack safety
- The frontier is a computed object, never narrative. Recompute
frontier.jsonafter every merge and stack mutation. It holds the ordered PR list, branch names, head SHAs, a generation number, and the lowest unmerged PR.orch frontier setwalks the PR base chain through the checkout's current branch, so chain order and PR states come from the forge. It usesghby default. Pass--forge originwhen the program resolved the forge to Origin. Head SHAs come from local branch refs, so run it from the stacker's clone. A branch with no PR errors rather than guessing. - Exactly one stacker per stack may mutate topology (chain rebases, force-pushes, base retargets, merges), serialized within its stack. Record the holder in the standing orders. A chain rebase at this scale is slow and blocks whoever runs it, so give it its own unit and keep the coordinator out of it. Follow Merge and restack safety for every rewrite.
- Workers never rebase, and never retarget or merge PRs. PR watchers follow
long-flight, one per stack, scoped to one immutable frontier generation. They report conflicts to the stacker rather than rebasing. - PR closes and retargets go through the stacker only. Closing a base PR orphans every chain above it. Merges and stack surgery are units with briefs like any other.
- One retro watcher follows merged PRs for reverts, post-merge CI breaks, and orphaned follow-ups.
Verification
Scale verification to the unit. When VERIFY is a single cheap command, the worker runs it and reports the output, and the coordinator spot-checks receipts. A dedicated verifier agent, on a different model family from the worker, is for units whose verification is expensive, judgment-laden, or high-blast-radius. A verifier agent whose entire product would be rerunning one command is ceremony, not verification.
Write ledger rows with orch ledger record. Check the current PR and head SHA with orch ledger check. ledger.tsv has one row per verdict, keyed by PR number plus head SHA. The verdicts are:
live-ui-verifiedunit-test-verifiedtype-check-onlyverifier-blockedverifier-failed
CI green is an input to a verdict, not a verdict. Behavioral work needs better than type-check-only. verifier-blocked is not a pass. Respawn the verifier when the environment heals. verifier-failed gets a fix unit, not a re-verify. A worker may self-report, and a verifier overrides it on the same key. A new head SHA voids the row, so re-verify after a restack. The ledger answers "was this verified", not memory and not the transcript.
A unit is not done until its output is externalized, the moment it lands, never batched to the end of the run. A worker pushes its branch, a verifier writes its ledger row, and receipts land in the store. Work that exists only on one machine when that machine dies was never done.
Liveness and failure
- Never resume an agent to check on it. A resume restarts an idle agent. Probe read-only: the ledger,
units.tsv,gh, pushed branches, and the background task list. Transcript mtime is not liveness. - A silent death gets a synthetic postmortem row in the inbox (unit, failure mode, last evidence, options). Replan on evidence as it arrives. Never wait for full quiescence.
- Retry by failure mode. A cap hit or out-of-memory respawns with smaller scope. A network drop retries as-is. A tool error retries on a different model. An unknown failure retries once. After two retries, abandon the unit and replan around it.
- A zombie that returns hours late reconciles against the current frontier and ledger before anything is accepted. Salvage unique findings through a fresh unit, never a blind merge.
- When continued spawning would produce garbage tree-wide (bad upstream output, broken acceptance, dead infrastructure), write a stop line at the top of the standing orders, let in-flight work finish, fix the cause, and clear the line.
- Bound your own infrastructure retries the way you bound a child's. After a few consecutive tool aborts, stop retrying. Write a terminal handoff to durable state (what is done, where it lives, the exact command to resume) and end the run.
- After a session restart, in-flight subagents are dead. Pushed branches, open PRs, and the store are not. Re-read the standing orders and
units.tsv, recompute the frontier, reattach in-flight work by PR and branch rather than by agent id, respawn one sub-coordinator per track from its stored brief plus the current state, drain, and resume. The dead session's store lock clears itself on the next write, becauseorchreplaces a lock whose holder pid is gone.
Escalation
These reach the human, batched into the status page rather than sent per item:
- irreversible actions (force-push to a shared branch, deploys, deletions, closing someone else's PR)
- genuine product or preference calls no experiment settles
- a standing order that contradicts observed reality
- a program-level dead end that survived a replan
Park each as a gates.md entry with orch gate park before asking, and route work around it.
These never reach the human: frontier nudges, rebase mechanics, retries, CI flake triage, review-thread triage, format fixes, scope the brief already forbids (refuse it and continue), and "should I keep going". When in doubt, act and log.
Mid-run discoveries fix only what blocks the frontier. Everything else parks in follow-ups. At this fan-out a small scope leak multiplies into PRs nobody asked for.
Reply
At checkpoints and at close, report:
- the predicate and the count against it, from
units.tsvandledger.tsv - the tracks and what each landed
- the frontier (PR list plus SHAs)
- a summary of the verdicts
- what was abandoned and why
- gates awaiting the human (the only asks)
- the store path and the trail path
Take numbers from the tables, not narrative. Link each PR as https://github.com/<owner>/<repo>/pull/<number>. Write it per tea-time.
Files in this skill
1kyoshi-command skill questions
How do I install the kyoshi-command skill in Claude Code?
Run npx degit tmcfarlane/team-avatar/plugins/team-avatar/skills/kyoshi-command ~/.claude/skills/kyoshi-command. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the kyoshi-command skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What is the primary role of the Coordinator in this skill?
The Coordinator frames the project, authors briefs, manages the inbox, and makes judgment calls without authoring or editing code directly.
Can I use this skill for small, single-agent tasks?
No, this skill is intended for ambitious programs that outlive a single agent; if one agent can finish within the session budget, you should use night-watch instead.