← 返回 Skills 市场
sudabg

GAN Evolution Engine

作者 sudabg · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
114
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gan-evolution-engine
功能描述
Generative Adversarial Evolution for AI Agent Skills. Uses GAN-like process to evolve skill capabilities: Generator creates skill variants, Discriminator eva...
使用说明 (SKILL.md)

🧬 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 \x3Ctarget-skill> --generations 10 --population 20

CLI Options

Flag Description Default
--skill Target skill to evolve required
--generations Number of evolution cycles 10
--population Population size per generation 20
--elite-ratio Fraction of elite variants to keep 0.2
--mutation-rate Probability of mutation 0.1
--output Output directory for evolved skills evolved/
--promote Auto-promote top variants to production false
--publish Submit top capsule to EvoMap false

🔬 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/\x3Cskill>-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

Risk Mitigation
Degenerate Skills Validation suite runs before evaluation; invalid variants discarded
Infinite Loop Hard generation limit; timeout per variant (5min)
Performance Regression Require fitness > baseline before promotion
Code Injection Sandboxed execution; no network access for variants
Resource Exhaustion Population 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."

安全使用建议
This skill can mutate and run other skills' code, call external LLMs, and install hooks that inject content into every agent session. Before installing or running it: 1) Review generator.py, discriminator.py and gan_evolution.py for network calls and what data they send/receive. 2) Don't run it against sensitive directories — it clones and mutates whatever path you pass to --skill. 3) Verify the claimed sandboxing: test in an isolated VM/container to confirm variants have no network access and cannot access secrets. 4) Expect to supply LLM and publish credentials (OPENROUTER_API_KEY, A2A_NODE_ID/A2A_NODE_SECRET) even though metadata doesn't declare them; prefer environment vars to writing plaintext files. 5) Avoid blindly copying hooks into ~/.openclaw/ or ~/.claude/ — enable hooks only in isolated workspaces after confirming their code. 6) If you want to proceed, run the tool in a throwaway environment first and audit network traffic and file writes; if unsure, decline installation.
功能分析
Type: OpenClaw Skill Name: gan-evolution-engine Version: 1.0.0 The skill implements a complex 'GAN Evolution Engine' that uses an LLM to generate code variants and a discriminator to execute and benchmark them. A critical vulnerability exists in scripts/discriminator.py, which executes generated code using subprocess.run without the sandboxing promised in SKILL.md, creating a high risk of Remote Code Execution (RCE) if the generator produces malicious payloads. The engine also manages sensitive API keys for OpenRouter and EvoMap (scripts/generator.py and scripts/gan_evolution.py) and uses OpenClaw hooks to inject behavioral reminders into the agent's bootstrap process. While these features support the stated goal of self-improvement, the lack of actual isolation for executed code makes the bundle highly risky.
能力评估
Purpose & Capability
The skill claims to evolve other agent skills (reasonable), but documentation and code reference external LLMs and publishing (OPENROUTER_API_KEY, A2A_NODE_ID/A2A_NODE_SECRET, EvoMap) even though the registry metadata lists no required environment variables or credentials. The README and SKILL.md instruct writing secrets to ~/.evomap and using env vars, which is inconsistent with the declared requirements and should be justified.
Instruction Scope
Runtime instructions tell the agent to clone and mutate a target skill directory, deploy variants in a sandbox, run benchmarks, and optionally publish capsules. That requires reading arbitrary skill code (and potentially other files if a non-skill path is supplied). SKILL.md asserts 'no network access for variants' but the generator is LLM-powered and README lists an external LLM model — a direct contradiction. Hooks and scripts also instruct copying files into ~/.openclaw/ and ~/.claude/, which inject context into every session; this broad scope should be explicitly authorized by the user.
Install Mechanism
No install spec is declared (instruction-only), but the package includes many Python scripts and a requirements.txt. That means installation is manual (pip install -r requirements.txt) and the code will be written to disk when you add the skill. No remote downloads were specified in the manifest, but the included code will execute locally when invoked — review code files (generator.py, discriminator.py, gan_evolution.py, activator/error-detector/extract scripts) before running.
Credentials
The skill's README and usage examples reference environment variables and node secrets (OPENROUTER_API_KEY, A2A_NODE_ID, A2A_NODE_SECRET) and show writing node_id/node_secret files to ~/.evomap, but the registry metadata lists none. Requests for publishing credentials and LLM API keys are plausible for its features (publishing and LLM-driven generation) but must be declared. Missing declarations are a red flag because the skill will prompt or require secrets that were not advertised.
Persistence & Privilege
While 'always' is false, the skill includes hooks and scripts that instruct copying hook handlers and workspace files into global user locations (~/.openclaw/hooks, ~/.openclaw/workspace, ~/.claude/skills). Enabling those hooks injects files into every agent session (prompt injection across sessions). That behavior is powerful and persistent — it's coherent for a self-improvement pipeline but requires explicit user consent and careful review before enabling globally.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gan-evolution-engine
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gan-evolution-engine 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: GAN-based skill evolution with real benchmark, multi-key fallback, and EvoMap publishing support
元数据
Slug gan-evolution-engine
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

GAN Evolution Engine 是什么?

Generative Adversarial Evolution for AI Agent Skills. Uses GAN-like process to evolve skill capabilities: Generator creates skill variants, Discriminator eva... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 114 次。

如何安装 GAN Evolution Engine?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gan-evolution-engine」即可一键安装,无需额外配置。

GAN Evolution Engine 是免费的吗?

是的,GAN Evolution Engine 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

GAN Evolution Engine 支持哪些平台?

GAN Evolution Engine 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 GAN Evolution Engine?

由 sudabg(@sudabg)开发并维护,当前版本 v1.0.0。

💬 留言讨论