/agent-skills:dd-github-onboardingfrom agent-skills
Walks through connecting GitHub to Datadog via the Datadog GitHub App, enabling source code in stack traces and pull request comments. Verifies existing connections, handles installation, and optionally adds service.datadog.yaml for Software Catalog.
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.
Connect GitHub to Datadog in two moves: the install on GitHub's install screen (the user installs the Datadog GitHub App on a GitHub org/account they own), then Datadog linking that installation so it can read the chosen repositories. The background poll drives the link.
The install is the user's — this skill never installs on their behalf and
never writes credentials. All /api/ calls go through pup api, which
authenticates with the user's own session; that session needs the
Integrations Manage (manage_integrations) permission, which is what
authorizes the connect (see Important Notes when it is missing). The install
URL is minted through the Datadog API, so it carries a short-lived Datadog
state and GitHub's post-install redirect lands back on Datadog cleanly; its
bearer is captured from pup auth token in process memory only.
scripts/github_setup.py owns site resolution, install-URL minting, account and
installation discovery, linking, verification, and the API calls — do not reproduce that logic
yourself. The API reference is
https://docs.datadoghq.com/api/latest/integrations/.
Not for GitHub Copilot usage metrics (use dd-github-copilot-onboarding) or
GitHub billing and costs in Cloud Cost Management (use
dd-github-costs-onboarding). Monitors and notifications are out of scope.
pup auth status, python3accounts → stop or continueauthorize --open (add --continue only after the user chose continue)wait in the background → exit 0verify --account <name> --json → exit 0Datadog 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.
pup and the site. This flow drives the Datadog API through pup api, and
the site is derived from the user's pup authentication, so the API
calls hit the same Datadog environment they are logged into:
pup auth status
authenticated: true → use the reported site; continue.authenticated: false → do not declare the user unauthenticated yet. pup
reports the session for the site in DD_SITE (default datadoghq.com) or the
named --org session — a user logged into another site (e.g. staging
datad0g.com) shows as unauthenticated under the default. Ask which site/org
they authenticated for, then re-run with DD_SITE=<site>. If they
authenticated a named (org-keyed) pup session instead, pass --org <name> to
the script's commands — it threads the flag through pup auth status,
pup api and pup auth token. Still false → stop and ask them to run
DD_SITE=<site> pup auth login (it needs a browser). Never guess a site.pup is missing (command -v pup fails) → 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 pup auth login.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>; if the user knows their site,
--site <site> bypasses pup for site resolution, but the API
steps still need a working pup.Pass the same context to every script command in this skill: --site <site> when Phase 0 needed DD_SITE=<site>, and the same --pup / --org.
Python. The flow runs scripts/github_setup.py, so confirm python3 is on
PATH before starting:
command -v python3 || echo "MISSING python3"
Browser. The install needs a browser logged into both GitHub and the
Datadog app. If there is no browser (a headless host), Phase 2 drops --open
and prints the URL for the user to open where they are logged in.
Permission. A 403 means the session lacks manage_integrations; see Important Notes.
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 ?
One check comes before anything is opened: whether the org already has a GitHub account connected. Do not ask which GitHub org, personal account, or repositories to connect — the user picks those on GitHub's install screen.
If the user's repositories are on GitHub Enterprise Server or GHE.com, stop and point them to the GitHub integration tile in Datadog: this flow connects github.com only.
Before opening anything, find out whether the org already has a GitHub
integration — the user may not want this flow at all. accounts is a
read-only GET (it also lists the user's app installations and their link
statuses):
python3 -I -B <skill>/scripts/github_setup.py accounts
Exit 2 / "no GitHub account is connected" → nothing is connected yet;
go straight to Phase 2. If it lists a NOT_LINKED_LINKABLE installation,
mention it in passing: link <installation_id> connects it without a new
install.
Exit 0 with accounts → report exactly what was discovered before
asking anything else. Name every account (with its repository count) and the
installations with their link statuses — --json gives the full lists. For
example:
We discovered these GitHub accounts are already connected: acme (3 repos). Your installations: acme — LINKED_TO_THIS_ORG; personal — NOT_LINKED_LINKABLE.
Then ask, with the host's native selector:
Would you like to: (1) stop — the existing connection already covers you, or (2) continue and connect another GitHub?
--continue (the script refuses to
open the install screen without it when accounts exist, so the user's
answer is what unlocks it).python3 -I -B <skill>/scripts/github_setup.py authorize --open
--continue.--json: url, minted, mint_error, existing_accounts). If the mint
is unavailable it falls back to GitHub's public install screen and reports
minted: false.--open and give the user the
URL.Never complete the install for the user, and do not wait for them to report back — start the poll below as soon as the screen is open. Tell the user:
authorize if it does),
and the browser needs a Datadog session for the site. After Install they
land on Datadog's GitHub configuration page.minted: false: GitHub's redirect after Install shows a
Datadog error page — harmless, the poll still lands the connect; say so
before they click Install.NOT_LINKED_MISSING_PERMISSIONS and cannot land — say so
plainly rather than retrying.python3 -I -B <skill>/scripts/github_setup.py wait --interval 5 --timeout 300
It waits through the pending-install state and retries transient errors.
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 connection — no question to the user in between.
It links the installation that becomes linkable while it polls, then polls
the accounts and exits 0 printing the new connection. --json emits site,
installation_id, github_account_name and new_accounts. Exit 2 means it
timed out: re-check the caveats above (the installation landed on a GitHub org
the user owns), and if the install completed before this poll started, link
it by hand (below); otherwise re-run this step.
When two installations become linkable at once the poll stops with them listed — pick one with the user and run:
python3 -I -B <skill>/scripts/github_setup.py link <installation_id>
To re-check by hand (for example, the connect predates this run), run
accounts (Phase 1).
After wait exits 0, run (read-only, in the background — it waits up to 120s
for Datadog's repository sync):
python3 -I -B <skill>/scripts/github_setup.py verify --account <github_account_name> --json
It reports sync_status, source_code_integration (Datadog can read the code
— what puts snippets in stack traces), and code_repositories /
pr_comment_repositories (up to 10 names each, with the full totals in
code_repository_count / pr_comment_repository_count). Exit 2 → say which
check failed: empty
code_repositories usually means no repositories were picked on GitHub's
install screen; sync_status: running → re-run verify in a few minutes.
The Software Catalog only drops a GitHub-synced entry while the integration can still see the change, so remove the demo files before unlinking:
catalog-cleanup --account <github_account_name> --dry-run --json — finds
the repositories with demo entries through the Software Catalog (no scan of
every repository) and lists the demo files catalog-pr added (only files
tagged source:dd-github-onboarding; the user's own definitions are never
touched). Relay any per-repository error or needs_choice (ask which gh
account, pass --gh-user). No service_names → go to step 4.--dry-run
and give the user each pr_url to merge.service_names:
catalog-wait --service-name <name> --absent --json. Exit 2 → not merged
yet: ask whether to keep waiting or unlink anyway.unlink <installation_id> (accounts lists the ids). Uninstalling the app
on GitHub, if wanted, comes after this — never before step 3.Prefix each command with python3 -I -B <skill>/scripts/github_setup.py.
Show it in action (optional). A PR that adds a service.datadog.yaml to one
of code_repositories; once merged, the repository appears in the Software
Catalog within seconds. It writes to the user's repository, so it starts with
a question. First run gh auth status --hostname github.com; if gh is
missing (see https://cli.github.com) or not logged in, skip the demo and say
why.
Offer it with the host's native selector (e.g. AskUserQuestion) — never
just in prose: "Want to see it in action? I can open a pull request that
adds your repository to Datadog's Software Catalog." Options: one per
repository in code_repositories (up to three, e.g. Yes, use
Test-Repository) and No, skip it. No → go to Final message.
Preview the chosen repository (writes nothing):
python3 -I -B <skill>/scripts/github_setup.py catalog-pr --repo <owner>/<repo> --dry-run --json
The script picks the GitHub account — never switch the user's active gh
account or try accounts yourself. gh_user is the only logged-in account
that can push; needs_choice: true → ask which (list the push ones in
accounts) and re-run with --gh-user. It refuses, before writing, if the
repo already has a catalog file (skip the demo), if the service name is
already in the catalog (offer --service-name <other>), or if an earlier
demo PR is still open. Each run uses a fresh branch
(datadog/software-catalog-<6 hex>, shown in branch); it never reuses or
deletes one.
Ask with the host's native selector, showing the file and naming the
account: "I'll open a pull request in <owner>/<repo> as <gh_user> adding
this service.datadog.yaml; once you merge it, the repository shows up in
the Software Catalog." Yes, open the pull request / No, skip it.
Never open it without a yes.
Open it: the same command without --dry-run, always with
--gh-user <gh_user>. It never touches the default branch or merges. Give
the user pr_url to merge.
Wait in the background (up to an hour, for the merge):
catalog-wait --service-name <service_name> --json. Exit 0 → include both
links in the final message, link (the catalog; search for the name) and
entity.github_url (the file it syncs from). Exit 2 → check the PR is
merged, and look in Event Management for
source:software_catalog status:error.
Only after verify exits 0 (never celebrate after a failure), built only from
what it confirmed, in this order:
<account> — Datadog can show code from
<n> repositories (<first names>) in stack traces, and comment on pull
requests in <m> (mention PR comments only for pr_comment_repositories).<service_name> — link,
entity.github_url (or the open pr_url if not merged yet).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 user's
Datadog session is not allowed to start the connect. Tell them they need
Integrations Manage (manage_integrations) on their Datadog org: an org
admin grants it through RBAC, and it is on the default Datadog Standard
Role. The related Integrations Read (integrations_read) is view-only
and is not sufficient. Reference:
https://docs.datadoghq.com/account_management/rbac/permissions/. Once an
admin grants the permission, re-run authorize --open.401 / not authenticated — the pup token itself is missing, stale, or
org-unbound; re-authenticate (pup auth login, see Phase 0) and re-run.minted: false; ignore
it. With a minted URL it means the URL expired or the browser had no
Datadog session — the poll still lands an install that happened, otherwise
re-run authorize --open.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub datadog-labs/agent-skills --plugin agent-skills78 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 with the same harness, keeps the change if it improves the score in the goal's direction (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 prompt/file 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)./agent-observability-eval-bootstrapBootstrap evaluators from production traces — by default propose online LLM-judge evaluators and, after you confirm, create them in Datadog as disabled drafts (never auto-enabled); on request emit Python SDK code or a framework-agnostic JSON spec instead. Use when user says "bootstrap evaluators", "generate evaluators", "create evals from traces", "eval bootstrap", "write evaluators", "build eval suite", "publish evaluators", or wants to generate BaseEvaluator/LLMJudge code or online judge configs from production LLM trace data. Works with ml_app and optional RCA report or failure hypothesis./agent-observability-eval-pipelineEnd-to-end Agent Observability pipeline for an instrumented ml_app — classify production traces, root-cause failures, bootstrap evaluators, then (optionally) sample + publish a dataset, generate + run an experiment, and analyze results. Six narrated phases with a standardized banner and a "continue" checkpoint between each. Pure orchestration over the agent-observability sub-skills (`agent-observability-session-classify`, `agent-observability-trace-rca`, `agent-observability-eval-bootstrap`, `agent-observability-experiment-bootstrap`, `agent-observability-experiment-analyzer`). Use when user says "run the eval pipeline", "go from traces to evals", "bootstrap evals end to end", "classify then RCA then bootstrap", "build an eval set from scratch", "onboard me to datasets and experiments", "walk me through experiments", "I have an ml_app, now what", "Agent Observability onboarding", "guided experiment setup", "from traces to experiments", or wants a deterministic, narrated tour from production data through evaluators, datasets, and experiments. Stop early with `--stop-after <phase>` to short-circuit at evaluators or dataset, or resume mid-flow with `--start-at <phase>`./agent-observability-experiment-analyzerAnalyze LLM experiment results. Handles single or comparative experiments, exploratory or Q&A modes. Use when user says "analyze experiment", "compare experiments", "analyze against baseline", or provides one or two experiment IDs for analysis./agent-observability-experiment-bootstrapBootstrap a reproducible LLM Observability experiment through the Python ddtrace SDK or the Node dd-trace SDK. Use for experiment, dataset, evaluator, benchmark, regression, or LLM-as-a-judge scaffolding. The legacy Python invocation remains supported.Other plugins' skills for the same job