Token导航 LogoToken导航

Agent Skill · 研究检索

arize-prompt-optimization(出现提示优化)

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

arize-prompt-optimization 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 15,970。

总安装 7,479周安装 318GitHub Stars 14下载 2,620核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/arize-ai/arize-skills --skill arize-prompt-optimization

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

Arize Prompt Optimization 优化提示词结构与系统指令设计,提升 Agent 行为可控性。适合规范任务边界、统一输出格式和增强提示复用性。基于 OpenInference 标准解析 prompts 存储位置和消息角色。不能将示例当作硬性规则,须保留真实业务约束条件。

高风险操作应在提示中嵌入确认步骤和回滚机制。

来源仓库内路径:skills/arize-prompt-optimization

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/arize-ai/arize-skills --skill arize-prompt-opt…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

arize-prompt-optimization 怎么安装?

在终端执行 npx skills add https://github.com/arize-ai/arize-skills --skill arize-prompt-optimization。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

arize-prompt-optimization 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

arize-prompt-optimization 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

arize-prompt-optimization 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

arize-prompt-optimization 用的人多吗?

公开数据是累计安装 7,479 次,近一周安装 318 次,下载 2,620 次,GitHub 14 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

arize-prompt-optimization 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
arize-prompt-optimization

出现提示优化 · 本页

7,47914接触敏感数据未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Arize Prompt Optimization Skill

SPACE — All --space flags and the ARIZE_SPACE env var accept a space name (e.g., my-workspace) or a base64 space ID (e.g., U3BhY2U6...). Find yours with ax spaces list.

Concepts

Where Prompts Live in Trace Data

LLM applications emit spans following OpenInference semantic conventions. Prompts are stored in different span attributes depending on the span kind and instrumentation:

ColumnWhat it containsWhen to use
attributes.llm.input_messagesStructured chat messages (system, user, assistant, tool) in role-based formatPrimary source for chat-based LLM prompts
attributes.llm.input_messages.rolesArray of roles: system, user, assistant, toolExtract individual message roles
attributes.llm.input_messages.contentsArray of message content stringsExtract message text
attributes.input.valueSerialized prompt or user question (generic, all span kinds)Fallback when structured messages are not available
attributes.llm.prompt_template.templateTemplate with {variable} placeholders (e.g., "Answer {question} using {context}")When the app uses prompt templates
attributes.llm.prompt_template.variablesTemplate variable values (JSON object)See what values were substituted into the template
attributes.output.valueModel response textSee what the LLM produced
attributes.llm.output_messagesStructured model output (including tool calls)Inspect tool-calling responses

Finding Prompts by Span Kind

  • LLM span (attributes.openinference.span.kind = 'LLM'): Check attributes.llm.input_messages for structured chat messages, OR attributes.input.value for a serialized prompt. Check attributes.llm.prompt_template.template for the template.
  • Chain/Agent span: attributes.input.value contains the user's question. The actual LLM prompt lives on child LLM spans -- navigate down the trace tree.
  • Tool span: attributes.input.value has tool input, attributes.output.value has tool result. Not typically where prompts live.

Performance Signal Columns

These columns carry the feedback data used for optimization:

Column patternSourceWhat it tells you
annotation.<name>.labelHuman reviewersCategorical grade (e.g., correct, incorrect, partial)
annotation.<name>.scoreHuman reviewersNumeric quality score (e.g., 0.0 - 1.0)
annotation.<name>.textHuman reviewersFreeform explanation of the grade
eval.<name>.labelLLM-as-judge evalsAutomated categorical assessment
eval.<name>.scoreLLM-as-judge evalsAutomated numeric score
eval.<name>.explanationLLM-as-judge evalsWhy the eval gave that score -- most valuable for optimization
attributes.input.valueTrace dataWhat went into the LLM
attributes.output.valueTrace dataWhat the LLM produced
{experiment_name}.outputExperiment runsOutput from a specific experiment

Prerequisites

Proceed directly with the task — run the ax command you need. Do NOT check versions, env vars, or profiles upfront.

If an ax command fails, troubleshoot based on the error:

  • command not found or version error → see references/ax-setup.md
  • 401 Unauthorized / missing API key → run ax profiles show to inspect the current profile. If the profile is missing or the API key is wrong, follow references/ax-profiles.md to create/update it. If the user doesn't have their key, direct them to https://app.arize.com/admin > API Keys
  • Space unknown → run ax spaces list to pick by name, or ask the user
  • Project unclear → ask the user, or run ax projects list -o json --limit 100 and present as selectable options
  • LLM provider call fails (missing OPENAI_API_KEY / ANTHROPIC_API_KEY) → run ax ai-integrations list --space SPACE to check for platform-managed credentials. If none exist, ask the user to provide the key or create an integration via the arize-ai-provider-integration skill
  • Security: Never read .env files or search the filesystem for credentials. Use ax profiles for Arize credentials and ax ai-integrations for LLM provider keys. If credentials are not available through these channels, ask the user.

Phase 1: Extract the Current Prompt

Find LLM spans containing prompts

# Sample LLM spans (where prompts live)
ax spans export PROJECT --filter "attributes.openinference.span.kind = 'LLM'" -l 10 --stdout

# Filter by model
ax spans export PROJECT --filter "attributes.llm.model_name = 'gpt-4o'" -l 10 --stdout

# Filter by span name (e.g., a specific LLM call)
ax spans export PROJECT --filter "name = 'ChatCompletion'" -l 10 --stdout

Export a trace to inspect prompt structure

# Export all spans in a trace
ax spans export PROJECT --trace-id TRACE_ID

# Export a single span
ax spans export PROJECT --span-id SPAN_ID

Extract prompts from exported JSON

# Extract structured chat messages (system + user + assistant)
jq '.[0] | {
  messages: .attributes.llm.input_messages,
  model: .attributes.llm.model_name
}' trace_*/spans.json

# Extract the system prompt specifically
jq '[.[] | select(.attributes.llm.input_messages.roles[]? == "system")] | .[0].attributes.llm.input_messages' trace_*/spans.json

# Extract prompt template and variables
jq '.[0].attributes.llm.prompt_template' trace_*/spans.json

# Extract from input.value (fallback for non-structured prompts)
jq '.[0].attributes.input.value' trace_*/spans.json

Reconstruct the prompt as messages

Once you have the span data, reconstruct the prompt as a messages array:

[
  {"role": "system", "content": "You are a helpful assistant that..."},
  {"role": "user", "content": "Given {input}, answer the question: {question}"}
]

If the span has attributes.llm.prompt_template.template, the prompt uses variables. Preserve these placeholders ({variable} or {{variable}}) -- they are substituted at runtime.

Phase 2: Gather Performance Data

From traces (production feedback)

# Find error spans -- these indicate prompt failures
ax spans export PROJECT \
  --filter "status_code = 'ERROR' AND attributes.openinference.span.kind = 'LLM'" \
  -l 20 --stdout

# Find spans with low eval scores
ax spans export PROJECT \
  --filter "annotation.correctness.label = 'incorrect'" \
  -l 20 --stdout

# Find spans with high latency (may indicate overly complex prompts)
ax spans export PROJECT \
  --filter "attributes.openinference.span.kind = 'LLM' AND latency_ms > 10000" \
  -l 20 --stdout

# Export error traces for detailed inspection
ax spans export PROJECT --trace-id TRACE_ID

From datasets and experiments

# Export a dataset (ground truth examples)
ax datasets export DATASET_NAME --space SPACE
# -> dataset_*/examples.json

# Export experiment results (what the LLM produced)
ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE
# -> experiment_*/runs.json

Merge dataset + experiment for analysis

Join the two files by example_id to see inputs alongside outputs and evaluations:

# Count examples and runs
jq 'length' dataset_*/examples.json
jq 'length' experiment_*/runs.json

# View a single joined record
jq -s '
  .[0] as $dataset |
  .[1][0] as $run |
  ($dataset[] | select(.id == $run.example_id)) as $example |
  {
    input: $example,
    output: $run.output,
    evaluations: $run.evaluations
  }
' dataset_*/examples.json experiment_*/runs.json

# Find failed examples (where eval score < threshold)
jq '[.[] | select(.evaluations.correctness.score < 0.5)]' experiment_*/runs.json

Identify what to optimize

Look for patterns across failures:

  1. Compare outputs to ground truth: Where does the LLM output differ from expected?
  2. Read eval explanations: eval.*.explanation tells you WHY something failed
  3. Check annotation text: Human feedback describes specific issues
  4. Look for verbosity mismatches: If outputs are too long/short vs ground truth
  5. Check format compliance: Are outputs in the expected format?

Phase 3: Optimize the Prompt

The Optimization Meta-Prompt

Use this template to generate an improved version of the prompt. Fill in the three placeholders and send it to your LLM (GPT-4o, Claude, etc.):

You are an expert in prompt optimization. Given the original baseline prompt
and the associated performance data (inputs, outputs, evaluation labels, and
explanations), generate a revised version that improves results.

ORIGINAL BASELINE PROMPT
========================

{PASTE_ORIGINAL_PROMPT_HERE}

========================

PERFORMANCE DATA
================

The following records show how the current prompt performed. Each record
includes the input, the LLM output, and evaluation feedback:

{PASTE_RECORDS_HERE}

================

HOW TO USE THIS DATA

1. Compare outputs: Look at what the LLM generated vs what was expected
2. Review eval scores: Check which examples scored poorly and why
3. Examine annotations: Human feedback shows what worked and what didn't
4. Identify patterns: Look for common issues across multiple examples
5. Focus on failures: The rows where the output DIFFERS from the expected
   value are the ones that need fixing

ALIGNMENT STRATEGY

- If outputs have extra text or reasoning not present in the ground truth,
  remove instructions that encourage explanation or verbose reasoning
- If outputs are missing information, add instructions to include it
- If outputs are in the wrong format, add explicit format instructions
- Focus on the rows where the output differs from the target -- these are
  the failures to fix

RULES

Maintain Structure:
- Use the same template variables as the current prompt ({var} or {{var}})
- Don't change sections that are already working
- Preserve the exact return format instructions from the original prompt

Avoid Overfitting:
- DO NOT copy examples verbatim into the prompt
- DO NOT quote specific test data outputs exactly
- INSTEAD: Extract the ESSENCE of what makes good vs bad outputs
- INSTEAD: Add general guidelines and principles
- INSTEAD: If adding few-shot examples, create SYNTHETIC examples that
  demonstrate the principle, not real data from above

Goal: Create a prompt that generalizes well to new inputs, not one that
memorizes the test data.

OUTPUT FORMAT

Return the revised prompt as a JSON array of messages:

[
  {"role": "system", "content": "..."},
  {"role": "user", "content": "..."}
]

Also provide a brief reasoning section (bulleted list) explaining:
- What problems you found
- How the revised prompt addresses each one

Preparing the performance data

Format the records as a JSON array before pasting into the template:

# From dataset + experiment: join and select relevant columns
jq -s '
  .[0] as $ds |
  [.[1][] | . as $run |
    ($ds[] | select(.id == $run.example_id)) as $ex |
    {
      input: $ex.input,
      expected: $ex.expected_output,
      actual_output: $run.output,
      eval_score: $run.evaluations.correctness.score,
      eval_label: $run.evaluations.correctness.label,
      eval_explanation: $run.evaluations.correctness.explanation
    }
  ]
' dataset_*/examples.json experiment_*/runs.json

# From exported spans: extract input/output pairs with annotations
jq '[.[] | select(.attributes.openinference.span.kind == "LLM") | {
  input: .attributes.input.value,
  output: .attributes.output.value,
  status: .status_code,
  model: .attributes.llm.model_name
}]' trace_*/spans.json

Applying the revised prompt

After the LLM returns the revised messages array:

  1. Compare the original and revised prompts side by side
  2. Verify all template variables are preserved
  3. Check that format instructions are intact
  4. Test on a few examples before full deployment

Phase 4: Iterate

The optimization loop

1. Extract prompt    -> Phase 1 (once)
2. Run experiment    -> ax experiments create ...
3. Export results    -> ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE
4. Analyze failures  -> jq to find low scores
5. Run meta-prompt   -> Phase 3 with new failure data
6. Apply revised prompt
7. Repeat from step 2

Measure improvement

# Compare scores across experiments
# Experiment A (baseline)
jq '[.[] | .evaluations.correctness.score] | add / length' experiment_a/runs.json

# Experiment B (optimized)
jq '[.[] | .evaluations.correctness.score] | add / length' experiment_b/runs.json

# Find examples that flipped from fail to pass
jq -s '
  [.[0][] | select(.evaluations.correctness.label == "incorrect")] as $fails |
  [.[1][] | select(.evaluations.correctness.label == "correct") |
    select(.example_id as $id | $fails | any(.example_id == $id))
  ] | length
' experiment_a/runs.json experiment_b/runs.json

A/B compare two prompts

  1. Create two experiments against the same dataset, each using a different prompt version
  2. Export both: ax experiments export EXP_A and ax experiments export EXP_B
  3. Compare average scores, failure rates, and specific example flips
  4. Check for regressions -- examples that passed with prompt A but fail with prompt B

Prompt Engineering Best Practices

Apply these when writing or revising prompts:

TechniqueWhen to applyExample
Clear, detailed instructionsOutput is vague or off-topic"Classify the sentiment as exactly one of: positive, negative, neutral"
Instructions at the beginningModel ignores later instructionsPut the task description before examples
Step-by-step breakdownsComplex multi-step processes"First extract entities, then classify each, then summarize"
Specific personasNeed consistent style/tone"You are a senior financial analyst writing for institutional investors"
Delimiter tokensSections blend togetherUse ---, ###, or XML tags to separate input from instructions
Few-shot examplesOutput format needs clarificationShow 2-3 synthetic input/output pairs
Output length specificationsResponses are too long or short"Respond in exactly 2-3 sentences"
Reasoning instructionsAccuracy is critical"Think step by step before answering"
"I don't know" guidelinesHallucination is a risk"If the answer is not in the provided context, say 'I don't have enough information'"

Variable preservation

When optimizing prompts that use template variables:

  • Single braces ({variable}): Python f-string / Jinja style. Most common in Arize.
  • Double braces ({{variable}}): Mustache style. Used when the framework requires it.
  • Never add or remove variable placeholders during optimization
  • Never rename variables -- the runtime substitution depends on exact names
  • If adding few-shot examples, use literal values, not variable placeholders

Workflows

Optimize a prompt from a failing trace

  1. Find failing traces: ax traces list PROJECT --filter "status_code = 'ERROR'" --limit 5
  2. Export the trace: ax spans export PROJECT --trace-id TRACE_ID
  3. Extract the prompt from the LLM span: jq '[.[] | select(.attributes.openinference.span.kind == "LLM")][0] | {messages:.attributes.llm.input_messages, template:.attributes.llm.prompt_template, output:.attributes.output.value, error:.attributes.exception.message}' trace_*/spans.json
  4. Identify what failed from the error message or output
  5. Fill in the optimization meta-prompt (Phase 3) with the prompt and error context
  6. Apply the revised prompt

Optimize using a dataset and experiment

  1. Find the dataset and experiment: ax datasets list --space SPACE ax experiments list --dataset DATASET_NAME --space SPACE
  2. Export both: ax datasets export DATASET_NAME --space SPACE ax experiments export EXPERIMENT_NAME --dataset DATASET_NAME --space SPACE
  3. Prepare the joined data for the meta-prompt
  4. Run the optimization meta-prompt
  5. Create a new experiment with the revised prompt to measure improvement

Debug a prompt that produces wrong format

  1. Export spans where the output format is wrong: ax spans export PROJECT \ --filter "attributes.openinference.span.kind = 'LLM' AND annotation.format.label = 'incorrect'" \ -l 10 --stdout > bad_format.json
  2. Look at what the LLM is producing vs what was expected
  3. Add explicit format instructions to the prompt (JSON schema, examples, delimiters)
  4. Common fix: add a few-shot example showing the exact desired output format

Reduce hallucination in a RAG prompt

  1. Find traces where the model hallucinated: ax spans export PROJECT \ --filter "annotation.faithfulness.label = 'unfaithful'" \ -l 20 --stdout
  2. Export and inspect the retriever + LLM spans together: ax spans export PROJECT --trace-id TRACE_ID jq '[.[] | {kind:.attributes.openinference.span.kind, name, input:.attributes.input.value, output:.attributes.output.value}]' trace_*/spans.json
  3. Check if the retrieved context actually contained the answer
  4. Add grounding instructions to the system prompt: "Only use information from the provided context. If the answer is not in the context, say so."

Troubleshooting

ProblemSolution
ax: command not foundSee references/ax-setup.md
No profile foundNo profile is configured. See references/ax-profiles.md to create one.
No input_messages on spanCheck span kind -- Chain/Agent spans store prompts on child LLM spans, not on themselves
Prompt template is nullNot all instrumentations emit prompt_template. Use input_messages or input.value instead
Variables lost after optimizationVerify the revised prompt preserves all {var} placeholders from the original
Optimization makes things worseCheck for overfitting -- the meta-prompt may have memorized test data. Ensure few-shot examples are synthetic
No eval/annotation columnsRun evaluations first (via Arize UI or SDK), then re-export
Experiment output column not foundThe column name is {experiment_name}.output -- check exact experiment name via ax experiments get
jq errors on span JSONEnsure you're targeting the correct file path (e.g., trace_*/spans.json)

平台分布

Codex

36.82%
按下载量换算965

Claude

33.57%
按下载量换算880

Cursor

18.13%
按下载量换算475

Gemini CLI

9.3%
按下载量换算244

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills