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 skills add Abhillashjadhav/AI-PM-essential-skills --skill prompt-optimizer-loopgit clone --depth 1 https://github.com/Abhillashjadhav/AI-PM-essential-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/abhillashjadhav/ai-pm-essential-skills/prompt-optimizer-loop)<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.
<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>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.1 | $0.00155 | $0.00741 |
| Opus 5 | $0.00077 | $0.00370 |
| Sonnet 5 | $0.00031 | $0.00148 |
| Haiku 4.5 | $0.00015 | $0.00074 |
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.
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
- TARGET: the prompt to improve (verbatim).
- TEST INPUTS: 2-3 realistic inputs that would hit this prompt in production. If the user has none, help draft them, then confirm.
- 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.
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.
- 11d ago First seen · 49 lines · 155 tokens per session scan A 831997135d6f
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.
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…
prompting
Guide for writing effective system prompts for LLM agents. Use when creating or editing system prompts for applications, agent configurations, or development tools.
few-shot-examples
Curated few-shot examples for construction AI tasks: classification, extraction, analysis. Domain-specific examples for improved LLM performance.
prompt-templates
Reusable prompt templates for construction AI tasks: cost estimation, schedule analysis, document processing, BIM queries. Structured prompts for consistent results.
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.
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…