darwin-skill: When Git Becomes the Fitness Function for AI Skills

An autonomous optimization loop that tests `SKILL.md`, scores what works, and reverts what doesn’t, so agent skills evolve by evidence instead of vibes.

8 min read • View on GitHub • More from alchaincyf

A blacksmith-like workshop where a document labeled SKILL.md sits on an anvil beside measuring calipers, a score gauge, and a small Git branch diagram. One hand files the document while another hovers near a red revert lever, showing that every edit is judged before it survives.
darwin-skill turns skill editing into a measured craft. The document changes, but only the changes that score better get to stay.
Key Takeaways

The ratchet that never forgets

The whole repo is built around a simple but sharp rule: if a change makes the skill worse, it does not survive. That is the ratchet. A skill file can mutate, but Git is the boundary that keeps bad mutations from becoming history.

That changes the emotional contract of AI iteration. Most prompt workflows ask you to trust the next draft. darwin-skill asks you to prove the draft improved the outcome, then either keep it or roll it back.

A close-up ratchet wheel with five labeled teeth: edit, test, score, keep, and revert. A pawl locks only the upward movement while a tiny Git timeline beneath it shows one commit advancing and another being rolled back, illustrating non-regression.
The core mechanism is not iteration for its own sake. It is selective evolution with rollback built in.

What darwin-skill is actually optimizing

The target is not a model, and not a prompt in the loose sense. It is `SKILL.md`, the instruction file that defines how an agent should behave. That matters because skills are accumulating assets. As a team adds more of them, manual editing becomes a maintenance burden instead of a craft.

# The thing being optimized

- `SKILL.md`: the skill definition and operating rules
- `test-prompts.json`: the cases used to probe the skill
- `results.tsv`: the score log that records each round
- Git commit history: the rollback line when a change fails

That file-centric view is the real pivot. The repo treats skill instructions as living artifacts that can be improved the same way software can, but with stronger discipline around measurement and reversal.

Why the rubric matters more than the rewrite

The most important design choice is not the rewrite step. It is the score. darwin-skill splits evaluation into structural quality and actual effectiveness, then forces test prompts to exist before edits begin. That blocks the usual trap where a prettier instruction set gets mistaken for a better one.

DimensionWhat it checksWhy it matters
Structural qualityMarkdown clarity, workflow design, checkpoints, and instruction specificityA skill that is hard to read is already expensive to maintain
EffectivenessWhether the skill performs better on real test promptsA polished file that fails in practice is still a failure
Independent scoringA separate sub-agent evaluates the changeSelf-grading would reward the edit agent’s own preferences
Pre-generated tests`test-prompts.json` comes before the rewriteIt prevents the target from shifting after the fact

The rubric is the guardrail. It keeps the loop from optimizing for appearances instead of outcomes.

A useful way to read the rubric is as two different kinds of truth. Structural scoring can inspect the file itself. Effectiveness scoring has to run the skill against a test set, then compare the output to a baseline. That split is what keeps the system honest.

The 5-phase loop, step by step

The workflow is narrow on purpose. It does one thing, measures it, and refuses to blur the result. That makes the loop feel less like a chatbot and more like a controlled experiment.

1. Initialize a clean optimization branch
2. Generate `test-prompts.json` before editing
3. Establish a baseline score
4. Fix the lowest-scoring dimension
5. Re-score, then keep or revert

That sequence matters because it forces causality. If the score rises, the new version earns its place. If it falls, Git removes the evidence and the system moves on.

Why the scores are split between structure and effectiveness

Scoring pathWhat it can seeWhat it cannot see
Structural analysisThe Markdown itselfWhether the skill actually behaves well in use
Effectiveness testingLive behavior on test promptsThe deeper writing quality that only human readers may notice
Combined rubricBalance between clean design and practical outputFalse confidence from either half alone

实测表现权重最高(25分)。Skill 写得再漂亮,跑出来效果不好就是零。

花叔 Huashu, Project Author · SKILL.md at master · alchaincyf/darwin-skill

That line gets to the center of the design. Structure is necessary, but it is not the point. The point is whether the skill actually works when another agent tries to use it.

The result card is not decoration

The HTML templates and screenshot pipeline are not cosmetic extras. They make the optimization legible. A score delta in a TSV file is useful, but a clean result card gives the team something to inspect, compare, and trust.

Generating illustration...

Optimization systems fail when they only produce metrics. darwin-skill also produces a report people can read.

That last mile matters more than people think. Metrics tell you whether a loop ran. A result card tells you whether someone will care enough to continue running it.

像训练模型一样优化你的 Agent Skills。

花叔 Huashu, Project Author · SKILL.md at master · alchaincyf/darwin-skill

How darwin-skill differs from autoresearch

The lineage is obvious, but the target changed. Karpathy’s autoresearch optimizes research code. darwin-skill optimizes agent skill files. The shared idea is ratcheted improvement, but the artifact, the evaluation surface, and the user payoff are different.

ProjectOptimizesEvaluationRollback logicPrimary value
autorresearchResearch code and experimental loopsScientific or model-training metricsKeep only measurable gainsBetter research automation
darwin-skill`SKILL.md` and related skill assetsRubric scores plus live skill testsGit revert on regressionBetter agent behavior through selection
Manual skill editingHuman-written instructionsAd hoc judgmentNone beyond memoryFast starts, weak consistency

Why the human stays in the loop

达尔文.skill —— 一个让你的Skill无限进化的系统:评估→改进→测试→保留或回滚 | Autoresearch-inspired autonomous skill optimization for Claude Code. Evaluate, improve, test, keep or revert.

花叔 Huashu, Project Author · alchaincyf/darwin-skill

The system is autonomous, but not reckless. It pauses for review because skill quality is partly numerical and partly contextual. A human checkpoint is not a weakness here. It is the acknowledgement that not every good instruction is obviously good on paper.

That is the quiet strength of the repo. It does not pretend that every agent decision can be reduced to a single score. It just makes the score good enough to steer the next move.