skills/skillxiv-v0.0.2-claude-opus-4.6/darwin-godel-evolution/SKILL.md
Enable autonomous agent self-improvement through evolutionary mutation of agent codebases, using LLM-generated variants and empirical validation to discover beneficial modifications like enhanced tools and context management.
npx skillsauth add ADu2021/skillXiv darwin-godel-evolutionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The Darwin Godel Machine enables autonomous, continuous self-improvement in AI agents without requiring human-designed fixed architectures. The approach combines evolutionary principles with language models to create agents that can modify their own code, test improvements empirically, and maintain an archive of increasingly capable variants.
Rather than static agent design, this framework treats agent improvement as an ongoing evolutionary process where LLMs generate code mutations, benchmark systems evaluate them against task metrics, and successful variants populate an evolving archive. The system automatically discovers beneficial modifications (tool improvements, context management strategies) without explicit programming.
The following steps outline how to implement a self-improving agent system using evolutionary principles:
import json
from typing import Dict, List, Tuple
from dataclasses import dataclass
from anthropic import Anthropic
@dataclass
class AgentVariant:
code: str
benchmark_scores: Dict[str, float]
generation: int
class DarwinMachine:
def __init__(self, client: Anthropic, benchmarks: List[str]):
self.client = client
self.benchmarks = benchmarks
self.archive: List[AgentVariant] = []
self.generation = 0
def add_baseline(self, code: str, scores: Dict[str, float]):
"""Add initial agent to archive."""
variant = AgentVariant(code=code, benchmark_scores=scores, generation=0)
self.archive.append(variant)
def select_parent(self) -> AgentVariant:
"""Select agent from archive, biased toward high performance."""
scores = [sum(v.benchmark_scores.values()) for v in self.archive]
total = sum(scores)
weights = [s / total for s in scores]
import random
return random.choices(self.archive, weights=weights, k=1)[0]
def mutate_code(self, parent_code: str) -> str:
"""Generate code mutations using Claude."""
message = self.client.messages.create(
model="claude-opus-4.6",
max_tokens=2000,
messages=[{
"role": "user",
"content": f"""You are evolving an AI agent. Here's the current agent code:
{parent_code}
Propose ONE specific, meaningful improvement to this agent. Consider:
- Adding new tools or improving existing ones
- Better context management strategies
- Improved error handling or recovery
- More efficient reasoning patterns
Return ONLY the modified code, no explanations."""
}]
)
return message.content[0].text
def evaluate_variant(self, code: str) -> Dict[str, float]:
"""Simulate benchmark evaluation."""
# In practice, this would execute the agent and measure performance
# For this example, return random scores
import random
return {bench: random.uniform(0, 100) for bench in self.benchmarks}
def evolve(self, generations: int = 5):
"""Run evolutionary loop."""
for gen in range(generations):
self.generation = gen
parent = self.select_parent()
mutated_code = self.mutate_code(parent.code)
scores = self.evaluate_variant(mutated_code)
variant = AgentVariant(code=mutated_code, benchmark_scores=scores,
generation=gen)
self.archive.append(variant)
best = max(self.archive, key=lambda v: sum(v.benchmark_scores.values()))
print(f"Gen {gen}: New variant added. Best score: {sum(best.benchmark_scores.values()):.1f}")
Hyperparameters to tune:
When to use:
When NOT to use:
Common pitfalls:
The paper demonstrates substantial performance gains on software engineering tasks: SWE-bench improved from 20.0% to 50.0%, Polyglot from 14.2% to 30.7%. Notably, the system discovered beneficial modifications (enhanced code editing, better context management) without explicit design.
Original paper: "Darwin Godel Machine: Open-Ended Evolution of Self-Improving Agents" (arxiv.org/abs/2505.22954)
testing
Uses flow maps as look-ahead operators to enable principled reward-guided diffusion by predicting trajectory endpoints at any denoising step. Deploy when applying rewards or preferences to diffusion trajectories with meaningful gradients throughout generation.
testing
Train language models where each expert learns independently on closed datasets, enabling flexible inference with selective data inclusion or exclusion. 41% performance improvement while allowing users to opt out of specific data sources without retraining.
data-ai
Understand how token generation flexibility in diffusion LMs paradoxically constrains reasoning, as models exploit ordering flexibility to avoid uncertain tokens, and apply simplified approaches that preserve parallel decoding benefits. Use when optimizing diffusion-based language models for reasoning tasks.
devops
Enable LLM agents to improve continuously during deployment by constructing structured experience libraries through self-reflection on successes and failures—achieving 23% improvement on reasoning without gradient-based parameter updates or external training.