Swat V2
SWAT v2 โ AI task orchestration system. Go MCP server + OpenClaw bridge plugin.
Ask AI about Swat V2
Powered by Claude ยท Grounded in docs
I know everything about Swat V2. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
SWAT
Autonomous multi-agent task execution engine. SWAT dispatches tasks to specialist squads โ each running as an independent AI coding agent session.
๐ Installation
Linux / macOS
curl -fsSL https://raw.githubusercontent.com/LangSensei/swat/main/install.sh | bash
Windows
irm https://raw.githubusercontent.com/LangSensei/swat/main/install.ps1 | iex
This will:
- Download the latest release for your platform
- Install the SWAT binary to
~/.swat/bin/and add it to your PATH (Linux/macOS: appends to.bashrc/.zshrc; Windows: updates user PATH in the registry) - Install framework blueprints to
~/.swat/blueprints/
OpenClaw Integration (Optional)
If you use OpenClaw, install the bridge plugin separately:
# See https://github.com/LangSensei/swat-openclaw
๐๏ธ Uninstallation
Linux / macOS
curl -fsSL https://raw.githubusercontent.com/LangSensei/swat/main/uninstall.sh | bash
Windows
irm https://raw.githubusercontent.com/LangSensei/swat/main/uninstall.ps1 | iex
Add --purge to also remove runtime data (operation history).
๐ฎ Usage
SWAT exposes 12 MCP tools. Configure your agent to connect:
MCP Configuration
{
"mcpServers": {
"swat": {
"command": "swat",
"args": []
}
}
}
Tools
Operations
swat_dispatchโ Dispatch a task (auto-classified to the right squad)swat_opsโ List operations with filters (status/since/limit/offset)swat_cancelโ Cancel a running operation
Squads
swat_squadsโ List installed squadsswat_squad_browseโ Browse the marketplaceswat_squad_installโ Install a squad from the marketplaceswat_squad_uninstallโ Uninstall a squadswat_squad_updateโ Update a squad to the latest marketplace version
Intake
swat_intake_createโ Create a recurring task (zero LLM cost)swat_intake_listโ List all intake queue entriesswat_intake_deleteโ Delete an intake entry
Notification
swat_notifyโ Send a notification to the user
CLI Flags
| Flag | Description |
|---|---|
--version | Print the installed version and exit |
--mcp-only | Start only the MCP server โ skip the background commander loop |
--runtime <name> | Set the AI coding agent runtime (default: copilot) |
--notify <target> | Set the notification target: desktop, openclaw (default: desktop) |
๐ง Architecture
Agent โ MCP โ SWAT Commander (Go) โ Squads (AI coding agent sessions)
SWAT is runtime-agnostic. The Commander orchestrates operations while a pluggable RuntimeAdapter handles runtime-specific details (dot-directories, agent files, MCP config paths, hooks).
| Component | Role |
|---|---|
| Commander | Go MCP server. Handles dispatch, workspace composition, dependency resolution, scheduling, and completion scanning. |
| Squads | Specialist agents. Each runs as an independent coding agent session with its own skills, MCP tools, and protocol. |
| RuntimeAdapter | Abstracts runtime differences. Each adapter knows its dot-dir, agent file name, MCP config path, and how to launch the agent. |
Supported Runtimes
| Runtime | Dot-Dir | Agent File | MCP Config | Launch Command |
|---|---|---|---|---|
copilot (default) | .github/ | AGENTS.md | .mcp.json | copilot |
gemini | .gemini/ | GEMINI.md | .gemini/settings.json | gemini |
Set the runtime with --runtime <name> (e.g. swat --runtime gemini).
How It Works
- You dispatch a task (Commander auto-classifies to the right squad)
- Commander provisions the workspace โ copies squad snapshot to
.squad/, skill hooks to<dotdir>/hooks/, skill content to<dotdir>/skills/, resolves MCP dependencies, writes the agent file (runtime-specific) - A coding agent session launches in the operation directory, reads the agent file + OPERATION.md
- Commander's background loop scans for completion (OPERATION.md status + report.html)
- Results surface through your agent
Skills vs Hooks: Skills are runtime-agnostic (shared across all runtimes). Hooks are runtime-specific and live under
hooks/copilot/,hooks/gemini/, etc. in each skill's blueprint.
Intake Queue
Unified task entry point โ all tasks (immediate dispatches and recurring schedules) flow through ~/.swat/intake/:
- Immediate tasks: created by
swat_dispatch, processed by background loop, deleted after completion - Recurring tasks: standard 5-field cron expressions with timezone support
immediateflag for first-run-now behavior- Per-file locking for concurrent safety
๐ Directory Structure
~/.swat/
โโโ blueprints/ # Templates & installed content
โ โโโ OPERATION.md # Operation template
โ โโโ squads/
โ โ โโโ _framework/ # Core protocol (versioned with binary)
โ โ โ โโโ PROTOCOL.md
โ โ โ โโโ TEMPLATE.md
โ โ โโโ <squad>/ # Squad blueprints
โ โ โโโ MANIFEST.md
โ โโโ skills/ # Shared skills (runtime-agnostic)
โ โโโ mcps/ # MCP server configs
โ
โโโ squads/ # Runtime data
โ โโโ _unclassified/ # Operations before squad assignment
โ โโโ <squad>/
โ โโโ operations/
โ โโโ <id>/ # Operation workspace
โ โโโ OPERATION.md
โ โโโ <agent-file> # Runtime-specific (AGENTS.md or GEMINI.md)
โ โโโ <mcp-config> # Runtime-specific (.mcp.json or .gemini/settings.json)
โ โโโ report.html
โ โโโ .squad/ # Squad blueprint snapshot (read-only)
โ โโโ <dotdir>/ # Runtime-specific (.github/ or .gemini/)
โ โโโ hooks/ # Skill hooks (runtime-specific)
โ โโโ skills/ # Skill content
โ
โโโ intake/ # Intake queue (JSON)
โโโ <id>.json
๐ ๏ธ Prerequisites
- Linux, macOS, or Windows
- GitHub CLI (authenticated)
- At least one supported AI coding agent runtime:
| Runtime | Requirements |
|---|---|
| Copilot (default) | GitHub Copilot CLI (npm install -g @github/copilot), Node.js 18+ |
| Gemini | Gemini CLI installed and available as gemini on PATH |
๐จ Building from Source
go build -o swat . # Go 1.24+
# With version injection:
go build -ldflags "-X main.version=v1.0.0" -o swat .
๐ฆ Related Projects
- swat-marketplace โ Squads, skills, and MCPs
- swat-openclaw โ OpenClaw integration (plugin + skill)
๐ License
MIT
