Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Diagnose and rewrite an underperforming LLM prompt so it produces reliable, well-structured output. Use when asked to improve a prompt, fix a prompt that gives inconsistent or wrong results, reduce hallucination/refusals, or make output follow a format. Produces a rewritten prompt with a diagnosis of what was failing, the specific changes and why, and a small test set to verify the fix.
.claude/skills/mohitagw15856-prompt-optimizer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 22% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 3% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 39% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 18% | 0% |
A weak prompt fails in patterned ways — vague task, no output contract, buried instructions, no examples, or asking for judgement with nothing to ground it. This skill diagnoses which failure mode is in play and rewrites the prompt to fix it, then hands you a way to check the fix held — so "it's flaky" becomes a specific, testable change rather than another round of fiddling.
You'll often get just the prompt and a vague "it's not working". Always deliver a full rewrite anyway — infer the intended task and output from the prompt's wording, state your assumptions, and rewrite. If the failing behaviour wasn't described, infer the most likely failure mode from the prompt's structure and say so. Never hand back only a critique with no rewritten prompt.
Ask for these only if they aren't already provided (else infer and label):
1. Diagnosis — the specific failure mode(s), each tied to the line that causes it:
| Symptom | Likely cause | Fix applied | |---|---|---| | Inconsistent format | no explicit output contract | added a schema + example | | Hallucinated details | asked to answer without grounding | added "use only the provided context; say what's unknown" | | Ignores an instruction | buried mid-paragraph | moved to a numbered rule near the top |
2. Rewritten prompt — the full new prompt in a fenced block, ready to paste. Apply the levers that fit: role + task in the first lines, an explicit output contract (structure/schema + a short example), grounding rules ("answer only from X; if unknown, say so"), constraints stated as rules not prose, and 1–3 few-shot examples when the task needs a demonstrated pattern.
3. What changed and why — a short bullet list mapping each edit to the symptom it addresses.
4. Test set — 3–5 concrete inputs (incl. an edge case and a "should refuse / say unknown" case) and the expected output for each, so the user can confirm the rewrite behaves before shipping.
Prompt-engineering practice — explicit output contracts, grounding/uncertainty handling, structured instructions, and example-driven demonstration.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 25,736 | 24,247 | -6% | 1 | 1 | 0% | 3,542 | 3,607 | +2% | 0 | 0 | — |
case-02 | fail→pass | 20,058 | 21,925 | +9% | 1 | 1 | 0% | 2,996 | 3,643 | +22% | 0 | 0 | — |
case-03 | fail→pass | 19,214 | 25,071 | +30% | 1 | 1 | 0% | 3,793 | 3,891 | +3% | 0 | 0 | — |
case-04 | pass→fail | 26,822 | 28,157 | +5% | 1 | 1 | 0% | 3,914 | 4,459 | +14% | 0 | 0 | — |
case-05 | pass→fail | 26,187 | 24,035 | -8% | 1 | 1 | 0% | 3,315 | 5,155 | +56% | 0 | 0 | — |
case-06 | pass→fail | 27,595 | 27,295 | -1% | 1 | 1 | 0% | 3,821 | 4,531 | +19% | 0 | 0 | — |
case-07 | fail→pass | 21,953 | 22,217 | +1% | 1 | 1 | 0% | 2,883 | 4,033 | +40% | 0 | 0 | — |
case-08 | fail→pass | 14,275 | 19,993 | +40% | 1 | 1 | 0% | 2,512 | 3,500 | +39% | 0 | 0 | — |
case-09 | fail→pass | 27,638 | 21,599 | -22% | 1 | 1 | 0% | 3,178 | 3,758 | +18% | 0 | 0 | — |
case-10 | fail→pass | 18,021 | 24,645 | +37% | 1 | 1 | 0% | 3,143 | 4,368 | +39% | 0 | 0 | — |
case-11 | fail→fail | 24,736 | 16,002 | -35% | 1 | 1 | 0% | 2,912 | 3,340 | +15% | 0 | 0 | — |
case-12 | fail→pass | 15,659 | 14,865 | -5% | 1 | 1 | 0% | 1,798 | 2,756 | +53% | 0 | 0 | — |
case-13 | fail→pass | 24,310 | 15,637 | -36% | 1 | 1 | 0% | 2,643 | 3,148 | +19% | 0 | 0 | — |
case-14 | fail→pass | 21,524 | 21,597 | +0% | 1 | 1 | 0% | 2,260 | 3,206 | +42% | 0 | 0 | — |
case-15 | fail→pass | 21,988 | 20,191 | -8% | 1 | 1 | 0% | 2,829 | 3,169 | +12% | 0 | 0 | — |
case-16 | fail→fail | 22,785 | 22,807 | +0% | 1 | 1 | 0% | 2,721 | 3,760 | +38% | 0 | 0 | — |
case-17 | fail→pass | 20,555 | 17,815 | -13% | 1 | 1 | 0% | 2,758 | 3,607 | +31% | 0 | 0 | — |
case-18 | fail→pass | 25,533 | 21,545 | -16% | 1 | 1 | 0% | 2,807 | 3,190 | +14% | 0 | 0 | — |
case-19 | fail→fail | 24,028 | 22,409 | -7% | 1 | 1 | 0% | 3,019 | 3,746 | +24% | 0 | 0 | — |
case-20 | fail→pass | 20,705 | 17,711 | -14% | 1 | 1 | 0% | 2,470 | 3,779 | +53% | 0 | 0 | — |
case-21 | fail→pass | 13,161 | 26,518 | +101% | 1 | 1 | 0% | 2,134 | 4,167 | +95% | 0 | 0 | — |
case-22 | fail→pass | 16,092 | 20,377 | +27% | 1 | 1 | 0% | 2,035 | 3,075 | +51% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +55 percentage points is the difference between those two pass rates over the 22 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.