skills/llm-prompt-optimizer/SKILL.md
Optimize prompts for better LLM outputs through systematic analysis and refinement
npx skillsauth add jmsktm/claude-settings 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.
The LLM Prompt Optimizer skill systematically analyzes and refines prompts to maximize the quality, accuracy, and relevance of large language model outputs. It applies evidence-based optimization techniques including structural improvements, context enrichment, constraint calibration, and output format specification.
This skill goes beyond basic prompt writing by leveraging understanding of how different LLMs process instructions, their attention patterns, and their response tendencies. It helps you transform underperforming prompts into high-yield instructions that consistently produce the results you need.
Whether you are building production AI systems, conducting research, or simply want better ChatGPT responses, this skill ensures your prompts are optimized for your specific model and use case.
| Action | Command/Trigger | |--------|-----------------| | Diagnose prompt issues | "Why isn't this prompt working: [prompt]" | | Optimize for accuracy | "Optimize for accuracy: [prompt]" | | Reduce hallucinations | "Reduce hallucinations in: [prompt]" | | Add structure | "Add better structure to: [prompt]" | | Model-specific optimization | "Optimize this for [model]: [prompt]" | | A/B test variants | "Create prompt variants for testing: [prompt]" |
Start with Clear Intent: Define exactly what success looks like before optimizing
Use Explicit Output Formats: LLMs follow structure better than vague requests
Calibrate Constraints: Too many constraints cause conflicts; too few cause drift
Leverage Positive Instructions: Tell the model what TO do, not just what NOT to do
Position Critical Instructions Strategically: Beginning and end get more attention
Use Delimiters for Multi-Part Inputs: Clear separation prevents confusion
"""User Query: {query}""" """Context: {context}"""For complex prompts, use iterative optimization:
1. Generate baseline outputs (n=5)
2. Score outputs against criteria
3. Identify lowest-scoring dimension
4. Adjust prompt targeting that dimension
5. Repeat until all dimensions score acceptably
Break complex tasks into simpler sub-prompts:
Complex: "Analyze this code, find bugs, suggest fixes, and refactor"
Decomposed:
Step 1: "List all potential bugs in this code"
Step 2: "For each bug, explain the fix"
Step 3: "Refactor the fixed code for clarity"
Show what NOT to do alongside positive examples:
Good output: [example]
Bad output (avoid this): [anti-example]
Key difference: [explanation]
When context is limited:
1. Remove redundant phrases
2. Use abbreviations consistently
3. Compress examples to minimal effective size
4. Prioritize recent/relevant context
5. Consider summarizing long contexts
data-ai
Optimize YouTube videos for SEO, thumbnails, descriptions, and audience retention
testing
Design and facilitate effective workshops with agendas, activities, and outcomes
data-ai
Design and optimize AI-powered workflows for complex tasks
data-ai
Design and implement automated workflows to eliminate repetitive tasks and streamline processes