Loop/ralphCImedium riskadvancedsafety B · 75X

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 Code
# .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_kaize ↗graded B · 75/100 — how grades work (Safety Score v2) →

Similar loops

All ci loops →

Run every 15 minutes to classify CI failures, fix clear regressions in a worktree with verification, and escalate infrastructure or security test failures.

prompt
→ Claude Code
/loop 15m $ci-triage — update ci-sweeper-state.md. Classify failures first. Fix only clear regressions in a worktree with verifier. Max 3 attempts. Escalate infra and security test failures
/goalCIlow risk

Get the build green

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

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

Run ci-triage on failing CI, fix clear regressions in isolation, verify before push, and update state—up to 3 attempts per cluster.

prompt
→ Claude Code
/loop 15m Run ci-triage on failing CI for default branch and open PRs. Update ci-sweeper-state.md. Fix only clear regressions in an isolated worktree. Spawn loop-verifier before any push. Max 3 attempts per failure cluster