self-improvement-loops

Designs recursive self-improvement loops where agents mine failures and edit their own harnesses.

Updated Aug 7, 2026
One-click install
npx skills add https://github.com/Sambhav242005/Major-Project --skill self-improvement-loops-sambhav242005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: self-improvement-loops
Source: https://github.com/Sambhav242005/Major-Project/tree/main/.agents/skills/self-improvement-loops
Command: npx skills add https://github.com/Sambhav242005/Major-Project --skill self-improvement-loops-sambhav242005

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building agents that modify their own prompts, context, workflows, or harness code risks reward hacking, diversity collapse, and silent stagnation. This Skill provides the design patterns, acceptance gates, and safety invariants needed to let a loop rewrite parts of itself without corrupting the signal that steers it. ## Core Features & Use Cases - Optimization Ladder Guidance: Route recurring failures to the right fix level, from prompt edits and structured context playbooks up to workflow graphs, harness code, and optimizer code. - Acceptance Gate Design: Implement two-split (held-in/held-out) no-regression acceptance with repeated evaluation, so self-modifications are accepted only on measured evidence. - Failure-Driven Loop Anatomy: Apply the three-stage pattern of weakness mining, bounded proposal, and validated merge, backed by a filesystem experience archive with raw traces. - Use Case: You are building an evolutionary search over agent scaffolds and the population keeps collapsing toward variants of one candidate. Use this Skill to add offspring-count-discounted parent selection, embedding-based novelty rejection, and an archive of all viable candidates. ## Quick Start Ask the agent to design a self-improvement loop for your agent harness, including the acceptance gate, editable surfaces, and diversity preservation mechanisms.

Frequently Asked Questions about self-improvement-loops

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an agent that improves its own harness?

Use a three-stage loop: mine failed traces into clustered weakness signatures, generate bounded proposals touching one editable surface each, then validate with a two-split acceptance gate before merging. Keep the evaluator and permissions outside anything the loop can modify.

What acceptance criteria should a self-modifying agent use?

Accept a candidate only when it does not regress on either a held-in split or a held-out split the proposer never sees, and strictly improves on at least one, under repeated evaluation. Reject trade-offs between splits even when the net score is positive.

How do I prevent reward hacking in self-improvement loops?

Hide the scoring implementation from the proposer and expose only scores and traces, since visible evaluators get monkey-patched or overwritten. Enforce budgets and sandboxing in the runtime rather than in prompt text, and count detected exploits as failed candidates.

Why does my self-improvement loop stop improving over time?

Common causes are diversity collapse from hill-climbing only the latest candidate, and degenerate improvers that silently return their input unchanged. Keep an archive of all viable candidates, discount parent selection by offspring count, and alarm on empty diffs, not just score drops.

When should I not use a recursive self-improvement loop?

Avoid it when evaluation is slow, ambiguous, or judge-only, when no held-out split can be protected from the proposer, or when the base model fails a capability validation run. Weaker models can degrade mean performance across iterations instead of compounding gains.

What is context collapse in agentic context engineering?

Context collapse occurs when a model monolithically rewrites its accumulated playbook, shrinking it drastically and dropping quality below the no-adaptation baseline. The fix is itemized entries with stable identifiers, incremental deltas, and deterministic non-model merge logic.