Back to Skills

optimizing-prompts

jeremylongshore
Updated 2 days ago
82 views
712
74
712
View on GitHub
Metaai

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.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/jeremylongshore/claude-code-plugins-plus
Git CloneAlternative
git clone https://github.com/jeremylongshore/claude-code-plugins-plus.git ~/.claude/skills/optimizing-prompts

Copy and paste this command in Claude Code to install this skill

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

  1. Analyzing Prompt: The skill analyzes the input prompt to identify areas of redundancy, verbosity, and potential for simplification.
  2. Rewriting Prompt: It rewrites the prompt using techniques like concise language, targeted instructions, and efficient phrasing.
  3. 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:

  1. Analyze the prompt for redundancies and areas for simplification.
  2. 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."
  3. 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:

  1. Identify areas for improvement in the prompt's clarity and focus.
  2. Rewrite the prompt to be more direct: "Summarize this document, including key points, arguments, evidence, and the conclusion."
  3. 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.

GitHub Repository

jeremylongshore/claude-code-plugins-plus
Path: backups/skills-batch-20251204-000554/plugins/packages/ai-ml-engineering-pack/skills/ai-ml-engineering-pack
aiautomationclaude-codedevopsmarketplacemcp

Related Skills

evaluating-llms-harness

Testing

This 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.

View skill

sglang

Meta

SGLang 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.

View skill

langchain

Meta

LangChain 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.

View skill

cloudflare-turnstile

Meta

This skill provides comprehensive guidance for implementing Cloudflare Turnstile as a CAPTCHA-alternative bot protection system. It covers integration for forms, login pages, API endpoints, and frameworks like React/Next.js/Hono, while handling invisible challenges that maintain user experience. Use it when migrating from reCAPTCHA, debugging error codes, or implementing token validation and E2E tests.

View skill