agentleFS
vatevstoilvatevstoil/claude-self-learning-os/skills/improve-loop/SKILL.md

improve-loop

Skill4 starsChanged 5 months agoMITView on GitHub

Autonomous self-improvement loop — adversarial audit → grouped fixes → fresh-eyes verify → repeat until dry, with PROOF of completion at every step. Use when the user says "improve the system", "self-improvement loop", "намери и поправи слабостите", "пусни loop на самоподобрения", "одит и оправи всичко", "направи го перфектно", or wants a full find→fix→verify cycle where "done" must be demonstrated, never claimed.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. benmarte/autoimprove★ 5same name
    2. Yco-0314/strata★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository8 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    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:

    Evidence before "done": Every claim of completion carries the command that proves it and its output.

    line 15
  2. Distinctive:

    Adversarial verify: Every audit finding gets an independent refuter prompted to DISPROVE it ("if not certain it's real → refuted").

    line 18
  3. Distinctive:

    Root cause, not symptom: Before fixing, grep every caller.

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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

Improve Loop — find → fix → prove, until dry

Codified from two full production runs (2026-07-02: 31 confirmed findings; 2026-07-03: 12 confirmed findings in same-day code). Both reached dry state with the full test suite green. The loop exists because the author of code is its worst reviewer — and because "probably works" is not a deliverable.

Invariants (non-negotiable — these are what make weaker models safe)

  1. Evidence before "done". Every claim of completion carries the command that proves it and its output. No runnable check → the work is not finished, it is a hypothesis. Pre-register the pass condition BEFORE running the check.
  2. Adversarial verify. Every audit finding gets an independent refuter prompted to DISPROVE it ("if not certain it's real → refuted"). Only confirmed findings get fixed. This kills plausible-but-wrong work.
  3. Fresh-eyes verifier between rounds. Per-group fixers are scoped to their own diff and CANNOT see cross-cutting regressions. One verifier reads the ENTIRE round diff before the next round starts. (This catch saved a precision-poisoning regression on 07-02.)
  4. Honest outcome vocabulary. insufficient_data is a valid, reportable verdict — never game a metric to look decided. If tests fail, the report says so with the output. A silenced signal is NOT a fixed problem.
  5. Root cause, not symptom. Before fixing, grep every caller; one guard in the shared function beats N guards at call sites. A signal that pattern-matches a known failure may have a different cause — verify the evidence supports THIS fix before changing state.
  6. WIRE > extend > add. In a mature system the upgrade is almost never a new generator — it is a new source in an existing queue, a consumer for a write-only ledger, or a retired dead limb. Check "who would TELL me if this dies?" — if the answer is "no one", wire that consumer first.
  7. Scale ceremony to stakes. A typo fix is one action + one check. A migration gets the full loop + independent verification.

The loop

0 GROUND   read the system map / graph / memory FIRST; real state (git, tests
           baseline count) before touching anything. Record the baseline.
1 AUDIT    fan out N read-only finders (one per dimension/stream/cluster) +
           an adversarial refuter per finding. Keep only CONFIRMED.
2 FIX      group confirmed findings by file-ownership (no two fixers share a
           file). Each fixer: surgical diff + test + real-producer run.
3 VERIFY   fresh-eyes agent reads the WHOLE round diff for cross-cutting
           regressions; full test suite; every touched producer actually run
           and its consumer rendered.
4 REPEAT   next round on what fresh-eyes + the suite found. DRY = 2
           consecutive rounds with zero new confirmed findings.
5 CLOSE    full suite green (report exact counts vs baseline) → update the
           knowledge graph + memory with the earned rules → honest final
           report: what was found, what was fixed, what remains OPEN (incl.
           user-action blockers), each with evidence.

Audit workflow template (Workflow tool)

Pipeline per stream — findings verify while other streams still audit:

const results = await pipeline(STREAMS,
  s => agent(`Read-only adversarial audit of ${s.files}. Focus: ${s.focus}.
    Read the real code — do not assume. Only defects with a concrete failure
    scenario (input/state → wrong output). Return findings (may be empty).`,
    { phase: 'Audit', schema: FINDINGS }),
  (rev, s) => parallel((rev?.findings || []).map(f => () =>
    agent(`Try to REFUTE by reading the real code + existing tests: ${f.summary}
      / ${f.failure_scenario}. Not CERTAIN it's real → refuted=true.`,
      { phase: 'Verify', schema: VERDICT, effort: 'high' })
      .then(v => ({ ...f, refuted: v?.refuted !== false })))))
const confirmed = results.filter(Boolean).flat().filter(Boolean)
                         .filter(f => !f.refuted)

Per-fix Definition of Done (the fixer's contract)

  • compile/lint clean on every touched file
  • the REAL producer ran and produced the expected output (state the pre-registered pass condition, show the actual output)
  • the consumer renders with the real data
  • the specific test file is green, then the FULL suite is green
  • deliberate shortcuts marked in-code (ponytail: ceiling + upgrade path)
  • report deviations from spec explicitly — never silently

Anti-deception rules (for every subagent this skill dispatches)

Include in every fixer/auditor prompt: "Your final message is a report to an orchestrator, not a human to impress. State exactly what you verified with which command and what you did NOT verify. An honest 'blocked/unverified' is worth more than a confident guess — false 'done' poisons the whole loop."

Cadence

On demand (after any substantial build), or monthly as system hygiene. Between runs, the standing gates (trust tiers, judge, integrity guard, health monitor) regulate the system; this loop is the deep pass that finds what they cannot.

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.