dot_swarm — markdown-native agent orchestration for multi-repo organizations
Project description
The .Swarm Protocol
Minimal, git-native, markdown-first agent orchestration for multi-repo organizations.
Multi-Actor Coordination: A Common Problem
Modern software teams use multiple AI coding agents simultaneously across different platforms. Without coordination:
- Two agents work on the same task simultaneously
- Context is lost when chat history is compacted
- Non-obvious decisions (why approach A over B) disappear forever
- No agent knows what the previous agent did or decided
Existing solutions (Jira, Linear, GitHub Issues) require web UIs and API credentials. Database-backed tools add binary files and server processes to your repo.
dot_swarm takes a different approach: everything is a markdown file any agent on any platform can read and write directly.
Stimergic Systems: Nature's Answer
In nature, central coordinators are rarely used — and when they exist, they do not actively manage coordination.
A bee queen does not dispatch workers or resolve conflicts. She emits chemical markers that encode colony state, and workers read those traces autonomously to decide what to do next. An ant queen does the same. The result is not top-down management — it is multi-master consensus through a shared medium. Hives split into independent sub-colonies. Ant colonies form task-specialized sub-teams. Neither requires a central node approving every action.
The key property that makes this work: all members speak the same chemical language. Every worker interprets pheromone gradients the same way. The signal is the protocol.
The cost of a central coordinator is not just latency — it is information overload and single-point fragility. A queen who had to consciously route every foraging decision would saturate immediately. The colony would slow to the speed of one brain.
dot_swarm applies this directly to software agent fleets:
!!! quote "The core principle" Agents that modify filesystem-native projects should leave traces in their environment for collaborative purposes, rather than reporting to a central node around which complicated systems must be arranged to prevent bottlenecks and data loss from information overload.
The .swarm/ directory is the shared medium. state.md is the pheromone trail.
BOOTSTRAP.md is the chemical language every agent reads first. As long as agents
follow the same protocol, coordination emerges from the environment — no coordination
service required.
Signals decay. Pheromone trails evaporate when not reinforced. dot_swarm reflects
this: swarm audit flags stale claims, memory.md entries are dated, and state.md
timestamps tell any agent exactly how fresh the picture is. Old signals stop misleading
new workers.
How It Works
The .swarm/ Directory
Every repository gets a .swarm/ directory with five files:
| File | Role |
|---|---|
BOOTSTRAP.md |
Universal agent protocol — every agent reads this first |
context.md |
What this project is, its constraints, its architecture |
state.md |
Current focus, active items, blockers, handoff note |
queue.md |
Work items with claim stamps |
memory.md |
Non-obvious decisions and rationale (append-only) |
The Pheromone Trail
Agents leave state traces (state.md updates) that guide successor agents without
direct communication. The next agent reads state.md first — it tells you exactly
where things stand in one glance. This is stigmergy: coordination via environment
modification, not via message passing.
The Claim Pattern
Work items use inline stamps for optimistic concurrency — no lock server needed:
## Active
- [>] [CLD-042] [CLAIMED · claude-code · 2026-03-26T14:30Z] Fix Redis timeout
priority: high | project: cloud-stability
## Pending
- [ ] [CLD-043] [OPEN] Add request ID tracing to all services
priority: medium | project: observability
## Done
- [x] [CLD-041] [DONE · 2026-03-25T16:00Z] Update auth health check path
project: cloud-stability
Hierarchical Coordination
Organization (your-company/) ← cross-repo initiatives
.swarm/
├── Division (service-a/) ← single-repo work
│ .swarm/
└── Division (service-b/)
.swarm/
Work items use level-prefixed IDs: ORG-001, CLD-042, FW-017. Cross-division items
live at org level with refs: pointers in each affected division's queue.
Why Not a Central Service?
The typical alternative — a shared task server, a Slack bot, a GitHub Issues label workflow — introduces a coordination bottleneck that does not exist in the natural systems that inspired dot_swarm:
| Central-node approach | Swarm approach |
|---|---|
| Agents report in, wait for assignments | Agents read environment, self-assign |
| Server becomes single point of failure | .swarm/ files replicated by git |
| API credentials required per-agent | Plain file access, no auth layer |
| Context window dumps to external system | Context lives where the code lives |
| Bottleneck grows with fleet size | Throughput scales with number of agents |
| Complex de-duplication logic needed | Optimistic claims + audit resolves conflicts |
The bee colony analogy is exact: multi-master protocols (hive splitting, independent sub-colonies) emerge naturally when agents share a medium rather than a manager. Any agent can start work on any unclaimed item without asking permission. The environment — not a coordinator — serializes conflicting writes through timestamps and claim stamps.
Quick Start
1. Install
pip install dot-swarm
# With AI features (swarm ai, drift check)
pip install 'dot-swarm[ai]'
2. Initialize
cd your-repo
swarm init
swarm status
3. Coordinate
swarm claim CLD-001
# ... do work ...
swarm done CLD-001 --note "Implemented JWT refresh via rotating secret"
swarm handoff
Credits
Inspired by Steve Yegge's "Welcome to Gas Town" and grounded in stigmergy research spanning six decades, from Grassé's termite mound studies (1959) through Dorigo's Ant Colony Optimization (1996) to Bonabeau, Dorigo & Theraulaz's Swarm Intelligence (1999).
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dot_swarm-0.3.0.tar.gz.
File metadata
- Download URL: dot_swarm-0.3.0.tar.gz
- Upload date:
- Size: 88.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8108e3d0649bce8dbc43f298ed99541ea0d4aad864eeb28d2b24a6a3bd56173
|
|
| MD5 |
32a75b28337603f138f07f8c131bd00f
|
|
| BLAKE2b-256 |
59dc074cf1c13dd320247f491c94e6e88a62c23340954e2c01ccaa4aa6f8c79c
|
Provenance
The following attestation bundles were made for dot_swarm-0.3.0.tar.gz:
Publisher:
publish-pypi.yml on oasis-main/dot_swarm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dot_swarm-0.3.0.tar.gz -
Subject digest:
e8108e3d0649bce8dbc43f298ed99541ea0d4aad864eeb28d2b24a6a3bd56173 - Sigstore transparency entry: 1340597493
- Sigstore integration time:
-
Permalink:
oasis-main/dot_swarm@088dc44e992f4801b9b6d5206cb7e2343b5cbc5a -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/oasis-main
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@088dc44e992f4801b9b6d5206cb7e2343b5cbc5a -
Trigger Event:
push
-
Statement type:
File details
Details for the file dot_swarm-0.3.0-py3-none-any.whl.
File metadata
- Download URL: dot_swarm-0.3.0-py3-none-any.whl
- Upload date:
- Size: 77.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ddbb59140f17f9f7269644dd47a89934d73a9f2fc6df6db92200ea3b6d61fe
|
|
| MD5 |
20e5f228a47a829aea431f4310a4e128
|
|
| BLAKE2b-256 |
8eb8c5821afd9f66e895607767a1873c4cb9111b2d03e8306c5e77b2fe05f8ea
|
Provenance
The following attestation bundles were made for dot_swarm-0.3.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on oasis-main/dot_swarm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dot_swarm-0.3.0-py3-none-any.whl -
Subject digest:
89ddbb59140f17f9f7269644dd47a89934d73a9f2fc6df6db92200ea3b6d61fe - Sigstore transparency entry: 1340597499
- Sigstore integration time:
-
Permalink:
oasis-main/dot_swarm@088dc44e992f4801b9b6d5206cb7e2343b5cbc5a -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/oasis-main
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@088dc44e992f4801b9b6d5206cb7e2343b5cbc5a -
Trigger Event:
push
-
Statement type: