optimize-loop

Run bounded iterations to improve a measurable metric in a git repository.

5|Updated May 2, 2026
One-click install
npx skills add https://github.com/vanducng/skills --skill optimize-loop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize-loop
Source: https://github.com/vanducng/skills/tree/main/skills/optimize-loop
Command: npx skills add https://github.com/vanducng/skills --skill optimize-loop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates autonomous improvement of a measurable metric by running a bounded sequence of iterations, committing each attempt, and automatically keeping or discarding changes based on a target metric.

Core Features & Use Cases

  • Bounded, iterative optimization with per-iteration commits for traceability.
  • Applies to metrics such as test coverage, bundle size, lint/type-errors, latency (p95), and LOC within software projects.
  • Use case: continuously improve a measurable quality until a defined goal is reached, while maintaining a git history of changes.

Quick Start

Define your Goal/Scope/Verify, then start the optimize-loop to run bounded iterations against your metric.

Frequently Asked Questions about optimize-loop

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

FAQPage Schema
How do I automate test coverage or bundle size optimization in my codebase?

To automate test coverage or bundle size optimization, you can run a bounded loop that iteratively applies changes, verifies the metric, and commits improvements. This autonomous loop keeps beneficial changes and discards regressions automatically.

What is an autonomous metric improvement loop and how does it work?

An autonomous metric improvement loop runs a bounded sequence of iterations against a defined metric. It executes a verify command to measure a numeric value, commits successful attempts, and uses a guard to validate that no regressions occur during the process.

Do I need a clean git repository to run iterative metric optimization?

Yes, you need a git repository with a clean working tree to run iterative metric optimization. This requirement ensures that the automated commit history accurately tracks only the changes generated by the optimization loop without conflicting with existing uncommitted work.

Can I use automated optimization loops to reduce p95 latency and lint errors?

Yes, you can use automated optimization loops to reduce p95 latency and lint errors. The process requires a verify command that prints a single numeric value, allowing the loop to measure, commit, and keep improvements for any quantifiable codebase metric.

What are the limitations of using bounded iterations for codebase metric optimization?

The main limitation of bounded iterations is that the loop stops after reaching a defined iteration limit, regardless of whether the target metric is fully achieved. Additionally, the process strictly requires a verify command that outputs a single numeric value to function correctly.

How do I set up a verification guard to prevent metric regressions during autonomous optimization?

To set up a verification guard, define an optional guard command alongside your verify command to validate changes before they are permanently committed. This ensures the autonomous optimization loop discards any iteration that causes a metric regression in your codebase.