Tools
Swarm Layer
Spec-driven workflow orchestrator plugin for OpenClaw
Install
npm install
npm
README
<div align="center">
# OpenClaw Swarm Layer
### Spec-Driven Workflow Orchestration for AI Agent Swarms
**The Evolution of Agent Orchestration:** Spec → Plan → Execute → Review → Ship
Turn workflow specifications into executable task graphs, dispatch through pluggable runners, and orchestrate multi-agent collaboration with persistent sessions.
[](LICENSE)
[](https://nodejs.org)
[](https://openclaw.dev)
[](#development)
[Quick Start](#quick-start) • [Features](#features) • [CLI Reference](#cli-commands) • [Configuration](docs/configuration.md) • [License](LICENSE)







</div>
---
## Features
- **Spec-driven orchestration** — import a spec, generate a task graph, execute in dependency order
- **Multiple runners** — manual (operator-driven), ACP (external harness), subagent (OpenClaw-native)
- **Review gates** — tasks require approval before marking done
- **Session management** — persistent sessions with reuse, thread binding, follow-up/steer
- **Automatic retry** — configurable retry policy with dead letter tracking
- **Operator UX** — attention items, highlights, recommended actions, reports
- **Report sync** — local reports + optional Obsidian vault sync
## Prerequisites
- Node.js >= 22
- [OpenClaw](https://openclaw.dev) >= 2026.2.24
## Installation
```bash
# Clone the repository
git clone https://github.com/xucheng/openclaw-swarm-layer.git
cd openclaw-swarm-layer
npm install
npm run build
# Install as an OpenClaw plugin
openclaw plugins install -l /path/to/openclaw-swarm-layer
```
## Quick Start
```bash
# 1. Initialize a project
openclaw swarm init --project /path/to/your/project
# 2. Write a spec file (Markdown with Goals/Phases/Tasks sections)
cat > SPEC.md << 'EOF'
# My Workflow
## Goals
- Build and test the feature
## Phases
### Phase 1
- Implement the core logic
- Write unit tests
### Phase 2
- Integration testing
EOF
# 3. Import the spec and generate task graph
openclaw swarm plan --project . --spec SPEC.md
# 4. Check status
openclaw swarm status --project .
# 5. Execute (dry-run first)
openclaw swarm run --project . --dry-run
openclaw swarm run --project .
# 6. Review completed tasks
openclaw swarm review --project . --task <taskId> --approve
# 7. Generate report
openclaw swarm report --project .
```
## CLI Commands
### Core Workflow
| Command | Description |
|---------|-------------|
| `swarm init --project <path>` | Initialize swarm state for a project |
| `swarm status --project <path>` | Show workflow status with attention items |
| `swarm plan --project <path> --spec <path>` | Import spec and build task graph |
| `swarm run --project <path> [--runner acp\|manual\|subagent] [--dry-run]` | Execute next runnable task |
| `swarm review --project <path> --task <id> --approve\|--reject` | Approve or reject a task |
| `swarm report --project <path>` | Generate workflow report |
| `swarm doctor` | Diagnose bridge compatibility |
### Session Management
| Command | Description |
|---------|-------------|
| `swarm session list --project <path>` | List all sessions |
| `swarm session inspect --project <path> --session <id>` | Inspect a session |
| `swarm session status --project <path> --run <id>` | Poll session status |
| `swarm session cancel --project <path> --run <id>` | Cancel an active session |
| `swarm session close --project <path> --run <id>` | Close a session |
| `swarm session follow-up --project <path> --session <id> --task <desc>` | Inject follow-up task |
| `swarm session steer --project <path> --session <id> --message <text>` | Send steering message |
| `swarm session cleanup --project <path> [--stale-minutes <n>]` | Clean up orphaned sessions |
## Architecture
```
CLI (src/cli/) <-> Tools (src/tools/)
| |
SwarmOrchestrator (src/services/orchestrator.ts)
|
RunnerRegistry -> TaskRunner implementations
| | |
ManualRunner AcpRunner SubagentRunner
|
StateStore + SessionStore (src/state/, src/session/)
```
See [docs/configuration.md](docs/configuration.md) for all configuration options.
## Development
```bash
npm run build # TypeScript -> dist/
npm test # Unit + e2e tests
npm run test:unit # Unit tests only
npm run test:e2e # E2E tests only
npm run test:watch # Watch mode
```
## Documentation
- [Configuration Reference](docs/configuration.md)
- [Operator Runbook](docs/operator-runbook.md) — install, smoke test, upgrade, rollback
- [Roadmap](docs/roadmap.md) — milestone structure
- [Milestones](docs/milestones.md) — definition of done
- [Current Plan](docs/current-plan.md) — status and future directions
- [Migration Checklist](docs/migration-checklist.md) — bridge replacement strategy
## License
[MIT](LICENSE)
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md).
tools
Comments
Sign in to leave a comment