# Skill Optimizer

SkillOpt-flavored offline training loop for any SKILL.md.

- Repository: https://github.com/rohitg00/pro-workflow (2940 stars)
- Category: AI and agents
- License: see repository
- Last updated: 2026-09-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add rohitg00/pro-workflow --skill skill-optimizer -g -a claude-code -y`
Codex: `npx skills add rohitg00/pro-workflow --skill skill-optimizer -g -a codex -y`
Cursor: `npx skills add rohitg00/pro-workflow --skill skill-optimizer -g -a cursor -y`
Gemini CLI: `npx skills add rohitg00/pro-workflow --skill skill-optimizer -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add rohitg00/pro-workflow`

## Description

SkillOpt-flavored offline training loop for any SKILL.md. Treats accumulated learn-rule corrections as training trajectories, proposes bounded patches via an optimizer LLM, gates each candidate against a held-out validation set built from the user's own past corrections, and ships only candidates that demonstrably improve the score. Inspired by Microsoft SkillOpt's ReflACT pipeline (rollout → reflect → aggregate → select → update → evaluate) adapted to pro-workflow's SQLite store. Use when a skill has accumulated 8+ learn-rule rows and the user wants the skill itself to get better, not just longer.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Skill Optimizer

Train an existing SKILL.md the way a deep-learning optimizer trains weights: via rollouts, gradient-like reflections, validation-gated acceptance. No model retraining; only the skill markdown changes.

## When to use

Use this skill when:
- A pro-workflow skill has accumulated 8+ learn-rule rows for it
- The user reports the skill is "getting bloated" or "rules keep being repeated"
- The user wants offline, budget-capped improvement over multiple sessions

Do not use when:
- Skill has fewer than 8 trajectories (nothing to learn from)
- The user wants real-time edits (this is offline, single-shot)
- No key has been explicitly configured for the selected provider

## Architecture (mirrors SkillOpt's six-stage loop)

```text
rollout      pull recent learnings from SQLite (existing learn-rule rows)
reflect      optimizer LLM analyzes a minibatch, proposes add/delete/replace patches
aggregate    vote-merge patches across minibatches
select       clip by LR budget (default: 3 adds, 2 deletes, 3 replaces per step)
update       apply selected patches to a candidate skill content
evaluate     evaluator LLM scores candidate against held-out validation items
gate         accept candidate only if weighted score >= current + acceptThreshold
slow update  at epoch boundary, consolidate accepted edits into a coherent rewrite
```

Failed candidates are stored in a rejection buffer and fed back to the next reflect step so the optimizer doesn't propose the same patch twice.

## Run it

In a plugin session, use the `providers` MCP server's `run_provider_task` tool with `task: "optimizer"` and `args: ["--slug", "<slug>", "--budget-usd", "0.50"]`. Keys come from the plugin configuration dialog. Standalone CLI installations use explicit `PRO_WORKFLOW_*_API_KEY` variables. See [provider configuration](../../references/provider-configuration.md); never request keys in chat or retrieve existing machine credentials.

```bash
/skill-optimize <slug> [options]
```

The rest: https://github.com/rohitg00/pro-workflow/blob/HEAD/skills/skill-optimizer/SKILL.md
