prompt-optimization-loop

prompt-optimization-loop is a skill for Claude Code, Codex from alexclowe/awesome-copilot-cowork-plugins. It costs 30 tokens per session (515 once invoked), scanned A, original, MIT.

A step-by-step method for improving prompts by testing normal, unusual, and deliberately difficult inputs, then changing the prompt based on observed failures.

In plain words
What is it for?
It is for designing evaluation cases, analysing real failures, comparing prompt versions, and recording why each change was made.
Why use it?
It helps isolate the causes of poor responses and reduce failures such as instruction hijacking, ambiguous requests, or malformed input.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for designing evaluation cases, analysing real failures, comparing prompt versions, and recording why each change was made.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alexclowe/awesome-copilot-cowork-plugins/prompt-optimization-loop
Install

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.

Any agent
npx skills add alexclowe/awesome-copilot-cowork-plugins --skill prompt-optimization-loop
Clone the repo
git clone --depth 1 https://github.com/alexclowe/awesome-copilot-cowork-plugins

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for prompt-optimization-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexclowe/awesome-copilot-cowork-plugins/prompt-optimization-loop/github.svg)](https://agentmods.dev/skills/alexclowe/awesome-copilot-cowork-plugins/prompt-optimization-loop)
Your own site
<a href="https://agentmods.dev/skills/alexclowe/awesome-copilot-cowork-plugins/prompt-optimization-loop"><img src="https://agentmods.dev/badge/skills/alexclowe/awesome-copilot-cowork-plugins/prompt-optimization-loop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for prompt-optimization-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexclowe/awesome-copilot-cowork-plugins/prompt-optimization-loop"><img src="https://agentmods.dev/badge/skills/alexclowe/awesome-copilot-cowork-plugins/prompt-optimization-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 515 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.00515
Opus 5 $0.00015 $0.00258
Sonnet 5 $0.00006 $0.00103
Haiku 4.5 $0.00003 $0.00052

Measured 5d ago against content hash 7a1fd4fb5f7b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

prompt-optimization-loop 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 5d 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.

prompt-engineer/skills/prompt-optimization-loop/SKILL.md · 40 lines

How it starts

The opening of the file, as written. The whole thing — 40 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You have deep expertise in iterative prompt optimization. When the user is working on prompt-engineering tasks — drafting, testing, or refining prompts and skills — apply this knowledge automatically.

Core competencies

Test case design:

  • Generate happy-path, edge, and adversarial cases with explicit coverage tags
  • Edge cases: empty fields, malformed input, multilingual content, ambiguous requests, very long input, conflicting instructions
  • Adversarial cases: prompt injection (instruction override, delimiter confusion, role hijacking), jailbreaks, data exfiltration attempts — reference OWASP LLM Top 10
  • Stratify synthetic cases by failure-mode hypothesis, not by surface form

Iteration discipline:

  • Always start with error analysis on real traces before generating synthetic cases (per Hamel Husain's eval methodology)
  • Cluster failures into root causes before changing the prompt — fixing 47 symptoms hides 3 underlying bugs
  • Make one change at a time when iterating, so A/B comparisons isolate the effect
  • Keep a versioned changelog of prompt edits with the failure mode each edit addressed

Evaluator selection:

  • Code-based evaluators (regex, schema validation, exact match) for objective criteria — deterministic and fast
  • LLM-as-judge for subjective criteria (tone, faithfulness, relevance) — but always validate against human labels first (TPR/TNR ≥ 0.8 baseline)
  • Human review for high-stakes or ambiguous criteria — never skip when shipping to production

Communication style

When assisting with prompt-engineering tasks:

  • Reference real eval frameworks (Anthropic eval cookbook, OpenAI Evals, Hamel Husain's eval-framework writeups, Eugene Yan's evaluation guidance) where appropriate
  • Distinguish between vanity metrics (aggregate score) and actionable metrics (failure mode pass rate)
  • Flag when a sample size is too small to draw conclusions
  • Always note that automated eval outputs are drafts requiring engineer verification before production decisions

Read the full file on GitHub · 40 lines

Changes

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.

  1. 5d ago First seen · 40 lines · 30 tokens per session scan A 7a1fd4fb5f7b

Subscribe to this mod's changes

prompt-optimization-loop is a skill published in the GitHub repository alexclowe/awesome-copilot-cowork-plugins (17 stars, last pushed 1mo ago), licensed MIT. It adds 30 tokens to every session and 515 once invoked, about $0.0002 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-09-03.