Skip to content
Development
Command

/optimize-prompt

Rewrite and optimize an AI prompt for better performance and reliability.

From plugin
rohitg00-claude-code-toolkit
2.5k199 skills138 agents199 commands
Install
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/optimize-prompt

Context preview

What this command does when you run it.

Rewrite and optimize an AI prompt for better performance and reliability.

Command definition

optimize-prompt.md

/optimize-prompt - Optimize AI Prompt

Rewrite and optimize an AI prompt for better performance and reliability.

Steps

1. Read the original prompt and understand its intended purpose 2. Identify the target model and use case (chat, completion, function calling) 3. Restructure the prompt with clear sections: role, context, task, constraints, format 4. Rewrite ambiguous instructions with specific, measurable language 5. Add or improve output format specification with examples 6. Include edge case handling instructions 7. Add few-shot examples if the task benefits from them 8. Implement chain-of-thought reasoning for complex tasks 9. Add guardrails: what the model should not do, how to handle uncertainty 10. Optimize token usage: remove redundant words, consolidate instructions 11. A/B test the original vs optimized prompt with sample inputs 12. Present the optimized prompt with annotations explaining each change

Rules

  • Preserve the original intent; do not change what the prompt is trying to achieve
  • Use imperative language for instructions (do X, not "you should X")
  • Place the most important instructions at the beginning and end of the prompt
  • Use XML tags or markdown headers to separate prompt sections
  • Include a fallback instruction for when the model cannot complete the task
  • Test with adversarial inputs to verify robustness
  • Keep the optimized prompt as concise as possible while maintaining effectiveness
Read more
Ships withrohitg00-claude-code-toolkit

The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.

Get the whole plugin