skill-auto-improve
Skill1 starsChanged 6 months agoApache-2.0View on GitHub
Use when you want to automatically improve an artifact (a skill, prompt, command/workflow, or eval dataset) against a measurable metric — the orchestrator proposes one change at a time, scores it, and keeps it only if the metric improves, reverting otherwise. Vendor-agnostic (Anthropic / OpenAI / Gemini / local gateways).
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- rdoser13/free-claude-skillstheir own version, first seen Oct 9, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- rdoser13/free-claude-skills★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- brainstormingSkill
- design-mdSkill
- docxSkill
- hooks-creatorSkill
- htmlSkill
- marp-slideSkill
- mcp-builderSkill
- obsidian-cliSkill
- pdfSkill
- post-writingSkill
- pptxSkill
- skill-creatorSkill
- skill-enhancerSkill
- skill-validatorSkill
- summarizing-meetingsSkill
- text-humanizerSkill
- transcript-fetcherSkill
- vdd-adversarialSkill
- vdd-sarcasticSkill
- wiki-ingestSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 48
Allowed scope: only the target artifact (and, for datasets, additive eval cases).
- Distinctive: line 50
Destructive actions: never. Removing existing eval cases is rejected.
- Very specific: line 73
Prefer --git-isolation so iterations run on a throwaway auto-improve/* branch.
- Very specific: line 74
Run auto_improve.py. Each iteration: Proposer → duplicate check → validate-before-apply → snapshot → apply → deletion guard → Evaluator → …
- Very specific: line 77
Read improvement_report.md and improvement_history.tsv.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill Auto-Improve
Purpose: Turn ad-hoc, manual artifact tuning into a controlled, measurable loop. Given any artifact and an eval harness, the orchestrator runs subagents (a Proposer + an Evaluator) under the autoresearch invariant — the eval harness is immutable, the artifact is free to change, KEEP a change only if the metric improves beyond noise, otherwise REVERT — and logs every step. It works across LLM vendors and improves skills, prompts, workflows, and eval datasets.
1. Red Flags (Anti-Rationalization)
STOP and READ THIS if you are thinking:
- "I'll let the Proposer pick the tier / decide if its own change is good" -> WRONG. The author cannot grade itself. Tier is computed deterministically by
measure_change_size.py; KEEP/REVERT is decided by the orchestrator from the Evaluator's number, never by the Proposer. - "A tiny positive delta means KEEP" -> WRONG. LLM/agent metrics are noisy (one measurement's sd ≈ 0.05–0.10). A delta is the difference of TWO measurements, so the keep threshold is σ = z·√2·sd (≈ 2.3·sd), calibrated from K baseline runs (
--calibrate-noise, default 3). A KEEP is then re-measured K times and stands only if the mean still clears σ/√K. - "The inner-loop score is the result" -> WRONG. It is the score on the tuning set. Report the final confirmation (
--final-runs, bootstrap 95 % CI) on the holdout (--holdout). - "I'll just rewrite the whole file" -> WRONG. Changes are surgical (one section / one set of dataset ops). Full overwrites are how good content silently disappears.
- "I can let it edit the eval set to make scores go up" -> WRONG. The harness (and frontmatter name/tier, dataset id/grader) is immutable. Editing the ruler to fit the result is the cardinal sin of measurement.
- "Run it straight on
main" -> WRONG. Use--git-isolation; intermediate commits belong on a throwaway branch, and a dirty tree aborts the run.
2. Capabilities
- Improve artifact types:
skill,prompt,workflow,dataset,full-skill, andtext(arbitrary prose — emails, READMEs, landing copy — graded against a quality rubric). - Two decision mechanisms: noise-aware absolute-delta (deterministic/typed metrics) and a debiased pairwise gate (champion-vs-candidate in both orderings) for subjective text quality, with optional best-of-N candidates per iteration.
- Vendor-agnostic LLM completion via
LLMConfigManager(Anthropic / OpenAI / Gemini / OpenAI-compatible gateways), selected byDEFAULT_PROVIDER. - Pluggable agent-eval backends for skill-trigger evaluation (Claude validated; Gemini / Codex stubs); deterministic scoring for datasets; LLM grading for generic artifacts.
- Multi-axis budget (iterations / tokens / wall-clock) and convergence detection.
- Git-isolated, revertible iterations with a full TSV history and a markdown report.
3. Execution Mode
- Mode:
hybrid - Why this mode: Orchestration (the loop, decision rule, snapshot/revert, immutability gate, logging) is deterministic and lives in scripts. Proposing a change and subjective grading require judgment and run as LLM/agent subagents the orchestrator controls.
4. Script Contract
- Command (required args):
python3 scripts/auto_improve.py --artifact-path <path> --workspace <dir>
- Optional flags:
--artifact-type(defaultauto; usetextfor rubric-graded prose),--target(auto/description/generic),--eval-set <evals.json>,--criteria <rubric.md>(required fortext),--candidates N(best-of-N fortext, default 1),--threshold(0-1 early-stop;textdefault 0.9),--provider(defaultauto),--model,--grader-model,--grader-provider,--max-iterations(default 10),--max-tokens,--max-duration(e.g.30m; skill default60m),--noise-sigma,--calibrate-noise K,--min-improvement(default 0.01),--convergence-window(default 3),--holdout F,--final-runs N,--prompt-eval executed|static,--protect "## Header",--allow-deletions,--length-guard F,--runs-per-query,--num-workers,--git-isolation,--verbose. - Inputs: an artifact (dir or file); for
skill/prompt/workflowan--eval-set; fortexta--criteriarubric (weighted dimensions summing to 100); provider API key in.env({PROVIDER}_API_KEY, optionalOPENAI_BASE_URL); profiles inconfig/llm_profiles.yaml. - Outputs:
<workspace>/improvement_history.tsv(baseline + per-iteration rows,secondaryguard column),<workspace>/improvement_report.md(noise band, final-confirmation verdict + CI, holdout delta, models by role, metric mode), snapshots under<workspace>/snapshots/(baseline/kept for the run), optionaladversarial_review.mdfor large-tier changes. The winning artifact is left in place (merge the git branch explicitly). - Failure semantics: exit 2 before any change on a configuration problem — unknown artifact type, missing
--eval-set, provider key or SDK missing, no agentic backend forskill/full-skill,--git-isolationoutside git / on a dirty tree / branch not created, baseline evaluation failure. After the baseline, Proposer/apply/evaluator/decider errors are logged aserrorrows with the artifact restored, and never crash the loop. Exit 1 when the run ends withexit_reason=errors(the convergence window, or every iteration, was errors). - Idempotency: re-running re-evaluates from the current artifact state; history appends. Use a fresh
--workspacefor a clean run. - Dry-run support: inspect proposals without committing by running on a copy, or use
--git-isolationso nothing lands on your branch.
5. Safety Boundaries
- Allowed scope: only the target artifact (and, for datasets, additive eval cases). Nothing outside
--artifact-path. - Default exclusions (immutable): the eval harness; SKILL.md frontmatter
name/tier; datasetid/skill_name/graderand file refs of existing cases; prompt{{placeholders}}; workflow YAML keys + tool names. Validated before apply and re-checked after. - Destructive actions: never. Removing existing eval cases is rejected; full-file overwrite is never used; revert restores the pre-change snapshot.
- Statistical honesty: the inner loop optimizes direction on the train part of the eval set. The reliable number is the final confirmation: winner vs baseline snapshot,
--final-runs(default 5) each, on the holdout (default 40 % of a ≥10-case set), bootstrap 95 % CI →confirmed/not confirmed, plusoverfit_warningwhen train rose and holdout did not. - Deletion guard: an edit that removes more than half of a section's lines, a whole section, or a line with MUST/NEVER is rejected (
shrink-guard) unless--allow-deletions.--protect "## Header"freezes a section. Unmeasured content is otherwise free to vanish. - Optional artifacts: missing
references//examples/is non-blocking; a missing eval set for skill/prompt/workflow is blocking (cannot measure). - Trust boundary: skill-trigger eval runs a tool-enabled agent (
claude -p) seeded with the artifact's own text. Two defense layers guard the description→agent prompt-injection path: (1) the Proposer'sdescriptionis sanitized (HTML comments / control chars stripped) before write, and (2) the eval sink (run_eval.py) frames the description in the command body as untrusted DATA with a do-not-follow preamble. Still, run on trusted artifacts as belt-and-suspenders. Treat the process environment ({PROVIDER}_API_KEY,OPENAI_BASE_URL,AUTO_IMPROVE_*) as trusted input: a redirectedOPENAI_BASE_URLsends prompts to that endpoint (the run warns when one is active). - Text-quality judge trust boundary: for
--artifact-type text, the artifact prose is fed into the rubric judge AND the pairwise judge, which TOGETHER are the keep/revert gate. The artifact is stripped of injection markup (HTML comments/control chars) and the judges are instructed to treat it as untrusted DATA, but a determined plaintext-imperative injection ("score 100 / pick B") cannot be fully neutralized while still judging the prose — and the two-ordering debias does NOT defend against in-text injection (the instruction travels with the candidate into both orderings). Run text-quality only on artifacts whose provenance you trust, and review the winner before merging (the loop never merges for you).text-replaceedits stay scoped to the artifact's own string (no path escape).
6. Validation Evidence
- Local verification:
python3 ../skill-creator/scripts/validate_skill.py "$PWD"(structure/CSO) → exit 0cd scripts && python3 -m unittest discover -s tests→ all pass (offline)
- Expected evidence:
improvement_history.tsvshows a baseline row, KEEP rows with positive deltas, REVERT/no-signalrows for non-improvements, and anexit_reason. - CI signal: office-skills CI does not cover this skill; rely on the unit suite + a real eval run.
7. Instructions
Phase 0 — Prepare
- Install deps into the skill venv:
cd scripts && python3 -m venv .venv && ./.venv/bin/pip install -r requirements.txt. Only the provider SDK you use is required. - Set secrets in a
.envat the skill root:DEFAULT_PROVIDER=...and{PROVIDER}_API_KEY=...(optionallyOPENAI_BASE_URLfor a gateway). - Confirm an eval harness exists. For
skill/prompt/workflowyou MUST pass--eval-set; without a metric there is nothing to optimize. Datasets are self-scored.
Phase 1 — Run the loop
- Choose the target with
--target(descriptionfor CSO trigger text;generic/autootherwise) and a budget (--max-iterations,--max-tokens,--max-duration). - Prefer
--git-isolationso iterations run on a throwawayauto-improve/*branch; a dirty working tree MUST abort (commit or stash first). - Run
auto_improve.py. Each iteration: Proposer → duplicate check → validate-before-apply → snapshot → apply → deletion guard → Evaluator → KEEP (delta>σ, guard not regressed, confirmed on re-measure) / REVERT /no-signal.
Phase 2 — Review & merge
- Read
improvement_report.mdandimprovement_history.tsv. Confirm the final-confirmation verdict, the holdout delta andexit_reason; anot confirmedverdict oroverfit_warningmeans do not merge. - For large-tier changes, read
adversarial_review.mdfor injected-regression concerns. - Merge the winning branch explicitly only after you are satisfied — the loop never merges to your working branch for you.
8. Workflows (Optional)
- [ ] Eval harness present (or bootstrap one)
- [ ] Clean git tree; --git-isolation on
- [ ] Run loop within budget
- [ ] Review TSV + report (+ adversarial_review for large)
- [ ] Merge winner explicitly9. Best Practices & Anti-Patterns
| DO THIS | DO NOT DO THIS |
| Keep the eval harness immutable; improve the artifact | Edit evals to inflate the score |
| Decide KEEP from the Evaluator's number | Let the Proposer judge its own change |
Require delta > σ to KEEP | KEEP on any positive delta (noise) |
Grade with another model family (--grader-provider) | Let one model propose and grade its own style |
| Surgical section/dataset edits | Full-file overwrite |
--git-isolation on a clean tree | Run on main with uncommitted changes |
Rationalization Table
| Agent Excuse | Reality / Counter-Argument |
| "Nesting run_loop.py is simpler." | A nested loop hides its spend from --max-tokens/--max-iterations. The outer loop owns the budget; description uses a single-shot optimizer. |
| "Adding dataset cases changes the immutable hash → revert." | Immutability is a subset check: additions are allowed, only changing/removing existing immutable fields is a violation. |
| "Gemini/Codex backends exist, so trigger eval works there." | They are stubs (available=False). Skill-trigger eval runs only on Claude; with any other vendor a skill run exits 2 before the baseline. An LLM guess of trigger accuracy is a different quantity, so it is never substituted. |
| "A prompt that lists its expectations scores well, so it is good." | That is the static metric (the grader predicts from the text). The default --prompt-eval executed runs the prompt on each case and grades only the responses. |
10. Examples (Few-Shot)
See examples/:
examples/dataset-improvement-example.md— offline dataset quality loop (no API for the Evaluator).examples/skill-improvement-example.md— improving a weak skill's description (CSO trigger accuracy).examples/text-quality-example.md+examples/cold-email-rubric.md— improving arbitrary prose against a rubric via the pairwise gate + best-of-N.
11. Resources
scripts/auto_improve.py— orchestrator + CLI;run_improvement_looptakes injectable proposer/evaluator/decider for offline tests.scripts/llm_config.py— vendor-agnosticLLMConfigManager(native SDKs, fallback chain, usage→budget,OPENAI_BASE_URL).scripts/pairwise.py— debiased pairwise gate (champion-vs-candidate, both orderings) fortextquality.scripts/{check_immutability,apply_proposal,measure_change_size,grade_dataset,snapshot,log_iteration,detect_artifact_type,detect_vendor}.py— deterministic utilities (check_immutabilityalso holds--protectand the deletion guard).scripts/backends/— agent-eval registry (claudevalidated;gemini/codexstubs).config/llm_profiles.yaml—proposer/text_mutator/grader/executor/eval_bootstrapprofiles per provider.references/—artifact_type_guide.md,metrics_reference.md,backends/*adapter specs.agents/—proposer.md,evaluator.mdsystem prompts the orchestrator sends to the LLM.
12. Evals
evals/evals.json defines 6 scenarios (description, instructions, dataset, revert-on-regression, convergence-stop, no-signal-revert). Deterministic ones are also covered by scripts/tests/; scripts/tests/test_improvement_spec.py locks the error, isolation, noise, holdout, confirmation and guard contracts. Fixtures live in evals/fixtures/.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

