agentleFS
lordmaculordmacu/nexo-rs/skills/loop/SKILL.md

Loop

Skill8 starsChanged 7 months agoApache-2.0View on GitHub

Bounded auto-iteration for a prompt with explicit stop predicates.

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

12 rules. 0 are common, 7 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 50 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run a prompt repeatedly with hard bounds and explicit stop criteria.

    line 11
  2. Distinctive:

    Stop condition is ambiguous and cannot be expressed explicitly.

    line 25
  3. Very specific:

    default when omitted: judge:task completed

    line 36
  4. Distinctive:

    If user provides explicit structured args, use them directly.

    line 40
  5. Very specific:

    If prompt is empty after parsing, stop and ask for a concrete prompt.

    line 51
  6. Very specific:

    If predicate satisfied: stop with status=success.

    line 64
  7. Very specific:

    If max_iters reached without success:

    line 66
  8. Distinctive:

    Never run unbounded loops.

    line 72
  9. Very specific:

    Never recurse into loop from inside loop.

    line 73
  10. Distinctive:

    Keep per-iteration evidence concise to avoid context bloat.

    line 74
  11. Distinctive:

    Do not silently broaden scope between iterations.

    line 75
  12. Distinctive:

    If a step is destructive/high-risk, require explicit user confirmation before the next attempt.

    line 76

“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

Run a prompt repeatedly with hard bounds and explicit stop criteria. This is for finite "try-fix-verify" loops, not background scheduling.

Use when

  • User asks to "retry until it passes", "iterate N times", "keep refining until X".
  • Task has a measurable stopping condition (exit code, regex match, or clear quality criterion).
  • A bounded deterministic loop is safer than open-ended autonomous retries.

Do not use when

  • User wants periodic or cron-like recurring tasks.
  • Stop condition is ambiguous and cannot be expressed explicitly.
  • Task is one-shot and does not benefit from iterative refinement.

Input contract

  • prompt (required): instruction/command to run each attempt.
  • max_iters (optional): default 3, clamp to [1, 10].
  • until_predicate (optional): one of:
    • regex:<pattern>
    • exit:<code>
    • judge:<criterion>
    • default when omitted: judge:task completed

Parsing rules (priority order)

  1. If user provides explicit structured args, use them directly.
  2. Else infer from natural language:
    • max_iters: phrases like "3 attempts", "max 5", "try 4 times".
    • until_predicate:
      • contains "until exit 0" or "until tests pass" -> exit:0
      • contains "until matches ..." -> regex:<...>
      • otherwise -> judge:<user criterion>
  3. If still missing:
    • max_iters = 3
    • until_predicate = judge:task completed

If prompt is empty after parsing, stop and ask for a concrete prompt.

Canonical workflow

  1. Normalize and validate inputs.
  2. Initialize an iteration ledger.
  3. For i = 1..max_iters:
    • Execute prompt.
    • Capture evidence:
      • short result summary
      • key output snippet
      • exit code when available
    • Evaluate predicate against current evidence.
    • If predicate satisfied: stop with status=success.
    • Else derive a focused refinement for the next attempt.
  4. If max_iters reached without success:
    • stop with status=max_iters_reached
    • return best-attempt summary + concrete next action.

Guardrails

  • Never run unbounded loops.
  • Never recurse into loop from inside loop.
  • Keep per-iteration evidence concise to avoid context bloat.
  • Do not silently broaden scope between iterations; only refine.
  • If a step is destructive/high-risk, require explicit user confirmation before the next attempt.

Output format

Always return:

  • status: success or max_iters_reached
  • iterations_run: attempts executed
  • max_iters: normalized cap actually used
  • predicate: normalized predicate
  • final_result: concise outcome
  • evidence: per-iteration bullets (delta-focused)
  • next_action: required when status=max_iters_reached

Examples

  • prompt="cargo test -p core" max_iters=5 until_predicate="exit:0"
  • prompt="reduce p95 latency by tuning query" max_iters=4 until_predicate="regex:p95 < 200ms"
  • prompt="rewrite explanation for clarity" max_iters=3 until_predicate="judge:clear, concise, no ambiguity"

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.