# Configuration Overview

Squadron uses HCL (HashiCorp Configuration Language) for all configuration.

## File Structure

A typical config directory:

```
my-config/
├── variables.hcl    # Variable definitions
├── models.hcl       # LLM provider configurations
├── agents.hcl       # Agent definitions
├── tools.hcl        # Custom tool definitions (optional)
├── missions.hcl     # Mission definitions (optional)
└── mcp.hcl          # MCP server config (optional)
```

You can also put everything in a single file—Squadron reads all `.hcl` files in the directory.

## Loading Order

Squadron uses **staged evaluation** to resolve references:

1. **Variables** - Load `variable` blocks (no context needed)
2. **Plugins** - Load `plugin` blocks with `vars` context
3. **Models** - Load `model` blocks with `vars` + `plugins` context
4. **Tools** - Load custom `tool` blocks with `vars` + `models` + `plugins` context
5. **Agents** - Load `agent` blocks with `vars` + `models` + `tools` + `plugins` context
6. **Missions** - Load `mission` blocks with full context

This enables expressions like:

```hcl
model "anthropic" {
  api_key = vars.anthropic_api_key  # Reference a variable
}

agent "assistant" {
  model = models.anthropic.claude_sonnet_4  # Reference a model
  tools = [tools.weather]
}
```

## Block Types

| Block | Purpose |
|-------|---------|
| `variable` | Define configuration variables |
| `model` | Configure LLM providers |
| `agent` | Define AI agents |
| `skill` | Define on-demand capability packages for agents |
| `tool` | Create custom tools |
| `plugin` | Load external plugins |
| `mcp "name"` | Pull tools from an external [MCP server](/config/mcp_tools) (npm, github, http, or bare command) |
| `mcp_host` | Start a built-in [MCP host](/config/mcp_host) to expose Squadron to AI clients |
| `mission` | Define multi-task missions |
| `commander` | Commander server connection config |
| `memory` | Shared filesystem locations accessible to missions (paths managed under `<squadron_home>/memories/shared/`) |

## Expressions

HCL supports expressions for dynamic values:

```hcl
# String interpolation
description = "Agent for ${vars.app_name}"

# References
api_key = vars.anthropic_api_key
model = models.anthropic.claude_sonnet_4

# Lists
tools = [builtins.http.get]
```

## Validation

Always validate your config before running:

```bash
squadron verify ./my-config
```

This catches errors like:
- Invalid HCL syntax
- Missing variable values
- Invalid model references
- Circular mission dependencies
