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.
# .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.
/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. |
/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.