/agent-skills:dd-pagerduty-onboardingfrom agent-skills
Walks through connecting PagerDuty to Datadog so monitors trigger and resolve incidents. Checks existing services, opens PagerDuty install screen, confirms setup, and optionally sends a test page.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Estimated time: < 5 minutes
Connect PagerDuty to Datadog in two user-driven moves: the install on PagerDuty's install screen (the user picks which PagerDuty service(s) to connect), and Datadog writing the integration keys as services when PagerDuty redirects back. Once a service is connected, Datadog can trigger and resolve incidents on it.
The install is the user's — this skill never installs on their behalf and never writes
credentials. All /api/ calls go through pup api with the user's own session; the
install-URL mint is the one call made outside pup api, and the script handles it (its
bearer stays in process memory only — never in argv, on disk, or in output).
scripts/pagerduty_setup.py owns site resolution, install-URL minting, service discovery,
and the API calls — do not reproduce that logic yourself. The API reference is
https://docs.datadoghq.com/api/latest/pagerduty-integration/.
This is a hands-on setup: run the commands yourself rather than handing the user a list, keep them in the loop, and let the user's answer decide whether an existing integration is extended.
Script exit codes (every subcommand): 0 success · 1 error — relay the error:
line · 2 an expected "not yet" outcome (services: nothing connected; wait: timed out;
test-page: a step did not happen) · 3 authorize --open could not open a browser.
Checklist:
pup, python3 present; site confirmed; pup auth status authenticated on the right orgservices → none connected, or the user chose "continue"authorize [--continue] --open → install screen openwait started in the background immediately → new service reportedDatadog for Government is not supported. If pup auth status reports a
ddog-gov.com site, stop and tell the user to set up the integration from the
Datadog app instead. The script refuses Government sites too.
Tools. pup and python3 are required; a browser is needed to finish PagerDuty's
install screen:
command -v pup >/dev/null 2>&1 && echo "pup: available" || echo "MISSING pup"
command -v python3 >/dev/null 2>&1 && echo "python3: available" || echo "MISSING python3 - the setup script needs it"
If pup is missing, ask before installing it:
brew tap datadog-labs/pack && brew install datadog-labs/pack/pup (macOS or Linux with
Homebrew), curl -fsSL https://raw.githubusercontent.com/DataDog/pup/main/install.sh | sh,
or npm install -g @datadog/pup (Windows or anywhere with npm); see
https://github.com/DataDog/pup. Then run DD_SITE=<site> pup auth login.
If python3 is missing or the user declines installing pup, stop and point them to the
PagerDuty integration tile in the Datadog app to connect it manually.
Session and site. The flow runs on the user's default pup session: the Datadog org
is whichever one that session's OAuth token belongs to, and the site comes from
DD_SITE (the script has no site flag; it reads the site from that session). Use no
named (--org) sessions — one default session means every command, including any pup
command handed back to the user, hits the same org.
DD_SITE=<site> pup auth status
datadoghq.com,
datadoghq.eu, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, or staging
datad0g.com). Never guess a site.authenticated: true → confirm with the user, with the host's native selector, that
this session is logged into the Datadog org they want to connect PagerDuty to. Yes →
continue. No → have them log in again (next bullet) and pick the right org.authenticated: false, or the wrong org → stop and ask them to run
DD_SITE=<site> pup auth login (it needs a browser) and pick the org they want on
Datadog's login screen — that makes it the default session's org. Warn them first if
they were already logged in: this replaces their existing default pup session.DD_SITE=<site> (each shell command starts
fresh, so it does not carry over on its own). The script resolves the site from
pup auth status, which reads it.pup returns non-JSON → the pup on PATH may not be the Datadog CLI (e.g. a
same-named proto tool shadowing it). Point the script at the real binary with
--pup <path-to-pup>, and pass it to every script command.Permissions. The pup session needs the Integrations Manage (manage_integrations)
permission on the Datadog org — it is what authorizes the connect. It sits on the default
Datadog Standard Role; an org admin grants it through RBAC. The related Integrations
Read (integrations_read) is view-only and is not sufficient. test-page also needs
Monitors Write (monitors_write), because it creates a throwaway monitor; without it,
skip the test page and have the user confirm the connect in PagerDuty. Reference:
https://docs.datadoghq.com/account_management/rbac/permissions/.
Before gathering anything else, ask whether to set up the integration for the
Datadog org the user is currently logged in to. Read the org's name from the
same pup session and site this run uses with pup api /api/v2/current_user
(the name of the orgs entry under included; the site is the one pup auth status reported). Then ask once with the host's native selector:
Do you want to set up this integration for the Datadog org on ?
Before minting anything, find out whether the org already has a PagerDuty integration —
the user may not want this flow at all. services is a read-only GET:
DD_SITE=<site> python3 -I -B <skill>/scripts/pagerduty_setup.py services
Replace <skill> with this skill's directory, here and in every later command.
Exit 2 → nothing is connected yet (a fresh org). Continue to Phase 2 as normal.
Exit 1 → an error (e.g. not authenticated, or a 403); relay it and fix it before
continuing — never treat it as "nothing connected".
Exit 0 with service names → report exactly what was discovered before asking
anything else. Name every service — the plain output lists them, and --json gives the
full list. For example:
We discovered these PagerDuty services are already connected: ops-pages, customer-incidents.
Then ask, with the host's native selector:
Would you like to: (1) stop — the existing services already cover you, or (2) continue and set up new services?
--continue (the script refuses the mint without
it when services exist, so the user's answer is what unlocks it).Which services to integrate is the user's choice, made on PagerDuty's install screen in Phase 2: they pick and connect the service(s) there. Do not try to select services for them.
DD_SITE=<site> python3 -I -B <skill>/scripts/pagerduty_setup.py authorize --continue --open
--continue when Phase 1 found nothing connected (it is only needed to proceed
past the existing-services guard). The command resolves the site (Phase 0), mints a
fresh install URL, and opens it.--open, print the returned URL, and ask the user to open
it where they are logged into both PagerDuty and the Datadog app.wait
anyway.state: hand it only to the user,
and never save, share, or reuse it.The URL lands the user directly on PagerDuty's install screen for the Datadog app: they log in to PagerDuty, pick the service(s) to connect, and install. Start the poll below as soon as the install screen is open and let it notice the install.
Two caveats to hand to the user:
state expires after about five minutes. Open it promptly; if it
expires, re-run this step for a fresh URL instead of reusing the old one. The browser
that finishes the install must also have a Datadog app session for the resolved site:
PagerDuty redirects back to Datadog, which writes the integration keys with that
session's org.authorize appends the guidance below to the error, so relay that text rather than
inventing a route. When classifying by hand:
--continue was not passed) → go back to
Phase 1's ask; the user decides.403 / Forbidden / manage_integrations → the session lacks
Integrations Manage; see Permissions in Phase 0. Once an admin grants it, re-run this
step for a fresh URL.401 / not authenticated — the pup token itself is missing, stale, or org-unbound;
re-authenticate (DD_SITE=<site> pup auth login, see Phase 0) and re-run./account/login). Fallback: the PagerDuty integration tile in the
Datadog app — the user opens the tile and clicks "Connect to PagerDuty", which runs the
same vendor flow with their browser session. Surface this plainly.DD_SITE=<site> python3 -I -B <skill>/scripts/pagerduty_setup.py wait --interval 5 --timeout 300
Start this as a background process immediately after the install screen is open
(background it with the host's process manager or a shell &), then continue when it
reports the new service(s). It snapshots the connected services on its first call and
exits 0 printing the new service name(s) as soon as PagerDuty's redirect lands — the poll
is the confirmation, so never ask the user to report back that they clicked install, and
never block on a "done". It prints nothing per poll; --json emits site and
new_services.
services before retrying. If the service the user picked
is listed, the install landed — before the poll started, or as a re-install of an
already-connected service, which wait does not report as new — so report it as
connected. Otherwise re-check the caveats above (PagerDuty account with install rights,
Datadog app session in that browser, URL not expired) and re-run the mint and wait.Send a test page to the service just connected. This verifies the wiring end to end — a real PagerDuty incident opens on the service, then resolves on its own:
DD_SITE=<site> python3 -I -B <skill>/scripts/pagerduty_setup.py test-page '<service>'
<service>? It opens a real PagerDuty incident
(it resolves on its own), so whoever is on call gets paged." with the options Yes,
send a test page / No, skip it. If several services were connected, ask which
one to page instead (plus a skip option). Never run it without a yes; on no, skip
ahead to the final message. Use the name exactly as the poll or services reported it.dd-pagerduty-onboarding:test) whose message is
@pagerduty-<service>, waits for it to alert — that is the page — then flips it so it
recovers, which resolves the PagerDuty incident, and deletes the monitor. The monitor
needs no data, so this works on a brand-new org. It usually takes a few minutes (each
step gives up after --timeout, default 300s); start it in the background and report
when it exits.paged/resolved/deleted); report that plainly. Exit 1 is an error
(e.g. a 403 without monitors_write); relay it. muted: true means
an active downtime (or a mute) covered the test monitor: it alerted (alerted: true)
but sent no notification, so PagerDuty was not paged — tell the user to end the
downtime and re-run. The monitor is deleted even when a step fails or the run is
interrupted; if the output says it was not, relay the pup monitors delete command it
prints.paged but not resolved — tell the user plainly to resolve the
incident on <service> in PagerDuty so it does not escalate.Only celebrate a verified test page (exit 0) — never after exit 1 or 2, including a muted run. Wiring monitors or notifications to the connected services is the monitors/notifications setup, not this skill.
End the run with these lines, in this order:
**PagerDuty connected:** <service names from `wait` or `services`>
**Test page:** sent and resolved 🎉 | skipped | failed at <paged|resolved|deleted> — <next step>
**Next:** route monitors with `@pagerduty-<service>`; see https://docs.datadoghq.com/integrations/pagerduty/
When asked: DD_SITE=<site> python3 -I -B <skill>/scripts/pagerduty_setup.py delete-service <name>
removes one service. It exits 0 only after a re-list confirms the service is gone; a failed
delete or a service still listed exits 1 with the error. services shows what exists first.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
78 skills in this plugin
/agent-observability-auto-experimentRun an iterative code-improvement hill-climb against real Datadog LLM-Obs data, locally, with Claude Code as the agent. Establishes a baseline eval, makes one focused change, re-scores both splits with the same harness, keeps the change when held-out test improves without overfitting val (labeling within-noise gains tentative), and repeats. This is the skill published as "Autoresearch" in Datadog Agent Observability. Use when the user says "run an auto experiment", "run autoresearch", "hill-climb this code", "iteratively improve X and measure the delta", "optimize this code/agent/pipeline/prompt against my traces", "auto-optimize against LLM-Obs", or wants the local equivalent of the auto_experiments worker. Works from an ml_app, a dataset_id, an annotation_queue_id (a queue of human-labelled interactions), a list of trace_ids, or (by exception) a local dataset file. The corpus and its val/test splits live in Datadog LLM-Obs Datasets, created once per run with a timestamp in their names./agent-observability-build-eval-from-annotationsFit a Datadog LLM-Obs evaluator to human labels. Takes an annotation queue, works out where in the trace the labelled property actually lives, drafts an LLM-judge that predicts the human label, scores that judge against the already-labelled rows with a metric agreed with the user, then hill-climbs it — inspect the errors, make one focused change, re-score, keep it only if it beats the best — for a bounded number of iterations, and finally publishes the winner to Datadog as a DISABLED evaluator (not a Datadog draft — a real evaluator with `enabled: false`). Use when the user says "build an eval from my annotations", "build an evaluator from the annotation queue", "turn my annotations into an evaluator", "learn an evaluator from my labels", "fit a judge to the annotation queue", "auto-label", "auto labelling", "automate this annotation queue", "scale up my human labels", or wants the rest of a queue graded the way the humans graded the first rows. Needs an annotation queue with at least two classes present in the human labels (e.g. one true and one false for a boolean).npx claudepluginhub datadog-labs/agent-skills --plugin agent-skillsOther plugins' skills for the same job