Bug Summary
In evolution/skills/evolve_skill.py, the evolved skill is reassembled with frontmatter on line 185, but the validation on line 189 checks the body-only text. This causes the skill_structure constraint to falsely fail every evolved skill because evolved_body has no YAML frontmatter.
Reproduction
Run any skill evolution (e.g. plan, github-code-review, systematic-debugging). The optimizer completes successfully, but validation fails with:
✗ skill_structure: Skill missing: YAML frontmatter (---), name field, description field
Meanwhile, the saved evolved_FAILED.md contains valid frontmatter:
---
name: plan
description: Plan mode for Hermes — inspect context, write a markdown plan...
---
Root Cause
Line 185 correctly assembles the full skill:
evolved_full = reassemble_skill(skill["frontmatter"], evolved_body)
Line 189 incorrectly validates the body only:
evolved_constraints = validator.validate_all(evolved_body, "skill", baseline_text=skill["body"])
Fix
Change line 189 from evolved_body to evolved_full:
evolved_constraints = validator.validate_all(evolved_full, "skill", baseline_text=skill["body"])
Evidence
I hit this on 5 consecutive skill evolutions. All had valid frontmatter, all scored well (57-67%), all were falsely rejected:
| Skill |
Score |
Rejected By |
systematic-debugging |
66.47% |
skill_structure |
github-code-review |
58.45% |
skill_structure |
plan |
63.66% |
skill_structure |
llm-wiki |
57.87% |
skill_structure + size_limit* |
test-driven-development |
67.58% |
skill_structure |
*llm-wiki also genuinely exceeded size, but skill_structure was the first blocker.
Environment
- Commit:
c763e85 (latest main as of 2026-04-22)
- Python 3.11
- DSPy 2.x
Bug Summary
In
evolution/skills/evolve_skill.py, the evolved skill is reassembled with frontmatter on line 185, but the validation on line 189 checks the body-only text. This causes theskill_structureconstraint to falsely fail every evolved skill becauseevolved_bodyhas no YAML frontmatter.Reproduction
Run any skill evolution (e.g.
plan,github-code-review,systematic-debugging). The optimizer completes successfully, but validation fails with:Meanwhile, the saved
evolved_FAILED.mdcontains valid frontmatter:Root Cause
Line 185 correctly assembles the full skill:
Line 189 incorrectly validates the body only:
Fix
Change line 189 from
evolved_bodytoevolved_full:Evidence
I hit this on 5 consecutive skill evolutions. All had valid frontmatter, all scored well (57-67%), all were falsely rejected:
systematic-debuggingskill_structuregithub-code-reviewskill_structureplanskill_structurellm-wikiskill_structure+size_limit*test-driven-developmentskill_structure*
llm-wikialso genuinely exceeded size, butskill_structurewas the first blocker.Environment
c763e85(latestmainas of 2026-04-22)