{"kind":"Skill","metadata":{"namespace":"community","name":"arize-annotation","version":"0.1.0"},"spec":{"description":"Creates and manages annotation configs (categorical, continuous, freeform label schemas) and annotation queues (human review workflows) on Arize. Applies human annotations to project spans via the Python SDK. Use when the user mentions annotation config, annotation queue, label schema, human feedback, bulk annotate spans, update_annotations, labeling queue, annotate record, or human review.","files":{"SKILL.md":"---\nname: arize-annotation\ndescription: Creates and manages annotation configs (categorical, continuous, freeform label schemas) and annotation queues (human review workflows) on Arize. Applies human annotations to project spans via the Python SDK. Use when the user mentions annotation config, annotation queue, label schema, human feedback, bulk annotate spans, update_annotations, labeling queue, annotate record, or human review.\nmetadata:\n  author: arize\n  version: \"1.0\"\ncompatibility: Requires the ax CLI and a configured Arize profile.\n---\n\n# Arize Annotation Skill\n\n\u003e **`SPACE`** — All `--space` flags and the `ARIZE_SPACE` env var accept a space **name** (e.g., `my-workspace`) or a base64 space **ID** (e.g., `U3BhY2U6...`). Find yours with `ax spaces list`.\n\nThis skill covers **annotation configs** (the label schema) and **annotation queues** (human review workflows), as well as programmatically annotating project spans via the Python SDK.\n\n**Direction:** Human labeling in Arize attaches values defined by configs to **spans**, **dataset examples**, **experiment-related records**, and **queue items** in the product UI. This skill covers: `ax annotation-configs`, `ax annotation-queues`, and bulk span updates with `ArizeClient.spans.update_annotations`.\n\n---\n\n## Prerequisites\n\nProceed directly with the task — run the `ax` command you need. Do NOT check versions, env vars, or profiles upfront.\n\nIf an `ax` command fails, troubleshoot based on the error:\n- `command not found` or version error → see references/ax-setup.md\n- `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, 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 \u003e API Keys\n- Space unknown → run `ax spaces list` to pick by name, or ask the user\n- **Security:** Never read `.env` files or search the filesystem for credentials. Use `ax profiles` for Arize credentials and `ax ai-integrations` for LLM provider keys. If credentials are not available through these channels, ask the user.\n\n---\n\n## Concepts\n\n### What is an Annotation Config?\n\nAn **annotation config** defines the schema for a single type of human feedback label. Before anyone can annotate a span, dataset record, experiment output, or queue item, a config must exist for that label in the space.\n\n| Field | Description |\n|-------|-------------|\n| **Name** | Descriptive identifier (e.g. `Correctness`, `Helpfulness`). Must be unique within the space. |\n| **Type** | `categorical` (pick from a list), `continuous` (numeric range), or `freeform` (free text). |\n| **Values** | For categorical: array of `{\"label\": str, \"score\": number}` pairs. |\n| **Min/Max Score** | For continuous: numeric bounds. |\n| **Optimization Direction** | Whether higher scores are better (`maximize`) or worse (`minimize`). Used to render trends in the UI. |\n\n### Where labels get applied (surfaces)\n\n| Surface | Typical path |\n|---------|----------------|\n| **Project spans** | Python SDK `spans.update_annotations` (below) and/or the Arize UI |\n| **Dataset examples** | Arize UI (human labeling flows); configs must exist in the space |\n| **Experiment outputs** | Often reviewed alongside datasets or traces in the UI — see arize-experiment, arize-dataset |\n| **Annotation queue items** | `ax annotation-queues` CLI (below) and/or the Arize UI; configs must exist |\n\nAlways ensure the relevant **annotation config** exists in the space before expecting labels to persist.\n\n---\n\n## Basic CRUD: Annotation Configs\n\n### List\n\n```bash\nax annotation-configs list --space SPACE\nax annotation-configs list --space SPACE -o json\nax annotation-configs list --space SPACE --limit 20\n```\n\n### Create — Categorical\n\nCategorical configs present a fixed set of labels for reviewers to choose from.\n\n```bash\nax annotation-configs create \\\n  --name \"Correctness\" \\\n  --space SPACE \\\n  --type categorical \\\n  --value correct \\\n  --value incorrect \\\n  --optimization-direction maximize\n```\n\nCommon binary label pairs:\n- `correct` / `incorrect`\n- `helpful` / `unhelpful`\n- `safe` / `unsafe`\n- `relevant` / `irrelevant`\n- `pass` / `fail`\n\n### Create — Continuous\n\nContinuous configs let reviewers enter a numeric score within a defined range.\n\n```bash\nax annotation-configs create \\\n  --name \"Quality Score\" \\\n  --space SPACE \\\n  --type continuous \\\n  --min-score 0 \\\n  --max-score 10 \\\n  --optimization-direction maximize\n```\n\n### Create — Freeform\n\nFreeform configs collect open-ended text feedback. No additional flags needed beyond name, space, and type.\n\n```bash\nax annotation-configs create \\\n  --name \"Reviewer Notes\" \\\n  --space SPACE \\\n  --type freeform\n```\n\n### Get\n\n```bash\nax annotation-configs get NAME_OR_ID\nax annotation-configs get NAME_OR_ID -o json\nax annotation-configs get NAME_OR_ID --space SPACE   # required when using name instead of ID\n```\n\n### Delete\n\n```bash\nax annotation-configs delete NAME_OR_ID\nax annotation-configs delete NAME_OR_ID --space SPACE   # required when using name instead of ID\nax annotation-configs delete NAME_OR_ID --force   # skip confirmation\n```\n\n**Note:** Deletion is irreversible. Any annotation queue associations to this config are also removed in the product (queues may remain; fix associations in the Arize UI if needed).\n\n---\n\n## Annotation Queues: `ax annotation-queues`\n\nAnnotation queues route records (spans, dataset examples, experiment runs) to human reviewers. Each queue is linked to one or more annotation configs that define what labels reviewers can apply.\n\n### List / Get\n\n```bash\nax annotation-queues list --space SPACE\nax annotation-queues list --space SPACE -o json\n\nax annotation-queues get NAME_OR_ID --space SPACE\nax annotation-queues get NAME_OR_ID --space SPACE -o json\n```\n\n### Create\n\nAt least one `--annotation-config-id` is required.\n\n```bash\nax annotation-queues create \\\n  --name \"Correctness Review\" \\\n  --space SPACE \\\n  --annotation-config-id CONFIG_ID \\\n  --annotator-email reviewer@example.com \\\n  --instructions \"Label each response as correct or incorrect.\" \\\n  --assignment-method all   # or: random\n```\n\nRepeat `--annotation-config-id` and `--annotator-email` to attach multiple configs or reviewers.\n\n### Update\n\nList flags (`--annotation-config-id`, `--annotator-email`) **fully replace** existing values when provided — pass all desired values, not just the new ones.\n\n```bash\nax annotation-queues update NAME_OR_ID --space SPACE --name \"New Name\"\nax annotation-queues update NAME_OR_ID --space SPACE --instructions \"Updated instructions\"\nax annotation-queues update NAME_OR_ID --space SPACE \\\n  --annotation-config-id CONFIG_ID_A \\\n  --annotation-config-id CONFIG_ID_B\n```\n\n### Delete\n\n```bash\nax annotation-queues delete NAME_OR_ID --space SPACE\nax annotation-queues delete NAME_OR_ID --space SPACE --force   # skip confirmation\n```\n\n### List Records\n\n```bash\nax annotation-queues list-records NAME_OR_ID --space SPACE\nax annotation-queues list-records NAME_OR_ID --space SPACE --limit 50 -o json\n```\n\n### Submit an Annotation for a Record\n\nAnnotations are upserted by config name — call once per annotation config. Supply at least one of `--score`, `--label`, or `--text`.\n\n```bash\nax annotation-queues annotate-record NAME_OR_ID RECORD_ID \\\n  --annotation-name \"Correctness\" \\\n  --label \"correct\" \\\n  --space SPACE\n\nax annotation-queues annotate-record NAME_OR_ID RECORD_ID \\\n  --annotation-name \"Quality Score\" \\\n  --score 8.5 \\\n  --text \"Response was accurate but slightly verbose.\" \\\n  --space SPACE\n```\n\n### Assign a Record\n\nAssign users to review a specific record:\n\n```bash\nax annotation-queues assign-record NAME_OR_ID RECORD_ID --space SPACE\n```\n\n### Delete Records\n\n```bash\nax annotation-queues delete-records NAME_OR_ID --space SPACE\n```\n\n---\n\n## Applying Annotations to Spans (Python SDK)\n\nUse the Python SDK to bulk-apply annotations to **project spans** when you already have labels (e.g., from a review export or an external labeling tool).\n\n```python\nimport pandas as pd\nfrom arize import ArizeClient\n\nimport os\n\nclient = ArizeClient(api_key=os.environ[\"ARIZE_API_KEY\"])\n\n# Build a DataFrame with annotation columns\n# Required: context.span_id + at least one annotation.\u003cname\u003e.label or annotation.\u003cname\u003e.score\nannotations_df = pd.DataFrame([\n    {\n        \"context.span_id\": \"span_001\",\n        \"annotation.Correctness.label\": \"correct\",\n        \"annotation.Correctness.updated_by\": \"reviewer@example.com\",\n    },\n    {\n        \"context.span_id\": \"span_002\",\n        \"annotation.Correctness.label\": \"incorrect\",\n        \"annotation.Correctness.updated_by\": \"reviewer@example.com\",\n    },\n])\n\nresponse = client.spans.update_annotations(\n    space_id=os.environ[\"ARIZE_SPACE\"],\n    project_name=\"your-project\",\n    dataframe=annotations_df,\n    validate=True,\n)\n```\n\n**DataFrame column schema:**\n\n| Column | Required | Description |\n|--------|----------|-------------|\n| `context.span_id` | yes | The span to annotate |\n| `annotation.\u003cname\u003e.label` | one of | Categorical or freeform label |\n| `annotation.\u003cname\u003e.score` | one of | Numeric score |\n| `annotation.\u003cname\u003e.updated_by` | no | Annotator identifier (email or name) |\n| `annotation.\u003cname\u003e.updated_at` | no | Timestamp in milliseconds since epoch |\n| `annotation.notes` | no | Freeform notes on the span |\n\n**Limitation:** Annotations apply only to spans within 31 days prior to submission.\n\n---\n\n## Troubleshooting\n\n| Problem | Solution |\n|---------|----------|\n| `ax: command not found` | See references/ax-setup.md |\n| `401 Unauthorized` | API key may not have access to this space. Verify at https://app.arize.com/admin \u003e API Keys |\n| `Annotation config not found` | `ax annotation-configs list --space SPACE` (or use `ax annotation-configs get NAME_OR_ID --space SPACE`) |\n| `409 Conflict on create` | Name already exists in the space. Use a different name or get the existing config ID. |\n| Queue not found | `ax annotation-queues list --space SPACE`; verify the queue name or ID |\n| Record not appearing in queue | Ensure the annotation config linked to the queue exists; check `ax annotation-configs list --space SPACE` |\n| Span SDK errors or missing spans | Confirm `project_name`, `space_id`, and span IDs; use arize-trace to export spans |\n\n---\n\n## Related Skills\n\n- **arize-trace**: Export spans to find span IDs and time ranges\n- **arize-dataset**: Find dataset IDs and example IDs\n- **arize-evaluator**: Automated LLM-as-judge alongside human annotation\n- **arize-experiment**: Experiments tied to datasets and evaluation workflows\n- **arize-link**: Deep links to annotation configs and queues in the Arize UI\n\n---\n\n## Save Credentials for Future Use\n\nSee references/ax-profiles.md § Save Credentials for Future Use.\n","references/ax-profiles.md":"# ax Profile Setup\n\nConsult this when authentication fails (401, missing profile, missing API key). Do NOT run these checks proactively.\n\nUse this when there is no profile, or a profile has incorrect settings (wrong API key, wrong region, etc.).\n\n## 1. Inspect the current state\n\n```bash\nax profiles show\n```\n\nLook at the output to understand what's configured:\n- `API Key: (not set)` or missing → key needs to be created/updated\n- No profile output or \"No profiles found\" → no profile exists yet\n- Connected but getting `401 Unauthorized` → key is wrong or expired\n- Connected but wrong endpoint/region → region needs to be updated\n\n## 2. Fix a misconfigured profile\n\nIf a profile exists but one or more settings are wrong, patch only what's broken.\n\n**Never pass a raw API key value as a flag.** Always reference it via the `ARIZE_API_KEY` environment variable. If the variable is not already set in the shell, instruct the user to set it first, then run the command:\n\n```bash\n# If ARIZE_API_KEY is already exported in the shell:\nax profiles update --api-key $ARIZE_API_KEY\n\n# Fix the region (no secret involved — safe to run directly)\nax profiles update --region us-east-1b\n\n# Fix both at once\nax profiles update --api-key $ARIZE_API_KEY --region us-east-1b\n```\n\n`update` only changes the fields you specify — all other settings are preserved. If no profile name is given, the active profile is updated.\n\n## 3. Create a new profile\n\nIf no profile exists, or if the existing profile needs to point to a completely different setup (different org, different region):\n\n**Always reference the key via `$ARIZE_API_KEY`, never inline a raw value.**\n\n```bash\n# Requires ARIZE_API_KEY to be exported in the shell first\nax profiles create --api-key $ARIZE_API_KEY\n\n# Create with a region\nax profiles create --api-key $ARIZE_API_KEY --region us-east-1b\n\n# Create a named profile\nax profiles create work --api-key $ARIZE_API_KEY --region us-east-1b\n```\n\nTo use a named profile with any `ax` command, add `-p NAME`:\n```bash\nax spans export PROJECT -p work\n```\n\n## 4. Getting the API key\n\n**Never ask the user to paste their API key into the chat. Never log, echo, or display an API key value.**\n\nIf `ARIZE_API_KEY` is not already set, instruct the user to export it in their shell:\n\n```bash\nexport ARIZE_API_KEY=\"...\"   # user pastes their key here in their own terminal\n```\n\nThey can find their key at https://app.arize.com/admin \u003e API Keys. Recommend they create a **scoped service key** (not a personal user key) — service keys are not tied to an individual account and are safer for programmatic use. Keys are space-scoped — make sure they copy the key for the correct space.\n\nOnce the user confirms the variable is set, proceed with `ax profiles create --api-key $ARIZE_API_KEY` or `ax profiles update --api-key $ARIZE_API_KEY` as described above.\n\n## 5. Verify\n\nAfter any create or update:\n\n```bash\nax profiles show\n```\n\nConfirm the API key and region are correct, then retry the original command.\n\n## Space\n\nThere is no profile flag for space. Save it as an environment variable — accepts a space **name** (e.g., `my-workspace`) or a base64 space **ID** (e.g., `U3BhY2U6...`). Find yours with `ax spaces list -o json`.\n\n**macOS/Linux** — add to `~/.zshrc` or `~/.bashrc`:\n```bash\nexport ARIZE_SPACE=\"my-workspace\"    # name or base64 ID\n```\nThen `source ~/.zshrc` (or restart terminal).\n\n**Windows (PowerShell):**\n```powershell\n[System.Environment]::SetEnvironmentVariable('ARIZE_SPACE', 'my-workspace', 'User')\n```\nRestart terminal for it to take effect.\n\n## Save Credentials for Future Use\n\nAt the **end of the session**, if the user manually provided any credentials during this conversation **and** those values were NOT already loaded from a saved profile or environment variable, offer to save them.\n\n**Skip this entirely if:**\n- The API key was already loaded from an existing profile or `ARIZE_API_KEY` env var\n- The space was already set via `ARIZE_SPACE` env var\n- The user only used base64 project IDs (no space was needed)\n\n**How to offer:** Use **AskQuestion**: *\"Would you like to save your Arize credentials so you don't have to enter them next time?\"* with options `\"Yes, save them\"` / `\"No thanks\"`.\n\n**If the user says yes:**\n\n1. **API key** — Run `ax profiles show` to check the current state. Then run `ax profiles create --api-key $ARIZE_API_KEY` or `ax profiles update --api-key $ARIZE_API_KEY` (the key must already be exported as an env var — never pass a raw key value).\n\n2. **Space** — See the Space section above to persist it as an environment variable.\n","references/ax-setup.md":"# ax CLI — Troubleshooting\n\nConsult this only when an `ax` command fails. Do NOT run these checks proactively.\n\n## Check version first\n\nIf `ax` is installed (not `command not found`), always run `ax --version` before investigating further. The version must be `0.14.0` or higher — many errors are caused by an outdated install. If the version is too old, see **Version too old** below.\n\n## `ax: command not found`\n\n**macOS/Linux:**\n1. Check common locations: `~/.local/bin/ax`, `~/Library/Python/*/bin/ax`\n2. Install: `uv tool install arize-ax-cli` (preferred), `pipx install arize-ax-cli`, or `pip install arize-ax-cli`\n3. Add to PATH if needed: `export PATH=\"$HOME/.local/bin:$PATH\"`\n\n**Windows (PowerShell):**\n1. Check: `Get-Command ax` or `where.exe ax`\n2. Common locations: `%APPDATA%\\Python\\Scripts\\ax.exe`, `%LOCALAPPDATA%\\Programs\\Python\\Python*\\Scripts\\ax.exe`\n3. Install: `pip install arize-ax-cli`\n4. Add to PATH: `$env:PATH = \"$env:APPDATA\\Python\\Scripts;$env:PATH\"`\n\n## Version too old (below 0.14.0)\n\nUpgrade: `uv tool install --force --reinstall arize-ax-cli`, `pipx upgrade arize-ax-cli`, or `pip install --upgrade arize-ax-cli`\n\n## SSL/certificate error\n\n- macOS: `export SSL_CERT_FILE=/etc/ssl/cert.pem`\n- Linux: `export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt`\n- Fallback: `export SSL_CERT_FILE=$(python -c \"import certifi; print(certifi.where())\")`\n\n## Subcommand not recognized\n\nUpgrade ax (see above) or use the closest available alternative.\n\n## Still failing\n\nStop and ask the user for help.\n"},"import":{"commit_sha":"541b7819d8c3545c6df122491af4fa1eae415779","imported_at":"2026-05-18T20:05:35Z","license_text":"MIT License\n\nCopyright GitHub, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","owner":"github","repo":"github/awesome-copilot","source_url":"https://github.com/github/awesome-copilot/tree/541b7819d8c3545c6df122491af4fa1eae415779/plugins/arize-ax/skills/arize-annotation"}},"content_hash":[79,183,242,68,159,4,151,114,41,91,43,234,18,195,87,67,251,97,12,241,172,103,229,138,163,175,190,21,38,45,59,109],"trust_level":"unsigned","yanked":false}
