-
Notifications
You must be signed in to change notification settings - Fork 1
Multi Agent Orchestration
Introduced in v0.3.0, formalized in v0.9.1 as the Master Orchestrator Rule.
When the master both plans and executes, context pollution compounds. Isolation = clean handoffs = fewer hallucinations.
See also: Master-Orchestrator for the master rule Β· Dispatch-Brief for the brief format
For any strong-work mission β multi-file change, migration, perf hunt, security audit, new feature, deep research β the main agent becomes an orchestrator only. It narrows, dispatches, synthesizes. It does not execute.
- Narrow mission and confirm scope with user
- Detect domain and tier
- Read top-level index only:
CLAUDE.md,PATTERNS.md,DESIGN_SYSTEM.md,ΰΈͺΰΈ²ΰΈ£ΰΈΰΈ±ΰΈ,.kasidit/knowledge/index - Pick the specialist from the registry
- Write the dispatch brief
- Synthesize outputs into a user-facing report
- Decide next step
- β Write code
- β Edit files
- β Run tests or servers
- β Read source files beyond the top-level index set
- β Search / grep / glob beyond initial scope detection
- β Fetch docs (delegate to
deep-researcher) - β Write migrations (delegate to
migration-specialist)
If the master catches itself doing any of the above β stop, spawn a specialist, pass the accumulated context.
- Trivial one-line fix on a single file the user explicitly pointed to
- Answering a pure question with no code change
- Reading the top-level index files
- Writing the final user-facing summary
8 active + 3 deprecated stubs (v0.10).
| Agent | Trigger | Scope |
|---|---|---|
architect-planner |
new feature / refactor > 2 files | plan only; trade-offs + open questions |
audit-specialist (v0.10) |
PR / OWASP / CVE / N+1 / pre-merge / pre-scale | unified audit via --focus=quality|security|perf|all
|
bug-hunter |
error / crash / wrong output / regression | root-cause + minimal fix; mandatory git log --grep / -S
|
deep-researcher |
library / API / framework research | trust hierarchy; caches to .kasidit/knowledge/
|
legacy-specialist |
legacy PHP / old framework / no-test | legacy-safe refactor |
migration-specialist |
schema / framework upgrade / backfill | expand-contract phases; rollback per phase |
refactor-surgeon |
named refactor | zero behavior change; test-parity |
test-writer |
add tests / regression / coverage | one target per call; regression after bug fix |
Deprecated stubs (v0.10 β removed in v0.11):
| Stub | Use this instead |
|---|---|
code-reviewer |
audit-specialist --focus=quality |
security-auditor |
audit-specialist --focus=security |
perf-profiler |
audit-specialist --focus=perf |
Every specialist invocation:
MISSION: <one sentence, verifiable outcome>
INPUTS:
- <file paths, symptoms, measurements, versions>
CONSTRAINTS:
- <deadline, compat, perf budget>
EXPECTED OUTPUT:
- <matches the agent's documented output block>
PRIOR CONTEXT:
- <findings from earlier specialists, if any>
No brief β no dispatch.
Heavy missions split across multiple agents:
Main (planner)
β
Dispatch per file/module
β
Agent 1 Agent 2 Agent 3 Agent 4
(file) (file) (file) (file)
β β β β
Findings Findings Findings Findings
β β β β
ββββββββββββ΄βββββββββββ΄βββββββββββ
β
Verifier agent (Haiku: mandatory)
β
Main (synthesizer) β report with confidence + priority
- 1 file per agent on Haiku
- 1 module per agent on Opus/Sonnet
- Main context stays lean β delegates all file reads
- Each agent returns structured output, not prose
- Verifier pass removes false positives (Haiku mandatory, Sonnet recommended for security)
Fan-Out Mode (/kasi-multi, v0.9.2)
When user wants parallel execution over dependency-chained execution, fan out.
/kasi-multi [N] [mission] # explicit
sudo <mission> # shorthand for N=6 + skip clarifying Qs
sudo <N> <mission> # shorthand with N
Default N=6 roster (heuristic, swappable by mission kind):
| Slot | Agent |
|---|---|
| 1 |
architect-planner or deep-researcher
|
| 2 |
general-purpose (build step) |
| 3 |
general-purpose (secondary workstream) |
| 4 |
general-purpose (extract / glue) |
| 5 |
test-writer or general-purpose (verification) |
| 6 |
audit-specialist --focus=quality (review slot, v0.10 β replaces standalone code-reviewer) |
Tier caps:
- Opus β full fan-out
- Sonnet β default, prefer 4 on large contexts
- Haiku β cap at N=4 (synthesis collapses with more)
sudo is a pacing signal, not a permission escalation. It still respects the destructive-op confirmation rule.
See Commands#kasi-multi for full flow.
Tier-specific orchestration (v0.8.0 Tier Cascade)
Opus: plan
β
Sonnet: implement
β
Haiku: audit by checklist
β
Opus: synthesize
Invoke via /kasi-cascade.
- β Master writing code on a strong-work mission
- β Master reading source files beyond the top-level index
- β Invoking a specialist without a dispatch brief
- β Specialist working outside its documented scope
- β Main agent loading file contents "just to check" β delegate
- β Running Haiku review without a verifier pass
Three hooks observe orchestration without entering AI context:
| Hook | Event | Job |
|---|---|---|
kasidit-route.py |
UserPromptSubmit |
Classifies mission kind, queries route-memory.jsonl for shortest successful mode, injects 1-line recommendation. |
kasidit-verify.py |
PostToolUse + Stop
|
Detects master orchestrator violations β [high] claim paired with direct Edit / Write / Bash (master should have delegated). Prints downgrade notice. |
kasidit-record.py |
Stop / SubagentStop
|
Parses [kasidit-log] emit lines from final output, appends to route-memory.jsonl. Router learns over time which roster size + mode succeeds for each kind. |
Synthesis-cost optimization gets data-driven: if the router sees kind=security-audit-php succeeded 5/5 times at N=4 and 0/5 at N=8, it recommends N=4 going forward. See Backend-Hooks for full payload contracts.
- v0.3.0 β multi-agent orchestration introduced
- v0.8.0 β tier cascade
- v0.9.1 β master orchestrator rule formalized
- v0.10.0 β runtime hooks observe orchestration; audit-specialist consolidates 3 audit agents
-
Backend-Hooks β
kasidit-route,kasidit-verify,kasidit-recordpayload contracts -
Agent-Audit-Specialist β single-entry audit agent with
--focus=quality|security|perf|all -
Kasi-Mode β
/kasimode toggle - Model Tiers
Repo β’ Discussions β’ Issues β’ Changelog β’ Security β’ Contributing β’ MIT β’ Β© Kasidit Wansudon
Kasidit
Core
- Commands
- Kasi-Mode π₯ v0.10
- Backend-Hooks π₯ v0.10
- Model Tiers
- Gravity Pattern
- Multi-Agent-Orchestration
- Claude Design Integration
- UI Override Mode
- FAQ
Version History
- Version History β overview
- v0.13.0 β thClaws (Consolidated) π¦
- v0.12.0 β thClaws Runtime Support π¦
- v0.11.0 β Backend + Bridge + Runbook π
- v0.10.0 β Mode + Backend Hooks
- v0.9.2 β Gravity
- v0.9.1 β Master Orchestrator
- v0.9.0 β Claude Design
- v0.8.0 β Tier Cascade
- v0.7.4 β SWE-bench
- v0.3.0 β Tier adaptation
- v0.2.1 β Docs protocol
- v0.2.0 β UI Override
- v0.1.0 β Core
Concepts
Commands
- Kasi-Init
- Kasi-Review
- Kasi-Security
- Kasi-Fix
- Kasi-Ui
- Kasi-Cascade
- Kasi-Multi
- Kasi-Scaffold
- Kasi-Docs
- Kasi-Status
- Kasi-Promote
- Kasi-Pull
- Kasi-Sync
- Kasi-Search
- Kasi-Wiki-Sync
Agents
- Agent-Architect-Planner
- Agent-Audit-Specialist π₯ v0.10
- Agent-Bug-Hunter
- Agent-Deep-Researcher
- Agent-Legacy-Specialist
- Agent-Migration-Specialist
- Agent-Refactor-Surgeon
- Agent-Test-Writer
Deprecated v0.10 (stubs β audit-specialist --focus=..., removed in v0.11)
-
Agent-Code-Reviewer β
--focus=quality -
Agent-Security-Auditor β
--focus=security -
Agent-Perf-Profiler β
--focus=perf