skills/fleet-orchestration/SKILL.md
Orchestrates multi-session workflows via Fleet API. Use when spawning child sessions for parallel or delegated work.
npx skillsauth add pgermishuys/weave-agent-fleet fleet-orchestrationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill teaches you how to orchestrate multi-session workflows using the Weave Agent Fleet API. Use it when the user asks you to work on multiple independent issues, repositories, or modules in parallel.
DO orchestrate when:
DO NOT orchestrate when:
Before spawning any children, determine whether tasks can safely run in parallel. This step is mandatory — skipping it risks merge conflicts, lost work, or wasted compute.
For each pair of tasks, assess file overlap:
| Overlap | Strategy | Example |
|---|---|---|
| No overlap — tasks touch completely different files/modules | Parallel with worktree | "Add auth tests" + "Fix dashboard CSS" |
| Possible overlap — tasks might touch shared files (configs, shared utils, types) | Sequential, or parallel with careful scoping | "Refactor auth module" + "Add auth rate limiting" |
| Definite overlap — tasks target the same files | Sequential only | "Fix login bug in auth.ts" + "Add MFA to auth.ts" |
Identify affected files — For each task, list the files/directories it will likely touch. Consider:
Check for shared boundaries — Even if tasks target different features, they may conflict on:
index.ts)npm install)When in doubt, serialize — A sequential run that succeeds is better than parallel runs that produce merge conflicts.
Always tell the user what you decided and why:
"I've analyzed the 3 tasks. Tasks 1 and 2 touch separate modules (auth vs. dashboard) — I'll run them in parallel using worktrees. Task 3 modifies shared types that Task 1 also touches, so I'll queue it after Task 1 completes."
When some tasks can parallelize and others must be sequential:
Example flow:
Batch 1 (parallel): Task A + Task B (no overlap)
↓ both complete via callbacks
Batch 2 (sequential): Task C (depends on A's output)
↓ completes via callback
Done — report results to user
Before spawning children, find your own session ID and instance ID. These will be used in the onComplete callback so children can notify you when they finish.
curl -s http://localhost:${FLEET_PORT:-3000}/api/sessions
The response is an array. Find your own entry by matching workspaceDirectory or session.title to your current context. Extract:
instanceId → your instance IDsession.id → your OpenCode session IDImportant: Use these exact values from the API response — do NOT guess or invent them.
For each parallel task, create a child session with an onComplete callback pointing back to you:
curl -s -X POST http://localhost:${FLEET_PORT:-3000}/api/sessions \
-H "Content-Type: application/json" \
-d '{
"directory": "/path/to/project",
"title": "Fix Issue #1 — Auth bug",
"isolationStrategy": "worktree",
"onComplete": {
"notifySessionId": "YOUR_OPENCODE_SESSION_ID",
"notifyInstanceId": "YOUR_INSTANCE_ID"
}
}'
Field mapping for onComplete — use values from your own session list entry:
| Value you need | Where to get it |
|---|---|
| notifySessionId | session.id from your entry in GET /api/sessions |
| notifyInstanceId | instanceId from your entry in GET /api/sessions |
The response contains the child's instanceId and session.id — save these to send it a prompt.
Isolation strategies:
| Strategy | Use When | Parallel-Safe |
|---|---|---|
| "worktree" | Parallel work on the same repo | Yes — each child gets its own git worktree and branch |
| "clone" | Completely isolated environments | Yes — each child gets a separate shallow clone |
| "existing" | Single session, or separate repos | No — multiple sessions share the same directory and will conflict |
Rule: Never use
"existing"when spawning multiple children on the same directory. Always use"worktree"or"clone".
Once the child session is created, give it its task:
curl -s -X POST http://localhost:${FLEET_PORT:-3000}/api/sessions/${CHILD_SESSION_ID}/prompt \
-H "Content-Type: application/json" \
-d '{
"instanceId": "CHILD_INSTANCE_ID",
"text": "Fix GitHub issue #1: the JWT token is not being refreshed correctly. The bug is in src/auth/token.service.ts. Write tests and ensure the build passes."
}'
Use session.id (OpenCode session ID) from the POST /api/sessions response as CHILD_SESSION_ID.
Write clear, scoped instructions — the child has no context other than what you give it. Include:
After spawning and prompting all children, wait — do NOT poll. When a child finishes, the Fleet automatically sends you a callback prompt in this format:
[Fleet Callback] Child session completed.
Session ID: <fleet-db-session-id>
Title: Fix Issue #1 — Auth bug
Files changed: 3
added: src/auth/token.service.spec.ts
modified: src/auth/token.service.ts
modified: src/app.module.ts
Status: idle (completed successfully)
For errors:
[Fleet Callback] Child session encountered an error.
Session ID: <fleet-db-session-id>
Title: Fix Issue #1 — Auth bug
Status: error
Tell the user you are waiting: "I've spawned 3 child sessions. Waiting for them to complete..."
After receiving a callback, inspect what the child did:
Get diffs:
curl -s "http://localhost:${FLEET_PORT:-3000}/api/sessions/${CHILD_SESSION_ID}/diffs?instanceId=${CHILD_INSTANCE_ID}"
Get messages/conversation:
curl -s "http://localhost:${FLEET_PORT:-3000}/api/sessions/${CHILD_SESSION_ID}?instanceId=${CHILD_INSTANCE_ID}"
After all parallel children complete, verify there are no conflicts before reporting success:
When a child encounters an error:
worktree isolation for parallel work on the same repo — avoids branch conflictsexisting for parallel children on the same directorydevelopment
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.