diff --git a/content/en/getting_started/software_delivery_mcp_tools/_index.md b/content/en/getting_started/software_delivery_mcp_tools/_index.md index 2207cd2147b..51a3d58940b 100644 --- a/content/en/getting_started/software_delivery_mcp_tools/_index.md +++ b/content/en/getting_started/software_delivery_mcp_tools/_index.md @@ -31,6 +31,8 @@ The Software Delivery MCP tools unlock AI-assisted workflows for: - **Reviewing code coverage**: Get coverage summaries for branches or commits, including patch coverage and breakdowns by service or code owner. - **Measuring DORA metrics**: Query deployment frequency, change lead time, change failure rate, and recovery time by service or team. - **Checking test optimization settings**: See which Test Optimization features are active for a service, including Test Impact Analysis, Early Flake Detection, and Auto Test Retries. +- **Retrying failed CI jobs**: Queue a retry for a failed GitHub Actions job without leaving the agent session. +- **Checking PR health**: Get a combined view of CI failures, code coverage, and quality or security violations for a pull request. ## Available tools @@ -72,6 +74,9 @@ The `software-delivery` toolset includes the following tools: `aggregate_dora_deployments` : Aggregate DORA metrics—deployment frequency, change lead time, change failure rate, and recovery time—as scalar values or timeseries. For a complete DORA summary, call this tool four times in parallel, once per metric. +`retry_datadog_ci_job` +: Queue a retry for a failed GitHub Actions CI job. A write operation that modifies CI state, requiring `CiVisibilityWrite` permission. Server-side limits cap retries at two per job over seven days. GitHub Actions only — for other CI providers, use the provider's UI to rerun. + ## Example prompts After you are connected, try prompts like: @@ -97,6 +102,51 @@ https://mcp.{{< region-param key="dd_site" >}}/api/unstable/mcp-server/mcp?tools For full setup instructions including client configuration for Cursor, Claude Code, VS Code, and other AI clients, see [Set Up the Datadog MCP Server][1]. +## Agent skills + +Agent skills are prebuilt instruction sets for AI coding agents that automate common Software Delivery workflows. The `dd-software-delivery` skill set is available in the [Datadog agent-skills][6] repository. It provides two skills for triaging flaky tests and unblocking failing PR pipelines using your live CI and Test Optimization data. + +Skills are loaded automatically by the MCP server when your prompt matches their purpose — for example, "TestMyFunc keeps failing in CI — investigate it" loads `/triage-flaky-test` automatically. You can also invoke them explicitly with a slash command after installing them locally. + +### Install + +The skills are available automatically when the `software-delivery` MCP toolset is connected — no installation required. To also invoke them explicitly with a slash command, install them locally: + +```shell +npx skills add datadog-labs/agent-skills --skill dd-software-delivery --full-depth -y +``` + +Restart Claude Code after installing for the slash commands to appear. + +### Available skills + +| Skill | Invoke with | What it does | +|-------|-------------|-------------| +| Triage flaky test | `/triage-flaky-test` | Get history, failure pattern, and AI category for a specific flaky test, then recommend fix, quarantine, or escalate | +| Unblock PR | `/unblock-pr` | Attribute each CI failure on a PR as flaky, infra, or regression, surface code coverage and quality or security violations, and propose a targeted action | + +### Triage flaky test + +`/triage-flaky-test` investigates a specific flaky test. It pulls 30-day failure history, extracts the top error messages and stack traces, and checks how many pipelines the test has impacted. If a CodeGen AI fix exists for the test, the skill surfaces it directly. Otherwise, it proposes a targeted fix based on the flaky category and stack trace. It produces a structured triage brief with a recommendation to fix, quarantine, or escalate to the owning team. + +If the skill recommends quarantine, it presents the proposed action and requires your explicit approval before calling `update_datadog_flaky_test_states`. All state changes are reversible. + +``` +/triage-flaky-test TestMyFunc +/triage-flaky-test com.example.MyTest github.com/org/repo +``` + +### Unblock PR + +`/unblock-pr` investigates a failing PR CI pipeline. For each failing job, it checks whether the failure was already present on the default branch or on other branches — a blame guard that classifies the failure as **flaky**, **infra**, or **regression**. In parallel, it fetches the branch's code coverage and any code quality or security violations from PR insights. It produces a triage brief with per-job classification, evidence, a recommended action, and a PR Health section summarizing coverage and violations. + +For flaky failures, the skill chains into `triage-flaky-test` for a deeper investigation. For infra failures on GitHub Actions, it retries the failed jobs using `retry_datadog_ci_job`; for other CI providers, it provides a link to the provider's UI. For regressions, it prompts you to investigate your code changes. + +``` +/unblock-pr +/unblock-pr my-feature-branch +``` + ## Further reading {{< partial name="whats-next/whats-next.html" >}} @@ -106,3 +156,4 @@ For full setup instructions including client configuration for Cursor, Claude Co [3]: /continuous_integration/ [4]: /tests/ [5]: /getting_started/site/ +[6]: https://github.com/datadog-labs/agent-skills