optimization-loop

Runs a measured, bounded search to find the fastest correct variant of an operation.

Updated Aug 3, 2026
One-click install
npx skills add https://github.com/m-de-graaff/skills --skill optimization-loop-m-de-graaff
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: optimization-loop
Source: https://github.com/m-de-graaff/skills/tree/main/skills/optimization-loop
Command: npx skills add https://github.com/m-de-graaff/skills --skill optimization-loop-m-de-graaff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Unstructured performance tuning wastes time on guesses, promotes changes that break correctness, and cannot distinguish real wins from measurement noise. This Skill turns "make it faster" into a bounded, evidence-driven loop with a baseline, a correctness gate, and a stopping condition. ## Core Features & Use Cases - Bounded variant search: Requires a defined operation, correctness gate, single metric, baseline with noise floor, and budget before any tuning begins. - Profile-first workflow: Enforces bottleneck identification via profilers, timing, or flame graphs before generating one-hypothesis variants. - Run ledger and promotion gate: Records every variant including rejected ones, and only promotes changes that pass full correctness, reproduce their delta, and have an obvious rollback. - Use Case: A nightly import of 2M rows takes 120 seconds. Profile the stages, test batch-size and worker-count variants one variable at a time, reject a faster variant that fails correctness, and promote the winner with documented commands and numbers. ## Quick Start Ask the assistant to optimize the nightly data import job using the optimization loop, starting with a baseline measurement and a correctness gate.

Frequently Asked Questions about optimization-loop

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

FAQPage Schema
How do I optimize a slow process without breaking it?▼

Define the exact operation, a correctness gate command, one metric, and a baseline with its noise floor before changing anything. Then test one-hypothesis variants on identical input, reject any that fail correctness, and promote only a reproduced winner with rollback.

How to tell if a performance improvement is real or just noise?▼

Measure the baseline multiple times to establish its noise floor, then compare variants against that floor. A delta inside the noise floor is not a result, and a one-off fast run must be reproduced or explained by a mechanism that predicts the win.

When should I stop tuning parameters in an optimization search?▼

Stop when improvement falls inside the noise floor, correctness starts failing, the budget of variants or time is spent, or two consecutive rounds produce nothing. Report the result as the best measured safe variant, not the optimum.

Why profile before trying optimization variants?▼

Optimizing something that is not the bottleneck cannot help, and Amdahl's law caps the possible gain. Profiling shows which stage dominates runtime so each variant carries a hypothesis about the measured stage it targets.

What are the limits of benchmark-based performance tuning?▼

Tuning against the same data you measure on overfits parameters to that set, and unrealistic benchmarks mislead because cache behavior changes at real data sizes. Keep a holdout dataset and validate winners under production-like conditions.