skill-optimizer

skill-optimizer is a skill for Claude Code, Codex from cynthiajones34/GBrain. It costs 19 tokens per session (2,366 once invoked), scanned A, a copy of skill-optimizer, MIT.

A skill-tuning tool that improves an existing agent skill by testing changes against a benchmark, which is a set of tasks used to measure quality.

In plain words
What is it for?
Use it to improve a skill's performance, create a benchmark for a new skill, or retune a skill for a different AI model.
Why use it?
It helps identify whether edits genuinely improve results before changing the skill. It also limits unsafe or unverified changes.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for gbrain. Also seen: built for gbrain.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/cynthiajones34/gbrain/skill-optimizer
Any agent
npx skills add cynthiajones34/GBrain --skill skill-optimizer
Clone the repo
git clone --depth 1 https://github.com/cynthiajones34/GBrain

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for skill-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/cynthiajones34/gbrain/skill-optimizer.svg)](https://agentmods.dev/skills/cynthiajones34/gbrain/skill-optimizer)
Your own site
<a href="https://agentmods.dev/skills/cynthiajones34/gbrain/skill-optimizer"><img src="https://agentmods.dev/badge/skills/cynthiajones34/gbrain/skill-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,366 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 91% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00019 $0.02366
Opus 5 $0.00010 $0.01183
Sonnet 5 $0.00004 $0.00473
Haiku 4.5 $0.00002 $0.00237

Measured 5d ago against content hash ba3028c7351d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

skill-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

91% identical to skill-optimizer — 17 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/skill-optimizer/SKILL.md · 189 lines

How it starts

The opening of the file, as written. The whole thing — 189 lines — stays where its author put it; the contents beside it link to each section on 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)
  │
  ├── 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

Read the full file on GitHub · 189 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 189 lines · 19 tokens per session scan A ba3028c7351d

Subscribe to this mod's changes

skill-optimizer is a skill published in the GitHub repository cynthiajones34/GBrain (0 stars, last pushed 29d ago), licensed MIT. It adds 19 tokens to every session and 2,366 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to skill-optimizer, differing in 17 lines, and is treated as a copy.