Break down goals into multiple tasks and coordinate execution with gates and recovery. Based on Claw Code's agentic harness.
92
90%
Does it follow best practices?
Impact
100%
1.09xAverage score across 3 eval scenarios
Passed
No known issues
Get the planning-execution harness running in under 5 minutes.
Each service runs independently on stdin/stdout. Open separate terminals:
cd ~/planning-execution-harness
python3 examples/python-planning.pyThen in another terminal, send a request:
echo '{"id":"1","method":"decompose","params":{"objective":"add dark mode"}}' | python3 examples/python-planning.pyYou should see:
{
"id": "1",
"result": [
{
"objective": "Prepare: Setup environment for 'add dark mode'",
"scope": "module",
...
},
...
]
}cd ~/planning-execution-harness
node examples/nodejs-worker.jsSend a request:
cat > /tmp/worker_req.json << 'EOF'
{
"id":"2",
"method":"spawn_worker",
"params":{
"task_packet":{
"objective":"Create theme provider",
"scope":"module",
"scope_path":"src/theme",
"acceptance_tests":["npm test"]
}
}
}
EOF
node examples/nodejs-worker.js < /tmp/worker_req.jsonYou should see events on stdout:
{"event_id":"evt_..._spawn","kind":"spawning","worker_id":"worker_..."}
{"id":"2","result":{"worker_id":"worker_..."}}Run the complete workflow with all services:
cd ~/planning-execution-harness
python3 examples/orchestrator.py "add dark mode to the dashboard"This will:
Expected output:
[Planning] Started
[Bootstrap] Started
[Worker] Started
=== Stage 1: Planning ===
Generated 4 task packets
[1] Prepare: Setup environment for 'add dark mode'
[2] Implement: Core logic for 'add dark mode'
[3] Test: Validate 'add dark mode' works correctly
[4] Polish: Final refinements for 'add dark mode'
=== Stage 2: Bootstrap ===
Executing phase: system_prompt_fastpath
✓ system_prompt_fastpath
Executing phase: mcp_fastpath
✓ mcp_fastpath
=== Stage 3: Spawn Workers ===
Spawning worker for task 1...
Spawned: worker_1234_1704067200
...
=== Stage 4: Trust Gates ===
worker_1234_1704067200: requires_approval=true
worker_1234_1704067200: marked trusted
...
=== Summary ===
Objective: add dark mode to the dashboard
Packets: 4
Workers: 4
Events: 14If you have ajv installed:
# Install ajv
npm install -g ajv-cli
# Validate a task packet
ajv validate -s schemas/task-packet.schema.json -d examples/request-examples.json# Read the full architecture guide
cat SKILL.md | less
# View the schemas
ls -la schemas/
# View the service contracts
ls -la contracts/
# View example implementations
ls -la examples/python3 examples/python-planning.py << 'EOF'
{"id":"p1","method":"decompose","params":{"objective":"fix login bug"}}
EOFpython3 -c "
import subprocess
import json
cmd = 'python3 -c \"import json, sys; sys.path.insert(0, \'examples\'); exec(open(\\\"examples/python-planning.py\\\").read())\"'
# If Rust bootstrap available:
# rustc examples/rust-bootstrap.rs -o /tmp/bootstrap
# echo '{\"id\":\"b1\",\"method\":\"execute_phase\",\"params\":{\"phase\":\"system_prompt_fastpath\"}}' | /tmp/bootstrap
"cat > /tmp/worker_test.sh << 'EOF'
#!/bin/bash
# Start worker manager in background
node examples/nodejs-worker.js > /tmp/worker.log 2>&1 &
WORKER_PID=$!
sleep 1
# Send spawn request
echo '{"id":"w1","method":"spawn_worker","params":{"task_packet":{"objective":"test","scope":"module"}}}' \
| nc localhost 5000 || echo 'Note: nc not available, check /tmp/worker.log'
# Stop worker
kill $WORKER_PID 2>/dev/null
# Show events
echo "Events logged:"
cat /tmp/worker.log
EOF
bash /tmp/worker_test.sh# Get task packets
PACKETS=$(python3 examples/python-planning.py << 'EOF'
{"id":"1","method":"decompose","params":{"objective":"feature"}}
EOF
)
# Spawn worker for first packet
echo $PACKETS | jq '.result[0]' | node examples/nodejs-worker.jspython3 examples/orchestrator.py "your objective here"echo '{"id":"1","method":"decompose","params":{"objective":"test"}}' \
| python3 examples/python-planning.py \
| jq '.result' \
| tee /tmp/plan.jsonMake sure you're in the repo directory:
cd ~/planning-execution-harnessServices use stdin/stdout, not network ports. If you see this error, you may have a background process:
pkill -f python-planning
pkill -f nodejs-worker
pkill -f orchestratorCheck that requests follow the contract schema:
ajv validate -s schemas/task-packet.schema.json < /tmp/my_packet.jsonEnsure stdin/stdout is connected:
# Good - service reads from stdin
echo 'request' | python3 examples/python-planning.py
# Bad - no input, service waiting on stdin
python3 examples/python-planning.py # Ctrl+C to exitcat SKILL.mdcontracts/ directoryexamples/Objective
↓ Planning Service (Python)
Task Packets
↓ Bootstrap Service (Rust/Python)
Prepared Environment
↓ Worker Manager (Node.js)
Worker Lifecycle
↓ Permission Gates
Gated Execution
↓ Agent Loop
SuccessEach arrow is a JSON message contract. Each box can be any language!
Need help? Check SKILL.md for the full architecture guide.