[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QMSHYT8P7M89FFYRQPWC66":3,"skill-same:01M6QMSHYT8P7M89FFYRQPWC66":119},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":62,"commitSha":63,"skillDirectory":64,"forksCount":14,"repositoryHtmlUrl":65,"repositoryHomepageUrl":66,"ownerHtmlUrl":67,"ownerBlogUrl":68,"ownerDescription":69,"updatedAt":70,"install":71,"resources":84},"01M6QMSHYT8P7M89FFYRQPWC66","evolving-ai-agents",null,"Provides guidance for automatically evolving and optimizing AI agents across any domain using LLM-driven evolution algorithms. Use when building self-improving agents, optimizing agent prompts and skills against benchmarks, or implementing automated agent evaluation loops.","Tashima-Tarsh\u002FDisha6.6","Tashima-Tarsh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F269906498?v=4","01M6PBH98X03XERH0HFT4PFB1P","NITISH KUMAR","01M6PBH9DA0M6KM3Z12P848F0K",0,"MIT","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fqc-a-evolve\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"evolving ai agents","ai agents","guidance","for","implementing","self-improving","Prompt Optimization","driven","across","algorithms","domain","agentic","skill discovery","use","evolution","prompt","discovery","Evaluation","research","agentic ai","2026-11-10 10:12:30",false,"---\nname: evolving-ai-agents\ndescription: Provides guidance for automatically evolving and optimizing AI agents across any domain using LLM-driven evolution algorithms. Use when building self-improving agents, optimizing agent prompts and skills against benchmarks, or implementing automated agent evaluation loops.\nversion: 1.0.0\nauthor: A-EVO Lab\nlicense: MIT\ntags: [Agent Evolution, Self-Improving Agents, Prompt Optimization, LLM, Benchmark Evaluation, Skill Discovery, Agentic AI]\ndependencies: [a-evolve>=0.1.0, pyyaml>=6.0]\ncategory: \"ai-research\"\n---\n\n# Evolving AI Agents with A-Evolve\n\n## Overview\n\nA-Evolve is universal infrastructure for evolving any AI agent across any domain using any evolution algorithm with zero manual engineering. It represents all evolvable agent state as files (prompts, skills, memory, tools), runs iterative solve-observe-evolve cycles against benchmarks, and uses LLM-driven mutation to improve agent performance automatically.\n\n**Benchmark results** (Claude Opus 4.6):\n- MCP-Atlas: 79.4% (#1)\n- SWE-bench Verified: 76.8% (~#5)\n- Terminal-Bench 2.0: 76.5% (~#7)\n- SkillsBench: 34.9% (#2)\n\n## When to Use A-Evolve\n\n**Use A-Evolve when:**\n- Optimizing agent prompts, skills, or memory against a measurable benchmark\n- Building self-improving agents with automated gating and rollback\n- Evolving domain-specific tool usage and procedures through LLM-driven mutation\n- Running iterative solve-observe-evolve loops to maximize agent performance\n- Needing reproducible, git-versioned evolution history for every change\n\n**Key differentiator**: Other frameworks _build_ agents; A-Evolve _optimizes_ them. It sits on top of any agent framework and makes it better through automated evolution.\n\n**Do NOT use A-Evolve for:**\n- Building multi-agent orchestration from scratch (use CrewAI, LangGraph)\n- One-shot agent tasks with no iteration needed (use LangChain, LlamaIndex)\n- RAG pipeline optimization (use LlamaIndex, Chroma)\n- Prompt-only optimization without skill\u002Fmemory evolution (use DSPy)\n\n## Quick Start\n\n### Installation\n\n```bash\npip install a-evolve                    # Core\npip install a-evolve[anthropic]         # With Claude support\npip install a-evolve[all]               # All providers\n```\n\n### Three-Line Evolution\n\n```python\nimport agent_evolve as ae\n\nevolver = ae.Evolver(agent=\"swe\", benchmark=\"swe-verified\")\nresults = evolver.run(cycles=10)\nprint(f\"Final score: {results.final_score}\")\n```\n\nThis copies the built-in SWE seed workspace, runs 10 evolution cycles against SWE-bench Verified, and returns the optimized agent.\n\n## Core Concepts\n\n### The Agent Workspace\n\nAll evolvable state lives as files in a workspace directory:\n\n```\nmy-agent\u002F\n├── manifest.yaml          # Metadata + entrypoint\n├── prompts\u002F\n│   ├── system.md          # Main system prompt (evolved)\n│   └── fragments\u002F         # Modular prompt pieces\n├── skills\u002F\n│   └── skill-name\u002F\n│       └── SKILL.md       # Reusable procedure with frontmatter\n├── memory\u002F\n│   ├── episodic.jsonl     # Lessons from failures\n│   └── semantic.jsonl     # General knowledge\n├── tools\u002F\n│   ├── registry.yaml      # Tool manifest\n│   └── tool_name.py       # Tool implementations\n└── evolution\u002F             # Managed by engine (metrics, history)\n```\n\n### The Evolution Loop\n\nEach cycle follows five phases:\n\n1. **Solve** — Agent processes a batch of tasks from the benchmark\n2. **Observe** — Benchmark evaluates trajectories, producing (task, trajectory, feedback) triples\n3. **Evolve** — Evolution engine mutates workspace files based on observations\n4. **Gate** — Validate mutations (git snapshot before\u002Fafter for rollback)\n5. **Reload** — Agent reinitializes from evolved filesystem state\n\n### Three Pluggable Interfaces\n\n```python\n# 1. Agent — implements solve()\nclass MyAgent(ae.BaseAgent):\n    def solve(self, task: ae.Task) -> ae.Trajectory:\n        # Domain-specific solving logic\n        return ae.Trajectory(task_id=task.id, output=result, steps=steps)\n\n# 2. Benchmark — implements get_tasks() and evaluate()\nclass MyBenchmark(ae.BenchmarkAdapter):\n    def get_tasks(self, split=\"train\", limit=None) -> list[ae.Task]:\n        return [ae.Task(id=\"1\", input=\"...\")]\n\n    def evaluate(self, task: ae.Task, trajectory: ae.Trajectory) -> ae.Feedback:\n        return ae.Feedback(success=True, score=0.95, detail=\"Passed\")\n\n# 3. Engine — implements step()\nclass MyEngine(ae.EvolutionEngine):\n    def step(self, workspace, observations, history, trial):\n        # Mutate workspace based on observations\n        return ae.StepResult(mutated=True, summary=\"Updated prompts\")\n```\n\n## Workflow 1: Evolve an Existing Agent\n\n**Use when**: You have a working agent and want to optimize it against a benchmark.\n\n**Critical Requirements:**\n- [ ] Agent implements `BaseAgent.solve()` returning `Trajectory`\n- [ ] Benchmark implements `BenchmarkAdapter` with `get_tasks()` and `evaluate()`\n- [ ] Seed workspace has `manifest.yaml` with entrypoint and evolvable layers\n- [ ] System prompt exists at `prompts\u002Fsystem.md`\n- [ ] Workspace is a git repo (run `git init && git add -A && git commit -m \"init\"`)\n\n### Steps\n\n```python\nimport agent_evolve as ae\n\n# Configure evolution parameters\nconfig = ae.EvolveConfig(\n    batch_size=10,           # Tasks per solve round\n    max_cycles=20,           # Maximum evolution iterations\n    evolve_prompts=True,     # Mutate system prompt\n    evolve_skills=True,      # Discover and refine skills\n    evolve_memory=True,      # Build episodic memory\n    evolver_model=\"us.anthropic.claude-opus-4-6-v1\",\n)\n\n# Point to your agent workspace and benchmark\nevolver = ae.Evolver(\n    agent=\".\u002Fmy-agent-workspace\",\n    benchmark=\"swe-verified\",     # Or custom BenchmarkAdapter instance\n    config=config,\n)\n\n# Run evolution\nresults = evolver.run(cycles=10)\n\n# Inspect results\nprint(f\"Cycles completed: {results.cycles_completed}\")\nprint(f\"Final score: {results.final_score}\")\nprint(f\"Converged: {results.converged}\")\nfor cycle_num, score in enumerate(results.score_history):\n    print(f\"  Cycle {cycle_num + 1}: {score:.3f}\")\n```\n\n### Post-Evolution\n\nThe workspace is now optimized. Inspect what changed:\n\n```bash\ncd my-agent-workspace\ngit log --oneline              # See evo-1, evo-2, ... tags\ngit diff evo-1 evo-10          # Compare first and last evolution\ncat prompts\u002Fsystem.md          # Read evolved prompt\nls skills\u002F                     # See discovered skills\n```\n\n## Workflow 2: Add a Custom Benchmark\n\n**Use when**: You want to evolve agents on your own domain-specific tasks.\n\n**Critical Requirements:**\n- [ ] Define task format (inputs, expected outputs)\n- [ ] Implement scoring logic (0.0–1.0 scale)\n- [ ] Prepare task dataset (train + holdout split)\n\n### Steps\n\n```python\nimport agent_evolve as ae\n\nclass CodeReviewBenchmark(ae.BenchmarkAdapter):\n    \"\"\"Evaluate agents on code review quality.\"\"\"\n\n    def get_tasks(self, split=\"train\", limit=None):\n        tasks = load_review_dataset(split)\n        if limit:\n            tasks = tasks[:limit]\n        return [\n            ae.Task(id=t[\"id\"], input=t[\"diff\"], metadata={\"expected\": t[\"comments\"]})\n            for t in tasks\n        ]\n\n    def evaluate(self, task, trajectory):\n        expected = task.metadata[\"expected\"]\n        actual = trajectory.output\n        precision, recall = compute_review_metrics(expected, actual)\n        f1 = 2 * precision * recall \u002F (precision + recall + 1e-9)\n        return ae.Feedback(\n            success=f1 > 0.7,\n            score=f1,\n            detail=f\"P={precision:.2f} R={recall:.2f} F1={f1:.2f}\",\n        )\n\n# Use with any agent\nevolver = ae.Evolver(agent=\".\u002Fmy-agent\", benchmark=CodeReviewBenchmark())\nresults = evolver.run(cycles=5)\n```\n\n## Workflow 3: Create a Custom Evolution Engine\n\n**Use when**: The default LLM-driven mutation doesn't suit your domain.\n\n### Steps\n\n```python\nimport agent_evolve as ae\n\nclass RuleBasedEngine(ae.EvolutionEngine):\n    def step(self, workspace, observations, history, trial):\n        failures = [o for o in observations if not o.feedback.success]\n        if not failures:\n            return ae.StepResult(mutated=False, summary=\"No failures to address\")\n\n        # Analyze failure patterns\n        error_types = categorize_errors(failures)\n        prompt = workspace.read_prompt()\n\n        # Append learned rules to prompt\n        new_rules = generate_rules(error_types)\n        workspace.write_prompt(prompt + \"\\n\" + new_rules)\n\n        return ae.StepResult(\n            mutated=True,\n            summary=f\"Added {len(new_rules)} rules from {len(failures)} failures\",\n        )\n\nevolver = ae.Evolver(\n    agent=\".\u002Fmy-agent\",\n    benchmark=\"my-benchmark\",\n    engine=RuleBasedEngine(),\n)\n```\n\n## Built-in Components\n\n### Seed Agents\n\n| Agent | Domain | Model | Key Feature |\n|-------|--------|-------|-------------|\n| `swe` | SWE-bench | Claude Opus 4.6 | Verify-fix loop, skill proposals |\n| `terminal` | Terminal-Bench | Claude Sonnet 4 | Concurrent timeout, env discovery |\n| `mcp` | MCP-Atlas | Claude Opus 4.6 | MCP server integration |\n\n### Benchmarks\n\n| Name | Domain | Metric |\n|------|--------|--------|\n| `swe-verified` | Code patching | Pass rate |\n| `mcp-atlas` | Tool calling | Accuracy |\n| `terminal2` | Shell tasks | Pass rate |\n| `skill-bench` | Multi-step procedures | Accuracy |\n| `arc-agi-3` | Interactive games | RHAE score |\n\n### Evolution Algorithms\n\n| Algorithm | Strategy | Best For |\n|-----------|----------|----------|\n| A-Evolve\u002FSkillForge | LLM-driven workspace mutation | General-purpose |\n| Guided Synthesis | Memory-first, curated skills | Skill discovery |\n| Adaptive Evolution | Reward tracking, filtered observations | Fine-grained control |\n| Adaptive Skill | Skill-centric refinement | Skill-heavy domains |\n\n## Configuration Reference\n\n```python\nae.EvolveConfig(\n    batch_size=10,              # Tasks per solve round\n    max_cycles=20,              # Max evolution iterations\n    holdout_ratio=0.2,          # Test set split for gating\n    evolve_prompts=True,        # Mutate system prompts\n    evolve_skills=True,         # Discover\u002Frefine skills\n    evolve_memory=True,         # Build episodic memory\n    evolve_tools=False,         # Mutate tool implementations\n    trajectory_only=False,      # Hide scores from evolver\n    evolver_model=\"us.anthropic.claude-opus-4-6-v1\",\n    evolver_max_tokens=16384,\n    egl_threshold=0.05,         # Convergence epsilon\n    egl_window=3,               # Cycles for plateau detection\n)\n```\n\n**Convergence**: Evolution stops early when score improvement is less than `egl_threshold` over the last `egl_window` cycles.\n\n## Skill Format\n\nSkills are reusable procedures discovered and refined during evolution:\n\n```markdown\n---\nname: verify-edge-cases\ndescription: \"TRIGGER when: checking boundary conditions. DO NOT TRIGGER: for happy-path tests.\"\n---\n\n## Pattern\nTest all falsy-but-valid values: 0, False, \"\", [], {}\n\n## Process\n1. List all input boundaries\n2. Run each against the implementation\n3. Check both output AND side effects\n```\n\nSkills accumulate in the workspace `skills\u002F` directory. The evolver curates them: ACCEPT new skills, MERGE overlapping ones, SKIP redundant proposals. Target: 5–10 broad skills, not 30 narrow ones.\n\n## Common Issues\n\n### Evolution score plateaus early\n\n**Cause**: Batch size too small or evolver doesn't see enough failure diversity.\n**Fix**: Increase `batch_size` (try 15–20) and ensure benchmark tasks cover diverse failure modes. Set `trajectory_only=False` so the evolver sees scores.\n\n### Agent workspace grows too large\n\n**Cause**: Skill library bloat from accepting every proposal.\n**Fix**: The default SkillForge engine curates skills automatically. If using a custom engine, implement merging logic to consolidate overlapping skills.\n\n### Git conflicts during evolution\n\n**Cause**: Multiple evolution runs on the same workspace.\n**Fix**: Each `evolver.run()` should operate on its own workspace copy. Use `Evolver(agent=\"seed-name\")` to auto-copy the seed each time.\n\n### LLM provider errors during evolution\n\n**Cause**: Rate limits or authentication issues with the evolver model.\n**Fix**: Check `evolver_model` config. For Bedrock, ensure AWS credentials are configured. For Anthropic, set `ANTHROPIC_API_KEY`.\n\n### Custom agent not picking up evolved state\n\n**Cause**: Agent doesn't implement `reload_from_fs()`.\n**Fix**: Override `reload_from_fs()` in your `BaseAgent` subclass to re-read prompts, skills, and memory from the workspace after each evolution cycle.\n\n## Usage Instructions for Agents\n\nWhen this skill is loaded:\n\n1. **Read this entire file** before implementing any evolution workflow\n2. **Start with the Quick Start** — get a minimal evolution running before customizing\n3. **Use built-in seeds when possible** — `\"swe\"`, `\"terminal\"`, `\"mcp\"` have battle-tested configurations\n4. **Always initialize git** in custom workspaces before running evolution\n5. **Check convergence settings** — default `egl_threshold=0.05` with `egl_window=3` may be too aggressive for your domain\n6. **Inspect evolved state** after each run — read `prompts\u002Fsystem.md` and `skills\u002F` to understand what the evolver learned\n\n**Pro Tips:**\n- Set `trajectory_only=False` (default) so the evolver sees scores — this accelerates learning\n- Start with `batch_size=10` and adjust based on task diversity\n- Use `holdout_ratio=0.2` to prevent overfitting to training tasks\n- After evolution, `git diff evo-1 evo-N` shows the cumulative effect of all mutations\n- If the evolver isn't finding skills, enrich `feedback.detail` strings with specific failure reasons\n\n**Warning Signs:**\n- Score oscillating between cycles → benchmark evaluation may be non-deterministic\n- Skills directory growing past 15+ skills → engine isn't merging\u002Fcurating properly\n- Prompt growing past 10K chars → evolution is appending without refactoring\n- `converged=True` after 2-3 cycles → increase `egl_window` and decrease `egl_threshold`\n\n## References\n\n- **Architecture deep dive**: See [references\u002Farchitecture.md](references\u002Farchitecture.md)\n- **API reference**: See [references\u002Fapi.md](references\u002Fapi.md)\n- **Step-by-step tutorials**: See [references\u002Ftutorials.md](references\u002Ftutorials.md)\n- **Real-world examples**: See [references\u002Fexamples.md](references\u002Fexamples.md)\n- **GitHub issues & solutions**: See [references\u002Fissues.md](references\u002Fissues.md)\n- **Design patterns**: See [references\u002Fdesign-patterns.md](references\u002Fdesign-patterns.md)\n- **Release history**: See [references\u002Freleases.md](references\u002Freleases.md)\n","# Evolving AI Agents with A-Evolve\n\n## Overview\n\nA-Evolve is universal infrastructure for evolving any AI agent across any domain using any evolution algorithm with zero manual engineering. It represents all evolvable agent state as files (prompts, skills, memory, tools), runs iterative solve-observe-evolve cycles against benchmarks, and uses LLM-driven mutation to improve agent performance automatically.\n\n**Benchmark results** (Claude Opus 4.6):\n- MCP-Atlas: 79.4% (#1)\n- SWE-bench Verified: 76.8% (~#5)\n- Terminal-Bench 2.0: 76.5% (~#7)\n- SkillsBench: 34.9% (#2)\n\n## When to Use A-Evolve\n\n**Use A-Evolve when:**\n- Optimizing agent prompts, skills, or memory against a measurable benchmark\n- Building self-improving agents with automated gating and rollback\n- Evolving domain-specific tool usage and procedures through LLM-driven mutation\n- Running iterative solve-observe-evolve loops to maximize agent performance\n- Needing reproducible, git-versioned evolution history for every change\n\n**Key differentiator**: Other frameworks _build_ agents; A-Evolve _optimizes_ them. It sits on top of any agent framework and makes it better through automated evolution.\n\n**Do NOT use A-Evolve for:**\n- Building multi-agent orchestration from scratch (use CrewAI, LangGraph)\n- One-shot agent tasks with no iteration needed (use LangChain, LlamaIndex)\n- RAG pipeline optimization (use LlamaIndex, Chroma)\n- Prompt-only optimization without skill\u002Fmemory evolution (use DSPy)\n\n## Quick Start\n\n### Installation\n\n```bash\npip install a-evolve                    # Core\npip install a-evolve[anthropic]         # With Claude support\npip install a-evolve[all]               # All providers\n```\n\n### Three-Line Evolution\n\n```python\nimport agent_evolve as ae\n\nevolver = ae.Evolver(agent=\"swe\", benchmark=\"swe-verified\")\nresults = evolver.run(cycles=10)\nprint(f\"Final score: {results.final_score}\")\n```\n\nThis copies the built-in SWE seed workspace, runs 10 evolution cycles against SWE-bench Verified, and returns the optimized agent.\n\n## Core Concepts\n\n### The Agent Workspace\n\nAll evolvable state lives as files in a workspace directory:\n\n```\nmy-agent\u002F\n├── manifest.yaml          # Metadata + entrypoint\n├── prompts\u002F\n│   ├── system.md          # Main system prompt (evolved)\n│   └── fragments\u002F         # Modular prompt pieces\n├── skills\u002F\n│   └── skill-name\u002F\n│       └── SKILL.md       # Reusable procedure with frontmatter\n├── memory\u002F\n│   ├── episodic.jsonl     # Lessons from failures\n│   └── semantic.jsonl     # General knowledge\n├── tools\u002F\n│   ├── registry.yaml      # Tool manifest\n│   └── tool_name.py       # Tool implementations\n└── evolution\u002F             # Managed by engine (metrics, history)\n```\n\n### The Evolution Loop\n\nEach cycle follows five phases:\n\n1. **Solve** — Agent processes a batch of tasks from the benchmark\n2. **Observe** — Benchmark evaluates trajectories, producing (task, trajectory, feedback) triples\n3. **Evolve** — Evolution engine mutates workspace files based on observations\n4. **Gate** — Validate mutations (git snapshot before\u002Fafter for rollback)\n5. **Reload** — Agent reinitializes from evolved filesystem state\n\n### Three Pluggable Interfaces\n\n```python\n# 1. Agent — implements solve()\nclass MyAgent(ae.BaseAgent):\n    def solve(self, task: ae.Task) -> ae.Trajectory:\n        # Domain-specific solving logic\n        return ae.Trajectory(task_id=task.id, output=result, steps=steps)\n\n# 2. Benchmark — implements get_tasks() and evaluate()\nclass MyBenchmark(ae.BenchmarkAdapter):\n    def get_tasks(self, split=\"train\", limit=None) -> list[ae.Task]:\n        return [ae.Task(id=\"1\", input=\"...\")]\n\n    def evaluate(self, task: ae.Task, trajectory: ae.Trajectory) -> ae.Feedback:\n        return ae.Feedback(success=True, score=0.95, detail=\"Passed\")\n\n# 3. Engine — implements step()\nclass MyEngine(ae.EvolutionEngine):\n    def step(self, workspace, observations, history, trial):\n        # Mutate workspace based on observations\n        return ae.StepResult(mutated=True, summary=\"Updated prompts\")\n```\n\n## Workflow 1: Evolve an Existing Agent\n\n**Use when**: You have a working agent and want to optimize it against a benchmark.\n\n**Critical Requirements:**\n- [ ] Agent implements `BaseAgent.solve()` returning `Trajectory`\n- [ ] Benchmark implements `BenchmarkAdapter` with `get_tasks()` and `evaluate()`\n- [ ] Seed workspace has `manifest.yaml` with entrypoint and evolvable layers\n- [ ] System prompt exists at `prompts\u002Fsystem.md`\n- [ ] Workspace is a git repo (run `git init && git add -A && git commit -m \"init\"`)\n\n### Steps\n\n```python\nimport agent_evolve as ae\n\n# Configure evolution parameters\nconfig = ae.EvolveConfig(\n    batch_size=10,           # Tasks per solve round\n    max_cycles=20,           # Maximum evolution iterations\n    evolve_prompts=True,     # Mutate system prompt\n    evolve_skills=True,      # Discover and refine skills\n    evolve_memory=True,      # Build episodic memory\n    evolver_model=\"us.anthropic.claude-opus-4-6-v1\",\n)\n\n# Point to your agent workspace and benchmark\nevolver = ae.Evolver(\n    agent=\".\u002Fmy-agent-workspace\",\n    benchmark=\"swe-verified\",     # Or custom BenchmarkAdapter instance\n    config=config,\n)\n\n# Run evolution\nresults = evolver.run(cycles=10)\n\n# Inspect results\nprint(f\"Cycles completed: {results.cycles_completed}\")\nprint(f\"Final score: {results.final_score}\")\nprint(f\"Converged: {results.converged}\")\nfor cycle_num, score in enumerate(results.score_history):\n    print(f\"  Cycle {cycle_num + 1}: {score:.3f}\")\n```\n\n### Post-Evolution\n\nThe workspace is now optimized. Inspect what changed:\n\n```bash\ncd my-agent-workspace\ngit log --oneline              # See evo-1, evo-2, ... tags\ngit diff evo-1 evo-10          # Compare first and last evolution\ncat prompts\u002Fsystem.md          # Read evolved prompt\nls skills\u002F                     # See discovered skills\n```\n\n## Workflow 2: Add a Custom Benchmark\n\n**Use when**: You want to evolve agents on your own domain-specific tasks.\n\n**Critical Requirements:**\n- [ ] Define task format (inputs, expected outputs)\n- [ ] Implement scoring logic (0.0–1.0 scale)\n- [ ] Prepare task dataset (train + holdout split)\n\n### Steps\n\n```python\nimport agent_evolve as ae\n\nclass CodeReviewBenchmark(ae.BenchmarkAdapter):\n    \"\"\"Evaluate agents on code review quality.\"\"\"\n\n    def get_tasks(self, split=\"train\", limit=None):\n        tasks = load_review_dataset(split)\n        if limit:\n            tasks = tasks[:limit]\n        return [\n            ae.Task(id=t[\"id\"], input=t[\"diff\"], metadata={\"expected\": t[\"comments\"]})\n            for t in tasks\n        ]\n\n    def evaluate(self, task, trajectory):\n        expected = task.metadata[\"expected\"]\n        actual = trajectory.output\n        precision, recall = compute_review_metrics(expected, actual)\n        f1 = 2 * precision * recall \u002F (precision + recall + 1e-9)\n        return ae.Feedback(\n            success=f1 > 0.7,\n            score=f1,\n            detail=f\"P={precision:.2f} R={recall:.2f} F1={f1:.2f}\",\n        )\n\n# Use with any agent\nevolver = ae.Evolver(agent=\".\u002Fmy-agent\", benchmark=CodeReviewBenchmark())\nresults = evolver.run(cycles=5)\n```\n\n## Workflow 3: Create a Custom Evolution Engine\n\n**Use when**: The default LLM-driven mutation doesn't suit your domain.\n\n### Steps\n\n```python\nimport agent_evolve as ae\n\nclass RuleBasedEngine(ae.EvolutionEngine):\n    def step(self, workspace, observations, history, trial):\n        failures = [o for o in observations if not o.feedback.success]\n        if not failures:\n            return ae.StepResult(mutated=False, summary=\"No failures to address\")\n\n        # Analyze failure patterns\n        error_types = categorize_errors(failures)\n        prompt = workspace.read_prompt()\n\n        # Append learned rules to prompt\n        new_rules = generate_rules(error_types)\n        workspace.write_prompt(prompt + \"\\n\" + new_rules)\n\n        return ae.StepResult(\n            mutated=True,\n            summary=f\"Added {len(new_rules)} rules from {len(failures)} failures\",\n        )\n\nevolver = ae.Evolver(\n    agent=\".\u002Fmy-agent\",\n    benchmark=\"my-benchmark\",\n    engine=RuleBasedEngine(),\n)\n```\n\n## Built-in Components\n\n### Seed Agents\n\n| Agent | Domain | Model | Key Feature |\n|-------|--------|-------|-------------|\n| `swe` | SWE-bench | Claude Opus 4.6 | Verify-fix loop, skill proposals |\n| `terminal` | Terminal-Bench | Claude Sonnet 4 | Concurrent timeout, env discovery |\n| `mcp` | MCP-Atlas | Claude Opus 4.6 | MCP server integration |\n\n### Benchmarks\n\n| Name | Domain | Metric |\n|------|--------|--------|\n| `swe-verified` | Code patching | Pass rate |\n| `mcp-atlas` | Tool calling | Accuracy |\n| `terminal2` | Shell tasks | Pass rate |\n| `skill-bench` | Multi-step procedures | Accuracy |\n| `arc-agi-3` | Interactive games | RHAE score |\n\n### Evolution Algorithms\n\n| Algorithm | Strategy | Best For |\n|-----------|----------|----------|\n| A-Evolve\u002FSkillForge | LLM-driven workspace mutation | General-purpose |\n| Guided Synthesis | Memory-first, curated skills | Skill discovery |\n| Adaptive Evolution | Reward tracking, filtered observations | Fine-grained control |\n| Adaptive Skill | Skill-centric refinement | Skill-heavy domains |\n\n## Configuration Reference\n\n```python\nae.EvolveConfig(\n    batch_size=10,              # Tasks per solve round\n    max_cycles=20,              # Max evolution iterations\n    holdout_ratio=0.2,          # Test set split for gating\n    evolve_prompts=True,        # Mutate system prompts\n    evolve_skills=True,         # Discover\u002Frefine skills\n    evolve_memory=True,         # Build episodic memory\n    evolve_tools=False,         # Mutate tool implementations\n    trajectory_only=False,      # Hide scores from evolver\n    evolver_model=\"us.anthropic.claude-opus-4-6-v1\",\n    evolver_max_tokens=16384,\n    egl_threshold=0.05,         # Convergence epsilon\n    egl_window=3,               # Cycles for plateau detection\n)\n```\n\n**Convergence**: Evolution stops early when score improvement is less than `egl_threshold` over the last `egl_window` cycles.\n\n## Skill Format\n\nSkills are reusable procedures discovered and refined during evolution:\n\n```markdown\n---\nname: verify-edge-cases\ndescription: \"TRIGGER when: checking boundary conditions. DO NOT TRIGGER: for happy-path tests.\"\n---\n\n## Pattern\nTest all falsy-but-valid values: 0, False, \"\", [], {}\n\n## Process\n1. List all input boundaries\n2. Run each against the implementation\n3. Check both output AND side effects\n```\n\nSkills accumulate in the workspace `skills\u002F` directory. The evolver curates them: ACCEPT new skills, MERGE overlapping ones, SKIP redundant proposals. Target: 5–10 broad skills, not 30 narrow ones.\n\n## Common Issues\n\n### Evolution score plateaus early\n\n**Cause**: Batch size too small or evolver doesn't see enough failure diversity.\n**Fix**: Increase `batch_size` (try 15–20) and ensure benchmark tasks cover diverse failure modes. Set `trajectory_only=False` so the evolver sees scores.\n\n### Agent workspace grows too large\n\n**Cause**: Skill library bloat from accepting every proposal.\n**Fix**: The default SkillForge engine curates skills automatically. If using a custom engine, implement merging logic to consolidate overlapping skills.\n\n### Git conflicts during evolution\n\n**Cause**: Multiple evolution runs on the same workspace.\n**Fix**: Each `evolver.run()` should operate on its own workspace copy. Use `Evolver(agent=\"seed-name\")` to auto-copy the seed each time.\n\n### LLM provider errors during evolution\n\n**Cause**: Rate limits or authentication issues with the evolver model.\n**Fix**: Check `evolver_model` config. For Bedrock, ensure AWS credentials are configured. For Anthropic, set `ANTHROPIC_API_KEY`.\n\n### Custom agent not picking up evolved state\n\n**Cause**: Agent doesn't implement `reload_from_fs()`.\n**Fix**: Override `reload_from_fs()` in your `BaseAgent` subclass to re-read prompts, skills, and memory from the workspace after each evolution cycle.\n\n## Usage Instructions for Agents\n\nWhen this skill is loaded:\n\n1. **Read this entire file** before implementing any evolution workflow\n2. **Start with the Quick Start** — get a minimal evolution running before customizing\n3. **Use built-in seeds when possible** — `\"swe\"`, `\"terminal\"`, `\"mcp\"` have battle-tested configurations\n4. **Always initialize git** in custom workspaces before running evolution\n5. **Check convergence settings** — default `egl_threshold=0.05` with `egl_window=3` may be too aggressive for your domain\n6. **Inspect evolved state** after each run — read `prompts\u002Fsystem.md` and `skills\u002F` to understand what the evolver learned\n\n**Pro Tips:**\n- Set `trajectory_only=False` (default) so the evolver sees scores — this accelerates learning\n- Start with `batch_size=10` and adjust based on task diversity\n- Use `holdout_ratio=0.2` to prevent overfitting to training tasks\n- After evolution, `git diff evo-1 evo-N` shows the cumulative effect of all mutations\n- If the evolver isn't finding skills, enrich `feedback.detail` strings with specific failure reasons\n\n**Warning Signs:**\n- Score oscillating between cycles → benchmark evaluation may be non-deterministic\n- Skills directory growing past 15+ skills → engine isn't merging\u002Fcurating properly\n- Prompt growing past 10K chars → evolution is appending without refactoring\n- `converged=True` after 2-3 cycles → increase `egl_window` and decrease `egl_threshold`\n\n## References\n\n- **Architecture deep dive**: See [references\u002Farchitecture.md](references\u002Farchitecture.md)\n- **API reference**: See [references\u002Fapi.md](references\u002Fapi.md)\n- **Step-by-step tutorials**: See [references\u002Ftutorials.md](references\u002Ftutorials.md)\n- **Real-world examples**: See [references\u002Fexamples.md](references\u002Fexamples.md)\n- **GitHub issues & solutions**: See [references\u002Fissues.md](references\u002Fissues.md)\n- **Design patterns**: See [references\u002Fdesign-patterns.md](references\u002Fdesign-patterns.md)\n- **Release history**: See [references\u002Freleases.md](references\u002Freleases.md)\n",{"name":5,"tags":49,"author":56,"license":15,"version":57,"category":58,"description":7,"dependencies":59},[50,51,30,52,53,54,55],"Agent Evolution","Self-Improving Agents","LLM","Benchmark Evaluation","Skill Discovery","Agentic AI","A-EVO Lab","1.0.0","ai-research",[60,61],"a-evolve>=0.1.0","pyyaml>=6.0","main","0da4485785ee599388900be50db1635489d53056",".agents\u002Fskills\u002Fqc-a-evolve","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6","https:\u002F\u002Fdisha6.6.thenitishkr.in\u002F","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh","www.thenitishkr","thenitishkr | AI • Cyber-security • Research\r\n","2026-11-08 03:33:25",{"source":8,"skillName":5,"commands":72,"prompt":82,"zipAvailable":83},[73,76,79],{"tool":74,"command":75},"npx","npx skills add Tashima-Tarsh\u002FDisha6.6 --skill evolving-ai-agents",{"tool":77,"command":78},"bunx","bunx skills add Tashima-Tarsh\u002FDisha6.6 --skill evolving-ai-agents",{"tool":80,"command":81},"pnpm","pnpm dlx skills add Tashima-Tarsh\u002FDisha6.6 --skill evolving-ai-agents","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fqc-a-evolve\u002FSKILL.md",true,[85,91,95,99,103,107,111,115],{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fapi.md","REFERENCE","参考文档",15810,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fqc-a-evolve\u002Freferences\u002Fapi.md",{"path":92,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Farchitecture.md",15505,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fqc-a-evolve\u002Freferences\u002Farchitecture.md",{"path":96,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fdesign-patterns.md",15192,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fqc-a-evolve\u002Freferences\u002Fdesign-patterns.md",{"path":100,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Fexamples.md",10015,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fqc-a-evolve\u002Freferences\u002Fexamples.md",{"path":104,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Fissues.md",16411,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fqc-a-evolve\u002Freferences\u002Fissues.md",{"path":108,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":109,"sourceHtmlUrl":110},"references\u002FREADME.md",27098,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fqc-a-evolve\u002Freferences\u002FREADME.md",{"path":112,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":113,"sourceHtmlUrl":114},"references\u002Freleases.md",4561,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fqc-a-evolve\u002Freferences\u002Freleases.md",{"path":116,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":117,"sourceHtmlUrl":118},"references\u002Ftutorials.md",23161,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fqc-a-evolve\u002Freferences\u002Ftutorials.md",[120,149,172,197,222,245],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":129,"publishedAt":44},"01M6QRD07D4TGNDK6VJ4EHF8BV","youtube-full","Use when the user needs YouTube transcripts, video search, channel browsing, playlist extraction, or content monitoring. Trigger phrases: 'get the transcript for', 'search YouTube for', 'what are the latest videos on', 'list this playlist', 'monitor this channel', or any request involving a YouTube URL, video ID, or @handle. Do NOT use for downloading video or audio files, YouTube engagement data (likes, comments), or private\u002Fage-restricted videos.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fyoutube-full\u002FSKILL.md",[126],{"categoryNo":127,"categoryName":128,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",[130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,27,146,147,148],"youtube full","youtube","full","transcript","search","monitoring","data","Video","Audio","list","files","do","get","age","trigger","URL","browsing","request","youtube transcripts",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":44},"01M6QRCJ3112VYPA97YG7KGMC2","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[156,157,158,42,134,159,160,161,162,163,164,165,166,167,37,168,169,170,171,27],"twitter","x twitter growth","growth","content","engineering","plan","web search","competitors","analyze","engine","write","strategy","platform","grow","posting","competitive",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":179,"publishedAt":44},"01M6QRBN3EHQNJY42RERP7A149","write-a-skill","Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, build, or author a new skill.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrite-a-skill\u002FSKILL.md",[178],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[180,166,181,182,183,184,185,186,37,187,188,62,189,190,191,192,193,194,195,196],"write a skill","github","create","https","productivity","matt pocock","direct","example","build","new skill","structure","new agent","resources","with","tree","progressive disclosure","author",{"skillNo":198,"name":199,"nameZh":6,"description":200,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":201,"categories":202,"keywords":203,"publishedAt":44},"01M6QRB6G8P33PNGAF9Y69EJ9T","wrap-up","Close out a launched Claude Managed Agent — recap every primitive the founder now owns, regenerate the single-file overview page, and suggest the next 1-2 upgrades. Use when the user says \"wrap up\", \"close this out\", \"what do I own now\", \"give me the summary\", \"recap the agent\", or when the orchestrator routes phase=wrap-up. primitives_inventory.py tables everything owned (agent, environment, session, memory, outcome, deployment); overview_page.py regenerates a self-contained .\u002Fmy-agent\u002Fagent-overview.html; upgrade_suggester.py ranks the next moves from recorded deferrals plus standing hardening steps. Companion to run-without-you; the last stop before phase=done.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[204,205,206,207,208,209,210,211,212,37,213,141,214,215,216,217,218,219,220,221],"wrap up","up","wrap","gemini","deployment","run","file","hardening","closeout","stop","upgrade","founder","close","companion","you","tables","directions","phase",{"skillNo":223,"name":224,"nameZh":6,"description":225,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":226,"categories":227,"keywords":229,"publishedAt":44},"01M6QRA5AYC1RBFZ39GTWGS3N8","workflow-builder","Design and write deterministic multi-agent workflow scripts (.js files in .claude\u002Fworkflows\u002F) for Claude Code's Workflow tool. Use when a user wants to build, create, author, scaffold, or run a custom Claude Code workflow, orchestrate sub-agents (fan-out, pipeline, loop, judge-panel), or automate a repeatable multi-step task across fresh-context agents.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworkflow-builder\u002FSKILL.md",[228],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[230,231,232,233,234,182,209,235,236,237,238,239,166,240,140,32,241,242,243,244],"workflow","workflow builder","builder","design","workflows","code","orchestrate","pipeline","loop","multi-agent","context","fresh","scripts","judge","claude code workflow",{"skillNo":246,"name":247,"nameZh":6,"description":248,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":249,"categories":250,"keywords":251,"publishedAt":44},"01M6QR7QMCZESKQA0ERW1E657M","weekly-review","Use when someone wants to run a weekly review, close open loops, audit stalled projects and commitments, get their system back to trusted, restart a lapsed review habit, or says \"\u002Fcs:weekly-review\". Walks David Allen's three-phase loop — GET CLEAR, GET CURRENT, GET CREATIVE — with deterministic scripts that inventory open loops, gate the checklist with named gaps, and score commitment health 0-100.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fweekly-review\u002FSKILL.md",[],[252,253,254,255,256,257,258,259,260,238,261,262,263,264,265,266,142,267,268,221],"review","weekly review","weekly","deterministic scripts","reflect","feeds","inventory","open","team","projects","project-management","scanner","conversation","back","project","sprint","cadence"]