Config-driven worker spawning for multi-agent systems. tmux + nohup backends, signal handling, health checks.
Project description
cervellaswarm-spawn-workers
Config-driven worker spawning for multi-agent systems.
Part of CervellaSwarm - Build AI agent teams that remember.
Features
- Auto-detect backend: tmux (preferred) or nohup (universal fallback)
- Config-driven: Spawn teams from
team.yamlfiles - Signal handling: Graceful shutdown on SIGINT/SIGTERM
- Health checks: Monitor worker status, uptime, and liveness
- File-based state:
.ready/.working/.donetask markers - Cross-platform: Works on macOS and Linux
Quick Start
pip install cervellaswarm-spawn-workers
# Spawn a single worker
cervella-spawn --worker backend --specialty backend
# Spawn a team from config
cervella-spawn --team team.yaml
# Check worker status
cervella-spawn --status
# Kill all workers
cervella-spawn --kill
# List available specialties
cervella-spawn --list
How It Works
team.yaml ──→ TeamLoader ──→ SpawnManager ──→ Backend (tmux/nohup)
│
PromptBuilder
│
claude -p --append-system-prompt
- TeamLoader reads your
team.yamland extracts agent configurations - PromptBuilder generates English system prompts with specialty focus
- SpawnManager launches workers via the detected backend
- Workers check
tasks_dir/for.readyfiles, claim with.working, finish with.done
team.yaml Format
name: my-project
version: "1.0.0"
process: hierarchical
agents:
- name: backend
type: worker
specialty: backend
model: sonnet
- name: tester
type: worker
specialty: tester
model: sonnet
spawn:
max_workers: 5
tasks_dir: .swarm/tasks
logs_dir: .swarm/logs
backend: tmux # or "nohup", omit for auto-detect
CLI Reference
cervella-spawn [OPTIONS]
Options:
--team PATH Spawn workers from team.yaml config
--worker NAME Spawn a single worker by name
--status Show worker status (alive/dead/uptime)
--kill Kill all workers gracefully
--list List available worker specialties
--specialty TYPE Worker specialty (default: generic)
--prompt TEXT Custom system prompt for the worker
--tasks-dir DIR Tasks directory (default: .swarm/tasks)
--logs-dir DIR Logs directory (default: .swarm/logs)
--max-workers N Max concurrent workers (default: 5)
--backend TYPE Force backend: tmux or nohup
--claude-bin PATH Path to claude CLI binary
--version Show version
Available Specialties
| Specialty | Focus Area |
|---|---|
backend |
Python, FastAPI, databases, API design |
frontend |
React, CSS, Tailwind, UI/UX, accessibility |
tester |
Testing, debugging, QA, validation |
docs |
Documentation, README, guides, tutorials |
devops |
Deployment, CI/CD, Docker, infrastructure |
data |
SQL, analytics, database design, ETL |
security |
Security audits, vulnerability assessment |
researcher |
Technical research, analysis, reports |
reviewer |
Code review, best practices, architecture |
generic |
General-purpose tasks across all domains |
Python API
from cervellaswarm_spawn_workers import SpawnManager, load_team
# Spawn from team config
team = load_team(Path("team.yaml"))
manager = SpawnManager(max_workers=5)
result = manager.spawn_team(team)
print(f"Spawned: {result.spawned}, Failed: {result.failed}")
# Spawn a single worker
worker = manager.spawn_worker(
name="backend",
specialty="backend",
)
# Check status
for status in manager.get_status():
print(f"{status.name}: {'ALIVE' if status.alive else 'DEAD'}")
# Cleanup
manager.kill_all()
How It Compares
| Feature | CervellaSwarm | CrewAI | AutoGen | LangGraph |
|---|---|---|---|---|
| Config-driven spawn | team.yaml | agents.yaml | No | No |
| Subprocess isolation | tmux/nohup | threads | threads | in-process |
| Backend auto-detect | Yes | N/A | N/A | N/A |
| Signal handling | SIGINT/SIGTERM | No | No | No |
| File-based state | .ready/.working/.done | No | No | No |
| Worker health check | CLI --status |
No | max_turns | No |
| Cross-platform | macOS + Linux | Yes | Yes | Yes |
| Dependencies | 1 (pyyaml) | 20+ | 15+ | 10+ |
Honest note: CrewAI and AutoGen excel at in-process agent orchestration with rich LLM routing. CervellaSwarm targets a different niche: subprocess-isolated workers with file-based coordination, ideal for long-running tasks where process isolation and crash recovery matter.
Architecture
The package has 4 core modules:
backend- Execution backends (tmux/nohup) with auto-detectionteam_loader- YAML config parser compatible with agent-templatesspawner- SpawnManager lifecycle (spawn, monitor, kill, cleanup)prompt_builder- English system prompt generation with specialties
Development
git clone https://github.com/rafapra3008/cervellaswarm.git
cd cervellaswarm/packages/spawn-workers
pip install -e ".[test]"
pytest
License
Apache-2.0 - See LICENSE for details.
Project details
Release history Release notifications | RSS feed
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 cervellaswarm_spawn_workers-0.1.0.tar.gz.
File metadata
- Download URL: cervellaswarm_spawn_workers-0.1.0.tar.gz
- Upload date:
- Size: 32.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23703ab933cd3525531b16ffb358d7d87a7c83dedb2b6d07375f97d9423eb3f4
|
|
| MD5 |
47e10ab0f2dfae3e7207fcf619bb3167
|
|
| BLAKE2b-256 |
e365e0e0dfea03fa63ce07e75048f40478b450c3ba152428008cda6351304b6f
|
Provenance
The following attestation bundles were made for cervellaswarm_spawn_workers-0.1.0.tar.gz:
Publisher:
publish-spawn-workers.yml on rafapra3008/cervellaswarm-internal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cervellaswarm_spawn_workers-0.1.0.tar.gz -
Subject digest:
23703ab933cd3525531b16ffb358d7d87a7c83dedb2b6d07375f97d9423eb3f4 - Sigstore transparency entry: 991484748
- Sigstore integration time:
-
Permalink:
rafapra3008/cervellaswarm-internal@ac9df4a1b110a5d243ef091a26655087aaf6bca8 -
Branch / Tag:
refs/tags/spawn-workers-v0.1.0 - Owner: https://github.com/rafapra3008
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-spawn-workers.yml@ac9df4a1b110a5d243ef091a26655087aaf6bca8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cervellaswarm_spawn_workers-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cervellaswarm_spawn_workers-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
889c2815cf2f0693252ca44d11b223297ed8dfa6e99c1ab7cd2b0f6971c1d5a3
|
|
| MD5 |
9d53c7ef5db44bc47724e0e5d49ab2fe
|
|
| BLAKE2b-256 |
fa8ba691fe04177eab7838208fd056cd6a3a5be3285ace5ece7a08899f2d76cc
|
Provenance
The following attestation bundles were made for cervellaswarm_spawn_workers-0.1.0-py3-none-any.whl:
Publisher:
publish-spawn-workers.yml on rafapra3008/cervellaswarm-internal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cervellaswarm_spawn_workers-0.1.0-py3-none-any.whl -
Subject digest:
889c2815cf2f0693252ca44d11b223297ed8dfa6e99c1ab7cd2b0f6971c1d5a3 - Sigstore transparency entry: 991484753
- Sigstore integration time:
-
Permalink:
rafapra3008/cervellaswarm-internal@ac9df4a1b110a5d243ef091a26655087aaf6bca8 -
Branch / Tag:
refs/tags/spawn-workers-v0.1.0 - Owner: https://github.com/rafapra3008
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-spawn-workers.yml@ac9df4a1b110a5d243ef091a26655087aaf6bca8 -
Trigger Event:
push
-
Statement type: