fleet-orchestration
Skill29 starsChanged 2 months agoMITView on GitHub
Operating rules for running a multi-agent fix fleet through plan, implement, adversarial judge, and commit. Use when the user says fleet, multi-agent fix, judge loop, or resume workflow. Covers checkpoint resume, disjoint-lib batching, the commit window, commitlint gates, and the nx run-many test rule.
In this repository25 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- agent-lanesSkill
- angular-3d-scene-crafterSkill
- angular-frontend-patternsSkill
- angular-gsap-animation-crafterSkill
- ddd-architectureSkill
- execute-phase-gated-taskSkill
- extract-and-relocate-angular-component-featureSkill
- humanize-librarySkill
- impeccableSkill
- nestjs-backend-patternsSkill
- nestjs-deploymentSkill
- nx-workspace-architectSkill
- orchestrationSkill
- ptah-cli-usageSkill
- resilient-nestjs-patternsSkill
- saas-platform-patternsSkill
- saas-workspace-initializerSkill
- skill-creatorSkill
- technical-content-writerSkill
- tribunalSkill
- typesafe-aiSkill
- ui-ux-designerSkill
- video-showcaseSkill
- webhook-architectureSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Run N independent bugfix or perf tasks as one fleet.
- Distinctive: line 16
Use this skill when the user asks to run several independent bugfix or perf tasks at once, each with its own task spec folder.
- Distinctive: line 84
Commit ONLY when no implementer is editing.
- Distinctive: line 102
Every body line: at most 100 chars.
- Very specific: line 115
Never run nx test projA projB.
- Very specific: line 118
Always run npx nx run-many -t test -p <projects>.
- Very specific: line 153
Wait for <agent-lane-completed>.
- Very specific: line 154
No signal → one ptah_agent_status { agentId } check, never a loop (agent-lanes skill §4).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fleet Orchestration Skill
Run N independent bugfix or perf tasks as one fleet. Each task is a
.ptah/specs/TASK_YYYY_NNN folder. The fleet moves every task through
plan, implement, adversarial judge, and commit. Use subagents or CLI
agents as the workers. You are the orchestrator. You compute state from
disk, you batch the work, and you commit.
1. WHEN TO USE
Use this skill when the user asks to run several independent bugfix or perf tasks at once, each with its own task spec folder.
- Each task is a
.ptah/specs/TASK_YYYY_NNNfolder. - Each task moves through: plan, implement, adversarial judge, commit.
- Workers are subagents (Task tool) or CLI agents (ptah_agent_spawn).
- You are the orchestrator: you batch, you verify, you commit.
Worked example:
Run TASK_2026_341..354 as one fleet. Group them by area. Plan each, implement each, judge each, then commit in one window.
2. HARNESS LIMITATION
This skill exists because of a Claude Code Workflow resume bug. Resume replays the longest unchanged PREFIX of agent() calls. parallel() starts calls in non-deterministic order. After a host crash, a resume re-runs finished agents and can flip completed task statuses back to in_progress.
Rule: never rely on resumeFromRunId for a parallel fleet. Resume by
recomputing state from disk artifacts. Re-invoke the workflow with fresh
args. The .claude/workflows/fleet-fix.js script takes that args shape.
Worked example:
A crash hits mid-batch. Do not call resumeFromRunId. Read each task.md status line and each judge-round-N.json. Build fresh args. Re-invoke fleet-fix.js with the new args.
3. ARTIFACT CHECKPOINTS
Three artifacts mark progress. Each proves one stage is done.
context.mdexists: planning is done.task.mdstatus:line isin_reviewordone: implementation is done. Edit exactly the status line. Never rewrite the carrier..ptah/specs/<id>/judge-round-<n>.json: judge round n is done. Schema:{ taskId, round, pass, defects[], testsRan, mentorNote }.
Agents write their artifact BEFORE they return. A re-spawned agent that finds its artifact must no-op and return.
Worked example:
Implementer returns. You check task.md: status is
in_review. You check judge-round-1.json: it is missing. You run judge round 1.
4. DISJOINT-LIB BATCHING
Two concurrent implementers must never edit the same lib. Group tasks by area. Same area runs sequential. Different areas run parallel.
This prevents a named failure: Edit-tool conflicts and test flakes from concurrent edits in one working tree.
Batch cap: one batch is at most 6 files across at most 2 libs, verified
by one scoped command (-p on those libs only). Bigger than that is two
batches. A long lane resends its whole context on every tool call, so
narrow batches are cheaper than one lane that does everything.
Worked example:
TASK_341 and TASK_342 both touch
agent-sdk. Run them sequential. TASK_343 toucheschat-ui. Run it parallel with the agent-sdk pair.
5. COMMIT WINDOW
Commit ONLY when no implementer is editing. The pre-commit hook runs lint-staged. lint-staged backs the tree up to a git stash and restores it after tasks. Concurrent agent edits made during the hook window are silently reverted.
Also: never run git commit from inside a workflow agent. The
orchestrator commits, in a quiet window, after all implementers stop.
Worked example:
All implementers return. All task.md status lines are
doneorin_review. No judge is writing. You commit now.
6. COMMITLINT GATES
This repo enforces commitlint. Follow these gates.
- Subject line: at most 72 chars.
- Every body line: at most 100 chars. Wrap at 72.
- Scope must be in the scope enum in commitlint config. Examples:
agent-sdk,rpc-handlers,electron,chat,vscode-core. securityandgitare NOT scopes.- Multi-scope with commas is allowed.
Worked example:
fix(agent-sdk,chat-streaming): scope the panel request- valid.fix(git): ...- rejected,gitis not a scope.
7. NX TEST RULE
Never run nx test projA projB. The positional names become Jest path
filters. Zero tests run. The command exits 0. You get a green lie.
Always run npx nx run-many -t test -p <projects>. Then READ the
"Running target test for N projects" header. Check that N is the number
you asked for. A misspelled project name is silently dropped. Tail or
filter the output (the header, failures, the summary); never put a full
test log into context.
Worked example:
npx nx run-many -t test -p @ptah-extension/chat @ptah-extension/markdownPrint "Running target test for 2 projects". 2 matches the ask. Proceed.
8. JUDGE PROTOCOL
The judge stance is to refute. The default verdict is fail.
- Number every defect with a
file:lineanchor and a concrete failing scenario. - Max 2 judge rounds. Then escalate to the orchestrator.
- Judges are read-only. No source edits. No task.md edits.
- A judge writes
judge-round-<n>.jsonbefore it returns.
Worked example:
Judge round 1 finds 2 defects. The revise stage consumes the defects. Judge round 2 finds 0 defects. It sets
pass: true. You commit.
9. CLI AGENT LANES
CLI agents (codex, ollama-cloud via ptah-cli) have NO shared context. Prompts must be fully self-contained. Use absolute Windows paths. State an explicit output format.
Flow: Spawn, wait for the completion signal, then Read.
ptah_agent_spawn { task, cli, files, deliverables }- Wait for
<agent-lane-completed>; it is pushed into this session. No signal → oneptah_agent_status { agentId }check, never a loop (agent-lanes skill §4). ptah_agent_read { agentId }- Max 3 concurrent CLI agents.
Worked example:
Spawn codex on TASK_341 with a self-contained prompt and the absolute path
D:/projects/ptah-extension/libs/backend/agent-sdk/. Do other work until the completion signal arrives. Read the output. Verify before you trust it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

