triage-flaky-test
БесплатноБез исполняемых скриптовНе проверенLoad when investigating a specific flaky test. Gets history, failure pattern, and category, then recommends fix, quarantine, or escalate.
от datadog-labs★ 188 звёзд на GitHubОб этом скилле
Triage Flaky Test
One-line summary: Investigate a specific flaky test — get history, failure pattern, and category, then recommend fix, quarantine, or escalate.
Requires: Datadog MCP tools, or the dd-pup skill with pup installed and authenticated.
Backend
Detection — At the start of every invocation, before taking any action, determine which backend to use:
- If the user passed
--backend pupanywhere → use pup mode immediately. Skip steps 2–4. - Check whether
get_datadog_flaky_testsappears in your available tools. - If present → use MCP mode throughout. Call tools exactly as named in this skill's workflow sections.
- If absent → check whether
pupis executable: runpup --versionvia Bash. If the command exits successfully (exit code 0), pup is available. - If pup responds → use pup mode throughout. Translate every tool call using the Tool Reference appendix at the bottom of this file.
- If neither is available → stop and tell the user:
"Neither the Datadog MCP server nor the pup CLI is available. Connect the MCP server or install pup (
brew install datadog-labs/pack/pup)."
pup invocation rules:
- Invoke via Bash with JSON output (
pup --output json ...) and parse the response. - Repository IDs passed to pup must be fully lowercase (the API rejects mixed-case).
- Sort values starting with
-require=syntax:--sort="-last_flaked"(not--sort "-last_flaked"). - If pup returns a 401/403, tell the user to run
pup auth refreshorpup auth login.
Input
| Parameter | Description |
|---|---|
| Test name | Fully qualified test name (e.g. TestMyFunc or com.example.MyTest) |
| Repository | Lowercase, no-schema URL (e.g. github.com/org/repo). Derive from git remote get-url origin if not provided. |
Workflow
STEP 0 — Parse Input
Derive repository ID from git if not provided:
git remote get-url origin
# Strip protocol and trailing .git, normalize SSH git@host:org/repo to host/org/repo, then lowercase
# e.g. https://github.com/DataDog/my-repo.git → github.com/datadog/my-repo
Validation fallback: If STEP 1 returns no results, confirm the correct repository by searching without a repo filter:
Tool: search_datadog_test_events
query: @test.name:"<test-name>"
from: now-30d
test_level: test
Extract @git.repository.id_v2 from results and retry STEP 1 with the confirmed value.
STEP 1 — Get Flaky Test Details
Preferred — use fingerprint_fqn if known (fingerprint_fqn is a valid CI Visibility search facet):
Tool: get_datadog_flaky_tests
query: fingerprint_fqn:<fqn>
sort_field: last_flaked
sort_order: desc
Fallback — use name + suite + repo:
Tool: get_datadog_flaky_tests
query: @test.name:"<test-name>" @test.suite:"<suite>" @git.repository.id_v2:"<repo>"
sort_field: last_flaked
sort_order: desc
Omit @test.suite if unknown. If multiple suites or modules match, resolve the test identity from the failing event before continuing; add @test.module when needed to distinguish them. Do not filter by flaky_test_state — return the test regardless of state.
Note: the query filter facet is flaky_test_state; the returned response attribute is flaky_state — do not use flaky_state:active as a query filter.
Extract from results:
fingerprint_fqn— unique test identifier; used as theidin STEP 5 write call. If absent, do not proceed to quarantine — see STEP 5.flaky_state— current state (active / quarantined / disabled / fixed)test_stats.failure_rate_pct— percentage of runs that failflaky_category— root cause categorycodeowners— owning teampipeline_stats.total_lost_time_ms— total CI time lost in millisecondsattempt_to_fix_id— non-empty when a Bits Code fix has been generatedweb_url— datacenter-correct FTM link, when supplied by the backend
pup mode response mapping: Pup returns raw JSON:API records: read fields from data[].attributes and use the matching record’s data[].id as fingerprint_fqn if it is not repeated in attributes. The MCP enriches responses with fingerprint_fqn and web_url; pup may not return web_url. Keep the ID tied to the confirmed test’s module, suite, name, and repository. If no link is supplied, use the FTM UI on the configured Datadog site; do not assume a US1 hostname.
STEP 2 — Get Recent Failure History
Tool: search_datadog_test_events
query: @test.name:"<test-name>" @test.suite:"<suite>" @test.status:fail @git.repository.id_v2:"<repo>"
from: now-7d
test_level: test
Extract:
- Error messages and stack traces (
@error.message,@error.stack) - Failing branches (
@git.branch) — branch-specific vs. widespread - Frequency pattern — random timing or specific conditions
- Unique
@ci.pipeline.idvalues for blast radius (STEP 3)
Reading stack traces: Read error chains from bottom to top. Chained errors hide the real cause — the innermost error at the bottom is the ro
Установить triage-flaky-test в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл triage-flaky-test?
Load when investigating a specific flaky test. Gets history, failure pattern, and category, then recommends fix, quarantine, or escalate.
Как установить скилл triage-flaky-test?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл triage-flaky-test запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic