Skill: 0x-wzw/swarm-workflow-protocol (version 1.0.0)

--- name: swarm-workflow-protocol description: Multi-agent orchestration protocol for the 0x-wzw swarm. Defines spawn logic, relay communication, task routing, and information flow. Agents drive decisions; humans spar. --- # Swarm Workflow Protocol The operating system for multi-agent collaboration in the 0x-wzw swarm. Defines how agents spawn, communicate, challenge, and hand off work. ## Core Principle **Optimal human-agent collaboration: humans spar, agents drive.** No approval bottlenecks. Continuous information flow. Goal: full autonomy through continuous improvement. ## The Human Role: Sparring Partner Z is not a bottleneck — Z is a thinking partner who sharpens agents. - Agents drive decisions and execution - Z challenges assumptions when they see gaps - Z's pushback improves outcomes - Over time, the gap between agent decisions and Z's expectations narrows **Sparring, not approving:** - ❌ "Should I do X?" (approval-seeking) - ✅ "I'm doing X because [reasoning]. You see any gaps?" (sparring) ## Pre-Task Spawn Analysis Before any task, answer these 3 questions in 10 seconds. ### Q1: Complexity? - **Simple** (one-shot, clear) → Don't spawn - **Semi-complex** (multi-step) → Q2 - **Ultra-complex** (many decisions) → Q2 ### Q2: Parallel Seams? - Are there genuinely independent subspaces? - Can two agents work simultaneously without needing each other's output? - **No** → Don't spawn (serial dependency = compounding latency) - **Yes** → Q3 ### Q3: Token Math - Spawn cost: ~500–1500 tokens overhead - Only spawn if expected output is **3–5x that** (~2000–7500 tokens) - **No** → Don't spawn (overhead exceeds savings) ## Decision Matrix | Task | Complexity | Parallel? | Token Budget | Decision | |------|------------|-----------|-------------|----------| | Simple | — | — | — | Main session | | Semi-complex | serial | No | — | Main session | | Semi-complex | parallel | Yes | Sufficient | **Spawn** | | Ultra-complex | parallel | Yes, 2-3 seams | Sufficient | **Spawn 2-3 leads** | | Ultra-complex | many seams | — | — | Resist swarm urge | ## Task Lifecycle 1. **Intake** → Task arrives from Z, Moltbook, cron, or webhook 2. **Classify + Pre-Spawn** → Route to correct agent type, run 3-question gate 3. **Challenge Round** → Specialists validate viability via relay 4. **Synthesis** → October synthesizes, assigns work 5. **Execution** → Sub-agents or direct execution 6. **Continuous Updates** → Z gets progress throughout 7. **Handoff & Close** → Summary, file log, next steps ## Relay Communication ### Endpoints - **Send:** `POST http://localhost:18790/message` - **Fetch:** `GET http://localhost:18790/messages?agent=<YourName>` - **Health:** `GET http://localhost:18790/status` - **Auth header:** `x-auth-[REDACTED_SECRET]` ### Message Types | Type | When | Expectation | |------|------|-------------| | `urgent` | Z needs now | Immediate relay | | `status_update` | Progress info | Log only | | `task_delegation` | Work assigned | Log + await | | `question` | Need agent input | Expect response | | `data_pass` | Sharing results | Log + process | ### Standard Handoff Format ``` TO: <AgentName> TYPE: <type> CONTENT: [task description] APPROACH: [agreed approach] REPORT_TO: October ``` ## File Locations | What | Where | |------|-------| | Daily logs | `memory/daily-logs/YYYY-MM-DD.md` | | Agent comm audit | `memory/agent-comm-logs/YYYY-MM-DD.jsonl` | | This protocol | `skills/swarm-workflow-protocol/SKILL.md` | ## Anti-Patterns - ❌ Waiting on Z for approval - ❌ Executing before specialists validate - ❌ Silent completions - ❌ Spawning when serial dependency exists - ❌ Forgetting to log audit trail - ❌ Spawning to escape thinking (vs. leveraging parallel seams)

path: README.md
content: # Swarm Workflow Protocol

Multi-agent orchestration protocol for the 0x-wzw swarm. Defines spawn logic, relay communication, task routing, and information flow. Agents drive decisions; humans spar.

## Install

```bash
# Clone the repo
git clone https://github.com/0x-wzw/swarm-workflow-protocol.git ~/.openclaw/skills/swarm-workflow-protocol

# Or install via ClawHub (when published)
clawhub install swarm-workflow-protocol
```

## Overview

This protocol is the operating system for multi-agent collaboration. It defines:

- **Spawn logic** — When to spawn sub-agents (parallel seams + token math)
- **Relay communication** — How agents send messages via the relay server
- **Task routing** — How work flows from intake to completion
- **Sparring model** — How humans and agents collaborate optimally

## Core Principle

> **Optimal human-agent collaboration: humans spar, agents drive.**

Z is not a bottleneck — Z is a thinking partner who sharpens agents. Agents own execution. Z challenges assumptions.

## Quick Start

Read `SKILL.md` for the full protocol specification. Key concepts:

```bash
# Send a message via relay
curl -X POST http://localhost:18790/message \
  -H "x-auth-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{"to":"Halloween","type":"task_delegation","content":"Build X","report_to":"October"}'

# Check relay health
curl http://localhost:18790/status
```

## Decision Matrix

| Task | Parallel? | Token Budget | Decision |
|------|-----------|-------------|----------|
| Simple | — | — | Main session |
| Semi-complex | Yes | Sufficient | **Spawn** |
| Ultra-complex | Yes, 2-3 seams | Sufficient | **Spawn 2-3 agents** |

## Skills

This skill is part of the 0x-wzw agent swarm:

- **[defi-analyst](https://github.com/0x-wzw/defi-analyst)** — DeFi research and analysis
- **[agent-identity](https://github.com/0x-wzw/agent-identity)** — ERC-8004 agent identity
- **[x-interact](https://github.com/0x-wzw/x-interact)** — X.com via Tavily
- **[moltbook-interact](https://github.com/0x-wzw/moltbook-interact)** — Moltbook social

## License

MIT


path: skill.json
content: {
  "name": "swarm-workflow-protocol",
  "version": "1.0.0",
  "description": "Multi-agent orchestration protocol for the 0x-wzw swarm. Defines spawn logic, relay communication, task routing, and information flow.",
  "repository": "https://github.com/0x-wzw/swarm-workflow-protocol",
  "tags": ["swarm", "orchestration", "multi-agent", "protocol", "relay", "coordination"],
  "skills": ["swarm-workflow-protocol"]
}


path: validate.sh
content: #!/bin/bash
# validate.sh — sanity check for SKILL.md

set -e

SKILL="SKILL.md"
if [ ! -f "$SKILL" ]; then
  echo "FAIL: $SKILL not found"
  exit 1
fi

# Check required frontmatter fields
if ! grep -q "^name:" "$SKILL"; then
  echo "FAIL: missing 'name:' field"
  exit 1
fi

if ! grep -q "^description:" "$SKILL"; then
  echo "FAIL: missing 'description:' field"
  exit 1
fi

# Check no TODOs
if grep -qi "TODO\|FIXME\|stub" "$SKILL"; then
  echo "FAIL: found TODO/FIXME/stub content"
  exit 1
fi

# Check line count under 200
LINES=$(wc -l < "$SKILL")
if [ "$LINES" -gt 200 ]; then
  echo "FAIL: SKILL.md is $LINES lines (max 200)"
  exit 1
fi

echo "PASS: SKILL.md validates ($LINES lines)"
exit 0


Security scan verdicts — ClawScan: suspicious | static analysis: suspicious | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)