arize-prompt-optimization
INVOKE THIS SKILL when optimizing, improving, or debugging LLM prompts using production trace data, evaluations, and annotations.
Skill by HenriqueOliveiraFiap
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/henriqueoliveirafiap-arize-prompt-optimization
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data, ml, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/arize-prompt-optimization
What's inside
- Skill name
arize-prompt-optimization- Description
- INVOKE THIS SKILL when optimizing, improving, or debugging LLM prompts using production trace data, evaluations, and annotations. Covers extracting prompts from spans, gathering performance signal, and running a data-driven optimization loop using the ax CLI.
- License
- MIT
- Instructions
- 447 lines in SKILL.md · view on GitHub
Files (3)
- SKILL.md
- ax-profiles.md · references/
- ax-setup.md · references/
SKILL.md (first lines)
# Arize Prompt Optimization Skill
## 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'`): 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 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 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: check `.env` for `ARIZE_API_KEY` and use it to create/update the profile via references/ax-profiles.md. If `.env` has no key either, ask the user for their Arize API key (https://app.arize.com/admin > API Keys)
- Space ID unknown → check `.env` for `ARIZE_SPACE_ID`, or run `ax spaces list -o json`, or ask the user
- Project unclear → check `.env` for `ARIZE_DEFAULT_PROJECT`, or ask, 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) → check `.env`, load if present, otherwise ask the user
## Phase 1: Extract the Current Prompt
### Find LLM spans containing prompts
```bash
# List LLM spans (where prompts live)
ax spans list PROJECT_ID --filter "attributes.openinference.span.kind = 'LLM'" --limit 10
# Filter by model
ax spans list PROJECT_ID --filter "attributes.llm.model_name = 'gpt-4o'" --limit 10
# Filter by span name (e.g., a specific LLM call)
ax spans list PROJECT_ID --filter "name = 'ChatCompletion'" --limit 10
```
### Export a trace to inspect prompt structure
```bash
# Export all spans in a trace
ax spans export --trace-id TRACE_ID --project PROJECT_ID
# Export a single span
ax spans export --span-id SPAN_ID --project PROJECT_ID
```
### Extract prompts from exported JSON
```bash
# 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:
```json
[
{"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)
```bash
# Find error spans -- these indicate prompt failures
ax spans list PROJECT_ID \
--filter "status_code = 'ERROR' AND attributes.openinference.span.kind = 'LLM'" \
--limit 20From HenriqueOliveiraFiap/awesome-copilot, MIT.
More from HenriqueOliveiraFiap/awesome-copilot
- 0.414score
arize-annotation
HenriqueOliveiraFiap
INVOKE THIS SKILL when creating, managing, or using annotation configs on Arize (categorical, continuous, freeform), or applying human annotations to project…
SkillDFreshness: DClaude Code +9 - 0.414score
arize-instrumentation
HenriqueOliveiraFiap
INVOKE THIS SKILL when adding Arize AX tracing to an application.
SkillDFreshness: DClaude Code +9 - 0.414score
arize-link
HenriqueOliveiraFiap
Generate deep links to the Arize UI.
SkillDFreshness: DClaude Code +9 - 0.414score
arize-ai-provider-integration
HenriqueOliveiraFiap
INVOKE THIS SKILL when creating, reading, updating, or deleting Arize AI integrations.
SkillDFreshness: DClaude Code +9 - 0.411score
arize-dataset
HenriqueOliveiraFiap
INVOKE THIS SKILL when creating, managing, or querying Arize datasets and examples.
SkillDFreshness: DClaude Code +9 - 0.411score
arize-experiment
HenriqueOliveiraFiap
INVOKE THIS SKILL when creating, running, or analyzing Arize experiments.
SkillDFreshness: DClaude Code +9 - 0.411score
arize-trace
HenriqueOliveiraFiap
INVOKE THIS SKILL when downloading or exporting Arize traces and spans.
SkillDFreshness: DClaude Code +9 - 0.409score
import-infrastructure-as-code
HenriqueOliveiraFiap
Import existing Azure resources into Terraform using Azure CLI discovery and Azure Verified Modules (AVM).
SkillDFreshness: DClaude Code +9 - 0.406score
azure-resource-health-diagnose
HenriqueOliveiraFiap
Analyze Azure resource health, diagnose issues from logs and telemetry, and create a remediation plan for identified problems.
SkillDFreshness: DClaude Code +9 - 0.406score
arize-evaluator
HenriqueOliveiraFiap
INVOKE THIS SKILL for LLM-as-judge evaluation workflows on Arize: creating/updating evaluators, running evaluations on spans or experiments, tasks…
SkillDFreshness: DClaude Code +9 - 0.405score
remember-interactive-programming
HenriqueOliveiraFiap
A micro-prompt that reminds the agent that it is an interactive programmer.
SkillDFreshness: DClaude Code +9 - 0.404score
refactor-plan
HenriqueOliveiraFiap
Plan a multi-file refactor with proper sequencing and rollback steps
SkillDFreshness: DClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Apr 1, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.247score
arize-prompt-optimization
raverx-dev
INVOKE THIS SKILL when optimizing, improving, or debugging LLM prompts using production trace data, evaluations, and annotations.
SkillDFreshness: DClaude Code +9 - 0.244score
arize-prompt-optimization
passelin
INVOKE THIS SKILL when optimizing, improving, or debugging LLM prompts using production trace data, evaluations, and annotations.
SkillDFreshness: DClaude Code +9
More from HenriqueOliveiraFiap
- 0.414score
arize-annotation
HenriqueOliveiraFiap
INVOKE THIS SKILL when creating, managing, or using annotation configs on Arize (categorical, continuous, freeform), or applying human annotations to project…
SkillDFreshness: DClaude Code +9 - 0.414score
arize-instrumentation
HenriqueOliveiraFiap
INVOKE THIS SKILL when adding Arize AX tracing to an application.
SkillDFreshness: DClaude Code +9 - 0.414score
arize-link
HenriqueOliveiraFiap
Generate deep links to the Arize UI.
SkillDFreshness: DClaude Code +9 - 0.414score
arize-ai-provider-integration
HenriqueOliveiraFiap
INVOKE THIS SKILL when creating, reading, updating, or deleting Arize AI integrations.
SkillDFreshness: DClaude Code +9 - 0.411score
arize-dataset
HenriqueOliveiraFiap
INVOKE THIS SKILL when creating, managing, or querying Arize datasets and examples.
SkillDFreshness: DClaude Code +9 - 0.411score
arize-experiment
HenriqueOliveiraFiap
INVOKE THIS SKILL when creating, running, or analyzing Arize experiments.
SkillDFreshness: DClaude Code +9
Cite this page
arize-prompt-optimization skill. Agent Mart. https://agentmart.dev/skills/henriqueoliveirafiap-arize-prompt-optimization (last updated 2026-10-24)