| name | electrobun-teams |
| description | This skill should be used when the user asks about "electrobun teams", "multi-agent electrobun", "electrobun UI agent", "electrobun backend agent", "RPC contract handoff", or CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS for electrobun feature development. |
| version | 1.0.0 |
Electrobun Feature Team
Two-agent sequential pipeline for building complete Electrobun features โ renderer first, bun-side second.
Team Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Orchestrator (main Claude / /electrobun-feature command) โ
โ Creates team, assigns tasks, receives handoff, passes it โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ Task 1 โ Task 2 (after T1)
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ
โ electrobun-ui-agent โ โโโโโโโโโบ โ electrobun-backend- โ
โ โ contract โ agent โ
โ Produces: โ handoff โ โ
โ โข src/<view>/ โ โ Produces: โ
โ โข src/shared/types โ โ โข src/bun/index.ts โ
โ โข RPC contract doc โ โ โข electrobun.config โ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ
Enabling Teams
export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
claude
Teams require this env var. Without it, the team tools (TeamCreate, TaskCreate, SendMessage) are not available.
Orchestrator: How to Run the Team
1. Create team:
TeamCreate { team_name: "electrobun-feature-team", description: "Building <feature>" }
2. Create tasks:
TaskCreate { subject: "T1: UI agent โ design views and produce RPC contract" }
TaskCreate { subject: "T2: Backend agent โ implement bun-side wiring from RPC contract" }
TaskUpdate { taskId: "T2", addBlockedBy: ["T1"] } // T2 blocked until T1 done
3. Spawn UI agent:
Agent {
name: "ui-agent",
team_name: "electrobun-feature-team",
subagent_type: "general-purpose",
prompt: "You are the electrobun-ui-agent. [full feature spec] ..."
}
TaskUpdate { taskId: "T1", status: "in_progress", owner: "ui-agent" }
4. Wait for UI agent to complete T1 and produce handoff document.
UI agent sends message: SendMessage to orchestrator with contract.
5. Receive contract. Pass to backend agent:
Agent {
name: "backend-agent",
team_name: "electrobun-feature-team",
subagent_type: "general-purpose",
prompt: "You are the electrobun-backend-agent. Contract: [paste handoff] ..."
}
TaskUpdate { taskId: "T2", status: "in_progress", owner: "backend-agent" }
6. Wait for backend agent to complete T2.
7. Shutdown team:
SendMessage { target: "ui-agent", type: "shutdown_request" }
SendMessage { target: "backend-agent", type: "shutdown_request" }
8. Report completion to user.
Team Roles
electrobun-ui-agent
Input: Feature description from orchestrator
Output: RPC contract handoff document + all renderer files
Produces:
src/<viewname>/index.html โ markup with #id-kebab-case on every control
src/<viewname>/index.css โ layout and styles
src/<viewname>/index.ts โ Electroview wiring using electrobun/view
src/shared/types.ts โ the MyRPCType typed RPC schema
electrobun-backend-agent
Input: RPC contract handoff from UI agent
Output: Complete bun-side implementation + config update
Produces:
src/bun/index.ts โ BrowserWindow creation + BrowserView.defineRPC()
- Updated
electrobun.config.ts โ views + copy entries
The RPC Contract Handoff Format
# RPC Contract Handoff โ <FeatureName>
## Views created
| View name | Source dir | Electrobun.config entry |
|---|---|---|
| mainview | src/mainview/ | mainview: { entrypoint: "src/mainview/index.ts" } |
## RPC type location
src/shared/types.ts โ exports MyRPCType
## Bun-side requests (renderer calls โ bun responds)
| RPC name | Params | Return | Trigger |
|---|---|---|---|
| doTheThing | { param: string } | string | #btn-primary-action click |
## Bun-side messages (renderer sends โ bun, no response)
| RPC name | Payload | Trigger |
|---|---|---|
| closeWindow | {} | #btn-done click |
## Webview-side requests (bun calls โ renderer responds)
| RPC name | Params | Return |
|---|---|---|
| getViewState | {} | { value: string } |
## Webview-side messages (bun sends โ renderer)
| RPC name | Payload | UI updated |
|---|---|---|
| updateStatus | { status: string } | #status-display |
## electrobun.config.ts copy entries
copy: {
"src/mainview/index.html": "views/mainview/index.html",
}
## Platform notes
- Requires CEF: no
- titleBarStyle: default
- Entitlements: none
Sequential Flow: Why UI First?
-
UI defines the contract โ the renderer knows what it needs from bun (requests) and what it will push to bun (messages). This is the natural source of truth for the RPC schema.
-
Backend implements the contract โ once the schema is known, the bun side is purely mechanical: implement each handler, return the right types.
-
No parallel work โ both agents write to different files (renderer vs bun), but the backend agent needs the schema to type its handlers. Running in parallel would require speculative typing.
Using /electrobun-feature Without Full Teams Mode
If CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is not set, the orchestrator runs the agents sequentially as subagents (one at a time) instead of as teammates. This is slower but produces the same output.
The /electrobun-feature command handles both modes.
Key Rules for Teammates
- UI agent must not touch
src/bun/ โ backend agent owns that directory
- Backend agent must not touch
src/<viewname>/ โ UI agent owns those directories
- Both agents read
src/shared/types.ts โ UI agent creates it, backend agent imports it
- Orchestrator passes the full handoff document โ do not rely on teammates reading each other's files