feat(skills): add plan-loop skill for /loop-based autonomous workflows#448
Conversation
Bottles the Ralph-style autonomous-loop pattern from the recent 13-server-deployment work into a reusable skill. Replaces the ralph-loop plugin pattern with one built entirely on `/loop`, `ScheduleWakeup`, and `Monitor` — no plugin enablement needed. What it does: - Triggers on phrases like "drive the plan", "run the worklist", "ralph this", "autonomous loop", or any multi-phase brief expected to span hours. - Two paths: resume an existing plan at .cursor/plans/<topic>/ by reading RALPH-WORKLIST.md and picking the first todo, or bootstrap a new plan from a stated goal using the embedded structure. - Encodes the per-iteration contract proven on the deploy work: per-tick guard, plan ≤10 lines, execute (5-files cap), gates, /simplify, commit, update worklist, ScheduleWakeup, stop. - Hard rules: no skipped gates, no edits outside allowlist, no secrets in commits, no force-push / --no-verify, one commit per iteration max. - Escalation triggers (architecture choice, trunk-failing test, new dependency, security finding, plan contradiction, etc.) cause the loop to stop and write STATUS: BLOCKED. - Skill routing for the "superpowers": /codex consult before non-trivial tasks, /simplify pre-commit, /codex challenge for silent-fail surfaces (Dockerfile, workflow YAML), /investigate for gate failures, /review pre-PR, /ship at the end. - Cache-aware loop pacing table (60s for quick / 270s under cache window / 1500s with Monitor) — never 300–1199 (worst-of-both). - Per-project gate detection (Python uv, Node pnpm, Maven, Cargo, Go) so it adapts to whatever project it's invoked in. - Monitor pattern for event-driven wakes (CI watching, copy- pasteable shell template). Files: - .agents/skills/plan-loop/SKILL.md — frontmatter + body (349 lines). - .agents/skills/plan-loop/templates/RALPH-LOOP.md — the contract, hard rules, escalations, and per-project gate hooks. Drop into any new plan dir verbatim; only customize the project gates and edit allowlist sections. - .agents/skills/plan-loop/templates/RALPH-STATE.md — initial STATUS: NOT STARTED scaffold + pre-flight checklist. Overwritten by the loop each iteration. Reachable via the existing .claude/skills → ../.agents/skills symlink, so the skill is discoverable in any session under this repo without further setup. To run from another project, copy the plan-loop directory into that project's skills location. Out of scope (deliberate): - Templates for 00-overview.md and RALPH-WORKLIST.md — too project-specific to template; the skill instructs Claude to author them in-context with the structure described in SKILL.md. - Active project-detection automation — the gate-detection table is descriptive guidance, not a runner. Could tighten with a detection script later if it proves worth the cost. - Field-test on a real second plan. The pattern is verified end- to-end on 13-server-deployment (12 atomic commits, 14 iterations, 1 fix-up); next plan that uses the skill will surface any rough edges.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Bottles the Ralph-style autonomous-loop pattern proven on PR #447 (the
13-server-deployment work — 12 atomic commits, 14 iterations, 1 fix-up)
into a reusable skill. Replaces the `ralph-loop` plugin pattern with
one built entirely on `/loop`, `ScheduleWakeup`, and `Monitor` —
no plugin enablement needed.
Why this and not `ralph-loop`
The session that produced PR #447 started with the `ralph-loop`
plugin and switched to `/loop` mid-flight because:
fails — exactly what bit us early in that session).
(60s for quick tasks, 270s for builds, 1500s for CI waits) instead
of `ralph-loop`'s fire-immediately default.
wakes (CI completion, log lines, file changes). `ralph-loop` has
no equivalent.
`ralph-loop`'s `--completion-promise` flag.
For "drive a 14-task plan to completion across hours, with CI waits
and event-driven gating", `/loop + ScheduleWakeup + Monitor` is the
right primitive. `ralph-loop`'s "iterate the same prompt forever
with no delay" is a different pattern (self-referential refinement),
not what we needed.
What's in this PR
Reachable in this repo via the existing `.claude/skills → ../.agents/skills` symlink — no further setup.
What it encodes
per-tick guard → plan in `RALPH-STATE.md` ≤10 lines → execute
(5-files cap) → gates → `/simplify` → commit + push → update
worklist → `ScheduleWakeup` → stop.
secrets in commits, no force-push / `--no-verify`, one commit
per iteration max.
new dependency, security finding, plan contradiction, gate-command
drift, build/test >5 min. Each triggers `STATUS: BLOCKED` instead
of "decide and proceed."
`/simplify` pre-commit, `/codex challenge` for silent-fail
surfaces, `/investigate` for gate failures (never just "fix and
rerun"), `/review` pre-PR, `/ship` at the end. Skills the loop
must NOT call: `/land-and-deploy`, `/canary`, anything that
pushes to prod or merges.
1500s with `Monitor` for CI waits. Explicit warning: never use
300–1199 (worst-of-both for the 5-minute prompt cache).
Cargo, Go) so the skill adapts to whatever project invokes it.
shell that polls `gh pr checks` and exits on `ALL_CHECKS_DONE`.
What's deliberately out of scope
too project-specific to template; the skill instructs Claude to
author them in-context with the structure described in SKILL.md.
table is descriptive guidance, not a runner.
on `13-server-deployment` (PR harness: deploy stack — Dockerfile, CI workflow, deploy evals (T10b verify) #447). The next plan that uses this
skill will surface any rough edges; that's normal for a v1.
Test plan
This PR is documentation + skill metadata. There's nothing to run; CI
won't trigger any harness workflows (the path filter on
`harness.yaml` is `miot-harness/**` and we only touch
`.agents/skills/`).
To exercise the skill after merge:
the two templates and write `00-overview.md` + an initial
`RALPH-WORKLIST.md` with task IDs T00..TN.
— read RALPH-WORKLIST.md, pick the first todo, follow the
per-iteration contract, then ScheduleWakeup the next tick. Stop
the loop entirely (omit ScheduleWakeup) if any escalation trigger
fires or all tasks are done.`