# github/squad architecture

> Architecture diagram of the GitHub repository github/squad, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/github/squad
- Repository: https://github.com/github/squad

## Overview

Squad is a human-directed multi-agent development product, exposed through a CLI and SDK. The main workflow is to initialize a project and configure a host, then submit work through the host’s coordinator for agent execution, with team state persisted and progress observable in the dashboard or interactive shell. The graph also preserves documented host integrations and the .NET adapter. Relationships are limited to README statements and source-index/import evidence; unsampled areas are not treated as inspected.

Main entry points: [`packages/squad-cli/src/cli/commands/client.ts`](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/commands/client.ts) (Client setup), [`packages/squad-cli/src/cli/shell/components/App.tsx`](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/shell/components/App.tsx) (Interactive shell), [`packages/squad-sdk/src/storage/storage-provider.ts`](https://github.com/github/squad/blob/dev/packages/squad-sdk/src/storage/storage-provider.ts) (Storage contract), [`packages/squad-cli/src/cli-entry.ts`](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli-entry.ts) (Squad CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and setup"]
  node_cli["Squad CLI<br/>[cli-entry.ts]"]
  node_client_setup["Client setup<br/>[client.ts]"]
  node_client_config["Client configuration<br/>[clients.ts]"]
  node_mcp_spec["MCP wiring<br/>[mcp-spec.ts]"]
  node_shell["Interactive shell<br/>[App.tsx]"]
  node_shell_commands["Shell commands<br/>[commands.ts]"]
  node_shell_sessions["Shell sessions<br/>[sessions.ts]"]
  node_dashboard["Team dashboard<br/>[sources.ts]"]
end

subgraph group_execution["Agent execution"]
  node_shell_router["Shell routing<br/>[router.ts]"]
  node_coordinator["Agent coordination<br/>[coordinator.ts]"]
  node_sdk_client["Copilot client<br/>[client.ts]"]
  node_roles["Agent roles"]
end

subgraph group_state["Team state"]
  node_state_contract["Storage contract"]
  node_filesystem_store[("Filesystem store")]
  node_sqlite_store[("SQLite store")]
  node_state_files[("Project team files")]
end

subgraph group_integrations["Host integrations"]
  node_dotnet_agent[".NET agent adapter<br/>[SquadAgent.cs]"]
  node_ai_host(("AI host"))
  node_copilot(("GitHub Copilot"))
end

node_operator(("Human operator"))

node_operator -->|"runs commands"| node_cli
node_cli -.->|"configures hosts"| node_client_setup
node_client_setup -->|"uses client settings"| node_client_config
node_client_config -->|"projects MCP wiring"| node_mcp_spec
node_operator -->|"submits work"| node_shell
node_shell -->|"executes commands"| node_shell_commands
node_shell_commands -->|"tracks sessions"| node_shell_sessions
node_shell_router -->|"routes to"| node_coordinator
node_shell -.->|"dispatches requests"| node_shell_router
node_coordinator -.->|"dispatches agent work"| node_sdk_client
node_sdk_client -->|"uses SDK"| node_copilot
node_operator -->|"opens dashboard"| node_dashboard
node_dashboard -->|"reads session files"| node_state_files
node_client_setup -->|"initializes team files"| node_state_files
node_ai_host -->|"resolves agent"| node_dotnet_agent
node_state_contract -->|"implemented by"| node_filesystem_store
node_state_contract -->|"implemented by"| node_sqlite_store

click node_cli "https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli-entry.ts"
click node_client_setup "https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/commands/client.ts"
click node_client_config "https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/core/clients.ts"
click node_mcp_spec "https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/core/mcp-spec.ts"
click node_shell "https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/shell/components/App.tsx"
click node_shell_commands "https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/shell/commands.ts"
click node_shell_sessions "https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/shell/sessions.ts"
click node_shell_router "https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/shell/router.ts"
click node_coordinator "https://github.com/github/squad/blob/dev/packages/squad-sdk/src/coordinator/coordinator.ts"
click node_sdk_client "https://github.com/github/squad/blob/dev/packages/squad-sdk/src/adapter/client.ts"
click node_roles "https://github.com/github/squad/blob/dev/packages/squad-sdk/src/roles/catalog-engineering.ts"
click node_dashboard "https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/dashboard/sources.ts"
click node_state_contract "https://github.com/github/squad/blob/dev/packages/squad-sdk/src/storage/storage-provider.ts"
click node_filesystem_store "https://github.com/github/squad/blob/dev/packages/squad-sdk/src/storage/fs-storage-provider.ts"
click node_sqlite_store "https://github.com/github/squad/blob/dev/packages/squad-sdk/src/storage/sqlite-storage-provider.ts"
click node_dotnet_agent "https://github.com/github/squad/blob/dev/src/Squad.Agents.AI/SquadAgent.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_client_setup,node_client_config,node_mcp_spec,node_shell,node_shell_commands,node_shell_sessions,node_dashboard toneBlue
class node_shell_router,node_coordinator,node_sdk_client,node_roles toneAmber
class node_state_contract,node_filesystem_store,node_sqlite_store,node_state_files toneMint
class node_dotnet_agent,node_ai_host,node_copilot toneRose
class node_operator toneIndigo
```

## Components

### CLI and setup

- [Squad CLI](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli-entry.ts): `packages/squad-cli/src/cli-entry.ts`
- [Client setup](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/commands/client.ts): `packages/squad-cli/src/cli/commands/client.ts`
- [Client configuration](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/core/clients.ts): `packages/squad-cli/src/cli/core/clients.ts`
- [MCP wiring](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/core/mcp-spec.ts): `packages/squad-cli/src/cli/core/mcp-spec.ts`
- [Interactive shell](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/shell/components/App.tsx): `packages/squad-cli/src/cli/shell/components/App.tsx`
- [Shell commands](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/shell/commands.ts): `packages/squad-cli/src/cli/shell/commands.ts`
- [Shell sessions](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/shell/sessions.ts): `packages/squad-cli/src/cli/shell/sessions.ts`
- [Team dashboard](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/dashboard/sources.ts): `packages/squad-cli/src/cli/dashboard/sources.ts`

### Agent execution

- [Shell routing](https://github.com/github/squad/blob/dev/packages/squad-cli/src/cli/shell/router.ts): `packages/squad-cli/src/cli/shell/router.ts`
- [Agent coordination](https://github.com/github/squad/blob/dev/packages/squad-sdk/src/coordinator/coordinator.ts): `packages/squad-sdk/src/coordinator/coordinator.ts`
- [Copilot client](https://github.com/github/squad/blob/dev/packages/squad-sdk/src/adapter/client.ts): `packages/squad-sdk/src/adapter/client.ts`
- [Agent roles](https://github.com/github/squad/blob/dev/packages/squad-sdk/src/roles/catalog-engineering.ts): `packages/squad-sdk/src/roles/catalog-engineering.ts`

### Team state

- [Storage contract](https://github.com/github/squad/blob/dev/packages/squad-sdk/src/storage/storage-provider.ts): `packages/squad-sdk/src/storage/storage-provider.ts`
- [Filesystem store](https://github.com/github/squad/blob/dev/packages/squad-sdk/src/storage/fs-storage-provider.ts): `packages/squad-sdk/src/storage/fs-storage-provider.ts`
- [SQLite store](https://github.com/github/squad/blob/dev/packages/squad-sdk/src/storage/sqlite-storage-provider.ts): `packages/squad-sdk/src/storage/sqlite-storage-provider.ts`
- **Project team files**

### Host integrations

- [.NET agent adapter](https://github.com/github/squad/blob/dev/src/Squad.Agents.AI/SquadAgent.cs): `src/Squad.Agents.AI/SquadAgent.cs`
- **AI host**
- **GitHub Copilot**

### Other components

- **Human operator**

## Connections

- Human operator → Squad CLI: runs commands (evidence: `README.md`)
- Squad CLI → Client setup: configures hosts
- Client setup → Client configuration: uses client settings (evidence: `packages/squad-cli/src/cli/commands/client.ts`)
- Client configuration → MCP wiring: projects MCP wiring (evidence: `packages/squad-cli/src/cli/core/clients.ts`)
- Human operator → Interactive shell: submits work (evidence: `README.md`)
- Interactive shell → Shell commands: executes commands (evidence: `packages/squad-cli/src/cli/shell/components/App.tsx`)
- Shell commands → Shell sessions: tracks sessions (evidence: `packages/squad-cli/src/cli/shell/commands.ts`)
- Shell routing → Agent coordination: routes to (evidence: `packages/squad-cli/src/cli/shell/router.ts`)
- Interactive shell → Shell routing: dispatches requests (evidence: `packages/squad-cli/src/cli/shell/components/App.tsx`)
- Agent coordination → Copilot client: dispatches agent work
- Copilot client → GitHub Copilot: uses SDK (evidence: `packages/squad-sdk/src/adapter/client.ts`)
- Human operator → Team dashboard: opens dashboard (evidence: `README.md`)
- Team dashboard → Project team files: reads session files (evidence: `README.md`)
- Client setup → Project team files: initializes team files (evidence: `README.md`)
- AI host → .NET agent adapter: resolves agent
- Storage contract → Filesystem store: implemented by (evidence: `packages/squad-sdk/src/storage/fs-storage-provider.ts`)
- Storage contract → SQLite store: implemented by (evidence: `packages/squad-sdk/src/storage/sqlite-storage-provider.ts`)
