/caddis-extras:agent-orchestrationfrom caddis-extras
Blueprint for orchestrating the agent pipeline from spec to planning, implementation, testing and debugging, plus when a second model is worth it, the intent→model map and cost guardrails.
Ships in caddis-extras. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Codify the operator-led orchestration methodology: a repeatable workflow where the human operator drives a multi-agent pipeline from raw specification to production-ready code. This skill captures the exact sequence, decision points, and artefacts that emerged from real feature delivery so any future session can follow the same playbook.
The operator (human) acts as orchestrator. Agents act as an advisory board — each specialised, none acting unilaterally. The operator:
┌─────────────────────────────────────────────────────────┐
│ OPERATOR-LED PIPELINE │
│ │
│ Operator ◄──► PRD Agent (requirements) │
│ Operator ◄──► Architect Agent (design decisions) │
│ Operator ◄──► Planner agent (implementation plan) │
│ Operator ◄──► Implement Agent (code generation) │
│ Operator ◄──► Tester Agent (test coverage) │
│ Operator ◄──► Code Reviewer (quality gate) │
│ Operator ◄──► Debug Agent (cross-cut polish) │
│ │
│ The operator is the thread that ties agents together. │
│ Agents never chain autonomously without review. │
└─────────────────────────────────────────────────────────┘
Every stage produces a persistent artefact (markdown file, commit, test run) that the next stage can consume without relying on conversation memory. This is what makes multi-session execution reliable.
The pipeline below is the sequential axis — which agent, in what order. There is a second, independent axis: how many models work a given stage. That is deliberately rationed — see Multi-model fan-out before reaching for a second model.
| Stage | Artefact | Location |
|---|---|---|
| Requirements | Spec / feature file | Supplied by operator (e.g. nextprompt.md) |
| Quick-Win Triage | Commit with passing tests | Git history |
| Architecture | ADR (Architecture Decision Record) | Inside the plan document |
| Planning | Plan document (phases, steps, files) | .caddis/plans/<feature>.md |
| Fidelity Audit | Gap table (0 gaps = pass) | Inside the plan document |
| Risk Assessment | Risk register (scored risks) | Inside the plan document |
| Implementation Prompts | Embedded copy-paste prompts | Inside the plan document |
| Implementation | Code + tests per phase | Git commits per phase |
| Code Review | Review report | Chat session or plan annotation |
| Debug / Polish | Fix-up plan (issues A–N) | .caddis/plans/<feature>-fixup.md |
Spec Input
│
▼
┌─────────────────┐
│ Stage 0: Triage │ ← Quick wins (H1–H3) committed immediately
└────────┬────────┘
│
▼
┌─────────────────┐
│ Stage 1: ADR │ ← Architect Agent scores options, operator picks
└────────┬────────┘
│
▼
┌─────────────────┐
│ Stage 2: Plan │ ← Planner agent writes phased plan + fidelity audit
└────────┬────────┘
│
▼
┌─────────────────┐
│ Stage 3: Absorb │ ← Mid-flight changes merged into plan (optional)
└────────┬────────┘
│
▼
┌─────────────────────────────┐
│ Stage 4: Implement (×N) │ ← One phase per session, tests pass
└────────┬────────────────────┘
│
▼
┌─────────────────┐
│ Stage 5: Review │ ← Code Reviewer Agent checks each phase
└────────┬────────┘
│
▼
┌─────────────────┐
│ Stage 6: Debug │ ← Cross-component polish, final commit
└─────────────────┘
Agent: Planner agent (read-only analysis) → Implement Agent (execute)
Purpose: Before any heavy planning, scan the spec for low-effort / high-value items that can be shipped in a single session.
Process:
nextprompt.md)feat: H1–H3 quick wins — <summary>Decision Gate:
Artefact: Git commit with passing tests.
Agent: Architect Agent
Purpose: For non-trivial work, evaluate competing design approaches before committing to a plan.
Process:
Decision Gate:
Artefact: ADR section in the plan document with option scores and rationale.
Agent: Planner agent
Purpose: Create a comprehensive, phased implementation plan that any agent can follow without ad-hoc interpretation.
Process:
.caddis/plans/<feature-name>.mdAfter authoring, audit the plan against the spec:
┌──────────────────────────────────────────────────┐
│ FIDELITY AUDIT │
│ │
│ For EACH requirement in the spec: │
│ → Is it mapped to a plan step? │
│ → Is the mapping specific (not hand-wavy)? │
│ │
│ Produce a gap table: │
│ | Spec Item | Plan Step | Status | │
│ |-----------|-----------|--------| │
│ | Feature X | Phase 2.3 | ✅ | │
│ | Feature Y | — | ❌ GAP | │
│ │
│ Target: 0 gaps before proceeding. │
└──────────────────────────────────────────────────┘
Score each identified risk:
| Risk | Likelihood (1–5) | Impact (1–5) | Mitigation |
|---|---|---|---|
| Example risk | 3 | 4 | Mitigation strategy |
Decision Gate:
Artefact: Plan document with fidelity audit table, risk register, and embedded prompts.
Agent: Planner agent (or the operator)
Purpose: Handle changes that arrive after the plan is created but before or during implementation. This is inevitable in real projects.
Triggers:
Process:
docs: absorb <change> into plan — <N> editsExample from practice:
Operator added
SCORE_TOOLTIPSdict to the Pydantic model independently. Planner agent traced 16 affected steps, updated them to reference the new dict, fixed band name inconsistencies exposed by the change, and regenerated 5 prompts.
Anti-pattern: Implementing against a stale plan. Always check if the plan reflects current reality before starting a phase.
Artefact: Updated plan document + commit.
Agent: Implement Agent (one phase per session)
Purpose: Execute the plan incrementally, with each session producing a committed, tested increment.
Process per phase:
Read .caddis/plans/<feature>.md and implement Phase N.
Run the tests of the files you changed, in the foreground, each command under 10 minutes. They must pass before commit. CI runs the full suite.
feat(<scope>): phase N — <summary>Session Discipline:
Embedded Prompts: The plan document should contain copy-paste prompts for each phase. This removes ambiguity:
### Phase 2 Prompt (copy into new chat)
> Read `.caddis/plans/my-feature.md`, specifically Phase 2 (steps 5–9).
> Implement each step in order. Run `pytest tests/ -x -q` after each file edit.
> When all steps pass, commit with message:
> `feat(cards): phase 2 — insight card refactoring`
Artefact: Git commit per phase with passing tests.
Agent: Code Reviewer Agent
Purpose: Quality gate before declaring the implementation complete.
Process:
Artefact: Review report (clean pass or list of issues).
Agent: Debug Agent (analysis) → Implement Agent (fixes)
Purpose: After multi-phase implementation, cross-cutting issues often emerge that no single phase could have caught. This stage catches them.
Triggers:
Process:
.caddis/plans/<feature>-fixup.mdfix(<scope>): post-track cross-component polishExample from practice:
After 5 implementation phases, the Debug Agent found:
- Health Score appearing in both insight cards AND summary card (duplication)
- Two tooltip CSS functions with different background colours (#4A4A4A vs #1F2937)
- Card height inconsistency (one card taller due to unused metric)
- Verbose alert text that should have been simplified These became 7 catalogued issues (A–G) in a fix-up plan.
Artefact: Fix-up plan document + final commit.
┌─────────────────────────────────────────────────────────┐
│ AGENT SELECTION GUIDE │
├─────────────────────────────────────────────────────────┤
│ │
│ "I have a raw spec / feature request" │
│ → Planner agent (triage quick wins, then plan) │
│ │
│ "I need to choose between design approaches" │
│ → Architect Agent (ADR with scored options) │
│ │
│ "I have a plan, need implementation" │
│ → Implement Agent (one phase per session) │
│ │
│ "Implementation is done, need quality check" │
│ → Code Reviewer Agent │
│ │
│ "Tests are failing after implementation" │
│ → Debug Agent (root-cause, then fix) │
│ │
│ "Multiple components don't look right together" │
│ → Debug Agent (cross-component audit) │
│ │
│ "I changed the model / data independently" │
│ → Planner agent (absorb changes into plan) │
│ │
│ "I need database schema changes" │
│ → SQL Expert Agent │
│ │
│ "I need new Streamlit components" │
│ → Streamlit Developer Agent │
│ │
│ "Session needs resumable context" │
│ → Relay Skill │
│ │
└─────────────────────────────────────────────────────────┘
⚠️ If you are not Claude Code, treat this section as ADVISORY and execute solo.
The
Agenttool, its per-agentmodel:override, theWorkflowtool, and the/glm,/deepseek,/caddis:cross-reviewcommands described below are Claude-Code-only. On Codex, Copilot, Antigravity/agy, or any other host: take the judgement from this section — default solo, cheapest deterministic check first, don't trust a single model on a security invariant — and ignore the mechanics. Do not attempt to emulate fan-out by hand, do not tell the user to run tools your host does not have, and do not treat the model map below as instructions you can execute. Solo execution is a correct, complete outcome here.
Everything above is sequential: one model, one stage at a time, operator in the loop. Fan-out — running two or more models on the same work and reconciling their output — is a separate axis, and it is expensive in three currencies at once: provider quota, the orchestrator's own context, and the human's attention. It earns its cost rarely. The rules below are ordered; apply them in order.
One model does the work. That is the default and it is right most of the time. Fan out only when the work is genuinely high-risk or high-uncertainty:
| Fan out | Stay solo |
|---|---|
| Security-sensitive code — authn/authz, crypto, secret handling, input trust boundaries | Boilerplate, CRUD, scaffolding |
| Correctness-critical algorithms where a subtle wrong answer looks right (concurrency, money, dates/timezones, migrations, dedup/merge logic) | Mechanical refactors with a green suite either side |
| Ambiguous specs — where the risk is that everyone misreads the requirement the same way | Anything a test, type-checker, or linter can decide |
| Verifying a frontier model's own risky output — a model is the worst reviewer of its own reasoning | Work already covered by an existing review gate |
| Irreversible / wide blast radius — a drop, a flag day, a fleet-wide sweep | Work you can trivially revert |
Two failure modes, both real: fanning out on size (a big mechanical task is still solo — split it across sessions, not models) and fanning out for reassurance (a second opinion you have already decided to ignore is pure cost).
Never spend a second model on something a deterministic check can decide. Climb this ladder and stop at the first rung that answers the question:
mypy/tsc, or a lint rule confirms
the concern, you are done — that is a fact, not an opinion, and it costs nothing.code-reviewer, security-analyst, anchor, preflight) — a
fresh context, not a fresh vendor. Catches most "did we miss something" cases.If a deterministic check can be written but doesn't exist yet, write the check — it is cheaper than the model call and it keeps paying.
Talk about lanes by what they are for, so plans, prompts, and reviews survive model releases and the LiteLLM cutover. This table is the single place the intent→model mapping lives — everything else (plans, commands, skills) refers to the intent name and points here.
| Intent | What it's for | Current model | Claude Code mechanics | Cost |
|---|---|---|---|---|
| deepest | Subtle correctness, security invariants, novel architecture, judgment-heavy seams | opus | /model opus; Agent(model: "opus") | High — Anthropic plan quota |
| broad | Wide parallel coverage of a large but not-subtle surface; the workhorse | sonnet | /model sonnet; Agent(model: "sonnet") | Medium — the default; budget for several |
| mechanical | Fully-specced, repeat-of-a-known-pattern, no judgment required | haiku | /model haiku; Agent(model: "haiku") | Low |
| cross-vendor-reviewer | A different vendor's blind spots on a diff — code review only | agy-carbon (default), deepseek, glm | /caddis:cross-review, /glm, /deepseek | Scarce — separate starter-tier subscription, NOT Anthropic quota. Ration it. |
| synthesis / long-horizon | Orchestrating many lanes, or work that can't self-verify across a large codebase | fable | /model fable | Very high — ~2× opus's rate-limit burn. RARE. |
Update this table, not the callers, when a model is added, retired, or re-tiered. A plan that says "cross-vendor-reviewer" keeps working; a plan that says "deepseek-chat" rots.
These are constraints, not preferences. Each exists because breaking it produced a real cost.
Invent no new machinery. Everything needed already ships:
| Need | Use |
|---|---|
| Second opinion, same vendor, fresh context | Agent tool → code-reviewer / security-analyst / anchor / preflight |
| A different tier for one lane only | The Agent tool's model: override (per-agent; does not change the session model) |
| 2–4 lanes in parallel | Several Agent calls in one message — they run concurrently. This is enough; you do not need anything heavier. |
| Deterministic multi-stage orchestration (fan out over a discovered list, loop until dry, adversarial verify stages) | The Workflow tool — only when the human explicitly asks for it; it can spawn dozens of agents |
| Cross-vendor review of a diff | /caddis:cross-review (or python .github/tools/oss_review.py --provider deepseek|glm --range <range>) |
| Cross-vendor opinion that needs to read the repo | /glm <prompt> or /deepseek <prompt> |
| Cross-vendor one-shot, no repo context | /ask-glm / /ask-deepseek |
| Per-phase model + lane assignment in a plan | /caddis:feature-plan — every phase already carries Model, Lane, and a cross-review provider |
Reviewer rule (standing): the reviewer is chosen by the author, and is never the same vendor.
Agy-written code gets Claude (Sonnet; Opus at tier 2). Claude-written code gets agy Neon high (Carbon medium if it fails). Pass --author and --tier to /caddis:cross-review.
Full command/billing decision table: docs/guide/multi-model-workflow.md.
| ❌ Anti-Pattern | ✅ Instead |
|---|---|
| Fanning out because the task is big | Fan out for risk, not size — split a big mechanical task across sessions, not models |
| Spending a cross-vendor pass before the tests have run | Cheapest check first — deterministic gates decide it for free |
| One cross-vendor agent per area | One consolidated cross-vendor pass per task — the lane is rationed |
| Using DeepSeek/GLM for audit, research, or planning | Code-review lane only — they are unreliable outside it |
| Adding an Nth lane without budgeting the synthesis | Cap the lanes; reconciling N reports lands on you and the human |
| Acting on a subagent's HIGH finding as reported | Re-verify it in the main thread against the cited file/line first |
| Blocking the task when a rationed lane is out of quota | Degrade to solo, log the skipped pass, continue |
| Jumping straight to code without a plan | Triage → ADR (if needed) → Plan → Implement |
| Implementing all phases in one session | One phase per session — clean context, focused work |
| Letting agents edit the plan document | Only the Planner agent (or operator) edits plans |
| Ignoring mid-flight changes | Absorb changes into the plan before continuing |
| Skipping fidelity audit | Audit every plan — 0 gaps required |
| Committing without tests | Tests pass before every commit |
| Doing handoff chains instead of phased work | Use plan documents for large work, handoffs for emergencies |
| Building the fix-up list from memory | Debug Agent audits files systematically, catalogues issues |
| Trying to fix cross-component issues during implementation | Finish all phases first, then do a dedicated debug pass |
Operator opens new chat:
"I have a feature spec in <file>. Let's use the operator-led pipeline:
1. Read the spec
2. Triage quick wins (H1–H3)
3. Implement quick wins and commit
4. Then create a phased plan for remaining work
Load .github/skills/workflow/agent-orchestration/SKILL.md for the methodology."
Operator opens new chat:
"Read .caddis/plans/<feature>.md and implement Phase N.
Run pytest after each file change. Commit when all tests pass.
Use message: feat(<scope>): phase N — <summary>"
Operator opens new chat:
"All implementation phases for <feature> are complete.
Audit all changed files for cross-component issues.
Catalogue each issue (A–N) with root cause, fix, and acceptance criteria.
Write the fix-up plan to .caddis/plans/<feature>-fixup.md"
Operator opens new chat:
"I independently added <change> to <file(s)>.
Read .caddis/plans/<feature>.md and update it to absorb this change.
Trace every affected step, update embedded prompts, re-verify fidelity."
Every stage that produces code changes should result in a commit:
| Stage | Commit Prefix | Example |
|---|---|---|
| Quick wins | feat: | feat: H1–H3 quick wins — tooltip bands, CSS fix |
| Plan + ADR (no code) | docs: | docs: create implementation plan + ADR for <feature> |
| Plan absorption | docs: | docs: absorb SCORE_TOOLTIPS into plan — 16 edits |
| Phase N | feat(<scope>): | feat(cards): phase 2 — insight card refactoring |
| Code review fixes | fix: | fix(cards): address review feedback — null guard |
| Debug polish | fix: | fix(ui): post-track cross-component polish |
A well-orchestrated session should produce:
| Situation | Load This Skill |
|---|---|
| Session continuation context | .github/skills/workflow/relay/SKILL.md |
| Verifying code before committing | .github/skills/workflow/verification-loop/SKILL.md |
| Writing implementation plans | .github/skills/docs/writing-plans/SKILL.md |
| Running the cross-vendor review lane | .github/skills/coding/cross-review/SKILL.md |
| Creating new reusable skills | .github/skills/workflow/skill-creator/SKILL.md |
| Best practices reference | .github/skills/workflow/best-practices/SKILL.md |
The methodology in this document was extracted from a real multi-agent UI-polish delivery:
| Stage | Artefact | Outcome |
|---|---|---|
| Triage | Commit ad29844 | H1–H3 quick wins, 393 → 410 tests passing |
| ADR | Option B selected (score 4.1/5) | Micro-frontend hybrid for chat widget |
| Plan | 1035-line plan document | 5 phases, numbered steps, embedded prompts |
| Fidelity Audit | 0 gaps | All 470 lines of spec mapped |
| Risk Assessment | 6 risks, 0 showstoppers | All mitigated |
| Absorption | 16 plan edits | SCORE_TOOLTIPS model change integrated |
| Phases 1–5 | 5 commits | All tests passing per phase |
| Code Review | Clean pass | No issues found |
| Debug | 7 issues catalogued (A–G) | Fix-up plan created |
This end-to-end cycle took ~10 sessions with full artefact trail and zero rework of fundamental design decisions.
A 17-hour run with 14 lanes used agy (Antigravity) as the main implementer. Details: .caddis/kb/agy-headless-implementer-limits.md in the caddis source repo. Read the rule first, then the evidence.
Rule: send agy only small, exact, mechanical cards, test fixes and CI watching. Send design-fidelity work, cross-file refactors and judgment to Codex or Claude. Give Opus only short contract-sized tasks.
Why (measured):
gemini-3.1-pro-high failed with "not supported in the selected location".--print mode agy started the full test suite as a background task and waited for a notification that never came (35 to 40 minutes lost, twice).Every card that goes to agy has these sections. A card without them is not ready.
## Goal: one sentence, one component or one page.## Files: a bullet list of every file the card may touch. The gate rejects any change outside it.## Tests first: the failing tests to write before the code, and the one targeted command that runs them.## Rules for agy (copy this block as it is):
## Done when: the exact observable result, and "report what you changed and what you could not do".-s workspace-write run builds. Files it creates are owned by a sandbox user and can block worktree removal.caddis-push or caddis update while any agy.exe runs. The release now refuses or skips in that case.What SKILL.md sets; muted values are Claude Code's defaults
81 skills in this plugin
/adopt-rbacPointer to the org's RBAC adoption skill. Use for "add RBAC to this app" or "adopt rbac-kit"./agent-md-refactorRefactor bloated agent instruction files (AGENTS.md, .cursorrules, .github/ files) into linked, progressively disclosed docs./algorithmic-artGenerative and algorithmic art with p5.js: flow fields, particle systems, animations, WebGL, audio-reactive visuals; exports HTML, PNG, GIF, MP4, SVG. Use for creative coding or any p5.js visual.npx claudepluginhub saajunaid/caddis-plugin --plugin caddis-extras