Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/gaasher/agent-loop-skills/prompt-optimizenpx skills add gaasher/Agent-Loop-Skills --skill prompt-optimizegit clone --depth 1 https://github.com/gaasher/Agent-Loop-SkillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/gaasher/agent-loop-skills/prompt-optimize)<a href="https://agentmods.dev/skills/gaasher/agent-loop-skills/prompt-optimize"><img src="https://agentmods.dev/badge/skills/gaasher/agent-loop-skills/prompt-optimize.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00166 | $0.01985 |
| Opus 5 | $0.00083 | $0.00992 |
| Sonnet 5 | $0.00033 | $0.00397 |
| Haiku 4.5 | $0.00017 | $0.00198 |
Grade A, and why
prompt-optimize scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Prompt Optimize Loop
An evolutionary optimizer for a prompt (OpenEvolve / AlphaEvolve-style). The artifact is a prompt that feeds the user's system; the feedback signal is a scalar metric printed by the user's own evaluation command. Each iteration proposes one quality-focused edit, re-runs the eval, and keeps the edit only if the metric improves — evolving the prompt toward higher scores. The eval is a black-box oracle the loop runs but never edits, so the optimization tracks what actually matters rather than gaming a number.
When to use
Use this when the user has a prompt and a command that scores the system using it, and wants the prompt improved to raise that score. Default to diagnosing the prompt's biggest current weakness each round and applying the one operator that addresses it; if the eval feedback points elsewhere, follow the feedback. Not for authoring a prompt from nothing, tuning weights/hyperparameters, or making a single manual edit with no score to compare against.
Setup
Resolve bindings interactively. If loop.run.yaml exists in the working dir, load it, confirm the
values in one line, and skip to the loop. Otherwise: on Claude Code (the AskUserQuestion tool is
available) infer a likely value for each binding and present it as the recommended option; on other
hosts ask each as a quoted plain-text prompt. Then write loop.run.yaml (format:
examples/run.example.yaml) and confirm the values before creating any other files.
| binding | meaning | default | how to infer |
|---|---|---|---|
<prompt_file> |
the prompt to optimize — the artifact the loop evolves | — | scan the working dir for the prompt/template file the eval reads |
<eval_cmd> |
required. Command that scores the current <prompt_file>; prints the metric (see output convention below). Treated as a black box — never edited |
— | ask the user; look for eval/score/bench scripts |
<objective> |
maximize or minimize, plus one line on what the metric measures |
maximize |
ask the user |
<target> |
optional score at which to stop early | — | ask the user; else leave unbound |
<sandbox_root> |
where prompt snapshots + ledger live | ./sandbox |
— |
<budget> |
max iterations | 10 | — |
<patience> |
stop after N consecutive non-improving iterations (plateau) | 3 | — |
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 132 lines · 166 tokens per session scan A c2c9cd2d904e
prompt-optimize is a skill published in the GitHub repository gaasher/Agent-Loop-Skills (163 stars, last pushed 2mo ago), licensed MIT. It adds 166 tokens to every session and 1,985 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
enhance-prompt
Transforms vague UI ideas into polished, Stitch-optimized prompts. Enhances specificity, adds UI/UX keywords, injects design system context, and structures output for better generation results.
prompt-optimization
Improve a prompt on the evaluations workbench through a measured loop. Score the baseline first, then duplicate the target column, form a hypothesis from failing rows, edit the copy's prompt draft, run, compare pass rate and cost, and repeat until the numbers hold. Use when the user asks to optimize or improve a…
prompt-engineer
Writes, refactors, and evaluates prompts for LLMs — generating optimized prompt templates, structured output schemas, evaluation rubrics, and test suites. Use when designing prompts for new LLM applications, refactoring existing prompts for better accuracy or token efficiency, implementing chain-of-thought or few-shot…
trend-analysis
基于多维度数据进行分级评估与趋势预测,通过设定差异化增长率计算预测值,并生成对比可视化图表,适用于绩效评估、目标设定等场景。.
large-file-parquet-analysis-and-highlight
当Excel文件总行数超过1万行时,通过转换为Parquet格式提升读取性能,提取目标指标并计算最大值,最后将结果输出为Excel并对特定行进行高亮标注。.
excel-basic-statistics-and-routing
Skill "excel-basic-statistics-and-routing" from OpenSenseNova/SenseNova-Skills, covering skill steps, 保存区间提取与汇总结果 and 保存筛选与统计结果.