Morning-triage harness with adversarial reviewer

A cron-fired skill that finds its own work (failed CI, new issues, recent commits), fans each finding out to an isolated worktree, gates every fix behind an adversarial reviewer that assumes the code is broken, and leaves draft PRs — merging stays human.

prompt
→ Claude
# .claude/skills/morning-triage/SKILL.md — fired by cron at 06:00 READ (discovery inputs): CI runs that failed since the last run (gh run list --status failure); issues opened in the last 24h; commits merged since yesterday; the previous ./state/triage.md. JUDGE: for each candidate decide actionable NOW vs noise; blocks a release → P0; already tracked → skip. Keep only what is worth a worktree today — the loop picks, you don't hand it a list. WRITE: append findings (finding | source | priority | status) to ./state/triage.md and commit it so tomorrow's run can read it. HANDOFF: one git worktree per finding (git worktree add ../wt-<slug> -b fix/<slug>), MAX_PARALLEL=3 — capped by how many PRs a human can actually review, not by the machine. VERIFY: a second subagent as adversarial reviewer — ROLE: adversarial code reviewer. ASSUME this code is BROKEN until proven otherwise; do not praise. CHECK in order: does it run (execute, don't read); run the tests and paste real output; edge cases the author skipped; does behavior match the ticket. VERDICT: PASS only if every check holds, otherwise REJECT with each reason listed. Maximum 3 attempts per finding, then log as blocked. STOP (red lines): never merge, never delete, never push to main; anything uncertain goes to ./inbox/ for a human, NOT into a PR. Caps set before the first run: per-run timeout 45 minutes, daily budget $20. PRs open as drafts; merging stays human.
claude-code

Implementation note

Condensed-verbatim from the source article's five-lesson build (SKILL.md, worktree fan-out, reviewer.md, state file, GH Actions cron). The acid test from the source: if the reviewer hasn't rejected anything in 5+ turns, it isn't working. Names the failure modes this prevents: Blind, Tangled, Nodding, Amnesiac, and Manual Loop.

Source: 0x_kaizegraded B · 80/100 — how grades work →

More ci loops

Get the build green, every time

Loop/goalGitHubBnew

Work through each task in .toh/plan.md, fix blockers, until the build command succeeds or you hit 40 turns.

prompt
→ Claude
/goal every task in .toh/plan.md is checked and the build command exits 0 — or stop after 40 turns . A Haiku evaluator judges the condition FROM THE TRANSCRIPT — one more reason the QC gate quotes actual output: unquoted results are invisible to the evaluator. |

Get the build green

Loop/goalcommunityB

Run the build, fix the first error, and repeat until npm run build exits 0, with a 10-turn cap.

prompt
→ Claude
/goal `npm run build` exits 0 — run the build, fix the first error, repeat until it succeeds; stop after 10 turns

Get lint and E2E tests passing

Loop/goalGitHubA

Execute work from PLAN.md until npm run lint and npm run test:e2e pass, scoping changes per AGENTS.md.

prompt
→ Claude
/goal Implement the work described in PLAN.md. Stop only when npm run lint and npm run test:e2e pass. Follow AGENTS.md, keep changes scoped, and report verification evidence Stop after 25 turns even if the goal is not reached.
cimedium riskcodex