prompt-optimizer-loop

prompt-optimizer-loop is a skill for Claude Code from Abhillashjadhav/AI-PM-essential-skills. It costs 155 tokens per session (741 once invoked), scanned A, original, MIT.

An interactive process for improving an existing prompt, which is an instruction given to an AI system. It changes one part at a time and measures each version against fixed example inputs and yes-or-no quality checks.

In plain words
What is it for?
Use it to establish a baseline, test prompt variations, target the most common failure, keep improvements, and revert changes that do not improve the agreed checks.
Why use it?
It replaces guesswork with a repeatable comparison of prompt changes. Keeping the tests and checklist fixed makes it easier to tell whether a change actually helped or made the result worse.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the pm-tactical plugin — 5 skills, 3 agents shipped together

Good fit Use it to establish a baseline, test prompt variations, target the most common failure, keep improvements, and revert changes that do not improve the agreed checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/abhillashjadhav/ai-pm-essential-skills/prompt-optimizer-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 Abhillashjadhav/AI-PM-essential-skills --skill prompt-optimizer-loop
Clone the repo
git clone --depth 1 https://github.com/Abhillashjadhav/AI-PM-essential-skills

Made for: Claude Code.

Or install pm-tactical, the plugin that ships this one along with the rest of its 5 skills, 3 agents.

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-optimizer-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/abhillashjadhav/ai-pm-essential-skills/prompt-optimizer-loop/github.svg)](https://agentmods.dev/skills/abhillashjadhav/ai-pm-essential-skills/prompt-optimizer-loop)
Your own site
<a href="https://agentmods.dev/skills/abhillashjadhav/ai-pm-essential-skills/prompt-optimizer-loop"><img src="https://agentmods.dev/badge/skills/abhillashjadhav/ai-pm-essential-skills/prompt-optimizer-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-optimizer-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/abhillashjadhav/ai-pm-essential-skills/prompt-optimizer-loop"><img src="https://agentmods.dev/badge/skills/abhillashjadhav/ai-pm-essential-skills/prompt-optimizer-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 155 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 741 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.00155 $0.00741
Opus 5 $0.00077 $0.00370
Sonnet 5 $0.00031 $0.00148
Haiku 4.5 $0.00015 $0.00074

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

Security

Grade A, and why

prompt-optimizer-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 11d 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.

pm-tactical/skills/prompt-optimizer-loop/SKILL.md · 49 lines

How it starts

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

Prompt Optimizer Loop

Improve a prompt the way engineers improve code: one change at a time, measured against a locked test, keep winners, revert losers. Interactive — the user approves each round.

Step 0 — Collect the three inputs

  1. TARGET: the prompt to improve (verbatim).
  2. TEST INPUTS: 2-3 realistic inputs that would hit this prompt in production. If the user has none, help draft them, then confirm.
  3. CHECKLIST: 3-6 binary yes/no quality checks (e.g., "output is valid JSON", "response under 100 words", "never invents a source"). If missing, draft candidates from the user's complaints and get approval. Once approved, the checklist is LOCKED — it cannot change during the loop. Changing it starts a new loop.

Step 1 — Baseline

Run the TARGET prompt against every test input. Score each output against every checklist item. Record the baseline as passes/total (e.g., 9/15 across 3 inputs × 5 checks).

Step 2 — One mutation

Identify the checklist item failing most often. Propose exactly ONE change to the prompt targeting that failure (add a constraint, reorder, add an example, tighten wording). State the hypothesis: "Adding X should fix check Y because Z." Never bundle multiple changes — attribution dies.

Step 3 — Re-test

Run the mutated prompt against ALL test inputs (not just the failing one). Score against the full locked checklist.

Step 4 — Keep or revert

  • Score improved AND no previously-passing check broke → KEEP. New version becomes current.
  • Score flat or worse, or a regression appeared → REVERT to the previous version. Log why the hypothesis failed.

Show the scoreboard after every round:

ROUND N | mutation: <one line> | hypothesis: <one line>
SCORE: X/Y (was X/Y) | regressions: none|<list> | verdict: KEEP|REVERT

Step 5 — Stop conditions

Stop when any of: all checks pass on all inputs; 2 consecutive reverts (diminishing returns); user says stop; 8 rounds reached. Then output: final prompt (clean copy), original prompt (untouched), full round-by-round changelog.

Read the full file on GitHub · 49 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. 11d ago First seen · 49 lines · 155 tokens per session scan A 831997135d6f

Subscribe to this mod's changes

prompt-optimizer-loop is a skill published in the GitHub repository Abhillashjadhav/AI-PM-essential-skills (3 stars, last pushed 9d ago), licensed MIT. It adds 155 tokens to every session and 741 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-31.

Related

Other skills, from other repositories

implementing-llm-guardrails-for-security

Implements input and output validation guardrails for LLM-powered applications to prevent prompt injection, data leakage, toxic content generation, and hallucinated outputs. Builds a security validation pipeline using NVIDIA NeMo Guardrails Colang definitions, custom Python validators for PII detection and content…

xalgorix/xalgorix · 143 tokens

prompting

Guide for writing effective system prompts for LLM agents. Use when creating or editing system prompts for applications, agent configurations, or development tools.

saffron-health/libretto · 31 tokens

few-shot-examples

Curated few-shot examples for construction AI tasks: classification, extraction, analysis. Domain-specific examples for improved LLM performance.

datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction · 30 tokens

prompt-templates

Reusable prompt templates for construction AI tasks: cost estimation, schedule analysis, document processing, BIM queries. Structured prompts for consistent results.

datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction · 30 tokens

opik-optimizer

Optimize LLM prompts, tools, and agents in Opik using standardized optimizer workflows (prompt optimization, tool optimization, and parameter tuning), dataset/metric wiring, and result interpretation.

vincentkoc/dotskills · 41 tokens

langgraph

Build multi-agent AI systems with LangGraph — the low-level orchestration framework for stateful, graph-based agent workflows. Covers supervisor, swarm, and hierarchical multi-agent patterns; subgraph composition; state management (checkpointers/stores); persistence; evals; and production debugging. Reach for this…

magnus919/agent-skills · 100 tokens