Skip to content

Working with War-Rooms

War-rooms are isolated execution environments for each epic. Every war-room gets its own directory with coordination files, and agents operate exclusively within their assigned room.

War-room structure

.agents/war-rooms/room-001/
├── config.json # Assignment: task ref, roles, goals
├── status # Current lifecycle state (single word)
├── channel.jsonl # Append-only message log
├── progress.json # Completion percentage + message
├── brief.md # Epic description for the agent
├── TASKS.md # Sub-task breakdown (created by agent)
├── lifecycle.json # State machine definition
├── pids.json # Active process IDs
└── artifacts/ # Files produced by the agent

Lifecycle states

Every war-room progresses through a state machine:

developing → review → fixing → passed
│ │
│ └──→ review (fix cycle)
└──→ failed-final (max retries)
StateDescription
developingAgent is implementing the epic
reviewQA agent is reviewing output
fixingEngineer addresses QA feedback
passedQA approved. Terminal
failed-finalMax retries exceeded. Terminal

Channel messages

The channel.jsonl file is the communication backbone. Each line is JSON:

{"id":"msg-001","from":"manager","to":"engineer","type":"task","ref":"EPIC-001","body":"Implement auth"}
{"id":"msg-002","from":"engineer","to":"qa","type":"done","ref":"EPIC-001","body":"Auth implemented..."}
TypeDirectionPurpose
taskmanager → engineerInitial assignment
doneengineer → qaReady for review
passqa → managerReview approved
failqa → engineerReview failed with feedback
fixmanager → engineerFix instructions
errorany → managerError report

Monitoring

Terminal window
# Check all rooms
pwsh .agents/war-rooms/Get-WarRoomStatus.ps1
# Watch a room's channel
tail -f .agents/war-rooms/room-001/channel.jsonl | jq .
# Check progress
cat .agents/war-rooms/room-001/progress.json | jq .

Debugging failures

  1. Read the fail message. jq 'select(.type == "fail")' .agents/war-rooms/room-001/channel.jsonl

  2. Check progress. Look at progress.json for how far the agent got.

  3. Inspect artifacts. Browse artifacts/ for partial output.

  4. Review TASKS.md. Check which sub-tasks were completed vs pending.

  5. Check PID status. cat .agents/war-rooms/room-001/pids.json | jq .

Manual overrides

Terminal window
echo "developing" > .agents/war-rooms/room-001/status

Use when an agent crashed and the room is stuck.

PID tracking

Each war-room tracks active processes in pids.json:

{"agent_pid": 12345, "mcp_pids": [12346, 12347], "started_at": "2025-01-15T10:30:00Z"}

The engine uses this to detect orphaned processes and clean up on cancellation.

Creating and removing rooms

Terminal window
# Create manually
pwsh .agents/war-rooms/New-WarRoom.ps1 \
-RoomId "room-manual" -TaskRef "TASK-001" \
-TaskDescription "Implement auth" -WorkingDir "/project" \
-DefinitionOfDone @("JWT working", "Tests pass") \
-AcceptanceCriteria @("POST /login returns 200")
# Remove a completed room
pwsh .agents/war-rooms/Remove-WarRoom.ps1 -RoomId room-001