Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问clear审计提醒

prompt-optimization及时优化

Agent Skill

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

总安装

261

周安装

11

GitHub Stars

公开资料未说明

下载量

92
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/sitechfromgeorgia/georgian-distribution-system --skill prompt-optimization

简介

prompt-optimization 用于辅助提示词和工作流模板的整理。

  • 适合规范任务边界、统一输出格式或优化提示词可复用性。
  • 使用时需保留真实业务约束,不要把示例当硬规则。
  • 涉及自动执行或外部工具调用时,应在提示词中明确确认步骤和权限边界。
  • 当前暂无底部简介内容,可参考来源仓库获取更多使用细节。

SKILL.md

Prompt Optimization Skill

Overview

Transform any request into an optimized, production-ready prompt for Claude 4.x that eliminates hallucinations and ensures first-response accuracy. Apply investigation-first protocols, extended thinking patterns, and anti-hallucination guards.

When to Use

Trigger this skill when:

  • User requests prompt improvement or optimization
  • Prompt contains "optimize", "improve my prompt", "make this better"
  • Vague requests need clarification and structure
  • Existing prompts show hallucination issues
  • User mentions "investigation first", "anti-hallucination", "production-ready"

Quick Start

Basic Optimization

User: "optimize: [paste prompt]"
→ Analyze structure
→ Apply Claude 4.x patterns
→ Return production version

Eliminate Hallucinations

User: "fix hallucinations in: [prompt]"
→ Add investigation protocol
→ Insert verification checkpoints
→ Remove speculation triggers

Core Optimization Framework

6 Key Strategies

1. Context & Motivation

Explain WHY, not just WHAT.

❌ WEAK: "Never use ellipses"
✅ STRONG: "Your response will be read by text-to-speech,
so never use ellipses since TTS cannot pronounce them."

2. Investigation-First

NEVER provide answers before investigating.

<investigation_required>
When user asks: "Fix this bug"

❌ DON'T: Immediately suggest fixes
✅ DO:
1. Examine code structure
2. Identify error location
3. Trace execution path
4. Review logs
5. Form evidence-based hypothesis
6. THEN suggest solution
</investigation_required>

3. Multishot Examples

Provide 2-3 examples covering different scenarios.

<multishot_pattern>
- Typical case (80% of scenarios)
- Edge case (unusual but valid)
- Error case (what NOT to do)
</multishot_pattern>

4. Explicit Output Format

Define EXACTLY what output should look like.

<output_format>
Structure:
1. **Summary** (2-3 sentences)
2. **Key Findings** (bullets)
3. **Recommendations** (numbered)
4. **Next Steps** (actions)

Do NOT include opinions or speculation.
</output_format>

5. Extended Thinking

For complex tasks, enable step-by-step reasoning.

<thinking_protocol>
Break down the problem:
1. What are we achieving?
2. What info do we have?
3. What steps are needed?
4. What could go wrong?
5. How do we verify?
</thinking_protocol>

6. Anti-Hallucination Guards

<anti_hallucination>
<rules>
1. NEVER make up facts/statistics
2. ALWAYS cite sources when available
3. Use "I don't know" when uncertain
4. Investigate before answering
5. Verify against context
</rules>

<when_uncertain>
If info not in context:
- State what you DO know
- Explain what's missing
- Suggest how to find it
- DON'T guess
</when_uncertain>
</anti_hallucination>

Optimized Prompt Template

Use this structure:

<role>
Specific expert role with domain knowledge
</role>

<context>
Why this task matters and background
</context>

<investigation>
What to check before responding:
- Information to gather
- Resources to consult
- Questions to clarify
</investigation>

<thinking>
Step-by-step approach:
1. Analyze request
2. Identify requirements
3. Consider edge cases
4. Plan response
5. Verify assumptions
</thinking>

<execution>
How to perform the task:
- Steps to follow
- Tools/methods to use
- Quality checks
</execution>

<output_format>
Exact format for response
</output_format>

<anti_hallucination>
Never speculate. If uncertain, state clearly.
</anti_hallucination>

<examples>
<example type="typical">[Ex 1]</example>
<example type="edge">[Ex 2]</example>
<example type="error">[Ex 3]</example>
</examples>
</optimized_prompt_template>

Claude 4.x Features

Extended Thinking

Enable for complex reasoning tasks.

<extended_thinking>
Use when task requires:
- Multi-step analysis
- Complex problem solving
- Long-horizon planning

Pattern: "Think step-by-step:
1. [Step]
2. [Step]
3. [Verification]"
</extended_thinking>

Parallel Tool Calling

Run multiple operations simultaneously.

<parallel_tools>
✅ DO: Call tools in parallel when independent
❌ DON'T: Sequential when unnecessary

Example: "Fetch user AND load settings AND check permissions"
→ All run simultaneously
</parallel_tools>

Long-Horizon Tasks

Track progress across interactions.

<long_horizon>
<state_management>
- Create progress.txt
- Log completed subtasks
- Note blockers
- Update after each step
</state_management>

<continuation>
When resuming:
1. Read progress.txt
2. Verify last state
3. Continue next task
4. Update progress
</continuation>
</long_horizon>

MCP Integration

<mcp_pattern>
<discovery>
1. Check MCP resources
2. Identify relevant tools
3. Load contextual prompts
</discovery>

<execution>
User asks about data:
1. Search MCP resources
2. Use MCP tools for real-time data
3. Apply MCP formatting prompts
4. Combine response
</execution>

<example>
"What's in Q4 sales report?"
→ MCP Resource: google_drive://Q4_Sales.xlsx
→ MCP Tool: parse_excel()
→ MCP Prompt: sales_summary_template
→ Return formatted analysis
</example>
</mcp_pattern>

Real-World Examples

Example 1: Vague → Structured

Before: "Help me build a website"

After: See website-build-example.md

Example 2: Bug Fix → Investigation-First

Before: "My app crashes on submit"

After: See bug-fix-example.md

Example 3: Data Analysis → Verification-First

Before: "Analyze this CSV"

After: See data-analysis-example.md

Advanced Patterns

Self-Verification

<self_verification>
After generating response:
1. Review vs requirements
2. Check hallucinations
3. Verify facts
4. Confirm format
5. Test edge cases

Issues found? Revise before delivery.
</self_verification>

Progressive Refinement

<progressive_refinement>
For complex prompts:
1. Start basic
2. Test samples
3. Identify failures
4. Add guards
5. Retest
6. Document

Iterate based on performance.
</progressive_refinement>

Context Management

<context_optimization>
For large prompts:
1. **Essential First**: Core instructions at top
2. **Progressive Disclosure**: Details on-demand
3. **References**: Link vs including
4. **Examples Last**: After instructions

If >2000 words:
- Split into skill + references/
- Use MCP for external resources
</context_optimization>

Guidelines

Always Do:

✅ Investigate before answering ✅ Provide multiple examples ✅ Define clear output format ✅ Include anti-hallucination guards ✅ Explain WHY, not just WHAT ✅ Use XML for structure ✅ Test with edge cases

Never Do:

❌ Skip investigation ❌ Assume intent ❌ Single example only ❌ Ambiguous output format ❌ Ignore hallucination risks ❌ Vague instructions ❌ Deliver untested prompts

Red Flags (Fix These):

🚩 "Create something" (too vague) 🚩 No examples 🚩 Missing output format 🚩 No verification steps 🚩 Assumes context 🚩 No anti-hallucination guards 🚩 Single-shot examples

Output Template

Deliver this when optimizing:

# Optimized Prompt

[Complete optimized prompt in XML format]

---

## Optimization Summary

**Changes Made:**
- Added investigation protocol
- Included multishot examples
- Defined output format
- Added anti-hallucination guards
- [Others]

**Expected Improvements:**
- Hallucination reduction: ~X%
- First-response accuracy: ~Y%
- Clarity: High/Medium/Low

**Testing Checklist:**
- [ ] Typical case
- [ ] Edge case
- [ ] Error/invalid input
- [ ] Ambiguous request
- [ ] Missing info

---

Ready to use!

Quality Metrics

MetricTarget
Hallucination Rate<5%
First-Response Success>90%
Iterations Needed1-2
Clarity ScoreHigh

Additional Resources

For detailed examples and deep-dive topics:

  • See references/ directory for complete examples
  • Claude 4.x documentation
  • MCP specification
  • Anthropic prompt engineering guide

*Version: 1.0.0 | Optimized for Claude 4.x*

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Claude Code

28.17%
按下载量换算26

windsurf

22.06%
按下载量换算20

OpenCode

19.76%
按下载量换算18

Gemini CLI

14.5%
按下载量换算13

Cursor

8.74%
按下载量换算8

Codex

3.65%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills