Autonomous QA watchdog. Run via `/loop 1h /qa-loop` to continuously evaluate project state and take action — dev work when incomplete, QA when built, idle when nothing warrants action. Designed for overnight/idle runs.
One loop. Evaluates project state. Decides what to do. Acts or stays idle.
/loop 1h /qa-loop
/loop 1h /qa-loop focus on responsive layout
Follows the Loop State File Convention from CLAUDE.md. State file: tmp/qa-loop-state.md.
current_task_detail. Bad: "working on auth". Good: "fixing failing test in tests/auth.test.ts:42 — assertion expects 401 but getting 403, need to update middleware check in src/middleware/auth.ts:18".status: BLOCKED, check if the blocker has been resolved (e.g., human merged a PR, dependency installed). If still blocked, log it and move to next_priority. If blocked for 3+ consecutive ticks on the same thing, flag it in qa-report.md for human attention and move on.Run this on every tick:
0. READ STATE FILE (tmp/qa-loop-state.md)
├─ File exists + status: IN_PROGRESS → RESUME current_task (skip to step 6)
├─ File exists + status: BLOCKED → Check if unblocked, else try next_priority
└─ File missing OR status: IDLE → Continue to step 1
1. IS THIS A SOFTWARE PROJECT?
├─ No → Log "not a software project, skipping" → IDLE
└─ Yes ↓
2. READ PROJECT STATE
Read: package.json (or equivalent), recent git log, tmp/qa-report.md (if exists),
any task files, TODO/FIXME comments, open issues.
Determine: What exists? What's expected? What's the gap?
3. IS THERE UNFINISHED DEV WORK?
Check: failing tests, incomplete features, TODOs from plan, empty stub files,
placeholder content, unimplemented routes.
├─ Yes → BRANCH: DEV (load domains/dev.md, pick highest-impact incomplete task, work it)
└─ No ↓
4. HAS ANYTHING CHANGED SINCE LAST QA PASS?
Compare: git diff since last qa-report timestamp, new commits, modified files.
├─ No changes + last QA was clean → Log "no changes, idle" → IDLE
└─ Changes exist OR no prior QA ↓
5. BRANCH: QA
Load domains/qa.md. Run the highest-priority applicable QA task:
Visual regression → Functional → Responsive → Performance →
Accessibility → Dead code → Links → Security.
Do ONE category per tick — thorough beats broad.
6. WRITE STATE FILE
After completing any action (DEV, QA, or IDLE), write tmp/qa-loop-state.md with
current status. If task completed this tick, set status: IDLE and populate
next_priority. If task is still in progress, set status: IN_PROGRESS with
detailed current_task_detail so the next tick can resume without re-discovery.
tmp/qa-report.md — even idle ticks get a one-line entry. This is your paper trail.tmp/qa-loop-state.md. No exceptions. This is your handoff to your future self. If you skip this, the next tick starts blind.If invoked with an argument (e.g., /qa-loop focus on responsive layout), weight that concern heavily in the decision tree. Still run the full evaluation, but prioritize the focus area when choosing which action to take.
## [ISO timestamp] — Tick #N
Decision: DEV | QA | IDLE
Reason: [why this branch was chosen]
Action: [what was done]
Result: [outcome, with screenshot paths if applicable]
Next: [what the next tick should prioritize]