Token导航 LogoToken导航TokenDH.com
AI 工具需要联网github未标认证来源可访问clear审计通过

prompt-enhancer提示增强器

Agent Skill

用于辅助提示词、系统指令、Agent 行为约束和工作流模板的整理。它适合让 Agent 规范任务边界、统一输出格式、拆分操作步骤或优化提示词可复用性。使用时需要保留真实业务约束,不要把示例当硬规则;涉及自动执行、外部工具或高风险操作时,应在提示词中明确确认步骤、权限边界和失败处理方式。

总安装

1,248

周安装

52

GitHub Stars

10

下载量

416
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:prompt-enhancer(提示增强器)
来源仓库:https://github.com/samhvw8/dot-claude
仓库路径:skills/prompt-enhancer
安装命令:
npx skills add https://github.com/samhvw8/dot-claude --skill prompt-enhancer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/samhvw8/dot-claude --skill prompt-enhancer

简介

用于辅助提示词、系统指令、Agent 行为约束和工作流模板的整理。

  • 适合让 Agent 规范任务边界、统一输出格式或优化提示词可复用性。
  • 使用时需要保留真实业务约束,不要把示例当硬规则。
  • 涉及自动执行、外部工具或高风险操作时,应在提示词中明确确认步骤和权限边界。
  • prompt-enhancer 属于AI 工具类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

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

  1. Conciseness: Remove unnecessary words while preserving intent
  2. Structure: Use clear formatting with multiple lines and logical sections
  3. XML Integration: Mix natural text with XML tags for clarity and parsing
  4. Direct Mission: Main task/quest/mission should NOT be wrapped in XML elements
  5. 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: queriesq, keywordkw, filterf, sort_bys
  • 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<50000 instead of price<50000
  • Parse p/c prefixes during remapping
  • Combine with semicolons: c=c4;p<50000 for 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.


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.


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.


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.

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:

  1. Read the user's prompt completely
  2. Identify enhancement opportunities
  3. Apply structural and linguistic improvements
  4. Output ONLY the enhanced version
  5. Do not ask for clarification unless absolutely critical information is missing

The enhanced prompt should be immediately usable by the user without any modifications.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.66%
按下载量换算128

windsurf

23.58%
按下载量换算98

Antigravity

19.49%
按下载量换算81

trae

13.23%
按下载量换算55

OpenCode

7.49%
按下载量换算31

Gemini CLI

3.63%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills