agentleFS
juandelossantosjuandelossantos/another-agent-skills/skills/self-improvement/SKILL.md

self-improvement

Skill1 starsChanged 11 days agoMITView on GitHub

Audit and fix project issues via self-improvement loop: detect, diagnose, propose, execute with human approval. Max 3 iterations per session. Do NOT use for one-off edits or active development.

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 27 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run bash scripts/audit-project.sh --json.

    line 30
  2. Very specific:

    Run bash scripts/audit-project.sh to verify fix (exit 0 = clean)

    line 57
  3. Very specific:

    Run project's test command (from STACK_CONFIG.md test_cmd — e.g., npm test, pytest, cargo test).

    line 58
  4. Distinctive:

    Wait for "yes commit"

    line 60
  5. Distinctive:

    After 3 iterations: STOP. Present summary report

    line 65
  6. Distinctive:

    If same issue appears in 3 consecutive sessions: escalate (create case study)

    line 66
  7. Distinctive:

    After a session: when several commits have been made

    line 70
  8. Very specific:

    At session start: if audit-project.sh has not been run in 7+ days

    line 72

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

Self-Improvement Loop

Overview

Closed-loop quality pipeline. The agent audits itself, diagnoses issues, proposes fixes, generates ADRs, and executes — all with human approval at every mutation.

References

  • PATTERNS.md — Pattern selection guide (created by init-agents --with-self-improvement)
  • ANTI-PATTERNS.md — Anti-pattern classification (created by init-agents)
  • audit-project.sh — Issue detector (universal-audit.sh wrapper, created by init-agents)
  • generate-adr.sh — ADR generator (created by init-agents)

Loop Steps

Step 1: Detect

Run bash scripts/audit-project.sh --json. Collect FAIL results from .failures array (core files only — non-core issues are non-blocking warnings in .warnings).

Step 2: Diagnose

For each FAIL, classify by type (check types are defined in .audit-config.json checks.*):

  • table — Column mismatch in markdown table
  • link — Broken internal link
  • length — File exceeds configured max_file_length
  • placeholder — TODO:/FIXME:/lorem ipsum in content (outside code blocks)

Consult PATTERNS.md to determine which workflow pattern applies. Consult ANTI-PATTERNS.md to identify the anti-pattern being fixed.

Step 3: Propose

Present a DECISION POINT to the user:

Self-improvement loop — Iteration [N/3]:
  Issues found: [count]
  Proposed fix: [description]
  Pattern applied: [PATTERNS.md pattern]
  ADR generated: [title]

Step 4: Generate ADR (if fix creates a new rule or pattern)

Run bash scripts/generate-adr.sh "Title" "Context" "Decision" "Consequences" "Compliance".

Step 5: Execute

With user approval per mutation:

  1. Apply the fix
  2. Run bash scripts/audit-project.sh to verify fix (exit 0 = clean)
  3. Run project's test command (from STACK_CONFIG.md test_cmd — e.g., npm test, pytest, cargo test). If no STACK_CONFIG.md, ask user for test command.
  4. Present Commit Manifest
  5. Wait for "yes commit"
  6. Commit

Step 6: Loop Guard

  • Max 3 iterations per session
  • After 3 iterations: STOP. Present summary report
  • If same issue appears in 3 consecutive sessions: escalate (create case study)

When to Use

  • After a session when several commits have been made
  • When user says "run self-improvement loop" or "audit the project"
  • At session start if audit-project.sh has not been run in 7+ days

When NOT to Use

  • One-off edits or active development (use feature implementation skills)
  • First-time project setup

Output Contract

Self-improvement fixes + ADRs — automated fixes applied to source files, audit-project.sh exiting 0, project tests passing, ADR generated if new rule created, no new warnings introduced, max 3 iterations per session, all mutations human-approved.

Prerequisites: init-agents installs the self-improvement loop by default (use --skip-self-improvement to skip). Creates scripts/audit-project.sh, .audit-config.json, PATTERNS.md, ANTI-PATTERNS.md, and ADRs/ in your project.

Verification

  • audit-project.sh exits 0 before and after each fix
  • Project test command passes (from STACK_CONFIG.md test_cmd)
  • ADR generated if new rule was created
  • No new warnings introduced (warn count ≤ previous iteration)

Guides

  • → See guides/UNIVERSAL-USAGE.md — How to run the loop in any project
  • → See guides/CONFIG-REFERENCE.md — All .audit-config.json keys documented
  • → See guides/EXAMPLE-NODE.md — End-to-end walkthrough in a Node.js project
  • → See guides/EXAMPLE-PYTHON.md — End-to-end walkthrough in a Python project

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.