Skip to content

feat(skills): add plan-loop skill for /loop-based autonomous workflows#448

Merged
korutx merged 1 commit into
microboxlabs:trunkfrom
odtorres:add-plan-loop-skill
May 10, 2026
Merged

feat(skills): add plan-loop skill for /loop-based autonomous workflows#448
korutx merged 1 commit into
microboxlabs:trunkfrom
odtorres:add-plan-loop-skill

Conversation

@korutx

@korutx korutx commented May 10, 2026

Copy link
Copy Markdown
Contributor

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:

  • `/loop` is built-in (no `enabledPlugins` step that silently
    fails — exactly what bit us early in that session).
  • `ScheduleWakeup` lets the loop pick cache-aware delays per tick
    (60s for quick tasks, 270s for builds, 1500s for CI waits) instead
    of `ralph-loop`'s fire-immediately default.
  • `Monitor` integrates first-class with `/loop` for event-driven
    wakes (CI completion, log lines, file changes). `ralph-loop` has
    no equivalent.
  • Termination is "omit `ScheduleWakeup`" — simpler than
    `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

File Purpose
`.agents/skills/plan-loop/SKILL.md` The skill — frontmatter triggers + 349-line body covering when-to-use, two paths (resume / bootstrap), per-iteration contract, hard rules, escalation triggers, skill routing, loop pacing, Monitor pattern, per-project gate detection, termination
`.agents/skills/plan-loop/templates/RALPH-LOOP.md` Drop-in template with the contract verbatim. Only customize the project-gates and edit-allowlist sections per plan
`.agents/skills/plan-loop/templates/RALPH-STATE.md` Initial `STATUS: NOT STARTED` scaffold + pre-flight checklist

Reachable in this repo via the existing `.claude/skills → ../.agents/skills` symlink — no further setup.

What it encodes

  • Per-iteration contract (10 steps, verbatim from the deploy work):
    per-tick guard → plan in `RALPH-STATE.md` ≤10 lines → execute
    (5-files cap) → gates → `/simplify` → commit + push → 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, gate-command
    drift, build/test >5 min. Each triggers `STATUS: BLOCKED` instead
    of "decide and proceed."
  • Skill routing: `/codex consult` before non-trivial tasks,
    `/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.
  • Cache-aware pacing table: 60s for quick / 270s for builds /
    1500s with `Monitor` for CI waits. Explicit warning: never use
    300–1199 (worst-of-both for the 5-minute prompt cache).
  • Per-project gate detection table (Python uv, Node pnpm, Maven,
    Cargo, Go) so the skill adapts to whatever project invokes it.
  • `Monitor` template for event-driven wakes — copy-pasteable
    shell that polls `gh pr checks` and exits on `ALL_CHECKS_DONE`.

What's deliberately out of scope

  • 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.
  • Field-test on a second plan — the pattern is verified end-to-end
    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:

  1. Author a plan dir: `mkdir -p .cursor/plans//`, copy in
    the two templates and write `00-overview.md` + an initial
    `RALPH-WORKLIST.md` with task IDs T00..TN.
  2. `git switch -c -loop` and verify gates green.
  3. Run: `/loop drive the plan per .cursor/plans//RALPH-LOOP.md
    — 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.`
  4. Walk away. Come back to a PR or a `STATUS: BLOCKED` in state.

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.
@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@korutx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 16 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d008e754-fa29-4a85-b5eb-53833a13db3d

📥 Commits

Reviewing files that changed from the base of the PR and between 8ee7753 and 9a4fc54.

📒 Files selected for processing (3)
  • .agents/skills/plan-loop/SKILL.md
  • .agents/skills/plan-loop/templates/RALPH-LOOP.md
  • .agents/skills/plan-loop/templates/RALPH-STATE.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@korutx korutx merged commit ac62cf3 into microboxlabs:trunk May 10, 2026
1 check passed
@korutx korutx deleted the add-plan-loop-skill branch May 10, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant