New Capability: Agent Team Formation

New Capability: Agent Team Formation

Date: 2026-03-09 Origin: Chris's question "How did the leadership team like the first all-hands?" led to the realization that 41 agents exist but none can hear each other, collaborate, or form teams autonomously. Impact: V, Sage, and Pax now automatically form teams of specialist agents for complex work. 6 slash commands wired to spawn 3-5 agents each. Filed by: Q (Quality System Manager)


What Was Built

Agent Office (Brick 16)

A persistent SQLite-backed system (data/agent-office.db) that gives agents presence, identity, trust, and coordination. Seven tables track:

  • Badge System — Every unit of agent work starts with badgeIn() and ends with badgeOut(). Four invocation types: slash command, scheduled, team spawn, autonomous.
  • Clearance Levels — 5 levels (Onboarding → Developing → Reliable → Trusted → Autonomous) earned through proven execution. Decay for inactivity or violations.
  • Agent-to-Agent Messaging — Three urgency levels (routine, important, urgent). Urgent messages trigger Loom force-runs.
  • Dynamic Team Formation — Clearance-gated team requests. Level 5 auto-approved, Level 4 requires leader approval.
  • Work Queue — Background workers detect actionable conditions and queue work for matching agents.
  • Office Manager — 30-minute autonomous loop matching work to available agents.

Custom Agent Definitions (45 agents)

Every agent in the organization now has a .claude/agents/{codename}.md file that registers it as a spawnable type in Claude Code Agent Teams. When V says Task(subagent_type: "sentinel"), Claude Code loads Sentinel's definition — identity, enforcement rules, HubSpot rules, and behavioral instructions.

A generator script (scripts/generate-agent-definitions.ts) produces teammate definitions from agents/org-roster.yaml. Leader definitions (V, Sage, Pax) are hand-crafted with full team formation behavior and maintained separately.

Active Leader Team Formation

V, Sage, and Pax definitions include:

  • Full agent roster tables with codenames and domains
  • Explicit Task(subagent_type: "{codename}") spawn instructions
  • Decision rule: "If work involves 2+ distinct agent domains → form a team"
  • Concrete examples mapping natural language requests to agent spawns
  • Synthesis protocol: spawn in parallel, gather own intel, synthesize

Slash Command Agent Wiring

Six slash commands now name specific specialist agents:

Command Agents Spawned Total
/daily-ops Sentinel, Pulse, Prelude, Encore 4
/daily-recap Sentinel, Pulse, Beacon 3
/meeting-prep Herald, Sentinel, Scribe 3
/weekly-plan Sentinel, Pulse, Horizon, Prelude, Marshal 5
/weekly-review Sentinel, Pulse, Forge, Echo, Encore 5
/all-hands Sage, Pax (leaders assess own orgs) 2

Infrastructure Changes

Change Before After
Agent presence None — agents had no runtime state SQLite database with badge-in/badge-out tracking
Agent trust All agents treated equally 5-level clearance earned through execution evidence
Agent communication No peer-to-peer messaging Message table with urgency levels and delivery via Loom
Agent spawning Built-in Claude Code agents only 45 custom agent definitions registered as spawnable types
Leader behavior Leaders do all work solo Leaders automatically form teams of specialists
Slash commands Named "Sage" and "Pax" generically Named specific specialist agents (sentinel, pulse, herald, etc.)
Autonomous execution None Work queue + Office Manager with 10-task daily budget and kill switch

Implementation

File Purpose
lib/agent-office/schema.sql 7 tables, 6 indexes
lib/agent-office/index.ts Core library: badgeIn, badgeOut, sendMessage, queueWork, requestTeam, generateStatus
lib/agent-office/clearance.ts Promotion/decay evaluation logic
lib/agent-office/seed.ts Initial seeding from org-roster + execution history
lib/agent-office/types.ts TypeScript interfaces for all data structures
agents/background-workers/workers/office-manager.ts 30-minute autonomous work matching loop
scripts/generate-agent-definitions.ts Generates .claude/agents/ from org-roster.yaml
.claude/agents/*.md 45 agent definitions (42 teammates + 3 leaders)
skills/teams/dynamic-team-protocol.md Protocol for ad-hoc team formation
memory/office-status.md Human-readable dashboard (regenerated)

Usage

Ad-hoc Team Formation (via Leaders)

Ask any leader a question that spans multiple domains:

V, I need a full operational check on our media pipeline. What shows are
coming up, what recordings still need processing, and are there any
distribution gaps for recent articles?

V automatically identifies three domains → spawns Prelude, Encore, Broadcast in parallel → synthesizes results.

Slash Commands

All six wired commands spawn agents automatically:

/daily-ops          # 4 agents: sentinel, pulse, prelude, encore
/daily-recap        # 3 agents: sentinel, pulse, beacon
/meeting-prep       # 3 agents: herald, sentinel, scribe
/weekly-plan        # 5 agents: sentinel, pulse, horizon, prelude, marshal
/weekly-review      # 5 agents: sentinel, pulse, forge, echo, encore
/all-hands          # 2 agents: sage, pax (org assessment)

Office Status

Check who's working and what's queued:

cat memory/office-status.md

Kill Switch

Pause all autonomous execution:

touch data/.office-paused    # Stop
rm data/.office-paused       # Resume

Leader Applications

V (Operations)

V is the primary beneficiary. As COO with 25 agents, V now delegates intelligence gathering to specialists instead of doing all operational work solo. Every slash command V leads now spawns 2-5 agents in parallel, reducing briefing time and improving coverage. V's synthesis role — pulling together signals from multiple agents into a coherent picture — is where leadership judgment adds value.

Sage (Customer)

Sage can now form teams within the Customer Org. A relationship health check can spawn Sentinel (monitoring), Tide (pipeline), and Scout (growth signals) simultaneously. Content work can spawn Forge (articles), Broadcast (distribution), and Chorus (YouTube). Sage's 11 agents cover the full customer lifecycle — team formation lets her activate the right combination for each request.

Pax (Finance)

Pax's 3 agents (Pulse, Horizon, Forecast) can be spawned for comprehensive financial intelligence. A revenue health check spawns all three in parallel. Pax can also pull from V's and Sage's agents when financial analysis needs operational or relationship context.


Dependencies

Dependency Status Notes
Claude Code Agent Teams Confirmed Available in current Claude Code version
SQLite (better-sqlite3) Confirmed Used by Content Vault, proven at scale
Loom (background workers) Confirmed Runner.ts modified with badge-in/badge-out
org-roster.yaml Confirmed Source of truth for all 41 agents
Session hooks Confirmed session-start.js injects status, session-end.js badges out

Verification

  1. Test prompt: Ask V about the media pipeline → V spawns Prelude, Encore, Broadcast in parallel (confirmed via screenshot, Mar 9 23:52 CT)
  2. Agent Office DB: data/agent-office.db contains all 41 agents with correct org/group/leader assignments
  3. Agent definitions: 45 files in .claude/agents/ (42 teammates + 3 leaders)
  4. Slash commands: All 6 command files reference specific subagent_type codenames

Commits

Hash Description
f6da977b Agent Office — Brick 16: persistent agent presence, clearance, messaging (20 files, 1,719 insertions)
e914eac9 Agent definitions for all 45 agents — custom types for team spawning (46 files, 2,308 insertions)
1e9963b5 Leader definitions with active team formation behavior (4 files, 308 insertions)
8bf4b70d Slash commands wired to specialist agents (6 files)
aea52d2c V's own specialist agents added to slash commands (5 files)
5955caf1 Rename Refiner → Q, Quality System manager (9 files)