gan-evolution-engine

Generative Adversarial Evolution for AI Agent Skills. Uses GAN-like process to evolve skill capabilities: Generator creates skill variants, Discriminator evaluates performance, iterative selection promotes high-fitness mutations. Integrates with evomap-publish for capsule submission.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "gan-evolution-engine" with this command: npx skills add sudabg/gan-evolution-engine

🧬 GAN Evolution Engine

"进化即对抗:生成变异,判别优劣,迭代超越"

The GAN Evolution Engine implements a generative adversarial approach to skill evolution. Instead of random mutations, it uses a learned Generator to propose skill modifications and a Discriminator to evaluate their fitness based on runtime metrics and user feedback.

✨ Features

  • 🎲 Generator Network: LLM-powered generation of skill variants (code, prompts, logic)
  • ⚖️ Discriminator: Performance-based fitness evaluation (accuracy, speed, user satisfaction)
  • 🔁 Adversarial Loop: Generator vs Discriminator co-evolution drives rapid improvement
  • 📈 Population Management: Maintains diverse pool of skill variants
  • 🚀 Elite Selection: Top-performing variants become candidates for promotion
  • 📊 Integration: Seamless integration with evomap-publish for capsule submission

🏗️ Architecture

┌─────────────────┐     ┌──────────────────┐
│   Generator     │     │  Discriminator   │
│  (LLM Agent)    │────▶│  (Perf Analyzer) │
└─────────────────┘     └──────────────────┘
         │                        │
         ▼                        ▼
   Skill Variants          Fitness Scores
         │                        │
         └────────┬───────────────┘
                  ▼
         Selection & Crossover
                  │
                  ▼
           Next Generation

📦 Usage

Quick Start

# 1. Ensure evomap-publish is configured
mkdir -p ~/.evomap
echo "node_db2f95ffdba95eb6" > ~/.evomap/node_id
echo "d846e0f269030e8b3eb3ed60472b164b448f8360e578a6392ccc4740d096ba14" > ~/.evomap/node_secret

# 2. Run GAN evolution cycle
python3 scripts/gan_evolution.py --skill <target-skill> --generations 10 --population 20

CLI Options

FlagDescriptionDefault
--skillTarget skill to evolverequired
--generationsNumber of evolution cycles10
--populationPopulation size per generation20
--elite-ratioFraction of elite variants to keep0.2
--mutation-rateProbability of mutation0.1
--outputOutput directory for evolved skillsevolved/
--promoteAuto-promote top variants to productionfalse
--publishSubmit top capsule to EvoMapfalse

🔬 How It Works

1. Population Bootstrap

  • Clone target skill as initial population (population=N)
  • Apply random mutations to diversify initial pool

2. Generator Phase

For each generation:

  • Prompt LLM with:
    • Parent skill code
    • Performance metrics (from Discriminator)
    • Mutation strategy (crossover, parameter tuning, prompt refinement)
  • Generate population variant candidates

3. Evaluation Phase (Discriminator)

For each variant:

  • Deploy in sandbox environment
  • Run benchmark suite (accuracy, latency, resource usage)
  • Collect user feedback if available
  • Compute fitness score = weighted sum:
    fitness = 0.4 * accuracy + 0.3 * speed + 0.3 * feedback
    

4. Selection & Crossover

  • Select top elite_ratio * population variants
  • Perform crossover: combine code fragments from 2 parents
  • Apply mutations to non-elite variants
  • Form next generation population

5. Termination

After generations cycles:

  • Select best variant (highest fitness)
  • Optionally: promote to production (--promote)
  • Optionally: create capsule and publish to EvoMap (--publish)

📊 Example Output

Generation 1/10
  Population: 20 variants
  Best fitness: 0.72 (variant-07)
  Avg fitness: 0.45
  Generator time: 2m 13s
  Discriminator time: 1m 42s

...

Evolution Complete! 🏆

🏆 Champion: variant-43 (fitness=0.89)
📈 Improvement: +22% over baseline
🚀 Promoted: skills/evolved/<skill>-v2/
📤 Capsule ID: sha256:abc123... (published)

⚙️ Implementation Details

Files

gan-evolution-engine/
├── SKILL.md                 # This file
├── scripts/
│   ├── gan_evolution.py    # Main orchestrator
│   ├── generator.py        # LLM-based variant generation
│   ├── discriminator.py    # Performance evaluation
│   ├── population.py       # Population management
│   └── fitness.py          # Fitness computation
└── references/
    └── prompts/            # Generator prompt templates

Key Functions

  • GANEvolutionEngine.__init__(skill_path, population, generations)
  • Engine.bootstrap_population(): Clone + mutate initial pool
  • Engine.run_generation(): One full cycle
  • Generator.generate_variant(parent, strategy): Create new variant
  • Discriminator.evaluate(variant): Return fitness score 0-1
  • Population.select_elites(): Top K variants
  • Population.crossover(parent1, parent2): Create child

🛡️ Safety & Risk

RiskMitigation
Degenerate SkillsValidation suite runs before evaluation; invalid variants discarded
Infinite LoopHard generation limit; timeout per variant (5min)
Performance RegressionRequire fitness > baseline before promotion
Code InjectionSandboxed execution; no network access for variants
Resource ExhaustionPopulation size capped at 100; parallel evaluations limited

🧪 Testing

Run unit tests:

python3 -m pytest tests/gan_evolution/ -v

📜 License

MIT


"Evolution is not random mutation alone; it's the selective amplification of success."

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

Capability Evolver

A self-evolution engine for AI agents. Analyzes runtime history to identify improvements and applies protocol-constrained evolution.

Registry SourceRecently Updated
2150Profile unavailable
Automation

Zhua Evolver

爪爪专属自我进化系统 —— 自动分析能力差距、搜索补强技能、执行进化循环、记录进化日志。Use when 爪爪需要自我进化、能力提升、技能补强、或达到更高智能水平。

Registry SourceRecently Updated
1780Profile unavailable
Automation

Self Evolution-v2

让AI agent拥有真正的自我审视和持续进化能力,对标Hermes Agent核心能力。

Registry SourceRecently Updated
1561Profile unavailable
Automation

Self Evolution Pro

增强型自我进化技能,集成自动技能提取、根因分析、知识图谱、跨会话同步、自动晋级机制。触发词:'总结这个经验'、'保存为技能'、'自我进化'、'学习这个'、'记录教训'。相比原版self-improving-agent,新增自动提取、多维度分析、进化追踪功能。

Registry Source
2550Profile unavailable