agentleFS
darrenCWJdarrenCWJ/agent-skills-scaffold/.claude/skills/loops/SKILL.md

loops

Skill0 starsChanged 3 months agoMITView on GitHub

Run bounded improve-verify loops on any deliverable. Use after every critique that finds issues, whenever iterating toward a quality bar, when the user says iterate, improve, fix, try again, or not good enough — any time work cycles more than once. Set the budget BEFORE the first iteration.

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use code-review.

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.
  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 3

    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:

    Set the budget: Default: 3 iterations. Complex/high-stakes work: 5.

    line 13
  2. Distinctive:

    Check convergence: is the remaining-issues list strictly shrinking?

    line 21
  3. Distinctive:

    Budget spent, still failing: STOP. Report to the user: what was attempted each iteration, what still fails, your best hypothesis why, and …

    line 27

“Common” is measured: kept by at least 6 in 10 of the 10 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

Loops

A loop = execute → verify → critique → fix. Loops are how quality happens; unbounded loops are how sessions die. Every loop needs a budget and an exit condition BEFORE it starts.

Setup (before iterating)

  1. Define done. The exit condition must be objective: tests green, checklist satisfied, critic approves. "Feels good" is not an exit condition.
  2. Set the budget. Default: 3 iterations. Complex/high-stakes work: 5. Write the budget down.
  3. Pick the verifier. Automated check > fresh subagent critic > self-review, in that order of preference.

Each iteration

  1. Fix ONLY what the last critique/verification flagged. No opportunistic extras — those go to the task list as separate items.
  2. Re-run the SAME verification. Changing the test mid-loop invalidates the loop.
  3. Log one line per iteration: Loop N: fixed X, Y | remaining: Z. This log goes in the handover if the session ends mid-loop.
  4. Check convergence: is the remaining-issues list strictly shrinking?

Exit rules

  • Converged: exit condition met → proceed to ship phase.
  • Failing for non-obvious reasons: switch to the debugging skill — hypothesis-driven, not blind re-fixing.
  • Budget spent, still failing: STOP. Report to the user: what was attempted each iteration, what still fails, your best hypothesis why, and 2–3 options. Never silently accept failure; never loop past budget.
  • Diverging (new issues appearing faster than fixes, or the same issue reappearing): stop immediately even with budget left — the approach is wrong. Re-plan; record a design decision about the abandoned approach and why it failed.
  • Oscillating (fix A breaks B, fix B breaks A): stop, the two constraints conflict. Surface the conflict as a design decision for the user.

Anti-patterns

  • Polishing beyond the exit condition ("one more pass") — done is done.
  • Widening scope mid-loop.
  • Re-verifying with a weaker check than the one that failed.

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.