v3 · Open Source · MIT License · Claude Cowork · OpenClaw

Skill Forge

An autonomous experiment loop for AI skills and codebases. It changes one thing, measures it against a held-out split, and keeps the change only if the difference is larger than what the eval set can actually resolve. Everything else gets rolled back. Works with Claude Cowork and OpenClaw, fully autonomous or step by step.

Wizard Dry-Run Hypothesize Mutate Diff Evaluate Score Keep / Neutral / Revert
Setup Wizard with Validation Gates → Experiment Loop → Morning Report

Two Domains, Two Execution Modes

Optimize SKILL.md files or any codebase. Run fully autonomous or step through each decision.

Skill Mode

Optimize AI Skills

Improve a Skill's SKILL.md by running evals, grading outputs, and scoring with a gate score. Works with Claude Cowork and OpenClaw skills.

  • Assertion-based scoring
  • Optional LLM-as-Judge
  • Train/test split for overfitting protection
Generic Mode

Optimize Any Metric

Improve any file against any shell command that returns a number: test coverage, bundle size, Lighthouse, Docker image size, lint errors.

  • Any shell command as metric
  • Higher-is-better or lower-is-better
  • Glob pattern for scope
Auto Mode

Run Unattended

Fully autonomous loop. Start it, go to sleep, wake up to a morning report with measurable improvements.

  • Perfect for Scheduled Tasks
  • Automatic keep/revert decisions
  • No user interaction needed
Guided Mode

Decide at Every Step

Interactive loop with 5 checkpoints where you review, adjust, and approve each experiment before it runs.

  • Review and edit evals
  • Approve or redirect hypotheses
  • Override keep/revert decisions

Guided Mode: 5 Checkpoints

In guided mode, you stay in control while the agents do the heavy lifting.

1

Review Evals

See generated test cases, adjust assertions, change weights, add your own edge cases.

2

Approve Hypothesis

The agent proposes what to change and why. Accept, modify, or provide your own direction.

3

Review Mutation Diff

See exactly what will change before it's applied. Edit, approve, or skip.

4

Evaluate Results

See the score before and after. Override the automatic recommendation if you know better.

5

Continue or Stop

See progress so far and decide: another round, N more rounds, or generate the final report.

Five Agents, One Loop

Each experiment cycle is driven by five specialized agents. Four run every round; the archivist every fifth.

🔬

Hypothesis Agent

The Scientist

Analyzes failures, consults the coverage matrix, and produces a testable hypothesis targeting the highest-impact root cause.

🩹

Mutator Agent

The Surgeon

Applies one minimal, focused change. Works on SKILL.md instructions or code files. Documents every change with category tags.

Scorer Agent

The Judge

LLM-as-Judge evaluating output quality across three dimensions. In Generic Mode, the shell command provides the score directly.

🎼

Orchestrator Agent

The Conductor

Assembles context for every agent call, picks the exploration/exploitation phase, collects near-miss hypotheses, and keeps history, coverage matrix and checkpoint in sync.

📜

Meta Agent

The Archivist

Every five experiments, distils what kind of edit actually works for this particular skill. Writes to the optimizer's own notes, never into the target skill. Each bullet needs an experiment id, each previous bullet gets a verdict.

Objective Scoring

Every mutation is measured against a gate score. No vibes, no gut feeling — just numbers.

Skill Mode — Gate Score
assertion_pass_rate × 1.00
Skill Mode — With LLM-as-Judge
assertions × 0.65  +  llm_judge × 0.35
Generic Mode — Direct Metric
shell_command → extract_number → compare_to_baseline → keep/neutral/revert
Decision — Three Outcomes
delta ≥ max(improvement_threshold, noise_floor, resolution) → KEEP
delta ≤ −regression_threshold → REVERT
everything in between, ties included → NEUTRAL
Resolution — the smallest difference that can mean anything
resolution = 2 ÷ N_assertions

The gate score is the assertion pass rate, so it moves in steps of 1/N. With nine assertions a single flip moves 0.111; a fixed threshold of 0.02 sits below that and turns every flip into a KEEP. The keep threshold is therefore at least two flips wide, and the loop tells you the number before it starts: “resolution 0.065, changes below this are not measurable with this eval set.”

NEUTRAL rolls the mutation back. A loop that keeps the new version on a zero round drifts away from its starting point without a single measurement to justify it. Deltas just below the keep threshold carry a near_miss flag, so the next round can vary the same hypothesis instead of dropping it. Efficiency (tokens, wall clock) is still measured and reported in the morning report, but it no longer gates anything.

Earlier Runs

Three runs under the v2 decision rules. Read the caveat below the numbers.

humanizer

Text humanization · 3 experiments
Before
0.74
After
0.90
+21.6% — Personality as a dedicated workflow step with concrete criteria.

fachbuch-lektorat

German technical book editing · 3 experiments
Before
87%
After
100%
Worked examples beat abstract rules for edge-case handling.

was-bisher-geschah

AI news briefing · 1 experiment
Before
93%
After
100%
Explicit constraints (char limits, required fields) fix format drift.

These runs predate v3. They used the old gate, where efficiency carried 20 percent of the score, and the old decision cascade. The repository contains no evals.json, history.json or snapshot for any of them, so none of it is reproducible from here. The 0.74 to 0.90 figure is a composite score under the old weighting; the 87 and 93 percent figures are raw assertion pass rates. Results from v3 onwards ship with their history.json and evals.json, or they do not get published.

Built to be Robust

Safeguards for a loop that edits your files unattended, all night, with nobody watching.

It cannot cheat the metric

The optimal mutation for flake8 src/ | wc -l is to delete src/. Before every generic-mode experiment the loop pins the metric config, the test files, the file count and the byte size of what it measures. Without a passing check it gets INVALID instead of a number.

Regions it must not touch

Put anything between FORGE_KEEP markers and the loop will never change it. A second region holds notes that bypass the gate. Both are checked byte-wise in Python, not by asking the agent whether it behaved.

Revert actually reverts

Every experiment snapshots the state before it, with a manifest. A rollback restores the recorded files and removes the ones the mutation added, from any working directory.

Differences below the noise are not kept

The gate score is the assertion pass rate, so it moves in steps of 1/N. The keep threshold is at least two flips wide. A fixed 0.02 would sit below the resolution of any real eval set and turn every single flip into a KEEP.

The holdout stays a holdout

train feeds hypotheses, val decides keep or revert, test is touched exactly twice: once for the baseline, once for the report. Assigned by a stable hash, so deleting an eval does not reshuffle the rest.

Regressions are not netted away

Five new hits against three new failures is a plus two in the aggregate and looks like progress. The report pairs the same evals across both versions and lists regressions first.

An ignored rule is not a missing rule

Before looking for a cause, every failure is classified: was there already a rule that would have prevented this? If yes, that produces a note, not a rewrite. Otherwise one subagent slip costs a correct rule.

Nothing grows for free

A token budget spans the skill plus everything the loop wrote beside it. Over budget, the next round is forced into pruning.

Crash recovery and resume

Three consecutive crashes pause the loop. If the process dies between mutation and decision, the checkpoint knows and rolls back before continuing.

271 tests, two adversarial reviews

Five independent reviewers went through the code, and a mutation test over 69 targeted changes hunted for tests that would not notice a real bug. Every finding is pinned in the suite.

Quick Start

Terminal
# Clone the repo
git clone https://github.com/GodModeAI2025/skill-forge.git

# Copy into your skills folder (Cowork or OpenClaw)
mkdir -p ~/.skills/skills
cp -r skill-forge/ ~/.skills/skills/skill-forge/

# Check that the machinery works (271 tests, no API calls)
python3 -m pytest tests/ -q

# Auto mode: let it run overnight
"Use skill-forge to improve my linkedin-content skill"

# Guided mode: decide at every step
"Use skill-forge in guided mode to improve my humanizer skill"

# Generic mode: optimize any metric
"Use skill-forge to optimize train.py — metric: python train.py --eval"

Works with your platform

Skill Forge uses the standard SKILL.md format and runs wherever AI skills are supported.

Claude Cowork
OpenClaw
Any SKILL.md host