Building with an AI assistant
The repo ships SKILL.md — a single, assistant-agnostic guide at the root of the swift/ directory.
It covers:
- Mental model — when to reach for
Agentvs.GroundedAgent, single-agent vs. classifier routing, text vs. voice - Real API signatures —
Orchestrator,Agent,GroundedAgent,LLMClassifier,ChatCompletionsClient, storage and tracing types - Module map — what each import (
AgentSquad,AgentSquadMCP,AgentSquadAudio) pulls in - Task recipes — the
AsyncThrowingStream<AgentEvent, any Error>loop, routing between agents, wiring tools, custom protocol conformances - Gotchas —
maxToolRoundsdefaults,JSONValueinteger decoding, storage scoping, tracing lifecycle, realtime teardown
Pointing your assistant at SKILL.md
Section titled “Pointing your assistant at SKILL.md”Tell your assistant once, before it writes any AgentSquad code:
Read
SKILL.mdbefore writing any AgentSquad code.
That is all. The file is self-contained — no context beyond it is required.
This works with any assistant: Claude, Cursor, GitHub Copilot, or anything else that can read a file.
Claude Code: install as a skill
Section titled “Claude Code: install as a skill”Claude Code users can register SKILL.md so it is loaded automatically whenever the assistant works on AgentSquad code. Copy the file into your project’s skills directory:
mkdir -p .claude/skills/agent-squad-swiftcp swift/SKILL.md .claude/skills/agent-squad-swift/SKILL.mdAfter that, Claude Code picks it up without an explicit instruction on every session.
What SKILL.md does not replace
Section titled “What SKILL.md does not replace”SKILL.md is guidance and a map, not an API reference. It tells you what to use, when, and what to watch out for. For exact signatures, read the sources under swift/Sources/AgentSquad/. For worked examples, see the rest of this doc site — in particular:
- Orchestrator and Agents for the core turn loop
- GroundedAgent for the Brain → Presenter anti-hallucination pattern
- Classifiers for multi-agent routing
- Tools and MCP tools for tool wiring
- LLM clients for pointing
ChatCompletionsClientat any OpenAI-compatible endpoint - Chat history for on-device persistence
- Tracing for span export
- Realtime voice for
VoiceAssistantsetup