New to Claude Skills? Learn how to install them →

arize-ai on GitHub

Phoenix Backend Development

Free

Streamline Python server development for AI observability.

by arize-ai11k stars on arize-ai/phoenix
1 views
Updated Aug 11, 2026
Get this skill

Free · Opens the source repo

What Phoenix Backend Development does

The Phoenix Backend Development skill is designed specifically for developers working with the Phoenix AI observability platform. Built on a robust stack that includes FastAPI for serving REST and Strawberry GraphQL APIs, this skill aids in writing and modifying server code efficiently. It supports various backend tasks, including adding mutations, types, migrations, and tests, making it an essential tool for anyone involved in the development of the Phoenix project.

This skill provides a comprehensive development guide, including commands to set up the environment, run tests, format code, and perform type checks. With structured references to key directories, developers can easily navigate the codebase, whether they are adding new features or debugging existing ones. The skill emphasizes best practices, such as the correct use of mutations and queries, ensuring that developers adhere to security protocols and maintain code quality.

Additionally, the skill includes hard rules and naming conventions that promote clarity and maintainability in the code. By following these guidelines, developers can avoid common pitfalls and ensure that their contributions are aligned with the project's standards. This skill is particularly useful for those who are new to the Phoenix platform or those looking to improve their backend development workflow.

In summary, the Phoenix Backend Development skill is a valuable resource for developers working on the Phoenix observability platform, providing them with the tools and knowledge needed to enhance their productivity and code quality.

When to use it

Use this skill when working on backend tasks in the Phoenix repository, such as writing server code or tests.

When not to use it

This skill may not be suitable for frontend development or tasks unrelated to the Phoenix backend.

What you can build with it

Adding a New Mutation

Utilize the skill to reference best practices while adding a new mutation to the GraphQL API.

Modifying Database Models

Follow the guidelines to safely modify database models and create migrations using Alembic.

Writing Unit Tests

Leverage the testing patterns provided to ensure your new features are well-tested and reliable.

How to install Phoenix Backend Development

View source

1. Install with the skills CLI

npx skills add arize-ai/phoenix/phoenix-server --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by arize-ai

Phoenix Backend Development

Phoenix is an AI observability platform. The backend is Python: FastAPI serving a REST API and Strawberry GraphQL API over an async SQLAlchemy ORM (PostgreSQL + SQLite).

Development Guide Index

Read DEVELOPMENT.md (env setup, uv, tests, debugpy, pre-commit, REST API conventions) and CONTRIBUTING.md (PR format, conventional commits, code review expectations) if you have not already.

Everyday Commands

make dev-backend                        # backend only, no frontend build needed
uv run pytest path/to/test -n auto      # run specific tests in parallel
make test-python                        # full test suite
make graphql                            # regenerate schema after GQL changes
make format                             # format all code
make typecheck-python                   # mypy + pyright

Key Directories

src/phoenix/server/api/
  mutations/        Domain-specific mutation mixins, composed in __init__.py
  types/            GraphQL types with field resolvers
  input_types/      Strawberry @input classes with validation
  subscriptions.py  Async generator subscriptions (streaming)
  queries.py        Root query type
  context.py        Request context: db, dataloaders, auth, event queue
  dataloaders/      Batch loaders (prevent N+1 queries)
  auth.py           Permission classes (IsNotReadOnly, IsNotViewer, etc.)
  routers/          REST API endpoints (v1/)
src/phoenix/db/
  models.py         SQLAlchemy ORM models (single file)
  migrations/       Alembic migrations
tests/unit/server/api/
  mutations/        Mutation tests
  types/            Type resolver tests
  conftest.py       Fixtures: db, gql_client, test data factories

What Are You Doing?

TaskReference
Adding or modifying a mutation, type, subscription, or inputreferences/graphql-patterns.md
Writing or modifying testsreferences/test-patterns.md
Writing tests for code that emits OpenInference spans (VCR cassettes, span attribute assertions)references/llm-trace-tests.md
Adding a migration or modifying database modelsreferences/database-patterns.md

Hard Rules

  • Side effects belong on Mutation, not Query. A resolver that makes outbound network calls, reads secrets, writes state, or accepts a user-supplied URL/host MUST be a @strawberry.mutation with permission_classes=[...]. Query fields bypass the make check-graphql-permissions CI guard and are reachable unauthenticated by default — this has been exploited as an SSRF vector. See references/graphql-patterns.md → "Query vs Mutation".

Naming

  • Avoid acronyms and single/double-letter abbreviations for local variables. Prefer the full noun: session / project_session over ps, trace over t, example / dataset_example over de. The cost of a longer identifier is trivial; the cost of having to mentally expand an acronym while reading unfamiliar code is not.
  • Established domain acronyms used in the codebase (db, gql, otel, llm) are fine — they're vocabulary, not abbreviations of local nouns.

Docstrings

The project rule of "default to no comments" is about inline comments, not docstrings. Public APIs should be documented.

  • Document parameters and return values on public methods of reusable classes (clients, services, factories, builders). Use Google-style Args: / Returns: / Raises: blocks when the meaning isn't fully recoverable from the type signature. Do not strip these during refactors — semantics outlive file moves.
  • Describe behavior, not implementation. A method on a docs-search client says "Invoke a backend tool and return its text result", not "Invoke a tool on the MCP server" — the underlying transport is an implementation detail and the docstring should survive a transport swap. Internal helpers (leading _) may reference the transport directly since their scope is bounded.
  • One-liner docstrings are fine when the name and types fully convey intent (close(), is_backend_tool(name)). Don't pad them with restated signatures.
  • Module docstrings belong at the top of any file that exposes public surface (a client class, a router, a service module). One sentence on what the module is for is enough.

Frequently asked questions about Phoenix Backend Development

Similar skills