Skip to content
Skillpedia
Prompts & LLMs31k Β· #9313

skill-optimizer

What it does

This skill improves the instructions in a skill file by testing candidate edits against a benchmark. It is for people who maintain AI skills and want measurable improvements.

When to use it

  • βœ“When you want to improve how well an existing skill performs against a benchmark.
  • βœ“When you need to create a benchmark file for a new skill.
  • βœ“When you switch to a different AI model and want to retune a skill.

Skill link

https://github.com/garrytan/gbrain/blob/master/plugin/skills/skill-optimizer/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/garrytan/gbrain/blob/master/plugin/skills/skill-optimizer/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œImprove my meeting summary skill by testing a few edits against the benchmark, and keep only the ones that clearly help.”

5 new skills a week. 1 minute to read.

How it works

The agent proposes candidate edits to the skill body and scores each one against a benchmark several times. It rewrites the skill only when a change clears a set margin, and it saves a version history.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Skill Optimizer

Self-evolving skill optimization. Treats SKILL.md as the trainable parameters of a frozen agent. Validation-gated, budget-capped, atomic-versioned.

Based on SkillOpt (arXiv 2605.23904, Microsoft Research, May 2026).

When to invoke this skill

The user wants to:

  • Improve an existing skill's execution quality against a benchmark
  • Bootstrap a benchmark file for a new skill
  • Re-tune a skill after switching target models

Iron Law

  • Validation gating is MANDATORY. Every candidate must clear median-of-3
    • epsilon=0.05 margin against the sel-set before SKILL.md gets rewritten.
  • Frontmatter mutation is FORBIDDEN. The optimizer only edits the body. Routing surface (triggers:, brain_first:) stays invariant.
  • Bundled skills require explicit opt-in AND an independent held-out set. Skills shipping with gbrain cannot be auto-mutated. To rewrite one in place the user passes BOTH --allow-mutate-bundled AND --held-out <path> with at least 5 benchmark-disjoint tasks; without the held-out set the run hard-refuses (exit 2). Drop --allow-mutate-bundled (or pass --no-mutate, the default for the dream-cycle phase) to write proposed.md for review instead β€” no held-out needed for review-only output.
  • Bootstrap output requires human review. Both --bootstrap-from-skill and --bootstrap-from-routing write a sentinel; you must review + STRENGTHEN the generated judges, delete the sentinel, and re-run with --bootstrap-reviewed before optimization can use the file.

The pipeline

gbrain skillopt <skill-name> [flags]
  β”‚
  β”œβ”€β”€ Pre-flight gates
  β”‚     β”œβ”€β”€ working tree clean (or --force)
  β”‚     β”œβ”€β”€ benchmark valid + D_sel >= 5 (D17)
  β”‚     β”œβ”€β”€ cost preflight (D3) β€” refuses over --max-cost-usd
  β”‚     └── per-skill DB lock (D14)
  β”‚
  β”œβ”€β”€ Baseline eval on D_sel (sets best_sel_score)
  β”‚
  β”œβ”€β”€ default: one rewrite of the body from a D_train forward pass,
  β”‚     accepted only through the same D12 validation gate
  β”œβ”€β”€ --loop (opt-in; has not beaten one-shot on benchmarks): for epoch in 1..N:
  β”‚     for step in 1..steps_per_epoch:
  β”‚       β”œβ”€β”€ forward pass: rollouts on D_train batch
  β”‚       β”œβ”€β”€ backward pass: reflect Γ— 2 (failures + successes per D7)
  β”‚       β”œβ”€β”€ rank + clip via LR cosine schedule
  β”‚       β”œβ”€β”€ apply edits (body-only per D5, tagged result per D9)
  β”‚       β”œβ”€β”€ validation gate: median-of-3 + epsilon=0.05 (D12)
  β”‚       └── if accept: commit via D8 history-intent-first
  β”‚     β”‚
  β”‚     └── slow update (D6) if no improvement this epoch
  β”‚
  └── Final test eval on D_test β†’ run receipt

Where your skills live

Plugin-bundled skills ship as a read-only snapshot; you cannot write a benchmark or optimization artifacts next to them. Run skillopt against your own writable skills directory: pass --skills-dir <path> (gbrain skillopt X --skills-dir ~/my-project/skills), or run from a workspace that contains a skills/ tree and the CLI auto-detects it. Every skills/X/... path below refers to that writable directory (your own authored skills, skillify-scaffolded skills, or a brain-resident skillpack), not the plugin snapshot.

Starting a benchmark from the skill itself (the common case)

The user will NOT hand-write a benchmark, and you shouldn't start from a blank file either. When the user says "make skill X better" and skills/X/skillopt-benchmark.jsonl doesn't exist, generate a starter from the SKILL.md directly:

  1. Generate the starter. Run:
    gbrain skillopt X --bootstrap-from-skill
    
    One LLM call reads skills/X/SKILL.md, infers what the skill produces and what "good" looks like, and writes ~15 tasks (each with rule judges) to skills/X/skillopt-benchmark.jsonl plus a # BOOTSTRAP_PENDING_REVIEW sentinel. No routing-eval.jsonl is needed. Tune the count with --bootstrap-tasks N (max 50).
  2. Review AND STRENGTHEN the judges. This is YOUR job and it is load-bearing. The generated rule checks are weak drafts β€” the model tends to emit generic contains, loose max_chars, or invented headings. Read each task, fix soft checks, add the must-haves the skill actually requires (real section names, real length ceilings, min_citations where sources are expected, tool_called/tool_not_called for tools the skill genuinely uses). A thin benchmark optimizes for a thin definition of quality β€” do not rubber-stamp.
  3. Delete the sentinel line (`# BOOTSTRAP_PENDING_RE
FAQ

Can it change the skill's triggers?

No. The routing part of the skill stays fixed, and only the body is edited.

Will it change built-in skills?

Only with explicit opt-in and a separate held-out test set. Otherwise it writes a proposal for review.

Does it need a benchmark?

Yes. Optimization is measured against a benchmark, and the skill can help build one.

Details

Original description by the author

Self-evolving skill optimization via SkillOpt-paper-grounded text-space optimizer.

repo: garrytan/gbrain

Popularity

GitHub stars
31k
Ranking position
#9313
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills