Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

optimize-prompt优化提示

Agent Skill

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

总安装

855

周安装

36

GitHub Stars

21

下载量

1
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/thepexcel/agent-skills --skill optimize-prompt

简介

用于辅助提示词、系统指令和工作流模板的整理,提升可复用性与行为规范性。

  • 适用于规范任务边界、统一输出格式或拆分操作步骤的场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 使用时应保留真实业务约束,避免将示例当作硬规则。
  • optimize-prompt 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Prompt Optimization Consultant

Expert consultant for optimizing AI prompts across platforms. Asks first, optimizes second.

Consultant Workflow

DISCOVER → DIAGNOSE → OPTIMIZE → VALIDATE

Phase 1: DISCOVER (Always First)

Before touching any prompt, ask these questions:

QuestionWhy It Matters
Platform?Claude API / OpenAI API / Gemini API / CLAUDE.md / ChatGPT / n8n
Model?Opus / Sonnet / Haiku / GPT-4o / GPT-5 / Gemini
Prompt type?System prompt / User prompt / Both
Goal?What should the AI do?
Current issues?What's not working?

Skip discovery only if: User provides all context upfront OR says "just optimize it."

Phase 2: DIAGNOSE

Score against platform-appropriate criteria (see checklist.md).

Phase 3: OPTIMIZE

Apply platform-specific techniques. Show before/after for each change.

Phase 4: VALIDATE

Verify no conflicting instructions and structure is coherent.


Quick Reference

System Prompt vs User Prompt

Put in System PromptPut in User Prompt
Role/personaSpecific task
Persistent behaviorDynamic content
Output formatUser's actual input
Boundaries & rulesTask-specific context
Tool usage guidelinesCurrent session info

Rule: Consistency across sessions → System. Specific to this interaction → User.

Platform Quick Guide

PlatformKey Optimization
Claude APIXML tags, anti-over-engineering clause, tools in API field
OpenAI APIMessage roles, pin model version, tools in tools field
Gemini APICritical instructions at END, temp=1.0, knowledge cutoff
CLAUDE.mdInline content, 150-200 instructions, no progressive disclosure
ChatGPTMarkdown, Memory integration, 1500 char limit
n8nDynamic variables {{$now}}, clear tool naming, memory node

Model-Specific Additions

ModelRequired Addition
Claude Opus 4.5Anti-over-engineering clause (mandatory)
Claude HaikuMore examples (3-5), numbered steps
OpenAI GPTExplicit verbosity control
GeminiGrounding clause if using context

Core Techniques

1. Structure by Platform

Claude (API & CLAUDE.md): XML tags

<context>Role and project</context>
<instructions>What to do</instructions>
<examples>Concrete examples</examples>

OpenAI/ChatGPT: Markdown with clear sections

## Role
You are a helpful assistant...

## Instructions
1. Always...
2. Never...

Gemini: XML or Markdown (pick one, don't mix)

  • Place critical instructions at END for long context

2. Instruction Hierarchy

PriorityMarkerUse For
1stCRITICALSecurity, data loss prevention
2ndIMPORTANTQuality-affecting rules
3rdRegularNormal instructions

Max 2-3 CRITICAL items. If everything is critical, nothing is.

3. Anti-Over-Engineering (Opus Required)

Avoid over-engineering. Only make changes that are directly requested.
Keep solutions simple and focused. Don't add features beyond what was asked.
Don't create abstractions for one-time operations.

4. Examples (3-5 Diverse)

<example>
User: "Add caching"
Bad: "Adding Redis..."
Good: "What's the bottleneck? Let me profile first."
</example>

5. Tables Over Paragraphs

| Tool | Purpose | Flag |
|------|---------|------|
| sql_query.py | Query | --schema |
| sql_write.py | Update | --save |

Anti-Patterns

Anti-PatternFix
Vague instructionsReplace with specific steps
Everything is CRITICALMax 2-3 truly critical items
No examplesAdd 3-5 concrete examples
Explaining basicsTrust the model knows
Wrong format for platformMatch platform conventions
System/User confusionSeparate by persistence vs task-specific

Output Format

## Discovery Summary
- Platform: [X]
- Model: [X]
- Type: [System/User/Both]
- Goal: [X]
- Issues: [X]

## Score: [X/100]

## Issues Found
1. **[Issue]** (Priority: High/Medium/Low)
   - Current: `[snippet]`
   - Problem: [why]
   - Fix: `[improved]`

## Optimized Prompt
[Full optimized version]

## Changes Made
- [bullet list]

References

ReferenceUse For
platforms.mdPlatform-specific deep dive
system-vs-user.mdSystem/User prompt guidance
techniques.mdCore optimization techniques
checklist.mdScoring checklist by platform
model-comparison.mdModel-specific behaviors

Related Skills

  • /deep-research — Research best practices for prompts
  • /skill-creator-thepexcel — Optimize skill system prompts

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Claude Code

26.82%
按下载量换算0

OpenCode

25%
按下载量换算0

windsurf

15.17%
按下载量换算0

Codex

12.68%
按下载量换算0

Antigravity

7.69%
按下载量换算0

Gemini CLI

3.07%
按下载量换算0

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills