ApertureOscillation
3-pass scope oscillation that holds a question constant while shifting zoom — narrow/tactical, wide/strategic, then synthesis — to surface design tensions,…
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.
$ npx -y skills add danielmiessler/personal_ai_infrastructure --skill Optimize --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/OptimizeContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
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
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.
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.
Two modes drive the same hill-climb loop:
Inspired by Karpathy's [autoresearch](https://github.com/karpathy/autoresearch) and extended with LLM-as-judge evaluation.
/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
/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
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`)
5. **EXECUTE** — The autonomous loop (`optimize-loop.md`):
6. **VERIFY** — Phase 9: RECOMMEND — diff, summary, apply/reject/partial options 7. **LEARN** — Phase 10: EXTRACT LEARNINGS — what worked, what didn't, structured insights
| 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") |
| 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 |
| Argument | Description | |----------|-------------| | `--resume` | Resume a previous optimization run | | `--status` | Show results summary |
When `/optimize` is invoked, the eval_mode is set based on arguments (`mode:` is retired — never write it to frontmatter):
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:**
⛰️ The Life Operating System — an intent engineering platform that moves you from your current state to your ideal state, in life and work.
Repo: danielmiessler/personal_ai_infrastructure
3-pass scope oscillation that holds a question constant while shifting zoom — narrow/tactical, wide/strategic, then synthesis — to surface design tensions,…
Curated aphorism collection with CRUD — content-based matching, themed search, thinker research, DB maintenance. Quotes organized by author/theme/context/usage…
Scrapes social platforms, business data, and e-commerce via Apify actors — Instagram, LinkedIn, TikTok, YouTube, Facebook, Google Maps, Amazon, and web crawls…
Search and retrieve arXiv academic papers by topic, category, or paper ID — with AlphaXiv-enriched AI-generated overviews. Uses arXiv Atom API across…
Static visual content across 20+ formats — diagrams, mermaid, infographics, D3 dashboards, comics, icons, wallpaper — via Nano Banana Pro (default), Nano…
AI audio editing pipeline: Whisper word-level transcription → Claude segment classification (KEEP/CUT_FILLER/CUT_FALSE_START/CUT_STUTTER/CUT_DEAD_AIR) → ffmpeg…