prompt-optimize

Iteratively refine prompts against custom evaluation metrics.

150|19|Updated Jun 15, 2026
One-click install
npx skills add https://github.com/gaasher/Agent-Loop-Skills --skill prompt-optimize-gaasher
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-optimize
Source: https://github.com/gaasher/Agent-Loop-Skills/tree/main/loops/prompt-optimize
Command: npx skills add https://github.com/gaasher/Agent-Loop-Skills --skill prompt-optimize-gaasher

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automatically refines user-provided prompts for scoring systems, optimizing the prompts to increase their performance against specific metrics.

Core Features & Use Cases

  • Iterative Optimization: Proposes and applies one quality edit to the prompt per iteration.
  • Score Improvement: Only keeps edits that increase the evaluation metric (score).
  • Use Case: Improve the accuracy of a task-specific prompt used with a custom scoring system, such as enhancing code quality with automated feedback.

Quick Start

Run the 'prompt-optimize' skill on your prompt file with your evaluation command: 'prompt-optimize -p my-prompt.txt -e my-eval-command'

Frequently Asked Questions about prompt-optimize

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

FAQPage Schema
How do I automatically refine and improve prompts for a custom scoring system?

Automated prompt refinement works by iteratively applying single quality edits to your prompt file and retaining them only if they increase the evaluation score. You need a prompt file and an evaluation command to measure performance against your custom metrics.

What do I need to set up before running prompt optimization iterations?

You need a prompt file to optimize and a custom evaluation command that outputs a score. This evaluation command acts as the sole source of feedback, while objective, target score, and iteration budget are optional settings.

Can I use this iterative prompt optimization without a custom evaluation command?

No, this prompt optimization requires an evaluation command as the sole source of feedback. Without it, the system cannot measure performance improvement or decide which prompt edits to keep during iteration.

How does the prompt refinement mechanism decide which edits to keep?

Prompt refinement proposes and applies one quality edit per iteration. It evaluates the updated prompt using your custom scoring command and only keeps the edit if it strictly increases the evaluation metric.

Are there limitations to using automated prompt scoring and refinement for evaluation?

The main limitation is its strict dependency on your custom evaluation command's accuracy. It optimizes solely for the score returned by that command, meaning any blind spots or biases in your evaluation logic will directly impact the refined prompt.