span-coding

Open-code Phoenix spans with PXI notes and promote patterns into structured annotations.

11.3k|1.1k|Updated Nov 9, 2022
One-click install
npx skills add https://github.com/Arize-ai/phoenix --skill span-coding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: span-coding
Source: https://github.com/Arize-ai/phoenix/tree/main/src/phoenix/server/agents/prompts/skills/span-coding
Command: npx skills add https://github.com/Arize-ai/phoenix --skill span-coding

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When analyzing LLM traces, failure patterns are unknown before a taxonomy exists, making it hard to label spans consistently. This Skill provides a qualitative coding workflow: inspect spans, write evidence-close open notes, recover them, group recurring patterns, and only then create structured annotations.

Core Features & Use Cases

  • Open Coding with PXI Notes: Write durable, per-span observations using the server-executed write_span_note tool with the pxi identifier, keeping notes as the canonical source of truth.
  • Note Recovery via GraphQL: Paginate Project.spans with the phoenix-graphql skill and filter spanNotes to identifier == "pxi" to resume analysis across sessions.
  • Axial Coding and Annotation Promotion: Group recovered notes into named categories, check existing annotation configs, and apply ui.spans.annotate only after labels stabilize.
  • Use Case: An engineer investigating why a support chatbot fails samples 200 spans, writes open notes like "Retriever returned onboarding docs for a cancellation question," groups them into a retrieval-mismatch category, and then applies a structured annotation label across the project.

Quick Start

Ask the agent to open-code a sample of spans from your Phoenix project to discover failure patterns before defining any annotation taxonomy.

Frequently Asked Questions about span-coding

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I open-code spans in Phoenix to find failure patterns?

Inspect each span's input, output, status, attributes, and exceptions, then call write_span_note with the span ID and a specific observation. Write what you saw rather than a category label, and skip correct spans since open coding is a signal-building pass.

How do I recover PXI span notes from a Phoenix project?

Query Project.spans through GraphQL requesting spanNotes with identifier, explanation, and timestamps, then paginate until hasNextPage is false. Filter results locally to notes whose identifier is exactly pxi, since there is no list_span_notes tool.

When should I use structured annotations instead of open notes?

Use ui.spans.annotate only after axial coding stabilizes your categories and you have checked existing project annotation configs. During open coding, free-form PXI notes come first unless the user already supplied a stable rubric.

What is the difference between open coding and axial coding for spans?

Open coding writes short, evidence-close notes on individual spans before categories exist. Axial coding recovers those notes, groups recurring failures, names actionable categories, and promotes stable ones into structured annotations.

Where are PXI span notes stored in Phoenix?

PXI notes are stored durably in Phoenix via the server-executed write_span_note tool, with at most one current note per span. The bash filesystem under .pxi/coding is only scratch space for memos and grouping tables, not the canonical store.