optimize

Runs iterative measurement-driven performance optimization for code, containers, LLM hyperparameters, and build pipelines.

2|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/DoctorMozg/claude-pipelines --skill optimize-doctormozg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize
Source: https://github.com/DoctorMozg/claude-pipelines/tree/main/plugins/mz-dev-pipe/skills/optimize
Command: npx skills add https://github.com/DoctorMozg/claude-pipelines --skill optimize-doctormozg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Performance tuning often relies on intuition, producing unverified speedup claims and changes that regress behavior. This Skill replaces guesswork with a scientific loop: it establishes a trustworthy baseline, profiles the dominant bottleneck, generates falsifiable hypotheses, and banks only changes a benchmark proves faster and a correctness check proves safe. ## Core Features & Use Cases - Measurement-first pipeline: No optimization runs before a reproducible baseline exists; every speedup number comes from a deterministic measurement harness, never from model narration. - Domain-generic contracts: A per-run Optimization Contract defines the metric, measurement command, correctness command, and allowed change space, so the same pipeline optimizes source code, container images, LLM hyperparameters, build pipelines, or composite systems. - Gated iterative loop: Approval gates guard the contract, hypothesis backlog, and each banked change, with hard blocks on noisy benchmarks (CV ceiling) and sub-threshold gains. - Use Case: Ask to make a tokenizer 2x faster with p95 under 120ms — the skill profiles the hotspot, ranks Amdahl-bounded hypotheses, tests four diversified candidate implementations in isolated worktrees, and banks only measured winners. ## Quick Start Ask the assistant to optimize a specific target with a measurable goal, for example: optimize src/parser/tokenizer.py to be 2x faster with p95 latency under 120ms.

Frequently Asked Questions about optimize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize code performance with a measurable goal?

Invoke the skill with a target, metric, and goal, such as a file path plus a p95 latency target. It establishes a baseline benchmark, profiles the dominant bottleneck, tests candidate changes, and banks only those a measurement harness proves faster and correct.

What kinds of targets can this performance optimization pipeline handle?

It handles source code, container images and services, LLM hyperparameters, build pipelines, and composite system targets spanning several domains. The methodology is identical across domains; only the measurement command, profiling technique, and change space differ per run.

When should I not use the optimize skill?

Do not use it for removing dead code or unused imports (use cleanup), fixing correctness bugs (use debug), or meeting general quality criteria (use polish). It also cannot run without a measurable metric and goal.

Why does the optimization run stop with BENCHMARK UNRELIABLE?

The baseline measurement's coefficient of variation exceeded the contract's noise ceiling, meaning the benchmark cannot separate a real speedup from host jitter. Quiesce the measurement host by closing background load, or raise the noise ceiling through the contract approval gate.

How does the pipeline verify a speedup is real and safe?

Every candidate is measured by a dedicated harness with warmup and repeated runs, must clear a 10% significance threshold and noise ceiling, and must pass the correctness command. Winners are re-measured in the working tree and require user sign-off before being banked.