Optimize

Iteratively adjust code or AI models using metrics or LLM-as-judge evaluations.

2|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/ylxai/hafiportrait-saas --skill optimize-ylxai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Optimize
Source: https://github.com/ylxai/hafiportrait-saas/tree/main/.kiro/skills/Optimize
Command: npx skills add https://github.com/ylxai/hafiportrait-saas --skill optimize-ylxai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

The Optimize skill unit helps in automatically optimizing various targets like code, AI models, and tasks. It allows users to either work with quantitative metrics (e.g., performance score, bundle size) or qualitative assessments based on binary evals using an LLM-as-judge system.

Core Features & Use Cases

  • Autonomous Optimization Loop: Runs optimization against any target (code, AI, etc.) by adjusting parameters, measuring outcomes, and learning from improvements.
  • Metric Mode: Automate performance tuning using specific metrics and measurements (e.g., Lighthouse scores for web pages).
  • Eval Mode: Use the LLM's judgment for evaluating skills, prompts, agents, and any text target with custom criteria and test inputs.
  • Use Case: Improve a website's load time or the quality of a machine learning model through systematic testing and iterative optimization.

Quick Start

To run the Optimize skill for optimizing performance, type:

/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

Frequently Asked Questions about Optimize

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

FAQPage Schema
How can I automate web performance tuning using Lighthouse scores?

You can automate web performance tuning by running the optimization loop in metric mode, configuring it to measure Lighthouse scores and iteratively adjust source files to improve the results.

What is LLM-as-judge evaluation for prompt and skill optimization?

LLM-as-judge evaluation is a qualitative approach where an AI model assesses text outputs against custom criteria and test inputs, using binary judgments to iteratively improve prompts and skills.

How do I set up autonomous machine learning optimization for specific metrics?

You set up autonomous machine learning optimization by defining a target metric and measurement command, then allowing the system to iteratively modify model parameters and evaluate outcomes to maximize performance.

Can I optimize code autonomously based on both quantitative metrics and qualitative feedback?

Yes, you can optimize code autonomously using either metric mode for quantitative measurements like bundle size or eval mode for qualitative feedback using LLM-as-judge binary evaluations.

What is the best way to iteratively improve an AI agent's task performance?

The best way to iteratively improve AI agent performance is through an autonomous optimization loop that adjusts parameters, measures outcomes via custom eval criteria, and learns from successive improvements.

Are there limitations when using autonomous optimization for web performance tuning?

A primary limitation is the dependency on the defined measurement budget and the accuracy of your extraction commands; the autonomous optimization loop requires precise metric extraction to function correctly.