/agent-skills:dd-github-copilot-onboardingfrom agent-skills
Walks through connecting GitHub Copilot to Datadog for usage and license metrics. Checks existing connections, confirms GitHub user and orgs, verifies org metrics policies, and handles OAuth consent. Can also remove a connected account.
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 Copilot to Datadog in two user-driven moves: the consent (the
OAuth grant) on GitHub's Authorize screen for the Datadog Copilot app, then Datadog writing
the account when GitHub redirects back. Once connected, Copilot usage and
license metrics (github_copilot.usage.*) start flowing.
The flow starts with a scope check (Phase 1): if the Datadog org already has
GitHub Copilot accounts connected, the skill reports exactly what is configured
and asks whether to stop or add another. A connection is a GitHub user's
grant — Datadog collects every GitHub org that user owns — so the skill
confirms the signed-in gh user, lists the GitHub orgs it will collect, checks
each one's usage metrics policy, and names the account after the GitHub login.
Copilot costs (Cloud Cost Management) are out of scope: hand off to
dd-github-costs-onboarding. Code in stack traces and pull request comments
belong to dd-github-onboarding.
The consent is the user's — this skill never authorizes on their behalf.
Every call except the mint rides pup api, which authenticates with the
user's own session. The mint POSTs straight to the site's UI host with the
session's OAuth token from pup auth token, held in memory only and never
printed (see Why the mint bypasses pup api in Phase 2). Nothing here waits
on the user to report back: the consent is detected by a background poll.
scripts/github_copilot_setup.py owns site resolution, the mint, account
discovery, and the API calls — do not reproduce that logic yourself.
This is a hands-on setup: run the commands yourself as part of the conversation rather than handing the user a list, and keep them in the loop.
Copy this checklist and tick it off:
pup auth status, python3, gh auth status (Phase 0)accounts → stop, or continue with --continueorgs → confirm <LOGIN>check-org <github-org> for each owned GitHub orgauthorize --account-name "<LOGIN>" --openwait --account-name "<LOGIN>" in the backgroundverify in the backgroundpup, authenticated. The whole flow rides on the user's pup session — it
resolves the site, carries every pup api call, and supplies the OAuth token
for the one call that does not ride pup api, the UI-host mint:
pup auth status
authenticated: true → use the reported site; continue.ddog-gov.com) → stop: this skill
doesn't support Government sites; point the user to the Datadog app. The
script refuses it too.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 pup session —
a user logged into another site (e.g. EU datadoghq.eu) shows as unauthenticated
under the default. Ask which site or pup session they authenticated, then re-run with
DD_SITE=<site>. If they authenticated a named (org-keyed) pup session instead, pass
the pup session flag --org <session> to the script's commands — it threads the flag
through pup auth status and the pup api calls. 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 → 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 mint and the API steps still need a working pup.python3. The flow runs through scripts/github_copilot_setup.py, invoked as
python3 -I -B, so python3 must be on PATH:
command -v python3 >/dev/null 2>&1 && echo "python3: available" || echo "MISSING python3 - https://www.python.org/downloads/"
command -v pup >/dev/null 2>&1 && echo "pup: available" || echo "MISSING pup"
command -v gh >/dev/null 2>&1 && echo "gh: available" || echo "MISSING gh - https://cli.github.com"
GitHub CLI (gh). Signed in as the GitHub user whose Copilot usage should
be collected — the flow lists the organizations that user owns and probes each
org's usage-metrics policy through gh, read-only, with no Datadog credentials:
gh auth status
gh is missing → ask before installing it from https://cli.github.com
(it is used read-only), then continue as below.gh auth login (it needs a browser)
before continuing.Browser. The consent happens on GitHub's Authorize screen in a browser, and
DD_SITE=<site> pup auth login needs one too. If there is no browser
(headless), the flow still works — drop --open in Phase 2, print the returned
URL, and ask the user to open it where they are logged into GitHub.
Permission. The session that mints the connection needs Integrations
Manage (manage_integrations) on the Datadog org; an org admin grants it
through RBAC. The related Integrations Read (integrations_read) is
view-only and is not sufficient. A missing grant surfaces as a 403 on the
mint — the routing is in Phase 2 under "If the mint fails".
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 ?
What gets connected is a GitHub user, not an org. The connection stores the OAuth token of the GitHub user who clicks Authorize, and every day Datadog collects Copilot metrics for every org that user can read Copilot data for (the orgs they own, with the usage metrics policy on). Picking an org does not limit the collection, so this flow never asks for one. The account is named after the GitHub login.
Start here: find out whether this Datadog org already has the integration — the
customer may not want this flow at all. accounts is a read-only GET that goes
through pup api:
python3 -I -B <skill>/scripts/github_copilot_setup.py accounts
Pass the same --pup/--site/pup-session --org <session> context as the rest of the flow (Phase 0).
Exit 2 / "no GitHub Copilot account is connected" → nothing is connected yet. Continue to Which GitHub account?
Exit 0 with accounts → report exactly what was discovered before
asking anything else. Name every account with its id — --json gives the
full list. For example:
We discovered these GitHub accounts are already connected: account1 (a1b2c3d4).
Then ask, with the host's native selector:
Would you like to: (1) stop — the existing account is sufficient, or (2) continue and connect another GitHub account?
--continue in
Phase 2 (the script refuses the mint without it when accounts exist, so the
customer's answer is what unlocks it).Find the signed-in gh user and the orgs it owns — read-only, no Datadog
credentials, and never blocks (a missing, unauthenticated or erroring gh exits
2 with a note rather than a traceback):
python3 -I -B <skill>/scripts/github_copilot_setup.py orgs
It prints gh user: <login> and then the orgs that user owns (role admin,
membership active); --json emits {"gh_login": ..., "orgs": [...]}. Tell the
user plainly, for example:
Connecting as GitHub user . Datadog will collect Copilot data for the orgs this user owns: , .
Then ask with the host's native selector whether that is the right GitHub user:
gh auth switch (or gh auth login), then re-run
orgs.authorize refuses it. Offer gh auth switch, or delete-account <id> first
if they want to reconnect it.gh auth switch to the GitHub user that owns the
orgs.orgs failed (exit 2: gh missing, not logged in, or an API error) →
ownership is unknown, so do not tell the user they own nothing. Relay the
error and help fix gh, then re-run orgs; or ask which GitHub login they
will authorize as and which orgs it owns. Confirm that login as <LOGIN>
before continuing — authorize --account-name and wait need it.Datadog collects enterprise-level Copilot data only when the account carries the
enterprise name, and gh cannot detect it without the read:enterprise scope,
so ask with the host's native selector:
Are your Copilot licenses managed by a GitHub Enterprise?
Options: No — licenses are per org (the common case), Yes, and Not sure. Copilot Business licenses can be assigned by an organization or by an enterprise; GitHub explains the plans at https://docs.github.com/en/copilot/get-started/plans and enterprise-managed Copilot at https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise.
Not sure → suggest asking whoever manages the company's GitHub Copilot billing. If they still cannot tell, treat it as No: per-org data is collected either way for the orgs this user owns, and only enterprise-level totals need the enterprise name.
No → continue; no enterprise flags.
Yes → ask for the enterprise name (its slug, as in
github.com/enterprises/<name>) and whether it is on GHE.com (GitHub
Enterprise Cloud with data residency).
--enterprise-name <name> to authorize and
verify. During consent the user picks "Authorize Enterprise Cloud".Ask whether to add tags to the new account (optional), such as
team:dev-tools: key:value pairs with no spaces or commas. Pass each one as
--tags <key:value> to authorize. Tags are set when the authorize URL is
minted, so ask before Phase 2; no answer means no tags.
Probe each owned org before minting — it is the same signal the metrics need, so an org with the policy off surfaces here instead of as missing data later:
python3 -I -B <skill>/scripts/github_copilot_setup.py check-org <github-org>
It calls GET /orgs/<github-org>/copilot/metrics/reports/organization-28-day/latest
through gh api:
verify.gh token lacks
the Copilot metrics scope; relay the gh auth refresh command it prints and
re-run.These are warnings, not blocks: continue to Phase 2 as long as at least one org
is enabled (or an enterprise name was given). If none is, ask whether to connect
anyway. (--json gives org, status and verdict.)
python3 -I -B <skill>/scripts/github_copilot_setup.py authorize --account-name "<LOGIN>" --open
<skill> with this skill's directory and <LOGIN> with the GitHub
login from Phase 1. Add --continue only when the user chose (2)
continue in Phase 1, --enterprise-name if one was given, and
--tags <key:value> once per tag the user chose. The command
resolves the site (Phase 0), mints the installation on the site's UI host
(see Why the mint bypasses pup api below), then opens the authorize URL
the Datadog API returns complete; add --json to capture site, url,
account_name and existing_accounts in the transcript.<LOGIN>. The connection
collects for whoever approves in the browser; if the browser is signed into a
different GitHub user, the account name will not match what it collects.authorize --open exits 3, the browser didn't open: give the user the URL printed after
open the URL manually:.The URL lands the user directly on GitHub's Authorize screen for the Datadog Copilot app. Never complete the consent on their behalf — but do not wait for them to report back either: start the poll below as soon as the consent screen is open and let it notice the consent. Repeat runs may auto-approve with no click.
Caveats to hand to the user:
state in the minted authorize URL is valid about 30 minutes — but
the account only appears after the consent, so open it promptly
anyway.pup session that minted — an
install finished from a different user or org is rejected. Multi-org users:
make sure the browser is on that same org.pup apiThis is the one call that does not ride pup api, and deliberately so. The
minted state token records the host the mint was sent to, and every
post-consent browser leg is driven by that recorded host — the redirect bounces
to https://<that host>/api/ui/oauth-integrations/github-copilot/install/finish
and on success to https://<that host>/integrations?...&oauthAuthenticationStatus=success.
Mint on api.<site> and the browser lands on the API host, where the user's
Datadog browser session cannot authenticate — the flow ends in "unauthorized"
right after the GitHub account is picked. Minting from the UI host reproduces
exactly what the integration tile's Authorize button does. (All the other
calls stay on pup api, which only ever attaches the session credential to the
api.<site> host.) The script derives the UI host — app.<site> for a bare
domain, the site itself for regional or vanity hosts (e.g. us3.datadoghq.com)
— so do not build it yourself.
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 customer decides.403 / Forbidden / manage_integrations — the user's
Datadog session is not allowed to start the connection. 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. Give the user the Roles page of their own
Datadog site — https://<UI host>/organization-settings/roles (e.g.
app.datadoghq.com for US1, app.datadoghq.eu for EU, us3.datadoghq.com
for US3) — and the reference
https://docs.datadoghq.com/account_management/rbac/permissions/. Once an
admin grants the permission, re-run this step.401 / not authenticated — the pup token itself is missing, stale, or
org-unbound; re-authenticate (pup auth login, see Phase 0) and re-run.python3 -I -B <skill>/scripts/github_copilot_setup.py wait --account-name "<LOGIN>" --interval 5 --timeout 300
Start this as a background process immediately after the consent screen is
open (background it with the host's process manager or a shell &), then
continue when it reports the account — the poll is the confirmation, so never
ask the user to report back that they clicked Authorize, and never block on a
"done". Always pass --account-name with the login from Phase 1: the wait exits
0 as soon as an account with that name is listed, even if the consent landed
before the poll started, and ignores unrelated accounts. That is safe because
authorize refuses a name that is already connected. --json emits
site and new_accounts. Exit 2 means it timed out: re-check this phase's
caveats and re-run authorize --open and wait. Pass the same
--site/--pup/pup-session --org <session> as the rest of the flow.
Tell the user: GitHub Copilot is connected — name the account that
landed. Copilot usage metrics (github_copilot.usage.*) start flowing.
If the metrics never appear (GitHub-side checks, in order):
check-org <github-org> for each org and act on its verdict as in
Phase 1's Is the Copilot usage metrics policy on?. The policy is an org
(or enterprise) policy; github.com/settings/... pages never show it.--enterprise-name).Cleanup, when asked:
python3 -I -B <skill>/scripts/github_copilot_setup.py delete-account <id>
removes one account (it re-lists afterwards and confirms the removal);
accounts shows what exists first.
Once wait reports the account, confirm that the orgs' metrics arrive without blocking
the conversation.
If Phase 1 found no enabled org and no enterprise name was given, there is nothing to check: skip the background check and tell the user the account is connected, but metrics arrival cannot be verified until an org has the Copilot usage metrics policy on (or an enterprise name is set). Otherwise:
Start a background subagent with this task. Pass one --github-org for each
org Phase 1 found enabled and --enterprise-name if one was given. The
subagent runs in a fresh shell, so give it the same Datadog context setup
used — the same DD_SITE=<site> prefix or --site, and the same --pup
and pup session --org <session> — and include them in its command; otherwise verify falls back
to the default site and could check the wrong one:
Run
DD_SITE=<site> python3 -I -B <skill>/scripts/github_copilot_setup.py verify --github-org "<ORG1>" --github-org "<ORG2>" [--pup <path>] [--org <session>](drop theDD_SITE=prefix and the bracketed flags that setup did not use) with a command timeout of at least 16 minutes. It polls Datadog for up to 15 minutes and prints JSON. Do not retry it or change anything. Report back itsstatus(succeeded,partial,failed, orerror),arrived,pending,links,message, and anyerrorobject.
Tell the user, in these words:
"Your GitHub Copilot integration is set up! I'm now checking in the background that your Copilot metrics are arriving in Datadog. This can take up to 15 minutes, and I'll let you know as soon as they show up. Feel free to keep working in the meantime."
When the subagent reports, relay the result:
succeeded: celebrate. Give a short, enthusiastic message such as "Your github
Copilot metrics now show up in Datadog!", the links
(one Metrics Explorer link per org that arrived), and two or three
one-sentence next steps, for example: open the GitHub Copilot Overview
dashboard to see seat usage and adoption; set a monitor on
github_copilot.organizations.billing.seats.* to catch seat pressure; compare
daily active users across teams. Only describe what the script confirmed.partial: celebrate the orgs in arrived the same way, then add one
sentence naming the pending orgs and that they can take longer.failed: stay encouraging. Copilot reports usage daily, so the first data
can take a while; suggest checking github_copilot.* metrics later, and the
If the metrics never appear checks above if they still don't show up.error: report the reason. For datadog_read_not_permitted, ask before
running pup auth login --extra-scopes metrics_read,timeseries_query.If no subagent tool is available, run the command yourself and report the same
way. The script looks for a Copilot seat-count point
(github_copilot.organizations.billing.seats.total, tagged org_name:<github-org>, or
the enterprise one tagged enterprise_name:<enterprise>) stamped after it
started. Datadog records a new seat count about every 10 minutes, so data
left over from an earlier install never counts.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
datadog, github-copilot, integration-setup, oauth, usage-metrics
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