asleekgeek/claude-multiagent-catalogue/arize-prompt-optimization
Claude Code and agent skill by asleekgeek/claude-multiagent-catalogue
- community
Checking that the SKILL.md file is still in the repository.
Optimizes, improves, and debugs LLM prompts using production trace data, evaluations, and annotations. Extracts prompts from spans, gathers performance signal, and runs a data-driven optimization loop using the ax CLI. Use when the user mentions optimize prompt, improve prompt, make AI respond better, improve output quality, prompt engineering, prompt tuning, or system prompt improvement.
Install
npx vskill@latest install asleekgeek/claude-multiagent-catalogue/arize-prompt-optimizationSKILL.md
The same SKILL.md was published earlier as arize-ai/arize-skills/arize-prompt-optimization.
Arize Prompt Optimization Skill
`SPACE` — All--spaceflags and theARIZE_SPACEenv var accept a space name (e.g.,my-workspace) or a base64 space ID (e.g.,U3BhY2U6...). Find yours withax 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:
| Column | What it contains | When to use | |
|---|---|---|---|
attributes.llm.input_messages | Structured chat messages (system, user, assistant, tool) in role-based format | Primary source for chat-based LLM prompts | |
attributes.llm.input_messages.roles | Array of roles: system, user, assistant, tool | Extract individual message roles | |
attributes.llm.input_messages.contents | Array of message content strings | Extract message text | |
attributes.input.value | Serialized prompt or user question (generic, all span kinds) | Fallback when structured messages are not available | |
attributes.llm.prompt_template.template | Template with {variable} placeholders (e.g., "Answer {question} using {context}") | When the app uses prompt templates | |
attributes.llm.prompt_template.variables | Template variable values (JSON object) | See what values were substituted into the template | |
attributes.output.value | Model response text | See what the LLM produced | |
attributes.llm.output_messages | Structured model output (including tool calls) | Inspect tool-calling responses |
Finding Prompts by Span Kind
- LLM span (
attributes.openinference.span.kind = 'LLM'): Checkattributes.llm.input_messagesfor structured chat messages, ORattributes.input.valuefor a serialized prompt. Checkattributes.llm.prompt_template.templatefor the template. - Chain/Agent span:
attributes.input.valuecontains the user's question. The actual LLM prompt lives on child LLM spans -- navigate down the trace tree. - Tool span:
attributes.input.valuehas tool input,attributes.output.valuehas tool result. Not typically where prompts live.
Performance Signal Columns
These columns carry the feedback data used for optimization:
| Column pattern | Source | What it tells you | |
|---|---|---|---|
annotation.<name>.label | Human reviewers | Categorical grade (e.g., correct, incorrect, partial) | |
annotation.<name>.score | Human reviewers | Numeric quality score (e.g., 0.0 - 1.0) | |
annotation.<name>.text | Human reviewers | Freeform explanation of the grade | |
eval.<name>.label | LLM-as-judge evals | Automated categorical assessment | |
eval.<name>.score | LLM-as-judge evals | Automated numeric score | |
eval.<name>.explanation | LLM-as-judge evals | Why the eval gave that score -- most valuable for optimization | |
attributes.input.value | Trace data | What went into the LLM | |
attributes.output.value | Trace data | What the LLM produced | |
{experiment_name}.output | Experiment runs | Output 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 foundor version error → see references/ax-setup.md401 Unauthorized/ missing API key → runax profiles showto 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 listto pick by name, or ask the user - Project unclear → ask the user, or run
ax projects list -o json --limit 100and present as selectable options - LLM provider call fails (missing OPENAI_API_KEY / ANTHROPIC_API_KEY) → run
ax ai-integrations list --space SPACEto 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
.envfiles or search the filesystem for credentials. Useax profilesfor Arize credentials andax ai-integrationsfor 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
Export a trace to inspect prompt structure
Extract prompts from exported JSON
Reconstruct the prompt as messages
Once you have the span data, reconstruct the prompt as a messages array:
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)
From datasets and experiments
Merge dataset + experiment for analysis
Join the two files by example_id to see inputs alongside outputs and evaluations:
Identify what to optimize
Look for patterns across failures:
- Compare outputs to ground truth: Where does the LLM output differ from expected?
- Read eval explanations:
eval.*.explanationtells you WHY something failed - Check annotation text: Human feedback describes specific issues
- Look for verbosity mismatches: If outputs are too long/short vs ground truth
- 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.):
Preparing the performance data
Format the records as a JSON array before pasting into the template:
Applying the revised prompt
After the LLM returns the revised messages array:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/arize-prompt-optimization/SKILL.md
Popularity
- Repository stars
- 2
- Repository forks
- 2
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/asleekgeek/claude-multiagent-catalogue/arize-prompt-optimization)