agentleFS
unclejobs-aiunclejobs-ai/second-claude-code/skills/loop/SKILL.md

loop

Skill40 starsChanged 3 months agoMITView on GitHub

Use when benchmarking and evolving prompt assets through a fixed-suite optimization loop

34 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use fleet, map and 6 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.
  • oguzhnatlySkill

    fleet

    Multi-agent fleet management for OpenClaw, Claude Code, Codex, Cursor, Windsurf, Gemini CLI, and custom agent stacks. One CLI to monitor, manage, and orchestrate your entire AI agent fleet. Fleet judges reliability, routes intelligently, tracks deltas, and keeps gateways, HTTP workers, Docker workers, and local processes accountable. Network access stays limited to loopback and explicitly configured endpoints. Operator consent required before install.

    Also in 3 projects that use this

  • srpadronoSkill

    map

    Crawls a codebase to discover all user journeys and creates a journey map (journeys.json) with test coverage status. Use when starting UI test coverage work, auditing existing coverage, or exploring a new codebase's user flows.

    Also in 3 projects that use this

  • AnasX7Skill

    improve

    Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.

    Also in 3 projects that use this

  • dcs-soniSkill

    codebase-onboarding

    Help developers understand unfamiliar codebases quickly. Use when

    Also in 3 projects that use this

  • AnthropicSkill

    verify

    Drive the contracts engine's runtime surface (the stdio MCP server) to verify changes end-to-end. Scoped to public-plugins/plugins/healthcare/skills/contracts/ and ../../servers/documents/.

    Also in 6 projects that use this

  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run a Karpathy-style optimization loop over the plugin's own prompt assets.

    line 25
  2. Very specific:

    Use node scripts/loop-runner.mjs show-suite <name> to load the suite and verify the allowed targets.

    line 44
  3. Very specific:

    Use node scripts/loop-runner.mjs run <name> ...

    line 45
  4. Very specific:

    Keep the top 1-2 elite candidates per generation.

    line 48
  5. Very specific:

    Only promote a winner when all hard gates pass and the score beats baseline by at least min_delta.

    line 49
  6. Very specific:

    Do not add routing for this skill in prompt-detect.mjs for v1.

    line 66
  7. Very specific:

    Do not mutate .mjs, docs/, README*, or tests/ as loop targets.

    line 67
  8. Very specific:

    Do not declare a winner when baseline remains best or when min_delta is not met.

    line 68
  9. Distinctive:

    Do not write to the main worktree directly.

    line 69

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

Resolve runtime paths before file or script operations.

Iron Law

A loop without a benchmark is meaningless.

Red Flags

  • "Let's just run it and see what happens" → STOP, because the Iron Law says a loop without a benchmark is meaningless — a fixed suite with numeric scoring must exist before any run.
  • "The new variant feels better" → STOP, because evaluator output must expose a numeric score that can be parsed deterministically — subjective improvement is not a valid promotion signal.
  • "Baseline is close enough, let's promote the candidate" → STOP, because winners are promoted only when the score beats baseline by at least min_delta — close is not enough.
  • "I'll mutate the docs and test files too" → STOP, because .mjs, docs/, README*, and tests/ are excluded from mutation scope — only allowed targets in the suite allowlist may be changed.
  • "One more generation might improve it" → STOP, because the loop must stop when budget is exhausted, min_delta is not met, or scores plateau — open-ended iteration wastes tokens without measurable gain.

Loop

Run a Karpathy-style optimization loop over the plugin's own prompt assets.

When to Use

  • Maintainers want to improve skills/**/SKILL.md, agents/*.md, commands/*.md, or templates/*.md
  • A fixed benchmark suite with numeric scoring already exists
  • Candidate variants should compete under the same time budget and the best variant should be promoted to an isolated branch

Subcommands

CommandPurpose
list-suitesList bundled loop suites in benchmarks/loop/
show-suite <name>Inspect the validated suite manifest
run <name>Create an isolated run branch, score a baseline, generate candidates, and promote a winner if min_delta is met
resume <run_id>Reload the saved loop state from .data/state/loop-active.json

Workflow

  1. Use node scripts/loop-runner.mjs show-suite <name> to load the suite and verify the allowed targets.
  2. Use node scripts/loop-runner.mjs run <name> ... to create the isolated codex/loop-... branch and run worktree.
  3. Inside that run worktree, create 3-5 prompt variants only within the selected targets.
  4. Evaluate every candidate with the suite's fixed case commands. Parse scores from JSON or review-style output only.
  5. Keep the top 1-2 elite candidates per generation. Stop when budget is exhausted, min_delta is not met, or the loop plateaus.
  6. Only promote a winner when all hard gates pass and the score beats baseline by at least min_delta.

Hard Gates

  • Selected targets must stay within the suite allowlist and the global v1 mutation scope.
  • Contract/runtime smoke checks must still pass when those files exist in the repo.
  • Evaluator output must expose a numeric score that can be parsed deterministically.
  • Winners are promoted only into the run branch/worktree, never into the current workspace.

State

  • Active state: <plugin-data>/state/loop-active.json
  • Artifacts: .captures/loop-<run_id>/
  • Bundled suites: benchmarks/loop/*.json

Gotchas

  • Do not add routing for this skill in prompt-detect.mjs for v1. It is slash-command only.
  • Do not mutate .mjs, docs/, README*, or tests/ as loop targets.
  • Do not declare a winner when baseline remains best or when min_delta is not met.
  • Do not write to the main worktree directly. The isolated loop branch is the output surface.

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.