Not loaded · from cap-evolve
Extracts learning signals from execution traces by separating good from bad rollouts, building a reflective dataset per failing task, and clustering failures by root-cause signature for actionable edits.
Claude Code won't load this skill
It ships in cap-evolve at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
A scalar reward says how much a candidate failed; it does not say why, and "why" is the only thing an editor can act on. Where RL back-propagates a scalar into weights, natural-language feedback back-propagates into prompt/tool/skill edits — and the richer it is, the larger the update extractable from a handful of rollouts.
{
"split": "val", "tag": "cand_003",
"reflective_dataset": [
{"task_id": "t12", "Inputs": "<what the task asked>",
"Generated Outputs": "<what the agent produced>",
"Feedback": "<the scorer's diagnosis>",
"Trajectory": "<path to this task's full trace>"}
],
"clusters": [
{"signature": "confirm write", "tasks": ["t12", "t19"], "score_lost": 1.6,
"tag": "BEHAVIORAL", "blast_radius": ["t3", "t7"]}
],
"kept_good": ["t1", "t4"]
}
scripts/run.py emits everything except tag (one of KNOWLEDGE, BEHAVIORAL,
DECISION / PERMISSION, CAPABILITY-GAP) and blast_radius, which it leaves null
because they need judgement — filling them in is the work below. kept_good is the
set the gate's no-regression check protects.
Not only zero-score tasks. Three kinds are real lost score and routinely missed: partial credit (scored e.g. 0.5 because one part of the action was wrong), communication / omission (the action happened but the required information was never reported or confirmed), and near-miss (≈0.7–0.9, one small correct change from a pass — the cheapest marginal gain per edit, easiest to overlook while staring at the zeros).
Separate always-failing (mean ≈ 0 — a root-cause fix) from flaky (0 < mean < 1 —
a consistency fix; find what the passing trials do and make it reliable). The reward
is the honest signal: a per-task Feedback line comes from the last trial and
can disagree with the graded mean.
The rollout record supplies the score and the feedback; the trajectory supplies the failure site, and the site is half of the cluster key. The runner owns the trace format, so never assume one — the location is asked for, not guessed:
adapter.trajectories(split) returns the directory (any structure,
any format). run.py --project DIR resolves it and attaches the path to each
entry as Trajectory; it never parses it. With no native store the pointer falls
back to the rollout record's own file, which core wrote../trajectories/. Read it there. scripts/ is not copied into
./guidance/diagnose/, so cluster by hand using the procedure below — it is the
same procedure the script runs.A cluster is ONE root cause, identified by a (failure-site, violated-expectation) pair: where the trajectory went wrong (the tool, field, or step the trace names) and which expectation was missed. Two failures belong to the same cluster when both halves agree — however differently the scorer phrased it, and whatever task-specific values it quoted. Derive the key like this:
failed, wrong,
missing, expected, invalid name that it failed, never why. Collapse
inflections (confirm / confirmed / confirmation are one token).narrated_without_action — the final message claims a state change happened
("… has been updated/cancelled/processed …") while no mutating tool call appears
anywhere in the trace. The agent treated its own completion signal, usually the
user's confirmation, as the action. A scorer words this exactly as it words a wrong
write, so the lexical key above cannot separate them and the optimizer ends up fixing
the arguments of a call that was never made. run.py therefore flags it from the
rollout (Rollout.tool_calls, or OpenAI-style tool_calls inside Rollout.trace)
and emits it as its own cluster, plus a per-task boolean in the reflective dataset.
Read-only tool names are recognised by their leading verb (get/list/search/…);
an adapter that knows better can mark a call {"mutates": true}. Nothing is flagged
when the rollout reports no tool calls at all — that is missing data, not evidence.
The fix this cluster calls for is structural, never a prose reminder: see
agent-optimize/references/tool-edit-lessons.md.
Two sanity checks on the result: one cluster per failing task means the signature is too fine and no generalizing edit is possible; one cluster spanning visibly different causes means it is too coarse — usually an unstripped preamble (step 1).
The tag says where the fix belongs. The lever itself is the selected capability's
business (./guidance/<cap>/SKILL.md); the tag tells it which kind of lever to reach
for, and its blast radius is the set of currently-passing tasks the fix would
change.
A cluster's value is the score it can recover minus the regression risk to its blast radius — which is why the radius is named per cluster and scoped to tasks concretely (ids, not "the same tool"), so the edit can be made to fire only on the failing condition. Then:
score_lost), biggest first — but do not let a small cluster whose
fix is STRUCTURAL sink under task count: a 2-task stall cracked by one new
mechanism can outweigh a many-task cluster of cosmetic misses;Write each diagnosis specific (the wrong call, the skipped step, the misread field — not "the answer was wrong"), causal (the decision that produced it, so the edit has a target), and general (the pattern, not the instance).
Some benchmarks copy ground truth or expected actions into the traces; when present
use them to pinpoint which action, argument, or value was expected — for
understanding only. Feedback that quotes the gold answer keeps the level at what
the right answer is instead of what class of mistake was made, and the optimizer
then memorizes the eval set (references/concepts.md has the full consequence).
python scripts/run.py --run-dir .capevolve/run_XXXX --tag seed \
--project .capevolve/project --split val
Run it on the current best candidate's rollouts each round, then tag, rank, and hand
the clusters to the algorithm's proposal prompt. --split train diagnoses train —
the honest learning surface when the gate scores val. --cluster first-words is the
old lexical key, kept for comparison only. The same script runs headlessly under
cap-evolve run / the orchestrate skill, which threads the run dir between phases.
references/concepts.md (~90 lines) — why a scalar reward is not enough, the
reflective dataset's provenance in GEPA, why clustering beats per-task patching,
the full consequence of a leaked gold answer, and the optimizer lineage with
sources. Load it for the why behind this procedure or a citation for it; the
procedure itself is complete above.meta.yaml (opens in a new tab)references/concepts.md (opens in a new tab)scripts/_bootstrap.py (opens in a new tab)scripts/abstract.py (opens in a new tab)scripts/build_tool_fixtures.py (opens in a new tab)scripts/check.py (opens in a new tab)scripts/cluster.py (opens in a new tab)scripts/run.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub skillberry-ai/cap-evolve --plugin cap-evolve22 skills in this plugin
/agent-optimizeFree-form optimization algorithm for agent orchestration mode: the conversational agent owns the whole search — reading a digest, proposing big coherent capability edits against failure-cluster hypotheses, probing only missing cells, promoting or pruning on a posterior, merging complementary branches, and sealing test once. Use when orchestration_mode is agent and algorithm_skill is agent-optimize. For a deterministic loop use hill-climb, gepa or skillopt instead./baselineEstablish the starting point. Use after implement-and-check and before any algorithm. Creates the run directory, freezes the seeded train/val/test split (written once), scores the unmodified seed capability on val, and records it as the candidate every algorithm must beat. Reports the remaining headroom so a saturated seed stops the run before it spends budget./blackboxThe Skillberry proxy intervention — put the optimized capability in the Skillberry Store and let the Skillberry Proxy-Agent (SPA) inject it into the agent's LLM calls, so the benchmark never sees skill files. Use when a capevolve.yaml sets `intervention: blackbox`, or when you need to provision, start, deploy to, stop or clean that stack./evaluateScore a candidate on a split with honest, variance-aware evaluation. Use whenever you need a number for a candidate (the algorithm calls it internally; you can also call it directly to inspect). Runs the target via the adapter for each task, scores each rollout, aggregates mean + standard error, and reports pass^k when trials > 1. Never touches the test split (that is finalize's sealed job)./evographDeprecated agent-mode algorithm (evo-graph port): a weakness-graph search that dispatched one solver agent per failure cluster and reverted a whole round on regression. Do not start new runs with it — its per-weakness fan-out is already `agent-optimize`'s sibling fan-out, done behind the honest val significance gate that evograph never applied, and everything else it did (failure clustering, rejected-edit memory, budget-aware fan-out, free-text stop condition) lives in `agent-optimize` + `phases/diagnose`. Use when reading or repairing an existing evograph run dir, or when writing the run-dir `wiki/` format the dashboard's Weakness-graph tab reads — and to see what to select instead: `agent-optimize` for agent-mode search, `hill-climb`, `gepa`, or `skillopt` for a deterministic loop./finalizeScore the best candidate on the held-out TEST split exactly once and seal the run. Use as the last evaluation step, after optimization stops. The run dir enforces the seal — a second finalize raises an error — so the headline number is produced once on data the optimizer never saw, the way an honest benchmark result must be.Other plugins' skills for the same job