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

# Squads

> Organize AI agents into domain-aligned teams with shared memory, triggers, and SQUAD.md configuration files

## What is a Squad?

A squad is a team of agents organized around a business domain. Each squad:

* Owns a specific area of responsibility
* Shares memory and context between agents
* Produces outputs to a dedicated location

## Squad Structure

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

## SQUAD.md Definition

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

## Mission
Transform raw intelligence into actionable insights.

## Agents
- analyst: Deep research and analysis
- writer: Content creation from research
- reviewer: Quality and accuracy checks

## Outputs
- research/ directory
- Weekly research reports
- Competitive analysis documents

## Memory
Shared context about ongoing research topics,
sources, and accumulated knowledge.
```

## Example Squad Domains

Organize squads by business function, not technical capability. `squads init`
ships four of these out of the box:

| Domain       | Example Focus                              | Example Agents                       |
| ------------ | ------------------------------------------ | ------------------------------------ |
| Intelligence | Strategic synthesis                        | intel-lead, intel-eval, intel-critic |
| Research     | Market & competitor intelligence           | lead, analyst, synthesizer           |
| Product      | Roadmap & specs                            | lead, scanner, worker                |
| Company      | Evaluates output, closes the feedback loop | manager, evaluator, goal-tracker     |

Add more as your needs grow — `squads init --pack engineering` and
`--pack marketing` ship ready-made squads for those domains, or build your own
with `squads add`.

<Tip>
  Start with the 4 starter squads. Each squad should have clear ownership of a business domain.
</Tip>

## Running a Squad

### Basic Execution

```bash theme={null}
# Run entire squad
squads run research

# Run specific agent
squads run research/analyst

# Preview without executing
squads run research --dry-run
```

### Continuous Improvement Loops

Squads can run in cycles that continuously improve your codebase:

```
┌─────────────────────────────────────────────────┐
│              Autonomous Loop                     │
├─────────────────────────────────────────────────┤
│  1. Audit      → Find issues, create tickets    │
│  2. Solve      → Branch, fix, create PR         │
│  3. Review     → Adversarial QA, test           │
│  4. Merge      → Auto-merge if passes           │
│  5. Deploy     → Release artifacts              │
│  6. Repeat     → New audit cycle                │
└─────────────────────────────────────────────────┘
```

This pattern enables:

* **Self-healing codebases** — Issues found and fixed automatically
* **Continuous quality** — Every change reviewed and tested
* **Human oversight** — Escalate to Slack/email when uncertain

See [GitHub Orchestration](/guides/github-orchestration) for implementation details.
