src/orchestrator/skills/orchestration-protocols/SKILL.md
Coordinates multiple agents with parallel task spawning, health monitoring, circuit breakers, and escalation paths. Use when managing parallel agents, handling agent timeouts, orchestrate agents, run tasks in parallel, concurrent agent execution, or fan-out tasks. Use when coordinating multi-agent task delegation.
npx skillsauth add etylsarin/opencastle orchestration-protocolsInstall 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.
Runtime patterns for managing delegated agents.
Intervene early when you spot:
| Signal | Action | |--------|--------| | Failing tests/builds | Check dependency resolution; revert if builds break | | Unexpected file changes | Revert; enforce partition | | Scope creep | Redirect to scoped files only | | Circular behavior | Halt; switch approach | | Intent misunderstanding | Clarify prompt; re-delegate |
When redirecting, explain why and how:
"Don't modify
libs/data/src/lib/product.ts— shared across features. Add the new query inlibs/data/src/lib/reviews.ts."
Sub-agents: Catch problems early (5 min in can save an hour). Background agents: Steer post-hoc — invest in prompt specificity and partition constraints upfront.
Run autonomously in isolated Git worktrees. Reserve for well-scoped tasks >5 min with clear acceptance criteria.
--resume to continueSpawn multiple research sub-agents in parallel when 3+ independent questions must be answered before implementation. Spawn if: ≥3 independent questions AND answers span multiple codebase areas — otherwise handle sequentially.
| Rule | Detail | |------|--------| | Divide by topic/area | Each researcher owns a coherent domain | | Max 3–5 researchers | More creates diminishing returns and token waste | | Focused scope per agent | Explicit dirs, file patterns, or questions | | Economy/Standard tier | Manage cost for research sub-agents |
Prompt template:
Research: [specific question]
Scope: [files/directories to search]
Return: key findings, relevant file paths (with line numbers), patterns, unanswered questions
Summarize prior phase output before passing to the next agent. Extract: files changed, key decisions, verification (pass/fail), blockers. Discard: raw tool output, reasoning traces, failed attempts.
Template:
### Prior Phase Output
**Phase [N] — [Agent Name] — [Task Title]**
- Files changed: [list]
- Decisions: [key decisions affecting downstream work]
- Verification: [lint ✅ | types ✅ | tests ✅]
- Blockers: [none | list]
Concrete example:
### Prior Phase Output
**Phase 2 — Researcher A — Find usages of `calculateTotal()`**
- Files changed: none (read-only research)
- Decisions: `calculateTotal` lives in `libs/cart/src/lib/total.ts`; new logic should live in `libs/cart/src/lib/discounts.ts`
- Verification: lint ✅ | types ✅ | unit smoke test (cart total) ✅
- Blockers: design question on rounding behavior (see `docs/rounding.md`)
Detailed Agent Health Monitoring, Error Recovery Playbook, and Agent Circuit Breaker tables have been moved to REFERENCE.md to keep this skill concise. See REFERENCE.md in this directory for thresholds, recovery steps, and escalation flows.
These use the OpenCastle CLI (npx opencastle or bin/cli.mjs):
opencastle run --file convoy.yml --dry-run
opencastle run --file convoy.yml --verbose
opencastle run --resume
opencastle run --status
opencastle run --retry-failed
Post-run verification (copy-paste checks):
if [ $? -ne 0 ]; then
echo "opencastle run failed — inspect .opencastle/convoy.log" \
&& tail -n 200 .opencastle/convoy.log && exit 1
fi
npx opencastle run --status
grep -i "error\|failed" .opencastle/convoy.log || echo "no obvious errors in logs"
| Phase | Check | Command / Action |
|-------|-------|-----------------|
| Pre-spawn | Inputs present (task, scope, ACs) | test -s convoy.yml \|\| exit 1 |
| During-run | Tail for fatal errors | tail -F .opencastle/convoy.log \| grep -i "fatal\|error" |
| Pre-merge | All agents exited 0 | jq -e '.agents[] \| .exit_code == 0' .opencastle/results.json |
| Output schema | Required fields present | jq -e '.agents[] \| (.findings and .file_paths)' .opencastle/results.json |
| Post-merge | Lint + smoke tests pass | npm run lint && npm test -- -t "smoke" |
| Blocker | Any failure | Block merge; reopen to original researcher(s) |
development
Defines 10 sequential validation gates: secret scanning, lint/test/build checks, blast radius analysis, dependency auditing, browser testing, cache management, regression checks, and smoke tests. Use when running pre-deploy validation or CI checks, CI/CD pipelines, deployment pipeline validation, pre-merge checks, continuous integration, or pull request validation.
development
Generates test plans, writes unit/integration/E2E test files, identifies coverage gaps, and flags common testing anti-patterns. Use when writing tests, creating test suites, planning test strategies, mocking dependencies, measuring code coverage, or test planning.
development
Provides model routing rules, validates delegation prerequisites, supplies cost tracking templates, and defines dead-letter queue formats for Team Lead orchestration. Load when assigning tasks to agents, choosing model tiers, starting a delegation session, running a multi-agent workflow, delegating work, choosing which model to use, or assigning tasks.
testing
Saves and restores session state including task progress, file changes, and delegation history. Use when saving progress, resuming interrupted work, picking up where you left off, or checkpointing current work.