Self-Evolution — let Wednesday optimize a skill’s text with DSPy/GEPA
Category: hermes-command
Where it works: Claude Code / any runtime that can run a script (manual, operator-triggered)
Source: _infra/scripts/self-evolve.py → wraps ~/src/hermes-agent-self-evolution (NousResearch, MIT)
What it is
An evolutionary optimizer for skill text. You point it at a SKILL.md; it auto-generates test
cases, runs GEPA (reflective prompt evolution) to rewrite the skill, checks the result against
safety gates, and saves an improved version for you to review. It runs entirely on the
model configured in Hermes (cheap background lane, never Claude) and never edits your repos —
it only writes a candidate file you choose whether to apply.
How to trigger it
- Direct / command:
python3 _infra/scripts/self-evolve.py --skill <name> --eval-source synthetic --iterations <N> - Add
--dry-runfirst to validate setup with zero AI calls. - Auto-fires? No — manual only. Full runs are operator-triggered by design.
How to use it
- Run it on a skill. It generates synthetic tasks, evolves the skill text via the Hermes-configured model, and gates the result.
- It saves three files under
~/src/hermes-agent-self-evolution/output/<skill>/<timestamp>/:baseline_skill.md,evolved_skill.md,metrics.json. - You review the diff (
diff baseline_skill.md evolved_skill.md). If the evolved version is better, you copy the good parts into the real skill. Nothing is deployed automatically.
Practical examples
- Tighten a skill — you:
--skill commit-msg --iterations 5→ it tries 5×40 evolution steps, scores each on auto-generated tasks → you get a candidate + a before/after score table. - Smoke-test it — you:
--skill demo-skill --hermes-repo /tmp/target --dry-run→ confirms the pipeline + backend are alive without spending any AI calls.
Notes / limits
- Proven: on the real
arxivskill it improved the holdout score +31% while making the skill 19% smaller (3 iterations, LLM-judge scored). Better and leaner. - Cost: runs on the cheap Hermes background lane (
:8645proxy), not Claude. Still, it makes many calls (a real run is minutes) — keep--iterationsmodest. ~3 is enough to see gains. - Tuning:
--max-growth(default 0.5) caps how much the skill may grow; higher--iterations= more search = bigger potential gains (and more time). - Safety: read-only against
~/.hermes/hermes-agent(your local patches are safe); writes only to its ownoutput/. Nothing auto-deploys — you review and apply. - Engineering detail + the 7 local patches:
_infra/docs/self-evolution-adoption.md.