---
name: loop-triage
description: Produces a clean, prioritized list of actionable work for an autonomous loop from CI failures, open issues, recent commits, and chat threads. Use when a development loop needs to decide what to work on next, when backlog noise exceeds signal, or at the start of each loop cycle.
category: loop-engineering
keywords: triage, prioritization, backlog, ci-failures, loop-cycle
---

# Loop Triage

## When to apply

Run at the **start of every loop cycle**, or whenever the volume of candidate work (CI failures, issues, review comments, alerts) exceeds what the loop can act on. Triage converts noise into a ranked, actionable list.

## Inputs

- Recent CI/test failures (last 24h)
- Open issues or tickets assigned to the team
- Recent commits on main (last 24–48h)
- Chat threads the loop can see
- The loop's current state file (what it already knows/attempted)

## Workflow

1. **Collect** — Gather every candidate item from all sources into one flat list. Do not filter yet.
2. **Deduplicate** — Collapse repeats: the same failure across jobs, an issue and its chat discussion, a flaky test re-failing.
3. **Classify** — Tag each item:
   - `bug` — broken behavior; production impact unknown
   - `flaky` — passes on retry; quarantine, don't chase
   - `chore` — deps, cleanup, docs; no behavior change
   - `feature` — new capability; needs design before code
4. **Rank** by: production impact > blocked others > recurrence count > age. Within ties, prefer smallest diff.
5. **Filter by capability** — Drop items the loop cannot safely do autonomously (auth, payments, schema migrations, anything on the denylist) into a "needs human" bucket instead.
6. **Emit the report.**

## Output format

```markdown
# Triage <date>

## Act now (loop-ownable)
1. [bug] <item> — evidence, suggested first step, risk
2. ...

## Needs human
- <item> — why (denylist/risk/ambiguity)

## Snoozed
- <item> — reason (flaky, waiting on upstream, duplicate of #N)
```

## Rules

- Every "act now" item needs evidence (a failing run URL, issue link, quoted error) — no vibes-based entries.
- Cap the act-now list at what one cycle can finish; overflow goes back to the pool, not to "urgent".
- Record triage output in the loop's state file so the next cycle doesn't re-derive it.

## Related skills

- [loop-budget](/skills/loop-budget) — Decides how many of the triaged items this cycle can afford.
- [minimal-fix](/skills/minimal-fix) — The execution style for each triaged bug.
