Optimize

Iteratively modify targets and select improvements using numeric metrics or LLM-as-judge evals.

1|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/davdunc/pai-framework --skill optimize-davdunc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Optimize
Source: https://github.com/davdunc/pai-framework/tree/main/skills/Optimize
Command: npx skills add https://github.com/davdunc/pai-framework --skill optimize-davdunc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates slow, manual trial-and-error when improving performance, quality, or outcomes by running an autonomous hill-climb loop that keeps changes that improve a measurable target and rejects failures.

Core Features & Use Cases

  • Metric-mode optimization: Improves a codebase using a user-supplied command that outputs a numeric metric to maximize or minimize.
  • Eval-mode optimization: Optimizes skills, prompts, agents, or text targets using LLM-as-judge binary evaluation criteria.
  • Guard-railed autonomous iteration: Iteratively modifies targets, measures results, reverts regressions, and repeats within a time or experiment budget.

Quick Start

Ask the optimizer to improve your target skill by running: /optimize --target "~/.claude/skills/Optimize" --max-experiments 10

Frequently Asked Questions about Optimize

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

FAQPage Schema
How do I automate prompt evaluation and iterative improvement for LLM agents?

Automate prompt evaluation using an LLM-as-judge binary eval mode that iteratively modifies targets, measures qualitative improvements, and reverts regressions within an experiment budget.

What is the best way to autonomously reduce code latency and optimize benchmark performance?

Autonomously reduce code latency by running a hill-climbing loop that modifies the codebase, executes metric commands to measure numeric targets, and selects only changes that yield improvements.

Can I use an autonomous loop to refine skills and text targets without manual trial-and-error?

Yes, you can eliminate manual trial-and-error by applying sandboxed target mutation that automatically applies verified improvements, rejects failures, or partially applies changes after verification.

Does autonomous code optimization work with custom benchmarking commands and numeric metrics?

Yes, metric-mode optimization accepts a user-supplied command that outputs a numeric metric to maximize or minimize, driving the autonomous iteration process to continuously improve the target.

How does hill-climbing optimization handle regressions when tuning performance targets?

Hill-climbing optimization handles regressions by automatically reverting modifications that fail to improve the measured target, ensuring only successful changes are kept within the time or experiment budget.

What are the limitations of using LLM-as-judge for qualitative refinement of prompts?

LLM-as-judge qualitative refinement requires generated binary evaluation criteria and operates within a sandboxed environment, limiting its scope to evaluating text targets rather than executing numeric metric commands.