Subagents Swarm Overview
Multi-agent coordination architecture inside BhaiCode.
Complex software engineering tasks require different skill sets: architectural design, rapid feature implementation, deep refactoring, and code review. BhaiCode coordinates these roles through the Subagents Swarm.
Swarm Structure
MERMAID
graph TD
USER["Developer (You)"] --> BHAI["Bhai<br/>(Lead Orchestrator & Builder)"]
BHAI <-->|System Design & Plans| PLANNER["Planner<br/>(System Architect)"]
BHAI <-->|Refactors & Migrations| EXECUTOR["Executor<br/>(Heavy Refactorer)"]
BHAI <-->|Codebase Scouting| EXPLORER["Explorer<br/>(Read-Only Search)"]
BHAI <-->|Security & Vulnerability| AUDITOR["Auditor<br/>(Security Inspector)"]
BHAI <-->|Code Quality & Lint| REVIEWER["Reviewer<br/>(Code Reviewer)"]
Core Agents
| Agent | Role | Focus |
|---|---|---|
| Bhai | Lead Orchestrator & Builder | Direct full-stack coding, conversational pair programming, tool calls, debugging |
| Planner | System Architect | Requirements breakdown, relational database modeling, step-by-step roadmaps |
| Executor | Heavy Refactorer | Multi-file code surgery, framework migrations, test suite generation |
| Explorer | Codebase Scout | Read-only symbol tracing, dependency mapping, file discovery |
| Auditor | Security Auditor | Vulnerability scanning, secret leaks, performance bottlenecks |
| Reviewer | Code Reviewer | Lint compliance, import hygiene, code cleanliness |
How Coordination Works
You talk directly with Bhai:
- Bhai evaluates task complexity and scope.
- For architectural or multi-phase tasks, Bhai delegates plan formulation to Planner.
- For deep refactoring or migrations, Bhai hands off the multi-file transformation to Executor.
- Subagents report results back to Bhai, who presents the final changes in the visual diff viewer.