pixie-qa
CLAUDE.md9 starsChanged 8 months agoMITView on GitHub
pixie-qa is a Python package and coding-agent skill for automated quality assurance of AI applications. Published as pixie, it provides instrumentation, evaluation, and observability primitives for LLM-powered apps. Test file naming: prefix test_, mirror source directory structure, one file per source module. Never use pip install — all dependency changes go through uv. Always run tools through uv run. Commit uv.lock alongside pyproject.toml changes. Write or verify tests BEFORE implementing features. All tests for the pixie module must be in…
- Installs packages
In this repository2 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- eval-driven-devSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
14 rules. About 0 are common, 8 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 76
Always run tools through uv run.
- Distinctive: line 86
Write test first → verify it fails (red)
- Distinctive: line 89
Run all tests to check for regressions
- Distinctive: line 103
Run manual e2e verification whenever changing:
- Distinctive: line 113
Run the manual fixture:
- Distinctive: line 127
Independent: no shared state or execution order dependency
- Distinctive: line 146
All function signatures must have type annotations for parameters and return values
- Very specific: line 147
Use | syntax for unions (not Optional or Union)
- Very specific: line 148
Use from __future__ import annotations at top of files
- Very specific: line 149
Avoid type: ignore, Any, and cast() unless absolutely necessary
- Distinctive: line 150
Use frozen dataclasses for immutable span types
- Distinctive: line 173
Never implement everything at once.
- Very specific: line 179
Before writing new code, search the codebase for existing similar code.
- Very specific: line 200
Every non-trivial feature or bug fix requires a file under changelogs/<feature>.md containing:
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md — pixie-qa
Project Overview
pixie-qa is a Python package and coding-agent skill for automated quality assurance of AI applications. Published as pixie, it provides instrumentation, evaluation, and observability primitives for LLM-powered apps.
Technology Stack
- Python 3.11+ with type hints
- uv for package management, virtual environments, and builds
- pytest for testing
- mypy for static type checking
- ruff for linting and formatting
- OpenTelemetry SDK and OpenInference for LLM call instrumentation
Package Structure
pixie/
__init__.py
assets/
index.html # compiled React scorecard (build artifact, gitignored)
cli/
test_command.py # pixie test entry point
evals/
scorecard.py # scorecard data models + template-based HTML generation
instrumentation/
__init__.py # public API: init(), flush()
spans.py # ObserveSpan, LLMSpan, message/content types
handler.py # InstrumentationHandler ABC
wrap.py # wrap() API for data-object-based tracing
processor.py # LLMSpanProcessor (OTel SpanProcessor)
queue.py # _DeliveryQueue (background worker thread)
instrumentors.py # auto-discovers and activates OpenInference instrumentors
py.typed
frontend/ # React scorecard SPA source
src/ # React components, types, styles
package.json # React 19, Vite 6, vite-plugin-singlefile
vite.config.ts # builds to ../pixie/assets/
tests/
pixie/ # automated tests (pytest)
cli/
test_test_command.py # CLI unit tests
e2e_fixtures/ # mock evaluators and datasets for e2e
evals/
instrumentation/
manual/ # manual testing fixtures (not run by pytest)
mock_evaluators.py
datasets/
sample-qa.json # run with: pixie test tests/manual/datasets/sample-qa.json
specs/ # design specs and architecture docsTest file naming: prefix test_, mirror source directory structure, one file per source module.
Package Management (uv)
Never use pip install — all dependency changes go through uv.
uv sync # Install/sync all dependencies
uv add <package> # Add runtime dependency
uv add --dev <package> # Add dev dependency
uv run pytest # Run tests
uv run mypy pixie/ # Type check
uv run ruff check . # Lint
uv run ruff format . # Format
uv build # Build packageAlways run tools through uv run. Commit uv.lock alongside pyproject.toml changes.
Test-Driven Development (TDD)
Write or verify tests BEFORE implementing features.
Workflow:
- Write test first → verify it fails (red)
- Implement minimal code → verify it passes (green)
- Refactor if needed, keeping tests green
- Run all tests to check for regressions
All tests for the pixie module must be in tests/pixie/.
Running Tests
uv run pytest # All tests
uv run pytest tests/pixie/ # pixie tests only
uv run pytest --cov=pixie # With coverageE2E Verification for pixie test
Run manual e2e verification whenever changing:
pixie/cli/test_command.pypixie/cli/main.pypixie/harness/runner.pypixie/evals/scorecard.pypixie/evals/criteria.py
Agent verification protocol:
Run the manual fixture:
export PIXIE_ROOT=/tmp/pixie_e2e_verify uv run pixie test tests/manual/datasets/sample-qa.json --no-open- Inspect console output — verify all 5 items appear with evaluator names and scores
- Inspect HTML scorecard with Playwright — verify evaluator names, scores, PASS/FAIL badges, and detail modals
Test Quality
- Focused: one thing per test
- Independent: no shared state or execution order dependency
- Fast: mock external dependencies (OTel, LLM providers)
- Clear: arrange-act-assert structure
Type Safety
Both mypy and Pylance must be clean (they catch different errors).
uv run mypy pixie/ # Type check pixie module
uv run mypy tests/pixie/ # Type check testsAlso check Pylance diagnostics in VS Code Problems panel — zero errors required before committing.
Rules:
- All function signatures must have type annotations for parameters and return values
- Use
|syntax for unions (notOptionalorUnion) - Use
from __future__ import annotationsat top of files - Avoid
type: ignore,Any, andcast()unless absolutely necessary - Use frozen dataclasses for immutable span types
Code Quality
uv run ruff check . # Lint
uv run ruff format . # FormatIncremental Development
Break large features into small, independent tasks. Before and after each task:
uv run pytest
uv run mypy pixie/
# Check Pylance Problems panelNever implement everything at once. Fix issues between tasks, not at the end.
Code Reuse
Before writing new code, search the codebase for existing similar code. Extract shared helpers when the same logic appears in 2+ places. Keep span types in pixie/instrumentation/spans.py, base classes as ABCs.
Documentation Requirements
Documentation is part of implementation, not a follow-up.
README Scoping Rules
| Change type | READMEs to update |
| New top-level directory | Create <dir>/README.md + update root README.md |
| New package directory | Create <dir>/README.md + update docs/package.md |
| New test fixtures or test directories | Update tests/README.md |
| CLI or scorecard changes | Update docs/package.md + tests/README.md |
| Build process changes | Update frontend/README.md + pixie/assets/README.md |
| API changes | Update docs/package.md + relevant module docstrings |
Changelog
Every non-trivial feature or bug fix requires a file under changelogs/<feature>.md containing:
- What changed and why
- Files affected
- Migration notes (if API behavior changed)
Hard Completion Gate
A task is not complete until all of the following are updated in the same change set:
- Relevant
README.mdfiles - Relevant
specs/*.md(design/behavior/architecture) changelogs/<feature>.mdtests/README.md(if test structure changed)
Error Handling Rules
- Never raise from
LLMSpanProcessor.on_end()— wrap entire body in try/except - Never raise from
_DeliveryQueue._worker()— wrap each iteration - Never raise from
submit()— drop silently on full queue - Handler method exceptions are silently swallowed — must not crash delivery thread
- Malformed JSON in span attributes — fall back to
{}orNone, never raise
Pre-Commit Checklist
- ✅ Write/update tests in
tests/pixie/ - ✅
uv run pytest— all tests pass - ✅
uv run mypy pixie/— zero type errors - ✅ Pylance Problems panel — zero errors
- ✅
uv run ruff check .— no linting errors - ✅ Docstrings /
README.md/specs/updated - ✅
changelogs/<feature>.mdadded/updated - ✅ If touching
pixie test/scorecard/evaluation harness/eval: run the agent verification protocol — runpixie teston the manual fixture and inspect console output + scorecard HTML with Playwright - ✅ All relevant
README.mdfiles updated per scoping rules
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

