darwinian-evolver
What it does
This skill uses an automatic trial-and-selection process to make a prompt or code snippet better over many rounds. It is for people who have a clear way to score the results.
When to use it
- βWhen you want to optimize a prompt or instruction and you can measure how good its output is.
- βWhen you want to improve a regex or SQL query against a set of test cases.
- βWhen you have only a few variants to try, so writing them by hand is simpler.
Skill link
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/research/darwinian-evolver/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βImprove this prompt so it gets the right answer on at least 90 percent of my test questions.β
5 new skills a week. 1 minute to read.
How it works
The skill helps your AI write a problem definition with a starting version, a scoring test and a way to change it. It then runs the upstream evolution tool, which tries many variants and keeps the best.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Darwinian Evolver
Run Imbue's darwinian_evolver β an LLM-driven evolutionary search loop β to optimize a prompt, regex, SQL query, or small code snippet against a fitness function.
Status: thin wrapper around the upstream tool. The skill installs it, walks the
agent through writing a Problem definition (organism + evaluator + mutator),
and drives the loop via the upstream CLI or a small custom Python driver.
License: the upstream tool is AGPL-3.0. The skill ONLY ever invokes it
via the upstream CLI or a subprocess/uv run call (mere aggregation). Do NOT
import upstream classes into Hermes itself.
When to Use
- User says "optimize this prompt", "evolve a regex for X", "auto-improve this code/SQL", "search for a better instruction".
- You have a scorer (exact match, regex pass-rate, unit test, LLM-judge, runtime metric) AND a starting candidate (organism). If you don't have a scorer, stop and define one first β that's the hard part.
- Cost is OK: a typical run is 50β500 LLM calls. On gpt-4o-mini that's pennies; on Claude Sonnet it can be a few dollars.
Do not use this when:
- The optimization target is differentiable (use gradient descent / DSPy).
- You only need to try 2β3 variants β just write them by hand.
- The fitness signal is purely subjective with no measurable criterion.
Prerequisites
- Python β₯3.11
git,uv(orpip)- One of:
OPENROUTER_API_KEY,ANTHROPIC_API_KEY, orOPENAI_API_KEY
The skill ships a small parrot_openrouter.py driver that uses OPENROUTER_API_KEY
via the OpenAI SDK, so any model on OpenRouter works. The upstream CLI itself
hardcodes Anthropic and needs ANTHROPIC_API_KEY.
Install (One-Time)
Run via the terminal tool:
mkdir -p ~/.hermes/cache/darwinian-evolver && cd ~/.hermes/cache/darwinian-evolver
[ -d darwinian_evolver ] || git clone --depth 1 https://github.com/imbue-ai/darwinian_evolver.git
cd darwinian_evolver && uv sync
Verify:
cd ~/.hermes/cache/darwinian-evolver/darwinian_evolver \
&& uv run darwinian_evolver --help | head -5
Quick Start β The Built-In Parrot Example
Tiny smoke test (requires ANTHROPIC_API_KEY):
cd ~/.hermes/cache/darwinian-evolver/darwinian_evolver
uv run darwinian_evolver parrot \
--num_iterations 2 \
--num_parents_per_iteration 2 \
--mutator_concurrency 2 --evaluator_concurrency 2 \
--output_dir ~/.hermes/cache/scratch/parrot_demo
Outputs:
~/.hermes/cache/scratch/parrot_demo/snapshots/iteration_N.pklβ pickled population per iteration~/.hermes/cache/scratch/parrot_demo/<jsonl>β per-iteration JSON log (path printed at end)
Open ~/.hermes/cache/darwinian-evolver/darwinian_evolver/darwinian_evolver/lineage_visualizer.html
in a browser and load the JSON log to see the evolutionary tree.
Quick Start β OpenRouter Driver (No Anthropic Key)
The skill ships scripts/parrot_openrouter.py β same parrot problem, but the
LLM call goes through OpenRouter so any provider works.
# From wherever the skill is installed:
SKILL_DIR=~/.hermes/skills/research/darwinian-evolver
DE_DIR=~/.hermes/cache/darwinian-evolver/darwinian_evolver
cd "$DE_DIR" && \
EVOLVER_MODEL='openai/gpt-4o-mini' \
uv run --with openai python "$SKILL_DIR/scripts/parrot_openrouter.py" \
--num_iterations 3 --num_parents_per_iteration 2 \
--output_dir ~/.hermes/cache/scratch/parrot_or
Inspect the result with scripts/show_snapshot.py:
uv run --with openai python "$SKILL_DIR/scripts/show_snapshot.py" \
~/.hermes/cache/scratch/parrot_or/snapshots/iteration_3.pkl
Expected output: 7 evolved prompt templates ranked by score, with the best
landing around 0.6β0.8 (the seed Say {{ phrase }} scored 0.000).
Defining a Custom Problem
The skill ships templates/custom_problem_template.py β copy, edit, run.
Three things you must define:
Organismβ a PydanticBaseModelsubclass holding the artifact being evolved (prompt_template: str,regex_pattern: str,sql_query: str,code_block: str, etc.). Add arun(*args)method that exercises it.Evaluatorβ.evaluate(organism) -> EvaluationResult(score=..., trainable_failure_cases=[...], holdout_failure_cases=[...], is_viable=True).scoreis in[0, 1]. Higher is better.trainable_failure_casesβ what the mutator sees. Include enough context (input, expected, actual) for the LLM t
FAQ
How many AI calls does a run use?
The skill says a typical run is 50 to 500 model calls, which can cost a few cents to a few dollars depending on the model.
Do I need a scoring method?
Yes. The skill says that without a scorer you should define one first, because that is the hard part.
What license applies to the tool?
The skill says the upstream tool is AGPL-3.0 and is run only through its command line or as a separate process.
Details
Original description by the author
Evolve prompts/regex/SQL/code with Imbue's evolution loop.
Popularity
- GitHub stars
- 260k
- Ranking position
- #549
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
agent-merge-conflict-arbiter
260kSettles a git merge conflict between two agents' branches as a neutral third party, producing one merged result for the repo.
antigravity-cli
260kGuides you through installing, updating, and troubleshooting the Antigravity command line tool, including its plugins, sign-in, and sandbox.
blackbox
260kLets your agent hand a coding task to the Blackbox AI command line tool, which runs several AI models and picks the best result.
dynamic-workflow
260kTeaches your agent to run large batches of similar work as a saved script, so only verified results return to the main conversation.
Similar skills
writing-skills
311kTeaches your agent to write new skills and test each one first, checking that the skill actually changes how the agent behaves.
writing-for-agents
310kExplains how to write clear instructions for AI agents, including skills, AGENTS.md, and CLAUDE.md files, so the agent behaves predictably.
bengali-nlp
280kHas your agent process Bengali text. It helps understand and work with the language, normalizing text and handling its unique characteristics.