Skip to content
Skills Library
AI & agents · Automation

Optimize

/Optimize

Autonomous optimization loop — hill-climb any target. Code with metrics, or skills/prompts/agents with LLM-as-judge. USE WHEN optimize, hill climb, improve metric, reduce latency, optimize skill, optimize prompt, eval mode.

Repository
LifeOS ↗
Licence
MIT
Last repository change
03.09.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
3
Deprecation

No signals detected. Repository changed on 03.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Autonomous optimization loop — hill-climb any target. Code with metrics, or skills/prompts/agents with LLM-as-judge. USE WHEN optimize, hill climb, improve metric, reduce latency, optimize skill, optimize prompt, eval mode.

Original author description

Autonomous optimization loop — hill-climb any target. Code with metrics, or skills/prompts/agents with LLM-as-judge. USE WHEN optimize, hill climb, improve metric, reduce latency, optimize skill, optimize prompt, eval mode.

How it works

  1. What It Does
  2. The Problem
  3. How It Works
  4. Invocation
  5. What Happens
  6. Arguments — Metric Mode
  7. Arguments — Eval Mode
  8. Shared Arguments
  9. Algorithm Integration
  10. Examples
Original SKILL.md headings · 175 lines, 1,094 words
SKILL.md preview
---
name: Optimize
version: 1.0.12
description: "Autonomous optimization loop — hill-climb any target. Code with metrics, or skills/prompts/agents with LLM-as-judge. USE WHEN optimize, hill climb, improve metric, reduce latency, optimize skill, optimize prompt, eval mode."
disable-model-invocation: true
---

# /optimize — Autonomous Optimization v2

## What It Does

Runs an autonomous optimization loop against any target. The agent modifies the target, measures the result, keeps improvements, discards failures, and repeats until it stops climbing. Two modes: metric mode for code targets that produce a number (latency, bundle size), and eval mode for skills, prompts, or agents judged by LLM-as-judge binary evals.

## The Problem

Tuning a thing for a measurable outcome is slow, boring, manual work. You change a file, run the measurement, eyeball whether it got better, keep or revert, then do it again — dozens of times. People give up after a few rounds and settle for "good enough" far short of the real ceiling. The targets without a clean number (a skill's quality, a prompt's effectiveness) are worse: there's no easy way to tell if a change actually helped. This skill runs that whole loop for you and only keeps changes that measurably win.

## How It Works

Two modes drive the same hill-climb loop:

- **Metric mode** — code targets with a shell command that produces a number (the original).
- **Eval mode** — skills, prompts, agents, or any text target judged by LLM-as-judge binary evals.

Inspired by Karpathy's [autoresearch](https://github.com/karpathy/autoresearch) and extended with LLM-as-judge evaluation.

## Invocation

### Metric Mode (code targets)

```
/optimize --metric "lighthouse_score" --higher-is-better \
  --measure "npx lighthouse http://localhost:3000 --output=json" \
  --extract "jq '.categories.performance.score * 100' lighthouse.json" \
  --files "src/**/*.tsx,src/**/*.css" \
  --budget 120

/optimize --resume        # Resume a previous optimization loop
/optimize --status        # Show results summary from last/current run
```

### Eval Mode (skill/prompt/agent targets)

```
/optimize --target "~/.claude/skills/ExtractWisdom"
/optimize --target "~/.claude/skills/Research/Workflows/QuickResearch.md"
/optimize --target "prompts/my-prompt.md"
/optimize --target "~/.claude/skills/ExtractWisdom" --max-experiments 20
```

In eval mode, the system automatically:
1. Detects the target type (skill, prompt, agent, code, function)
2. Reads the target to understand its purpose and constraints
3. Generates 3-6 binary eval criteria and 3-5 test inputs
4. Presents criteria + inputs for your approval before starting
5. Runs the optimization loop using LLM-as-judge scoring
6. Presents a recommendation (apply/reject/partial) when done

## What Happens

This skill drives the LifeOS Algorithm as an autonomous mutation loop:

1. **OBSERVE** — Define or auto-detect the target, set eval_mode
2. **THINK** — Analyze codebase/skill, generate hypothesis queue
3. **PLAN** — Prioritize hypotheses by expected impact
4. **BUILD** — Phase 0: TARGET ANALYSIS (see `optimize-loop.md`)
   - Detect target type, auto-generate eval criteria (eval mode), set up sandbox, baseline
5. **EXECUTE** — The autonomous loop (`optimize-loop.md`):
   - Hypothesize → Modify target → Measure (metric or eval) → Keep/Revert → Repeat
   - Metric mode: ~12 experiments/hour (at 5-min budget)
   - Eval mode: ~6-8 experiments/hour (multi-run judging is slower)
6. **VERIFY** — Phase 9: RECOMMEND — diff, summary, apply/reject/partial options
7. **LEARN** — Phase 10: EXTRACT LEARNINGS — what worked, what didn't, structured insights

## Arguments — Metric Mode

| Argument | Required | Default | Description |
|----------|----------|---------|-------------|
| `--metric NAME` | yes | | Human-readable metric name |
| `--measure COMMAND` | yes | | Shell command that produces the metric |
| `--files GLOB` | yes | | Files the agent may modify (comma-separated) |
| `--higher-is-better` | | (default) | Higher metric values are better |
| `--lower-is-better` | | | Lower metric values are better |
| `--extract COMMAND` | | Last number in stdout | Extract metric from output |
| `--budget SECONDS` | | 300 | Time budget per experiment |
| `--target VALUE` | | none | Stop when metric reaches this value |
| `--max-experiments N` | | none | Stop after N experiments |
| `--locked GLOB` | | none | Files the agent must NOT modify |
| `--constraints TEXT` | | none | Additional rules (e.g., "tests must pass") |

## Arguments — Eval Mode

| Argument | Required | Default | Description |
|----------|----------|---------|-------------|
| `--target PATH` | yes | | Path to skill directory, prompt file, or agent definition |
| `--max-experiments N` | | none | Stop after N experiments |
| `--runs N` | | 3 | Runs per experiment (more = more reliable, slower) |
| `--criteria "Q1" "Q2"` | | auto-generated | Override auto-generated eval criteria |
| `--inputs "I1" "I2"` | | auto-generated | Override auto-generated test inputs |
| `--budget SECONDS` | | 300 | Time budget per experiment |

## Shared Arguments

| Argument | Description |
|----------|-------------|
| `--resume` | Resume a previous optimization run |
| `--status` | Show results summary |

## Algorithm Integration

When `/optimize` is invoked, the eval_mode is set based on arguments (`mode:` is retired — never write it to frontmatter):

- `--measure` provided → `eval_mode: metric` (git branch sandbox)
- `--target` provided → `eval_mode: eval` (directory sandbox)

ISC criteria become **guard rails** — assertions that must hold true across ALL experiments. Guard rails must REMAIN satisfied perpetually. A violation triggers automatic revert regardless of score improvement.

**Reference files:**
- `~/.claude/LIFEOS/ALGORITHM/optimize-loop.md` — the full loop protocol
- `~/.claude/LIFEOS/ALGORITHM/eval-guide.md` — how to write good eval criteria
- `~/.claude/LIFEOS/ALGORITHM/archive/target-types.md` — target detection and ISC generation

## Examples

### Metric Mode

**Optimize page load time:**
```
/optimize --metric "lighthouse_perf" --higher-is-better \
  --measure "npx lighthouse http://localhost:3000 --output=json --output-path=lh.json" \
  --extract "jq '.categories.performance.score * 100' lh.json" \
  --files "src/**/*.tsx,src/**/*.css" \
  --target 95 --budget 120
```

**Optimize bundle size:**
```
/optimize --metric "bundle_bytes" --lower-is-better \
  --measure "bun run build 2>&1 && du -sb dist/ | cut -f1" \
  --files "src/**/*.ts" \
  --constraints "all tests must pass"
```

**ML training (Karpathy-style):**
```
/optimize --metric "val_bpb" --lower-is-better \
  --measure "uv run train.py > run.log 2>&1 && grep '^val_bpb:' run.log | cut -d' ' -f2" \
  --files "train.py" \
  --locked "prepare.py" \
  --budget 300
```

### Eval Mode

**Optimize a skill's Extract workflow:**
```
/optimize --target "~/.claude/skills/ExtractWisdom" --max-experiments 15
```

**Optimize a standalone prompt:**
```
/optimize --target "prompts/summarize-article.md" --runs 5
```

**Optimize with custom criteria:**
```
/optimize --target "~/.claude/skills/Research/Workflows/QuickResearch.md" \
  --criteria "Does the output contain specific facts with sources?" \
            "Is the output structured with clear sections?" \
            "Does the output avoid generic filler?" \
  --inputs "research quantum computing breakthroughs 2025" \
           "quick research on supply chain security" \
           "find recent developments in AI agents"
```

## Gotchas

- **Hill-climbing can get stuck in local optima.** If score plateaus, consider resetting with different initial conditions.
- **Eval mode vs metric mode:** Use metric mode for quantifiable targets (latency, size). Use eval mode for qualitative targets (skill quality, prompt effectiveness).
- **Regression tolerance prevents catastrophic changes.** Don't set it to 0 — some regression in secondary metrics is acceptable if primary metric improves significantly.

Versions

RepositoryScoreLicence
This page · danielmiessler/LifeOS95MIT
flavien-ia/hypervibe-craft100Apache-2.0
marcel-bich/marcel-bich-claude-marketplace100MIT
joris887/exosuit100MIT
tmih06/ompig-slim100MIT
gosuda/dalcom-skills100Apache-2.0
wwylon/devkit100MIT
precedentlabs/skill-library100MIT
sebbsssss/optimize-skill100MIT

Database snapshot: 13.11.2026 · package version 64de7f806557 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100hill-climb
    Use when the user wants to hill climb, optimize something against a number, run autoresearch, or keep improving code, tests or a prompt unattended. Agrees one measurable goal, proves the scorer cannot be gamed, then keeps only measured improvements.
  • 100hill-climb
    Disciplined improve-measure-keep-or-revert loop for any kind of work. Use whenever the user says "hill-climb this", "keep improving X until...", "optimize", "make it faster/smaller/better and prove it", "run experiments overnight", "autoresearch", or wants something improved…
  • 90evals:hill-climb
    Hill-climb a skill, agent, rule, or CLAUDE.md against its eval suite. Use when changing one to raise an eval score, when building or readying the suite a climb runs on, when judging whether a score change beat noise, or when testing whether an instruction still earns its tokens.
  • 100hill-climb
    Score any artifact against a rubric with a blind, multi-provider jury (programmatic checks first, then the council skill as judges) and, when asked, keep improving it round after round until every judge rates every category at or above a target and above best-in-class…
  • 90prompting:hill-climb
    Hill-climb a skill, agent, rule, or CLAUDE.md against its eval suite. Use when changing one to raise an eval score, when judging whether a score change beat noise, or when testing whether an instruction still earns its tokens.
  • 95HillClimb
    Improves anything in LifeOS (a skill, workflow, eval, ISA, prompt, rule or code metric) by experiment: finds its real misses in Errata, Assay and its ISA, draws changes from varied proposers, keeps only what held-out measurement supports until plateau, lands each catch as a…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.