# Agent Squad Swift

Use when building or modifying a Swift app that uses the AgentSquad Swift framework, ...

- Repository: https://github.com/2FastLabs/agent-squad (7796 stars)
- Category: Design
- License: Apache-2.0
- Last updated: 2026-10-08
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add 2FastLabs/agent-squad --skill agent-squad-swift -g -a claude-code -y`
Codex: `npx skills add 2FastLabs/agent-squad --skill agent-squad-swift -g -a codex -y`
Cursor: `npx skills add 2FastLabs/agent-squad --skill agent-squad-swift -g -a cursor -y`
Gemini CLI: `npx skills add 2FastLabs/agent-squad --skill agent-squad-swift -g -a gemini-cli -y`

## Description

Use when building or modifying a Swift app that uses the AgentSquad Swift framework, on-device multi-agent orchestration for iOS 16+ / macOS 14+: orchestrator, agents (Agent, GroundedAgent), classifier routing, LLM clients (OpenAI-compatible), tools (native + MCP), tool UIs/widgets, on-device storage, tracing, and realtime voice, built-in types and custom implementations.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# AgentSquad Swift, assistant guide

Protocol-driven, on-device multi-agent framework (Swift 6.2, iOS 16+ / macOS 14+; persistence via
`FileChatStorage` on iOS 16+, `DeviceChatStorage` on iOS 17+). This is guidance and
a map, **not an API reference**. Read the exact signatures from the source (`swift/Sources/AgentSquad/`)
and the worked recipes from the docs site sources (`docs/src/content/docs/swift/`); this file tells
you *what to use, when, and what to watch out for*.

## When to use what

- **One assistant** → an `Agent` (or `GroundedAgent`) + an `Orchestrator` with no classifier. No routing hop.
- **Several specialists** → multiple agents + an `LLMClassifier`; the orchestrator routes each turn.
- **Answers must not drift from data** (prices, stock, balances) → `GroundedAgent`: a Brain calls
  tools, an isolated Presenter speaks only from the curated results (it can be a smaller/local model).
- **Voice** → a `VoiceAssistant` (a peer of the orchestrator, not an agent): `OpenAIVoiceAssistant`
  (single LLM + tools, speaks directly, the spoken analog of `Agent`) or
  `OpenAIGroundedVoiceAssistant` (Brain → Presenter, can't drift from data, analog of `GroundedAgent`).

Every component is a `Sendable` protocol with one built-in implementation, swap in your own anywhere.

## Modules (import only what you use)

The rest: https://github.com/2FastLabs/agent-squad/blob/HEAD/swift/SKILL.md
