external-team-lead
Skill215 starsChanged 2 months agoMITView on GitHub
How a non-terminal external agent (Antigravity, Cursor, Zed, IDE chat, or any chat agent with localhost CLI and filesystem access) operates as lead of a team of terminal worker agents in Switchboard.
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- improve-featureSkill
- improve-planSkill
- improve-featureSkill
- kanban-operationsSkill
- manage-featuresSkill
- query-kanbanSkill
- switchboard-orchestrationSkill
- worktree-cleanupSkill
- kanban-operationsSkill
- manage-featuresSkill
- query-kanbanSkill
- switchboard-cloudSkill
- switchboard-memoSkill
- switchboard-remoteSkill
- switchboardSkill
- worktree-cleanupSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 7 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Lead-Paced Pipeline: When your current feature passes review, you pull the next staged card with POST /kanban/queue/next.
- Very specific: line 28
All interactions with Switchboard go through the switchboard CLI (switchboard api <METHOD> <path> [jsonBody]).
- Very specific: line 29
Verify Switchboard is running:
- Very specific: line 73
Read .switchboard/teams/<teamId>/head-prompt.md to re-orient:
- Very specific: line 83
If you are remote (reaching Switchboard through a tunnel, no filesystem access):
- Distinctive: line 88
Read the frontmatter and report body.
- Distinctive: line 89
Verify the work (see Step 3).
- Distinctive: line 96
Do not accept "I'm done" at face value.
- Distinctive: line 102
If you are remote:
- Very specific: line 117
Use "dispatch" when the worker is starting work on it — that is what attaches the standing-orders block, the seat directive block (GIT …
- Very specific: line 138
Check your team roster (from head-prompt.md or ptyListTerminals) for a seat with role "reviewer".
- Distinctive: line 139
If your team has a reviewer:
- Very specific: line 147
If your team has NO reviewer seat, do NOT move the card.
- Distinctive: line 150
When the reviewer reports that the feature passed review:
- Very specific: line 156
If dispatched is returned: begin working on the new feature.
- Very specific: line 157
If dispatched: null (reason: "queue empty"): all staged work is complete.
- Very specific: line 158
If 409 Conflict: a subtask or feature is still in flight in a coding column.
- Distinctive: line 164
Avoid recurring cron jobs that create a new chat session on every tick.
- Very specific: line 167
Run a background script or daemon in the current session that monitors .switchboard/teams/<teamId>/reports/.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: External Team Lead Mode
This skill defines how a non-terminal external agent (Antigravity, Cursor, Zed, IDE chat, or any chat agent with localhost CLI and filesystem access) operates as the lead of a team of terminal worker agents in Switchboard.
1. Core Operating Concept
In External-Headed Team Mode:
- You (the external agent) are the Team Lead. You have no terminal window in the fleet; you control the team entirely via HTTP calls to Switchboard's
LocalApiServerand file reads/writes in the workspace. - Workers are terminal agents. They execute subtasks in terminal ptys, code in worktrees/branches, and report completion by writing markdown report files to
.switchboard/teams/<teamId>/reports/. - State and instructions persist on disk. Your instructions, roster, and active feature are stored in
.switchboard/teams/<teamId>/head-prompt.md. - Verification is empirical. You verify code changes with
git, not by trusting self-reports. - Plan files are the source of truth. You read them, dispatch based on them, and review against them. You never rewrite, edit, or restructure plan content. Your only write to a plan file is the completion-report append (if you are also coding), never a rewrite of the plan's content sections.
- Lead-Paced Pipeline. When your current feature passes review, you pull the next staged card with
POST /kanban/queue/next.
2. API Access
All interactions with Switchboard go through the switchboard CLI (switchboard api <METHOD> <path> [jsonBody]).
Verify Switchboard is running:
switchboard api GET /health3. Team Initialization
To create an external-headed team:
switchboard api POST /teams/create-external '{
"template": "Coding",
"headName": "<your-agent-name>",
"featureId": "<optional-feature-id>"
}'Response returns:
{
"success": true,
"teamId": "team_<your-agent-name>",
"workers": [ ... ],
"headPromptFile": ".switchboard/teams/team_<your-agent-name>/head-prompt.md",
"reportsDir": ".switchboard/teams/team_<your-agent-name>/reports"
}3b. Board Reads
- Full board:
switchboard api GET /kanban/board - Features:
switchboard api GET /kanban/features— pick yours byplanId. There is noGET /kanban/feature;/kanban/featureis POST-only (feature creation). - Plans:
switchboard api GET /kanban/plans· One plan:switchboard api GET "/kanban/plan?planId=<planId>"
4. The Tick Loop (Wake & Operate)
Each time you wake (via background watcher, one-shot timer, or user prompt), follow these steps in order:
Step 1: Read Head Prompt & Context
Read .switchboard/teams/<teamId>/head-prompt.md to re-orient:
- Active feature ID and subtask breakdown.
- Live worker roster and roles.
Step 2: Read & Claim Incoming Reports
Inspect .switchboard/teams/<teamId>/reports/:
ls -1 .switchboard/teams/<teamId>/reports/*.md 2>/dev/nullIf you are remote (reaching Switchboard through a tunnel, no filesystem access):
switchboard api GET "/teams/<teamId>/reports"— list unclaimed worker reports with contentswitchboard api POST "/teams/<teamId>/reports/claim" '{"filename": "..."}'— mark a report processed
For each unhandled report file:
- Read the frontmatter and report body.
- Verify the work (see Step 3).
- Claim the report: Move the report file to
.switchboard/teams/<teamId>/reports/claimed/(or callswitchboard api POST "/teams/<teamId>/reports/claim" '{"filename": "..."}'if remote) so it is not re-processed on future ticks:mv .switchboard/teams/<teamId>/reports/<report-file>.md .switchboard/teams/<teamId>/reports/claimed/
Step 3: Verify Work Empirical via Git
Do not accept "I'm done" at face value. Verify commits and diffs in the worktree/repository:
git -C <worktree> rev-list --count <base>..HEAD
git -C <worktree> diff <base>..HEADIf you are remote:
switchboard api GET "/worktree/<worktreeId>/diff"— full diff + commit count + commit logswitchboard api GET "/worktree/<worktreeId>/diff?stat=true"— summary only (lighter)
Step 4: Dispatch Next Subtask or Advance Card
- Dispatch subtask to a worker:
switchboard api POST /kanban/dispatch '{ "plan": "<subtaskPlanId>", "targetColumn": "<CODING_COLUMN>", "from": "<your-agent-name>" }' - Send prompt to a worker terminal:
"kind"says what the payload IS, and it decides what the host appends. Use"dispatch"when the worker is starting work on it — that is what attaches the standing-orders block, the seat directive block (GIT POLICY, subagent policy) and the dispatch directives. Use"message"for a fix round, a question, a verdict or a relayed note: the text is delivered alone. Omittingkindon a payload that carries nodispatchobject is read as a message, so a dispatch must say so. Passdispatch: { planId, role }on a dispatch — the host stampsdispatched_terminalanddispatched_aton the card, which lights upplanTitleon the status pane and gives the release paths a holder to act on. Without it the card has no holder and the pane reads idle even while the seat is working.switchboard api POST /terminals/verb/ptySendPrompt '{ "name": "<workerName>", "data": "<instructions>", "origin": "<your-agent-name>", "clearBeforePrompt": false, "kind": "dispatch", "dispatch": { "planId": "<subtaskPlanId>", "role": "coder" } }' - Hand whole feature to review when all subtasks pass — ONLY if your team has a reviewer seat:
Check your team roster (from
head-prompt.mdorptyListTerminals) for a seat with role "reviewer". If your team has a reviewer:
If your team has NO reviewer seat, do NOT move the card. Write a finished report toswitchboard api POST /kanban/dispatch '{ "plan": "<featurePlanId>", "targetColumn": "CODE REVIEWED", "from": "<your-agent-name>" }'.switchboard/mission-control/reports/naming the feature and its planId, and stop. The card stays where it is.
Step 5: Pull Next Feature (Queue Next)
When the reviewer reports that the feature passed review:
switchboard api POST /kanban/queue/next '{
"from": "<your-agent-name>"
}'- If
dispatchedis returned: begin working on the new feature. - If
dispatched: null(reason: "queue empty"): all staged work is complete. Report to human and stop. - If
409 Conflict: a subtask or feature is still in flight in a coding column.
5. Wake & Scheduling Patterns
Avoid recurring cron jobs that create a new chat session on every tick. Use one of these in-session patterns:
- Event-Driven Background Watcher (Preferred):
Run a background script or daemon in the current session that monitors
.switchboard/teams/<teamId>/reports/. When a new file arrives, it exits or emits output, reactively waking you in the same conversation. - In-Session One-Shot Timer (Alternative):
Set a single-shot timer (e.g.
schedulewithDurationSeconds=60). When it expires, you wake in the same session, check reports, act, and set another one-shot timer if work is still in flight. - User Prompt (Fallback): User asks for team status or to process updates.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

