agentleFS
qyndexqyndex/claude-init/.claude/skills/loop/SKILL.md

loop

Skill2 starsChanged 5 months agoMITView on GitHub

Run a continuous Ralph-style autonomous loop until a budget or success condition is hit. Each iteration restarts with a fresh subagent that reads PLAN.md + progress.md from disk, picks the next unblocked task, executes, verifies, and writes back. Native to Claude Code via /loop, but this skill formalizes the discipline.

55 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use review-bugbot, origin and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • 0mlkrizzz655335vSkill

    review-bugbot

    缺陷导向代码审查。用 Bugbot 子代理找 bug。

    Also in 4 projects that use this

  • 0mlkrizzz655335vSkill

    origin

    origin CLI 管理。安装、登录、更新、修复 origin.cursor.com 的 CLI。"disabled-environments:

    Also in 3 projects that use this

  • PandelisZSkill

    update-cli-config

    View and modify Cursor CLI configuration settings in ~/.cursor/cli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.

    Also in 4 projects that use this

  • 32103210Skill

    migrate-to-skills

    Convert 'Applied intelligently' Cursor rules (.cursor/rules/*.mdc) and slash commands (.cursor/commands/*.md) to Agent Skills format (.cursor/skills/). Use when you want to migrate rules or commands to skills, convert .mdc rules to SKILL.md format, or consolidate commands into the skills directory.

    Also in 4 projects that use this

  • 32103210Skill

    update-cursor-settings

    Modify Cursor/VSCode user settings in settings.json. Use when you want to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.

    Also in 4 projects that use this

  • MicrosoftSkill

    automate

    Propose an automation from a completed task or a new idea, then create it after approval. Use when the user asks to create an automation or wants scheduled local or cloud agent work.

    Also in 4 projects that use this

  • +3 more from 0mlkrizzz655335v
  • +1 more from 32103210

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 50 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use a loop only when all of these are true:

    line 18
  2. Distinctive:

    Verify script returns non-zero for the second time in a row

    line 77
  3. Distinctive:

    Always in a worktree: Never run a loop on main.

    line 83
  4. Distinctive:

    Always verifiable: No verify command → no loop.

    line 84
  5. Distinctive:

    Always budgeted: No budget → no loop.

    line 85
  6. Distinctive:

    Resumable: Every iteration writes a progress.md so a fresh session can pick up.

    line 86
  7. Distinctive:

    Audited: Every iteration's tokens, time, and diff size are logged.

    line 87
  8. Distinctive:

    After stop: "Loop stopped after <N> iterations.

    line 96

“Common” is measured: kept by at least 6 in 10 of the 50 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Loop

A bounded, resumable, evidence-driven autonomous loop. Modeled on Geoffrey Huntley's Ralph + Anthropic's /loop command.

When to use

Use a loop only when all of these are true:

  • The goal is machine-verifiable (tests pass / lint clean / endpoint returns 200).
  • The work is decomposed into tasks in tasks/TASKS.md.
  • A wrong direction does not compound silently (e.g., wholesale design rewrite is NOT loop material).
  • You can budget tokens and time honestly.

When NOT to use

  • Ambiguous design work
  • New-area scaffolding without a spec
  • Anything that touches production data
  • Anything without a verifyCompletion() you can encode

Process

1. Confirm prerequisites:
   - tasks/TASKS.md exists and has pending unblocked tasks
   - .claude/scripts/verify.sh exists and exits 0 when project is healthy
   - Running inside a worktree (not main)

2. Declare the budget — MACHINE-ENFORCED, not prose:
   bash .claude/scripts/loop-iteration.sh start --until <ISO-timestamp> --max-iter <N>
   (writes {started_at, deadline, max_iter, iter_count} run metadata; every
   iteration increments the count and loop-iteration.sh exits 2 once a cap is
   crossed. --budget <tokens> remains LLM-tracked — stop yourself when crossed.)

3. Loop:
   while not stop_condition:
     a. Run `bash .claude/scripts/loop-iteration.sh` — the deterministic gate.
        exit 0 → it prints the nominated task (canonical next-task.sh picker);
        exit 2 → HALT NOW (abort cap, run budget, or external TASKS.md edit —
        the reason is printed); exit 1 → stop (empty/blocked backlog or verify
        pre-flight failure — ideation branch when IDEATE is printed).
     b. Delegate the nominated task to implementer subagent (fresh context).
     c. On subagent return:
        - if completed:
            stage commit, flip via `task-status.sh T-<id> done`, capture token usage
        - if failed:
            flip via `task-status.sh T-<id> failed --note "<reason>"`,
            log failure to progress.md, move on (don't retry the same one)
        (task-status.sh feeds the abort/progress recorder — never skip it)
     d. Run .claude/scripts/verify.sh
     e. Write summary line to plans/active/<id>-progress.md
     f. Evaluate stop conditions

4. On stop, report:
   - tasks completed
   - tasks failed
   - tokens spent
   - wall time
   - next manual step

Stop conditions (any one triggers stop)

  • Budget reached (--budget, --until, --max-iter)
  • Two consecutive iterations produced no committable diff
  • Verify script returns non-zero for the second time in a row
  • Any security check fails
  • User interrupts (^C or /stop)

Hard rules

  • Always in a worktree. Never run a loop on main.
  • Always verifiable. No verify command → no loop.
  • Always budgeted. No budget → no loop.
  • Resumable. Every iteration writes a progress.md so a fresh session can pick up.
  • Audited. Every iteration's tokens, time, and diff size are logged.

Output

plans/active/<id>-progress.md   (appended each iteration)
.claude/memory/playbooks/loop-<date>.md   (post-mortem)

After stop: "Loop stopped after <N> iterations. <M> tasks completed. <K> failed. Tokens: <T>. Time: <W>. Next: <manual step>."

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.