datadog/check-ci
>- results with ci-watch, investigate failures, and report. Use when the user asks to check, watch, or monitor CI, or to see whether a pipeline passed.
npx skills add https://github.com/DataDog/dd-trace-php --skill check-ci
Monitor GitLab CI and GitHub Actions until all jobs finish, then investigate
any failures and report results.
When --commit is used (or defaulting to HEAD), both GitLab pipelines and
GitHub Actions workflow runs are monitored. GitHub monitoring requires
ddtool auth github login --org DataDog; if unavailable, a warning is
printed and only GitLab is monitored. --pipeline <id> is GitLab-only and
skips GitHub.
$ARGUMENTS may contain any combination of:
--commit <ref> — git ref to resolve (default: HEAD); monitors GitLab +GitHub
--pipeline <id> — specific GitLab pipeline ID (skips GitHub monitoring)--jobs <pat1,pat2> — comma-separated substring patterns (case-insensitive);monitor ONLY the jobs whose name contains any pattern. In monitoring mode the
run finishes as soon as the matched subset is terminal (rather than waiting for
the whole pipeline); with --list-jobs the snapshot shows only matched jobs.
Applies to both GitLab jobs and GitHub Actions workflow jobs. Omit for
whole-pipeline monitoring (the default).
--list-jobs — quick snapshot mode (no monitoring)If no --commit or --pipeline is given, default to --commit HEAD.
--list-jobsRun synchronously and exit immediately:
.claude/ci/check-ci --commit <ref> --list-jobs
Prints all jobs grouped by pipeline (GitLab) and workflow run (GitHub
Actions) with their status. Print the table to the user and stop. Do not
continue to the monitoring steps.
PYTHONUNBUFFERED=1 .claude/ci/check-ci [OPTIONS]
run_in_background: true in Bash tool invocation. Do NOT append & orredirect output.
/path/to/tasks/<id>.output ("Output is being written to ..." in the tool
invocation output). Note this path — it is required in Step 2. This file path
will be referred to as OUTPUT_FILE henceforth.
--commit HEAD.--max-failures 50 (default) and--timeout 7200 (default, 2 h).
--jobs "<pat1>,<pat2>,...". Therun then finishes as soon as those matched jobs are terminal, instead of
waiting for the whole pipeline. Example — watch the three Windows test_c
version variants:
PYTHONUNBUFFERED=1 .claude/ci/check-ci \
--jobs "windows test_c: [7.2],windows test_c: [7.3],windows test_c: [7.4]"
.claude/ci/ci-watch [--start-offset N] OUTPUT_FILE
OUTPUT_FILE must be the output file from the check-ci task above.run_in_background: true.runs, you may do other work.
RESUME_OFFSET: <N>. Record it for re-runs.ci-watch exit codes:
| Code | Meaning |
|------|---------|
| 0 | All pipelines completed — no failures |
| 1 | One or more FAILED: lines detected |
| 2 | Stale — no new output for 5 minutes |
| 3 | check-ci timed out |
Immediately after ci-watch exits, call
mcp__speak_when_done__speak(message="...") (the first time, you'll need to do
invoke ToolSearch("select:mcp__speak_when_done__speak"):
-l`)
Then choose the appropriate action:
Report success to the user and stop.
grep "^FAILED:" OUTPUT_FILE
The output directory is /tmp/gitlab_<pipeline_id>/. Logs are at:
fail_logs/<job_id>.log — GitLab job tracesgh_fail_logs/gh_<job_id>.log — GitHub Actions job logsGitHub entries in failure.txt are prefixed [GH].
OOM) — mark these as flaky rather than real failures.
Except you don't need to go through of them if it becomes evident it's
unnecessary.
a. The user explicitly asked you to fix CI failures.
b. You have made changes to address the failures.
c. The current branch has an upstream remote branch.
If any condition is missing, stop and report instead.
When all three hold: commit the fix, push, then go back to Step 1
to re-monitor.
If possible, before attempting a fix, try to reproduce the failure locally.
Check @.claude/ci/index.md for instructions. Then attempt your fix and rerun
to confirm the fix resolves the problem.
Re-run ci-watch with --start-offset <RESUME_OFFSET> (Step 2) to
resume watching from where you left off. If check-ci itself has also
exited, restart from Step 1.
Re-run ci-watch with --start-offset <RESUME_OFFSET> (back to Step 2).
Use tooling/bin/download-artifacts to fetch build outputs from CI jobs
(e.g., compiled extensions, SSI loader, datadog-setup.php). Useful when
investigating a failure that produced an artifact worth inspecting locally.
instruction "Do not push to git remotes unless explicitly asked to."
changes) should be noted but not treated as real failures requiring
a fix. However, to confirm that a test is failure you should look for
similar failures in the merge base.
GITLAB_PERSONAL_ACCESS_TOKEN is already set in the environment —do not re-export it.
curl -s -H "PRIVATE-TOKEN: $GITLAB_PERSONAL_ACCESS_TOKEN" \
"https://gitlab.ddbuild.io/api/v4/projects/355/jobs/<JOB_ID>/trace"
Take datadog/check-ci from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.