--- name: triage description: Generate a human handoff brief summarizing loop status — completed, blocked, and remaining stories with recommended next steps. --- # /triage — Generate Human Handoff Brief Generate a triage brief summarizing the current state of a loop run. Use this when: - The loop hit max iterations without completing - You want a status check mid-run - You're handing off to another developer ## Instructions When the user invokes `/loop-triage`: ### Step 1: Read Current State 1. Read `.loop/prd.json` — get story statuses 2. Read `.loop/progress.md` — get session log and patterns 3. Read `.loop/config.json` — get mode and iteration settings 4. Check git log for recent commits on the loop branch ### Step 2: Analyze For each story, determine: - **Complete**: `passes: true`, verified by evaluator - **In Progress**: `passes: false`, has been attempted (check progress.md for entries) - **Blocked**: `passes: false`, rejected multiple times (check `rejections` count and `notes`) - **Not Started**: `passes: false`, no progress.md entries, no rejections ### Step 3: Generate Brief Write to `.loop/triage/TRIAGE_BRIEF.md`: ```markdown # Triage Brief Generated: {current date and time} Mode: {mode from config.json} Branch: {branchName from prd.json} ## Status Summary - **Complete:** {N} stories - **In Progress:** {N} stories - **Blocked:** {N} stories (hit retry limit) - **Not Started:** {N} stories ## Story Details | ID | Title | Status | Rejections | Notes | |----|-------|--------|------------|-------| | US-001 | ... | Complete | 0 | | | US-002 | ... | Blocked | 3 | Evaluator rejected: ... | | US-003 | ... | Not Started | 0 | | ## Key Patterns Discovered {Copy the Codebase Patterns section from progress.md} ## Blocked Stories — Analysis For each blocked story, summarize: - What was attempted - Why it was rejected (from notes field) - Suggested approach for a human to unblock it ## Recommended Next Steps Based on the current state: 1. {Most important next action} 2. {Second priority} 3. {Third priority} ## Files Modified {List all files changed across all commits on the loop branch, with brief descriptions} ``` ### Step 4: Present to User Show the summary inline and tell the user where the full brief is saved.