External team lead

From TentacleOpera/switchboard · View interactive version

External team lead is an AI agent skill from the GitHub repository TentacleOpera/switchboard. 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.

How to use this skill

Skill file

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:


2. API Access

All interactions with Switchboard go through the switchboard CLI (switchboard api <METHOD> <path> [jsonBody]).

Verify Switchboard is running:

switchboard api GET /health

3. 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

GET /kanban/feature; /kanban/feature is POST-only (feature creation).


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:

Step 2: Read & Claim Incoming Reports

Inspect .switchboard/teams/<teamId>/reports/:

ls -1 .switchboard/teams/<teamId>/reports/*.md 2>/dev/null

If you are remote (reaching Switchboard through a tunnel, no filesystem access):

For each unhandled report file:

  1. Read the frontmatter and report body.
  2. Verify the work (see Step 3).
  3. Claim the report: Move the report file to .switchboard/teams/<teamId>/reports/claimed/ (or call switchboard api POST "/teams/<teamId>/reports/claim" '{"filename": "..."}' if remote) so it is not re-processed on future ticks:

```bash

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>..HEAD

If you are remote:

Step 4: Dispatch Next Subtask or Advance Card

```bash

switchboard api POST /kanban/dispatch '{

"plan": "<subtaskPlanId>",

"targetColumn": "<CODING_COLUMN>",

"from": "<your-agent-name>"

}'

```

"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.

Omitting kind on a payload that carries no dispatch object is read as a

message, so a dispatch must say so. Pass dispatch: { planId, role } on

a dispatch — the host stamps dispatched_terminal and dispatched_at on

the card, which lights up planTitle on 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.

```bash

switchboard api POST /terminals/verb/ptySendPrompt '{

"name": "<workerName>",

"data": "<instructions>",

"origin": "<your-agent-name>",

"clearBeforePrompt": false,

"kind": "dispatch",

"dispatch": { "planId": "<subtaskPlanId>", "role": "coder" }

}'

```

Check your team roster (from head-prompt.md or ptyListTerminals) for a seat with role "reviewer".

If your team has a reviewer:

```bash

switchboard api POST /kanban/dispatch '{

"plan": "<featurePlanId>",

"targetColumn": "CODE REVIEWED",

"from": "<your-agent-name>"

}'

```

If your team has NO reviewer seat, do NOT move the card. Write a finished report to .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>"
}'

5. Wake & Scheduling Patterns

Avoid recurring cron jobs that create a new chat session on every tick. Use one of these in-session patterns:

  1. 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.

  1. In-Session One-Shot Timer (Alternative):

Set a single-shot timer (e.g. schedule with DurationSeconds=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.

  1. User Prompt (Fallback):

User asks for team status or to process updates.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.