optimizing-prompts
About
This skill automatically analyzes and rewrites LLM prompts to reduce token usage, lowering costs and improving response speed. It identifies and removes redundancies to make prompts more concise and effective. Developers should use it when they need to optimize prompts for cost reduction or performance enhancement.
Documentation
Overview
This skill empowers Claude to refine prompts for optimal LLM performance. It streamlines prompts to minimize token count, thereby reducing costs and enhancing response speed, all while maintaining or improving output quality.
How It Works
- Analyzing Prompt: The skill analyzes the input prompt to identify areas of redundancy, verbosity, and potential for simplification.
- Rewriting Prompt: It rewrites the prompt using techniques like concise language, targeted instructions, and efficient phrasing.
- Suggesting Alternatives: The skill provides the optimized prompt along with an explanation of the changes made and their expected impact.
When to Use This Skill
This skill activates when you need to:
- Reduce the cost of using an LLM.
- Improve the speed of LLM responses.
- Enhance the quality or clarity of LLM outputs by refining the prompt.
Examples
Example 1: Reducing LLM Costs
User request: "Optimize this prompt for cost and quality: 'I would like you to create a detailed product description for a new ergonomic office chair, highlighting its features, benefits, and target audience, and also include information about its warranty and return policy.'"
The skill will:
- Analyze the prompt for redundancies and areas for simplification.
- Rewrite the prompt to be more concise: "Create a product description for an ergonomic office chair. Include features, benefits, target audience, warranty, and return policy."
- Provide the optimized prompt and explain the token reduction achieved.
Example 2: Improving Prompt Performance
User request: "Optimize this prompt for better summarization: 'Please read the following document and provide a comprehensive summary of all the key points, main arguments, supporting evidence, and overall conclusion, ensuring that the summary is accurate, concise, and easy to understand.'"
The skill will:
- Identify areas for improvement in the prompt's clarity and focus.
- Rewrite the prompt to be more direct: "Summarize this document, including key points, arguments, evidence, and the conclusion."
- Present the optimized prompt and explain how it enhances summarization performance.
Best Practices
- Clarity: Ensure the original prompt is clear and well-defined before optimization.
- Context: Provide sufficient context to the skill so it can understand the prompt's purpose.
- Iteration: Iterate on the optimized prompt based on the LLM's output to fine-tune performance.
Integration
This skill integrates with the prompt-architect agent to leverage advanced prompt engineering techniques. It can also be used in conjunction with the llm-integration-expert to optimize prompts for specific LLM APIs.
Quick Install
/plugin add https://github.com/jeremylongshore/claude-code-plugins-plus/tree/main/ai-ml-engineering-packCopy and paste this command in Claude Code to install this skill
GitHub 仓库
Related Skills
sglang
MetaSGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
evaluating-llms-harness
TestingThis Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.
llamaguard
OtherLlamaGuard is Meta's 7-8B parameter model for moderating LLM inputs and outputs across six safety categories like violence and hate speech. It offers 94-95% accuracy and can be deployed using vLLM, Hugging Face, or Amazon SageMaker. Use this skill to easily integrate content filtering and safety guardrails into your AI applications.
langchain
MetaLangChain is a framework for building LLM applications using agents, chains, and RAG pipelines. It supports multiple LLM providers, offers 500+ integrations, and includes features like tool calling and memory management. Use it for rapid prototyping and deploying production systems like chatbots, autonomous agents, and question-answering services.
