Orchestrates multi-session workflows via Fleet API. Use when spawning child sessions for parallel or delegated work.
64
76%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Risky
Do not use without reviewing
Optimize this skill with Tessl
npx tessl skill review --optimize ./skills/fleet-orchestration/SKILL.mdThis 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 userBefore 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/sessionsThe 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: errorTell 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 directory5ff2c3a
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.