> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agents-squads.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Working with Squads

> Structure your agents into effective teams

## What Makes a Good Squad?

A squad is a team of agents organized around a **business domain**—not a technical function.

<Note>
  Think departments, not features. "Research" not "Text Processing".
</Note>

## Squad Structure

```
.agents/squads/research/
├── SQUAD.md           # Squad definition (required)
├── lead.md            # Agent: briefs the team, reviews outputs
├── analyst.md         # Agent: deep research
└── synthesizer.md     # Agent: turns findings into a report
```

## Creating a Squad

### 1. Create the Directory

```bash theme={null}
mkdir -p .agents/squads/marketing
```

### 2. Define SQUAD.md

```markdown theme={null}
# Marketing Squad

## Mission
Create compelling content that converts.

## Agents
- copywriter: Ad copy and landing pages
- seo-analyst: Keyword research and optimization
- social: Social media content

## Outputs
- marketing/ directory
- Campaign assets
- Performance reports

## Memory
Shared context about brand voice, target audience,
successful campaigns, and style guidelines.
```

### 3. Add Agents

Create individual `.md` files for each agent listed.

## Squad Design Patterns

### Pattern 1: Pipeline

Agents work in sequence.

```
analyst → writer → reviewer → publish
```

### Pattern 2: Parallel

Agents work independently on related tasks.

```
┌─ seo-analyst ─┐
│               │
├─ copywriter  ─┼─→ coordinator
│               │
└─ designer ───┘
```

### Pattern 3: Specialist

One lead agent delegates to specialists.

```
lead-researcher
├── calls → market-analyst
├── calls → competitor-analyst
└── calls → trend-analyst
```

## Running Squads

```bash theme={null}
# Run all agents in a squad
squads run marketing

# Run specific agent
squads run marketing/copywriter

# Check squad status
squads status marketing -v
```

## Best Practices

| Do                          | Don't                          |
| --------------------------- | ------------------------------ |
| Organize by business domain | Organize by technical function |
| 3-7 agents per squad        | 20+ agents in one squad        |
| Clear ownership boundaries  | Overlapping responsibilities   |
| Shared squad memory         | Isolated agent silos           |

## Next Steps

<CardGroup cols={2}>
  <Card title="Use Memory" icon="brain" href="/guides/using-memory">
    Share context between agents
  </Card>

  <Card title="CLI Reference" icon="terminal" href="/cli-reference">
    All squad commands
  </Card>
</CardGroup>
