Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

triage-flaky-test

БесплатноБез исполняемых скриптовНе проверен

Load when investigating a specific flaky test. Gets history, failure pattern, and category, then recommends fix, quarantine, or escalate.

datadog-labsот 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:

  1. If the user passed --backend pup anywhere → use pup mode immediately. Skip steps 2–4.
  2. Check whether get_datadog_flaky_tests appears in your available tools.
  3. If present → use MCP mode throughout. Call tools exactly as named in this skill's workflow sections.
  4. If absent → check whether pup is executable: run pup --version via Bash. If the command exits successfully (exit code 0), pup is available.
  5. If pup responds → use pup mode throughout. Translate every tool call using the Tool Reference appendix at the bottom of this file.
  6. 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 refresh or pup 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 the id in 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 fail
  • flaky_category — root cause category
  • codeowners — owning team
  • pipeline_stats.total_lost_time_ms — total CI time lost in milliseconds
  • attempt_to_fix_id — non-empty when a Bits Code fix has been generated
  • web_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.id values 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

Полный SKILL.md на GitHub

Установить triage-flaky-test в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/fix-patterns.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить triage-flaky-test с