diff --git a/commands/spawn-issues.md b/commands/spawn-issues.md index cb0c1c2..574b601 100644 --- a/commands/spawn-issues.md +++ b/commands/spawn-issues.md @@ -137,22 +137,24 @@ Process: Work autonomously. If blocked, note it in PR description and report status as partial/failed. ``` -### Step 4: Poll and Pipeline +### Step 4: Event-Driven Pipeline -Run a polling loop until all issues reach a terminal state (approved, failed, or max iterations): +**Do NOT poll.** Wait for `` messages that arrive automatically when background tasks complete. + +When a notification arrives: +1. Read the output file to get the result +2. Parse the result and print status update +3. Spawn the next stage (reviewer/fixer) in background +4. Continue waiting for more notifications ``` -while any issue not in terminal state: - for each issue: - check TaskOutput (block=false) for current task - - if task completed: - parse result - print status update - start next step (spawn next agent) - update issue state - - brief pause before next poll iteration +On for task_id X: + - Find which issue this task belongs to + - Read output file, parse result + - Print status update + - If not terminal state, spawn next agent in background + - Update issue state + - If all issues terminal, print final summary ``` **State transitions:** @@ -164,7 +166,7 @@ implementing → (worker done) → reviewing → (approved) → DONE → (worker failed) → FAILED ``` -**On each completion, print status:** +**On each notification, print status:** ``` [#42] Worker completed → PR #55 created, starting review