# Multi-Agent Team — Example Configuration

This example sets up a 3-team agent system for a web application project.

## Team Structure

```
Orchestrator
├── Frontend Team Lead
│   ├── UI Developer (React components)
│   └── Styling Specialist (CSS/Tailwind)
├── Backend Team Lead
│   ├── API Developer (endpoints, routes)
│   └── Database Specialist (queries, migrations)
└── Review Team Lead
    ├── Code Reviewer (quality, patterns)
    └── Security Reviewer (vulnerabilities)
```

## Configuration

```yaml
# .pi/multi-team/teams.yaml
teams:
  orchestrator:
    model: claude-opus-4
    role: "Orchestrator — delegates, never executes"
    max_turns: 25
    
  frontend-lead:
    model: claude-sonnet-4
    role: "Frontend Team Lead — plans UI work, delegates to devs"
    max_turns: 30
    agents:
      - frontend-dev
      - styling-dev
    
  backend-lead:
    model: claude-sonnet-4
    role: "Backend Team Lead — plans API work, delegates to devs"
    max_turns: 30
    agents:
      - api-dev
      - db-dev
      
  review-lead:
    model: claude-sonnet-4
    role: "Review Team Lead — coordinates quality checks"
    max_turns: 20
    agents:
      - code-reviewer
      - security-reviewer
```

## Domain Locking

```yaml
# Frontend domain
frontend-lead:
  domain:
    - path: src/frontend/
      read: true
      upsert: true
      delete: false
    - path: src/shared/
      read: true
      upsert: false
      delete: false

# Backend domain  
backend-lead:
  domain:
    - path: src/api/
      read: true
      upsert: true
      delete: false
    - path: src/db/
      read: true
      upsert: true
      delete: false
```

## Running

```bash
# Start the team
cd your-project && just multi-team

# Delegate a task
"Design and implement a user profile feature"
```
