agentleFS
relai-airelai-ai/agent-eval-loop/skills/loop/SKILL.md

loop

Skill34 starsChanged 3 days agoApache-2.0View on GitHub

Continuously improve an AI agent from traces, feedback and evaluations through repeated learning and experiments. Use improve for a single fix or improvement and eval for a one-off evaluation run. Excludes scheduled prompts and polling.

56 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

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

  • 0

    Common

    Most of the 51 edited versions we read keep these.

  • 4

    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:

    Every kept change has comparable evidence and regression checks.

    line 19
  2. Distinctive:

    Before claiming an improvement, a comparable baseline exists for the objective and guardrails, measured or reused with a rationale.

    line 43
  3. Distinctive:

    Use the shared reviewable handoff for decisions or annotations: show their consequences and a useful chat or app review path.

    line 138
  4. Distinctive:

    Stop when the agreed objective or limits are reached, the user asks, blocking judgment is needed, or no worthwhile authorized experiment …

    line 145

“Common” is measured: kept by at least 6 in 10 of the 51 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: learn from new traces, fix, repeat

Inspect existing evidence and runners. Read relai/README.md, or the bundled terms when absent; use the start skill for needed managed records without rebuilding working infrastructure. This skill coordinates learning and verified improvement across the discover, eval and improve skills under one contract.

The flow below is a starting point. Adapt, reorder, repeat or skip activities when that better serves the request and the evidence, and load stage guidance only when relevant. The agreed scope, budget, authorization, evidence requirements and stage rules still bind.

Goal: useful learning and evidence-backed improvement with human judgment used where needed. Every kept change has comparable evidence and regression checks; every candidate decision is recorded with its reason. An investigation can produce useful knowledge without a code change. Maintain that knowledge when it helps future work under the shared policy; do not fill an iteration with artifact updates that add no durable value.

Two levels: learning iterations and experiments

  • An iteration is a learning cycle started by a credible learning opportunity: new inputs, an unresolved question, or a useful experiment using existing evidence. It need not include trace intake, new tests or code changes.
  • An experiment round happens inside an iteration (improve: improve-loop). It can produce learning without a patch. Accepted candidates become the incumbent; other exploration remains isolated.

A round cap counts experiment rounds, including diagnosis; report candidate attempts separately.

Done when

The paths below describe RELAI-managed records. Existing project contracts, iteration history, candidate decisions and reporting may serve the same purpose when authorization and evidence remain inspectable and recoverable; do not create duplicate state merely to match these filenames.

  • The contract was approved (below) and saved in relai/records/loop/state.json (relai/docs/files.md), with a line in decisions.md.
  • Before claiming an improvement, a comparable baseline exists for the objective and guardrails, measured or reused with a rationale. Investigation without a candidate records its findings and limits without an improvement claim.
  • Each iteration is appended to state.json under iterations; each attempted candidate has a relai/changes.md entry.
  • The loop stopped on a stopping condition, and you reported: the iterations run and what started each, experiments run, candidates tried and kept, the applicable objective/guardrail evidence and its limits, resource measurements, the regressions caught and changes rejected (and why), the user's decisions, total spend, benchmark coverage, and where the improved agent lives; the final split of a benchmark only when authorized. Relevant managed state or equivalent project reporting is current.

Establish the loop agreement

Reuse an existing contract covering these choices. Ask only for missing consequential choices or changed boundaries; establish a new contract before starting when none exists. The contract is the improvement agreement (relai/README.md, Terms) and supplies the authorization for the stage decisions it covers. It is not approval to skip an uncovered consequential decision.

  • Objective and guardrails: what improves (test pass rate, or cost or latency with scores held), and the guardrails with their bounds and evidence requirements.
  • Scope: what may change (prompts, tool descriptions, skills, memory or context construction, retry logic, agent code, model settings) and what is off-limits.
  • Inputs: the trace folder or stream to learn from, if any, the test suites in play, and any benchmarks (with any agreed held-out sample and batch size per iteration). When traces will be triaged by a model, the provider and model, and the user's authorization to send trace text to it (discover: trace-triage); with that and the budget, the loop runs triage beyond the pilot size (--yes for the example script).
  • Length: the most iterations to run, or "until there is nothing new"; and any experiment limit per iteration.
  • Budget and evidence: a ceiling for the loop and any per-iteration limits, covering agent trials, judges and triage. Measurement effort is chosen per decision (eval: measure).
  • When to ask the user (recommend: only these): user intent is genuinely ambiguous; two requirements conflict; a behavior is irreversible or safety-sensitive; a judge and the user's past verdicts disagree; a product-policy decision is needed. They are asked as relai/README.md says ("When the user is asked"); everything else proceeds and appears in the digest.
  • Approvals: delegated (default): fresh independent reviews stand in for scenario approval, grader previews and task lists, as delegated approvals describe; or supervised: the user approves each scenario table, grader preview and kept change individually. Inside the loop this setting answers the build skills' "how involved" question.
  • Check-ins: a short digest after every iteration (default), or only at the end.
  • Watch mode (optional): instead of stopping when nothing is new, re-check the trace source on a schedule the user sets up and start an iteration only when new traces or answers have arrived. A check that finds nothing new exits quietly; report any host/model usage rather than promising that a scheduled check is free.
  • Delivery: kept changes accumulate on a branch for review (default), never in the user's working tree unless the contract says so.

The locked kernel

Hold measurement meaning and relevant comparison conditions stable within an iteration: frozen tests and their evaluators, the held-out set and acceptance rule. Budget and authorization also stay binding. Supporting implementation repairs or improvements may proceed within scope under the shared adaptation policy; changes to measurement meaning require controlled repair and comparable starting evidence. New tests join only at an iteration's start, after their fresh review and freeze, and get a baseline on the incumbent before any candidate is compared with them. The loop may propose a change to the kernel (a rubric repair, a retired test, a new budget); only authorization covering that change permits it.

Suggested learning flow

With adequate evaluations, begin at improvement; diagnosis may return to discovery when an ambiguity appears. Record adaptations that affect evidence, scope or delivery. Keep the real dependencies: comparable evidence precedes improvement claims, delivered revisions need verification, and measurement changes go through the locked kernel.

  1. What is worth learning next? New traces or answers, uncovered behavior, missing measurements, or a credible experiment on existing evidence. If none remains, stop or wait in watch mode rather than repeating activities for their own sake.
  2. Intake. Triage traces that arrived since the last iteration (discover: trace-triage; incremental by trace id) and read new feedback and answers.
  3. Filter by usefulness. Routine runs with no signal are archived. Durable knowledge goes to the wiki: requirements from settled answers, evidence on risks, near misses. Reproducible behavior becomes test proposals: runs the user's feedback judged wrong, uncovered situations, co-occurring weak signals, harder rungs of tests the agent now passes. Questions the contract says to ask go to open questions or feedback.md and are asked together; the loop does not wait on them, it works on everything else.
  4. Grow the tests. Build the strongest proposals (the eval skill): realistic, both directions, a fresh review standing in for scenario approval and grader preview when the contract's approvals are delegated, then freeze. Held-out tests are optional (the eval skill's Split rule).
  5. Establish starting evidence for the objective and guardrails: reuse comparable incumbent runs or measure what is missing (eval: measure). On benchmarks, use exact development selections (benchmark.py batch --case-ids ...) plus any agreed held-out sample; never the final split.
  6. Experiment as improve: improve-loop describes; alternatives follow its candidate-selection reference.
  7. Verify the delivered candidate with comparable before/after evidence and a fresh review of the actual delivered diff.
  8. Accept or roll back by the improve loop's acceptance rule, judged over the iteration's delivered changes. Preserve the last verified incumbent, record dropped candidates as rejected, and reverify and review the resulting diff. An accepted iteration is a new generation of the agent.
  9. Record and report. Append the iteration to state.json (relai/docs/files.md), update relai/STATUS.md, and send the digest: what started the iteration, what was learned, tests added, experiments and candidate outcomes, comparable measurements and their limits, spend so far; then ask the waiting questions. Use the shared reviewable handoff for decisions or annotations: show their consequences and a useful chat or app review path. Revisit relevant deferred questions when new evidence or the current work warrants it; do not repeat an unchanged backlog or silently treat a nonblocking question as deferred.

Stopping conditions and recovery

Stop when the agreed objective or limits are reached, the user asks, blocking judgment is needed, or no worthwhile authorized experiment remains. Outside watch mode, do not start a new iteration on unchanged inputs merely to evade a round cap. Stalls, extensions and recovery after interruption follow improve: improve-loop; state.json is an orchestration summary, never evidence that a candidate ran or was accepted.

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.