# Agent Self-Evolution

Diagnoses agent failures and evolves prompts and skills from error patterns.

- Repository: https://github.com/aiming-lab/AutoResearchClaw (14798 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-08-19
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add aiming-lab/AutoResearchClaw --skill a-evolve -g -a claude-code -y`
Codex: `npx skills add aiming-lab/AutoResearchClaw --skill a-evolve -g -a codex -y`
Cursor: `npx skills add aiming-lab/AutoResearchClaw --skill a-evolve -g -a cursor -y`
Gemini CLI: `npx skills add aiming-lab/AutoResearchClaw --skill a-evolve -g -a gemini-cli -y`

## Description

Apply A-Evolve's agentic evolution methodology to improve AI agent performance across runs. Use when the user wants to diagnose agent failures, generate targeted skills from error patterns, evolve system prompts, or accumulate episodic knowledge. Works standalone or inside AutoResearchClaw pipelines. Triggers on: "evolve", "self-improve", "diagnose failures", "generate skills from errors", "what went wrong and how to fix it", or any mention of A-Evolve.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# A-Evolve: Agentic Evolution Skill

Apply the **Solve → Observe → Evolve → Gate → Reload** methodology from
[A-Evolve](https://github.com/A-EVO-Lab/a-evolve) to iteratively improve
agent performance. This skill is prompt-based, no external dependencies,
no harness changes. You analyze failures, propose workspace mutations, and
generate durable artifacts (skills, prompt patches, knowledge entries) that
the agent can load in future runs.

## Core Loop

When asked to evolve or improve agent performance, follow this 5-step loop:

### 1. Solve (Collect Evidence)

Gather the agent's execution artifacts. Ask the user for or locate:
- Run logs, error traces, or experiment outputs
- Pass/fail results per task
- Metric values (accuracy, reward, success rate)
- Any existing session files from previous runs

If inside AutoResearchClaw, look at:
- `artifacts/rc-*/`, experiment outputs, charts, reviews
- `evolve.log` or stage-specific logs
- `reviews.md`, peer review feedback
- Sentinel watchdog reports

### 2. Observe (Diagnose)

Analyze the collected evidence to produce structured observations:

For each failed or underperforming task, identify:
- **Error category**: code bug, timeout, wrong approach, missing knowledge,
  API misuse, hallucinated reference, prompt ambiguity, etc.
- **Root cause**: What specifically went wrong and why
- **Frequency**: Is this a one-off or a recurring pattern across tasks?
- **Severity**: blocking (pipeline crash) / degrading (wrong result) /
  cosmetic (formatting issue)

Write observations as a structured list:

```
## Observations (Batch N)

### OBS-1: [Category] Short description
- Tasks affected: task_001, task_005, task_012
- Root cause: ...
- Frequency: 3/50 tasks (6%)
- Severity: degrading

### OBS-2: ...
```

### 3. Evolve (Propose Mutations)

Based on observations, propose one or more of these mutation types:

**A. Generate a Skill** (for recurring patterns, frequency ≥ 3)

The rest: https://github.com/aiming-lab/AutoResearchClaw/blob/HEAD/.claude/skills/a-evolve/SKILL.md
