investigate-pd-incident
Investigate a PagerDuty incident by fetching it via the PagerDuty MCP server, classifying the alert type, and dispatching to the appropriate specialist skill…
от Recidiviz★ 48 звёзд на GitHub
Установить investigate-pd-incident в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Skill: Investigate PagerDuty Incident
Overview
This is the generic entry point for triaging any PagerDuty incident. It pulls the incident details via the PagerDuty MCP server, classifies what kind of alert fired, dispatches to a specialist skill that knows how to diagnose that class of failure, and then (after user confirmation) posts the full diagnosis back to the PagerDuty incident as a note so the same context is visible to anyone else triaging — including future automated invocations of this skill.
The only write action this skill takes is adding a note to the incident, and only after confirmation. Never acknowledge, resolve, or snooze the incident unless the user explicitly asks.
Step 1: Verify the PagerDuty MCP server is connected
The PagerDuty MCP tools are named mcp__pagerduty__*. If those tools are not
available in this session, halt and tell the user:
"This skill needs the PagerDuty MCP server. Install it with:
claude mcp remove pagerduty 2>/dev/null; \ claude mcp add --transport http pagerduty https://mcp.pagerduty.com/mcp \ --header "Authorization: Token YOUR_PD_API_TOKEN"Get a User API token at PagerDuty → Profile → My Profile → User Settings → Create API User Token. Then restart Claude Code and re-run this skill.
Do not use the
/mcpdialog'sAuthenticatebutton — the hosted PD MCP does not support OAuth dynamic client registration, which is what Claude Code's built-in auth flow requires."
Step 2: Extract the incident ID
Accept either:
- A full URL like
https://recidiviz.pagerduty.com/incidents/Q09D28GV4W96FQ— the ID is the last path segment - A bare incident ID (e.g.
Q09D28GV4W96FQ) - An incident number (e.g.
26962) — the MCP accepts this too
Step 3: Fetch the incident
Call mcp__pagerduty__get_incident with the ID. Also call
mcp__pagerduty__list_alerts_from_incident with query_model={"limit": 10} —
the alerts carry richer detail than the incident itself. If the alert body's
details field is non-empty, inspect it. For email-integration alerts it will
usually be empty; that's expected.
Step 4: Establish the deployed version in the alerting project
Before dispatching to a specialist, find the deployed version of the
project that fired the alert. All downstream "what changed" queries must be
scoped to this tag, not to origin/main. Misattributing a prod alert to a
commit that isn't in the deployed version is a common and expensive mistake.
Derive the project id from the incident — for Recidiviz Airflow alerts, the
dag_id prefix identifies it (recidiviz-123_* = prod, recidiviz-staging_*
= staging). Then run:
./recidiviz/tools/deploy/print_deployed_version.sh <project_id>
The TF-state version is authoritative for what code is running —
always use that as deployed_tag. The script also prints a Cloud Run
previous row derived from case-triage-web's revision history; use
that as prev_deployed_tag for any "what changed between the last two
deploys" work in the specialist. The script also prints the latest
successful view-update version; if it lags the TF-state version by more
than ~3 hours, the update_managed_calculation_views task may be failing, which
matters for data-content alerts. For staging the script additionally
prints the latest tag on origin/main (prod has no reliable branch-tip
signal today). See recidiviz/tools/deploy/CLAUDE.md for details.
Pass the resolved deployed_tag (and the prior deployed tag, for diffs) to
the specialist in Step 5.
Step 5: Classify the alert
Use the incident title and service summary to decide which specialist to invoke. Current dispatch table:
| Match | Specialist |
|---|---|
Title matches the regex ^Failure: Task Run: (?P<dag_id>[\w-]+)\.(?P<task_id>\w+), started: (?P<start>.+)$ and service summary contains Airflow Tasks |
Read and follow .claude/skills/investigate-airflow-failure/SKILL.md — pass through the parsed dag_id, task_id, incident start datetime, and the deployed_tag from Step 4 |
| (anything else) | Skip Step 6 and go directly to Step 7 |
The Airflow alert title format is produced by
AirflowAlertingIncident.unique_incident_id in
recidiviz/airflow/dags/monitoring/airflow_alerting_incident.py. If that format
changes and the regex stops matching, update both files.
Step 6: Post the diagnosis as a PagerDuty note (specialist path only)
Runs only after a specialist was dispatched in Step 5 and returned a diagnosis. Skip this step when no specialist matched — there is nothing to post.
6a: Draft the note
Take the same structured diagnosis you presented to the user and reformat it into a PagerDuty note. Include all of the sections the specialist produced — not just the TLDR — because this note may be the only context available to a future reader (another on-caller, or another Claude invocation running headlessly).
Target sections (in order), using Markdown bold head
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл investigate-pd-incident?
Investigate a PagerDuty incident by fetching it via the PagerDuty MCP server, classifying the alert type, and dispatching to the appropriate specialist skill. Use when the user provides a PagerDuty incident URL or ID (e.g. "investigate this PD alert", "what's going on with incident Q09D28GV4W96FQ", "diagnose https://recidiviz.pagerduty.com/incidents/...").
Как установить скилл investigate-pd-incident?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл investigate-pd-incident запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…