Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

llm-prompt-optimizerLLM prompt 优化器

Agent Skill

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

总安装

1,234

周安装

53

GitHub Stars

35,738

下载量

432
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill llm-prompt-optimizer

简介

llm-prompt-optimizer 用于辅助提示词、系统指令和 Agent 行为约束的整理,适合规范任务边界和输出格式。

  • 它支持拆分操作步骤、优化提示词可复用性,并帮助维护工作流模板。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,适用于 Codex、Claude、Cursor、Gemini CLI 等宿主环境。
  • 使用时需保留真实业务约束,避免将示例当作硬规则;涉及自动执行时应明确确认步骤和权限边界。
  • 建议结合原始 README 了解具体能力和限制,确保安全合规使用。

SKILL.md

LLM Prompt Optimizer

Overview

This skill transforms weak, vague, or inconsistent prompts into precision-engineered instructions that reliably produce high-quality outputs from any LLM (Claude, Gemini, GPT-4, Llama, etc.). It applies systematic prompt engineering frameworks — from zero-shot to few-shot, chain-of-thought, and structured output patterns.

When to Use This Skill

  • Use when a prompt returns inconsistent, vague, or hallucinated results
  • Use when you need structured/JSON output from an LLM reliably
  • Use when designing system prompts for AI agents or chatbots
  • Use when you want to reduce token usage without sacrificing quality
  • Use when implementing chain-of-thought reasoning for complex tasks
  • Use when prompts work on one model but fail on another

Step-by-Step Guide

1. Diagnose the Weak Prompt

Before optimizing, identify which problem pattern applies:

ProblemSymptomFix
Too vagueGeneric, unhelpful answersAdd role + context + constraints
No structureUnformatted, hard-to-parse outputSpecify output format explicitly
HallucinationConfident wrong answersAdd "say I don't know if unsure"
InconsistentDifferent answers each runAdd few-shot examples
Too longVerbose, padded responsesAdd length constraints

2. Apply the RSCIT Framework

Every optimized prompt should have:

  • RRole: Who is the AI in this interaction?
  • SSituation: What context does it need?
  • CConstraints: What are the rules and limits?
  • IInstructions: What exactly should it do?
  • TTemplate: What should the output look like?

Before (weak prompt):

Explain machine learning.

After (optimized prompt):

You are a senior ML engineer explaining concepts to a junior developer.

Context: The developer has 1 year of Python experience but no ML background.

Task: Explain supervised machine learning in simple terms.

Constraints:
- Use an analogy from everyday life
- Maximum 200 words
- No mathematical formulas
- End with one actionable next step

Format: Plain prose, no bullet points.

3. Chain-of-Thought (CoT) Pattern

For reasoning tasks, instruct the model to think step-by-step:

Solve this problem step by step, showing your work at each stage.
Only provide the final answer after completing all reasoning steps.

Problem: [your problem here]

Thinking process:
Step 1: [identify what's given]
Step 2: [identify what's needed]
Step 3: [apply logic or formula]
Step 4: [verify the answer]

Final Answer:

4. Few-Shot Examples Pattern

Provide 2-3 examples to establish the pattern:

Classify the sentiment of customer reviews as POSITIVE, NEGATIVE, or NEUTRAL.

Examples:
Review: "This product exceeded my expectations!" -> POSITIVE
Review: "It arrived broken and support was useless." -> NEGATIVE
Review: "Product works as described, nothing special." -> NEUTRAL

Now classify:
Review: "[your review here]" ->

5. Structured JSON Output Pattern

Extract the following information from the text below and return it as valid JSON only.
Do not include any explanation or markdown — just the raw JSON object.

Schema:
{
  "name": string,
  "email": string | null,
  "company": string | null,
  "role": string | null
}

Text: [input text here]

6. Reduce Hallucination Pattern

Answer the following question based ONLY on the provided context.
If the answer is not contained in the context, respond with exactly: "I don't have enough information to answer this."
Do not make up or infer information not present in the context.

Context:
[your context here]

Question: [your question here]

7. Prompt Compression Techniques

Reduce token count without losing effectiveness:

# Verbose (expensive)
"Please carefully analyze the following code and provide a detailed explanation of
what it does, how it works, and any potential issues you might find."

# Compressed (efficient, same quality)
"Analyze this code: explain what it does, how it works, and flag any issues."

Best Practices

  • Do: Always specify the output format (JSON, markdown, plain text, bullet list)
  • Do: Use delimiters (```, ---) to separate instructions from content
  • Do: Test prompts with edge cases (empty input, unusual data)
  • Do: Version your system prompts in source control
  • Do: Add "think step by step" for math, logic, or multi-step tasks
  • Don't: Use negative-only instructions ("don't be verbose") — add positive alternatives
  • Don't: Assume the model knows your codebase context — always include it
  • Don't: Use the same prompt across different models without testing — they behave differently

Prompt Audit Checklist

Before using a prompt in production:

  • Does it have a clear role/persona?
  • Is the output format explicitly defined?
  • Are edge cases handled (empty input, ambiguous data)?
  • Is the length appropriate (not too long/short)?
  • Has it been tested on 5+ varied inputs?
  • Is hallucination risk addressed for factual tasks?

Troubleshooting

Problem: Model ignores format instructions Solution: Move format instructions to the END of the prompt, after examples. Use strong language: "You MUST return only valid JSON."

Problem: Inconsistent results between runs Solution: Lower the temperature setting (0.0-0.3 for factual tasks). Add more few-shot examples.

Problem: Prompt works in playground but fails in production Solution: Check if system prompt is being sent correctly. Verify token limits aren't being exceeded (use a token counter).

Problem: Output is too long Solution: Add explicit word/sentence limits: "Respond in exactly 3 bullet points, each under 20 words."

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.36%
按下载量换算148

Claude

31.15%
按下载量换算135

Cursor

19.2%
按下载量换算83

Gemini CLI

10.42%
按下载量换算45

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills