skills/llm-prompt-optimizer/SKILL.md
Use when improving prompts for any LLM. Applies proven prompt engineering techniques to boost output quality, reduce hallucinations, and cut token usage.
npx skillsauth add ranbot-ai/awesome-skills llm-prompt-optimizerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill transforms weak, vague, or inconsistent prompts into precision-engineered instructions that reliably produce high-quality outputs from any LLM (Claude, Gemini, GPT-4, Llama, etc.). It applies systematic prompt engineering frameworks — from zero-shot to few-shot, chain-of-thought, and structured output patterns.
Before optimizing, identify which problem pattern applies:
| Problem | Symptom | Fix | |---------|---------|-----| | Too vague | Generic, unhelpful answers | Add role + context + constraints | | No structure | Unformatted, hard-to-parse output | Specify output format explicitly | | Hallucination | Confident wrong answers | Add "say I don't know if unsure" | | Inconsistent | Different answers each run | Add few-shot examples | | Too long | Verbose, padded responses | Add length constraints |
Every optimized prompt should have:
Before (weak prompt):
Explain machine learning.
After (optimized prompt):
You are a senior ML engineer explaining concepts to a junior developer.
Context: The developer has 1 year of Python experience but no ML background.
Task: Explain supervised machine learning in simple terms.
Constraints:
- Use an analogy from everyday life
- Maximum 200 words
- No mathematical formulas
- End with one actionable next step
Format: Plain prose, no bullet points.
For reasoning tasks, instruct the model to think step-by-step:
Solve this problem step by step, showing your work at each stage.
Only provide the final answer after completing all reasoning steps.
Problem: [your problem here]
Thinking process:
Step 1: [identify what's given]
Step 2: [identify what's needed]
Step 3: [apply logic or formula]
Step 4: [verify the answer]
Final Answer:
Provide 2-3 examples to establish the pattern:
Classify the sentiment of customer reviews as POSITIVE, NEGATIVE, or NEUTRAL.
Examples:
Review: "This product exceeded my expectations!" -> POSITIVE
Review: "It arrived broken and support was useless." -> NEGATIVE
Review: "Product works as described, nothing special." -> NEUTRAL
Now classify:
Review: "[your review here]" ->
Extract the following information from the text below and return it as valid JSON only.
Do not include any explanation or markdown — just the raw JSON object.
Schema:
{
"name": string,
"email": string | null,
"company": string | null,
"role": string | null
}
Text: [input text here]
Answer the following question based ONLY on the provided context.
If the answer is not contained in the context, respond with exactly: "I don't have enough information to answer this."
Do not make up or infer information not present in the context.
Context:
[your context here]
Question: [your question here]
Reduce token count without losing effectiveness:
# Verbose (expensive)
"Please carefully analyze the following code and provide a detailed explanation of
what it does, how it works, and any potential issues you might find."
# Compressed (efficient, same quality)
"Analyze this code: explain what it does, how it works, and flag any issues."
Before using a prompt in production:
development
Production-grade Android app development guide covering native (Kotlin/Java), cross-platform (Flutter, RN, KMM), and hybrid architectures.
testing
Plan, orchestrate, and adversarially verify parallel AI coding agents with a dynamic multi-agent workflow engine.
development
Generate professional, ATS-optimized CVs for FlowCV, Canva, Google Docs, or Word. Handles multi-source merging, JD targeting, seniority adaptation, and humanized rewriting. Outputs paste-ready text wi
tools
Generate hand-drawn 16:9 article illustrations with the Grav character IP, sparse annotations, and absurd but clear visual metaphors.