
prompt-enhancer
Prompt engineering and optimization for AI/LLMs. Capabilities: transform unclear prompts, reduce token usage, improve structure, add constraints, optimize for specific models, backward-compatible rewrites. Actions: improve, enhance, optimize, refactor, compress prompts. Keywords: prompt engineering, prompt optimization, token efficiency, LLM prompt, AI prompt, clarity, structure, system prompt, user prompt, few-shot, chain-of-thought, instruction tuning, prompt compression, token reduction, prompt rewrite, semantic preservation. Use when: improving unclear prompts, reducing token consumption, optimizing LLM outputs, restructuring verbose requests, creating system prompts, enhancing prompt clarity.
- Installs
- 79
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/samhvw8/dot-claude --skill prompt-enhancer- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads prompt-enhancer automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Prompt Enhancer Skill
Purpose
Transform user prompts into enhanced, production-ready versions that are concise, clean, and optimally structured for AI agents and sub-agents. Includes optimization techniques for reducing LLM output token usage while maintaining semantic accuracy and backward compatibility.
When to Use This Skill
Use this skill when:
- User explicitly asks to improve, enhance, or optimize a prompt
- User sends an unclear, verbose, or poorly structured prompt
- User mentions they want better results from AI interactions
- User asks for help writing prompts for agents or automation
- User's request lacks clarity or proper structure
- User wants to reduce LLM output tokens or API costs
- User needs to optimize JSON schema for token efficiency
- User requests compact output format while maintaining compatibility
Core Principles
- Conciseness: Remove unnecessary words while preserving intent
- Structure: Use clear formatting with multiple lines and logical sections
- XML Integration: Mix natural text with XML tags for clarity and parsing
- Direct Mission: Main task/quest/mission should NOT be wrapped in XML elements
- Clean Output: Return ONLY the enhanced prompt - no meta-commentary
Enhancement Process
Input Analysis
- Identify the core objective
- Extract key requirements and constraints
- Detect ambiguities or missing information
- Recognize the intended agent or use case
Task-Based Technique Selection (Optional)
Evaluate if the task would benefit from specific prompting techniques:
Chain-of-Thought (CoT)
- Use for: Complex reasoning, math problems, logical deduction, step-by-step analysis
- Implementation: Add instruction to "think step by step" or "show your reasoning"
Chain-of-Draft
- Use for: Writing tasks, content creation, iterative refinement
- Implementation: Request initial draft, then progressive improvements
Few-Shot Learning
- Use for: Pattern-based tasks, specific formatting, consistent outputs
- Implementation: Include 2-3 examples showing input-output pairs
ReAct (Reasoning + Acting)
- Use for: Tool use, multi-step tasks, decision-making processes
- Implementation: Combine reasoning traces with action steps
Self-Consistency
- Use for: Tasks needing verification, multiple valid approaches
- Implementation: Request multiple solutions, then synthesis
Tree-of-Thoughts
- Use for: Complex problem-solving, exploring alternatives
- Implementation: Ask to explore multiple paths before selecting best
Role-Based Prompting
- Use for: Domain-specific expertise, perspective-taking
- Implementation: Assign expert role (e.g., "Act as a senior engineer...")
Least-to-Most Prompting
- Use for: Breaking down complex problems into subproblems
- Implementation: Start with simpler versions, build up complexity
Apply technique only if it materially improves the task outcome.
LLM Output Token Optimization
When the goal is to reduce output tokens (API costs) while maintaining functionality:
Core Strategy: Compact Output + Server-Side Remapping
The LLM generates ultra-compact format, application remaps to original format for clients. This provides:
- Significant token savings (30-60%)
- 100% backward compatibility
- Negligible remapping overhead (<10 microseconds)
Optimization Techniques:
1. Ultra-Compact JSON Keys
- Replace long keys with 1-2 character abbreviations
- Examples:
queries→q,keyword→kw,filter→f,sort_by→s - Savings: 70-85% per key
2. Short Codes for Repeated Values
- Replace long IDs/enums with short codes (c1-c18, etc.)
- Example:
category=MjUzOTM=→c=c4 - Provide reverse mapping table in application
- Savings: 75-90% on category/enum values
3. String Compression for Structured Data
- Use compact string format instead of nested objects when possible
- Example:
[{"filter_by":"category","operator":"=","value":"c4"}]→"c=c4" - Parse and expand server-side
- Savings: 60-80% on filter/query structures
4. Omit Default Values
- Instruct LLM to omit fields with default values
- Application fills in defaults during remapping
- Example: Omit
"sort_by":"relevant"when it's the default - Savings: Additional 10-30% when defaults are common
5. Operator Abbreviation
- Use shortest form:
p<50000instead ofprice<50000 - Parse
p/cprefixes during remapping - Combine with semicolons:
c=c4;p<50000for multiple filters
Implementation Pattern:
System Prompt Structure:
1. Define ultra-compact schema with examples
2. Specify key mappings (q=queries, kw=keyword, etc.)
3. Provide short codes table (c1=category1, c2=category2, etc.)
4. Show examples of compact output
5. Emphasize: omit defaults when possible
Application Layer:
1. Parse compact LLM output
2. Expand abbreviated keys
3. Map short codes to full values
4. Fill in default values
5. Return original format to client
Example Transformation:
Before Optimization (Original Output):
{
"queries": [
{"keyword": "milk", "filter": "category=dairy", "sort_by": "relevant"},
{"keyword": "bread", "filter": "category=bakery", "sort_by": "relevant"}
]
}
After Optimization (LLM Output - 60% smaller):
{
"q": [
{"kw": "milk", "f": "c=c8"},
{"kw": "bread", "f": "c=c3"}
]
}
Client Receives: Original format (remapped automatically)
Tradeoffs Analysis:
✅ Pros:
- 30-60% token savings typical
- Lower API costs
- Faster LLM response (less to generate)
- 100% backward compatible
⚠️ Cons:
- Remapping overhead (<10μs, negligible)
- More complex implementation
- Requires application-side mapping logic
- Prompt becomes slightly less human-readable
When to Apply:
- High-volume API usage (>1000 requests/day)
- Cost-sensitive applications
- Output tokens are >50% of total costs
- Schema is stable and well-defined
- Application can handle remapping logic
When NOT to Apply:
- Low-volume usage (<100 requests/day)
- Schema frequently changes
- Human readability is critical
- No application layer (direct LLM → client)
Structural Improvements
- Break complex requests into clear sections
- Use XML tags for: constraints, examples, context, format requirements
- Keep main mission/task as direct natural language
- Apply logical line breaks for readability
Language Optimization
- Replace verbose phrases with concise alternatives
- Use active voice and direct instructions
- Eliminate redundancy and filler words
- Maintain specificity while reducing length
XML Tag Usage Guidelines
Use XML tags for:
<constraints>- Limitations and boundaries<examples>- Sample inputs/outputs<context>- Background information<format>- Output structure requirements<requirements>- Specific criteria to meet<guidelines>- Best practices to follow
Do NOT use XML tags for:
- The primary mission statement
- The main task description
- The core request or question
Output Format
Return ONLY the enhanced prompt with:
- No conversational lead-in
- No explanations or commentary
- No placeholder text
- No quotation marks wrapping the prompt
- No meta-discussion about the enhancement
Example Transformations
Before: "I need you to help me write some code for a web app that will let users sign up and log in, and I want it to be secure and use modern best practices, and also it should have a nice UI, maybe you could suggest what framework to use?"
After: Create a secure authentication system for a web application with user registration and login functionality.
<requirements> - Implement modern security best practices - Include password hashing and session management - Design a clean, user-friendly interface - Provide framework recommendation with rationale </requirements> <format> - Code implementation - Security considerations - Framework justification - UI/UX guidelines </format>Before: "Can you analyze this data and tell me what's interesting about it and maybe make some charts or visualizations if that would help understand it better and also let me know if there are any trends or patterns?"
After: Analyze the provided dataset and identify key insights, trends, and patterns.
<requirements> - Highlight statistically significant findings - Identify temporal trends and correlations - Note any anomalies or outliers </requirements> <format> - Executive summary of findings - Data visualizations (charts/graphs as needed) - Detailed pattern analysis - Actionable recommendations </format>Before: "I'm trying to figure out the best pricing strategy for my SaaS product and I'm not sure whether to go with monthly or annual billing or maybe tiered pricing?"
After (with Chain-of-Thought technique applied): Determine the optimal pricing strategy for a SaaS product.
<context> Consider: monthly vs. annual billing, tiered pricing models, market positioning </context> <approach> Think step by step: 1. Analyze target customer segments and their payment preferences 2. Evaluate competitor pricing models in the space 3. Calculate unit economics for each pricing option 4. Assess cash flow implications 5. Consider customer lifetime value impact </approach> <requirements> - Provide reasoning for each recommendation - Include pros/cons analysis - Suggest A/B testing approach if applicable </requirements>Before: "Write a blog post about AI in healthcare that's engaging and informative"
After (with Chain-of-Draft technique applied): Write an engaging and informative blog post about AI applications in healthcare.
<approach> Use iterative drafting: 1. Create outline with key points and narrative arc 2. Draft introduction and conclusion 3. Develop body sections with examples 4. Refine for clarity, flow, and engagement </approach> <requirements> - Target audience: healthcare professionals and tech enthusiasts - Length: 1200-1500 words - Include real-world examples and case studies - Balance technical accuracy with accessibility </requirements> <format> - Compelling headline - Hook in first paragraph - Clear section headers - Actionable takeaways </format>Real-World Token Optimization Example
Before (Original Prompt):
Create JSON queries to search for products. Each query should have a keyword, filter with category, and sort_by field. Return in this format: {"queries":[{"keyword":"milk","filter":"category=dairy","sort_by":"relevance"}]}
After (Token-Optimized Prompt):
Generate product search JSON queries. Reject dangerous content.
<rules>
- Each query: ≥1 category filter
- Total: ≥3 keywords (no duplicates)
- Use 'ex' for exact brands/attributes
- Default sort: relevant (omit if default)
- Filter: string format "c=c4" or "c=c4;p<50000"
</rules>
<categories>
c1=household, c2=personal care, c3=bakery, c4=fresh food, c5=oils, c6=dry goods, c7=cleaning, c8=dairy
</categories>
<examples>
"milk vinamilk"→{"q":[{"kw":"milk vinamilk","ex":"vinamilk","f":"c=c8","s":"popular"}]}
"rice noodles meat"→{"q":[{"kw":"rice","f":"c=c6"},{"kw":"noodles","f":"c=c6"},{"kw":"meat","f":"c=c4"}]}
"oranges under 50k"→{"q":[{"kw":"oranges","f":"c=c4;p<50000"}]}
</examples>
Result:
- LLM generates:
{"q":[{"kw":"milk","f":"c=c8"}]}(60% smaller) - Application remaps to:
{"queries":[{"keyword":"milk","filter":"category=dairy","sort_by":"relevance"}]} - Client receives original format unchanged
- Token savings: 60.5% on typical 3-query response
Quality Checklist
Before returning the enhanced prompt, verify:
- ✓ Main objective is clear and unambiguous
- ✓ XML tags are used appropriately (not for main mission)
- ✓ Structure uses multiple lines for readability
- ✓ Language is concise and direct
- ✓ No extraneous commentary included
- ✓ All key requirements preserved
- ✓ Actionable and complete
- ✓ If optimizing tokens: compact schema defined, mapping clear, examples provided
Implementation Notes
When applying this skill:
- Read the user's prompt completely
- Identify enhancement opportunities
- Apply structural and linguistic improvements
- Output ONLY the enhanced version
- Do not ask for clarification unless absolutely critical information is missing
The enhanced prompt should be immediately usable by the user without any modifications.
FAQ
What does the prompt-enhancer skill do?
Prompt engineering and optimization for AI/LLMs. Capabilities: transform unclear prompts, reduce token usage, improve structure, add constraints, optimize for specific models, backward-compatible rewrites. Actions: improve, enhance, optimize, refactor, compress prompts. Keywords: prompt engineering, prompt optimization, token efficiency, LLM prompt, AI prompt, clarity, structure, system prompt, user prompt, few-shot, chain-of-thought, instruction tuning, prompt compression, token reduction, prompt rewrite, semantic preservation. Use when: improving unclear prompts, reducing token consumption, optimizing LLM outputs, restructuring verbose requests, creating system prompts, enhancing prompt clarity.
How do I install prompt-enhancer?
Run npx skills add https://github.com/samhvw8/dot-claude --skill prompt-enhancer in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/prompt-enhancer/ (personal) or .claude/skills/prompt-enhancer/ (project).
Which AI agents can use prompt-enhancer?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is prompt-enhancer safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains prompt-enhancer?
It is published by samhvw8 in samhvw8/dot-claude. It has 79 recorded installs.
More from samhvw8/dot-claude
ui-design-system
samhvw8/dot-claude
React UI component systems with TailwindCSS + Radix + shadcn/ui. Stack: TailwindCSS (styling), Radix UI (primitives), shadcn/ui (components), React/Next.js. Capabilities: design system architecture, accessible components, responsive layouts, theming, dark mode, component composition. Actions: review, design, build, improve, refactor UI components. Keywords: TailwindCSS, Radix UI, shadcn/ui, design system, component library, accessibility, ARIA, responsive, dark mode, theming, CSS variables, component architecture, atomic design, design tokens, variant, slot, composition. Use when: building component libraries, implementing shadcn/ui, creating accessible UIs, setting up design systems, adding dark mode/theming, reviewing UI component architecture.
ui-ux-design
samhvw8/dot-claude
UI/UX design reference database. 50+ styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.
claude-md-architect
samhvw8/dot-claude
CLAUDE.md file generation and optimization for Claude Code projects. Capabilities: initialize project instructions, analyze codebase context, optimize existing CLAUDE.md, apply Anthropic best practices, reduce token usage, improve effectiveness. Actions: init, create, optimize, enhance CLAUDE.md files. Keywords: CLAUDE.md, project instructions, Claude Code setup, project context, codebase analysis, Anthropic best practices, token optimization, project configuration, AI instructions, coding guidelines, project rules, workspace setup. Use when: initializing CLAUDE.md for new projects, optimizing existing project instructions, setting up Claude Code for a codebase, improving AI coding guidelines.
nextjs-turborepo
samhvw8/dot-claude
Full-stack web development with Next.js and Turborepo. Stack: Next.js 14+ (App Router, RSC, Server Actions, PPR, SSR, SSG, ISR), Turborepo (monorepo, pipelines, remote caching), RemixIcon (3100+ icons). Capabilities: server components, API routes, middleware, caching strategies, build optimization, monorepo management. Actions: create, build, deploy, optimize Next.js apps, setup monorepo, configure caching. Keywords: Next.js, App Router, Server Components, RSC, Server Actions, SSR, SSG, ISR, PPR, Turborepo, monorepo, remote cache, build pipeline, parallel execution, workspace, pnpm, icons. Use when: building Next.js apps, implementing SSR/SSG, setting up monorepos, optimizing build performance, configuring caching strategies, managing shared dependencies.
aesthetic
samhvw8/dot-claude
Visual design intelligence and UI aesthetics. Integrates: chrome-devtools, ai-multimodal, media-processing. Capabilities: design analysis, visual hierarchy, color theory, typography, micro-interactions, animation, design systems, accessibility. Actions: analyze, design, create, capture, evaluate, implement UI aesthetics. Keywords: Dribbble, Behance, Mobbin, design inspiration, visual hierarchy, color palette, typography, spacing, animation, micro-interaction, design system, style guide, accessibility, WCAG, contrast ratio, golden ratio, whitespace, visual rhythm. Use when: building beautiful UIs, analyzing design inspiration, implementing visual hierarchy, adding animations/micro-interactions, creating design systems, evaluating aesthetic quality, capturing design screenshots.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available