test-flakiness
できること
このスキルは、多くの実行にわたる自動テストの結果を調べ、ランダムに失敗するテストを見つけます。信頼できない赤いビルドに悩む開発者とQAリーダー向けです。
使う場面
- ✓チームに多くのテスト実行があり、一部のテストがランダムに失敗すると疑われるとき。
- ✓開発者がCIの失敗を「おそらく不安定なテストだ」と無視し始めたとき。
- ✓隔離されたテストについて、考えられる原因の診断が必要な場合。
スキルのリンク
https://github.com/Donchitos/Claude-Code-Game-Studios/blob/main/.claude/skills/test-flakiness/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“CIログを調べて、不安定なテストを見つけ、隔離すべきものを教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルはCIログファイルを読み、多数の実行にわたる成功率を計算して、断続的な失敗を見つけます。不安定なテストごとに隔離するか修正するかを提案し、レポートを保存することもできます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
!bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" resolve_config --keys automation
Automation mode: Resolve modes.automation (project.local.yaml →
project.yaml → default collaborative). Every AskUserQuestion call and
every file write follows .claude/docs/automation-modes.md
(collaborative asks always · guided major-only · autonomous logs and proceeds;
automation_always_ask categories always prompt).
Test Flakiness Detection
A flaky test is one that sometimes passes and sometimes fails without any code change. Flaky tests are worse than no tests in some ways — they train the team to ignore red CI runs, masking genuine failures. This skill identifies them, explains likely causes, and recommends whether to quarantine or fix each one.
Output: Updated tests/regression-suite.md quarantine section + optional
production/qa/flakiness-report-[date].md
When to run:
- Polish phase (tests have had many runs; statistical signal is reliable)
- When developers start dismissing CI failures as "probably flaky"
- After
/regression-suiteidentifies quarantined tests that need diagnosis
1. Parse Arguments
Modes:
/test-flakiness [ci-log-path]— analyse a specific CI run log file/test-flakiness scan— scan all available CI logs in.github/or standard log output directories/test-flakiness registry— read existing regression-suite.md quarantine section and provide remediation guidance for already-known flaky tests- No argument — auto-detect: run
scanif CI logs are accessible, elseregistry
2. Locate CI Log Data
Option A — GitHub Actions (preferred)
Check for test result artifacts:
ls -t .github/ 2>/dev/null
ls -t test-results/ 2>/dev/null
For Godot projects: GdUnit4 outputs XML results compatible with JUnit format,
under reports/ (its default report folder, res://reports/). Check reports/,
and any test-results/ you saved runs into, for .xml files.
For Unity projects: game-ci test runner outputs NUnit XML to test-results/
by default.
For Unreal projects: automation logs go to Saved/Logs/. Grep for
Result={Success} and Result={Fail} — each test prints
Test Completed. Result={<status>}
(docs/engine-reference/unreal/current-best-practices.md, "Command Line").
Option B — Local log files
If a path argument is provided, read that file directly.
Option C — No log data available
If no logs found:
"No CI log data found. To detect flaky tests, this skill needs test result history from multiple runs. Options:
- Run the test suite at least 3 times and collect the output logs
- Check CI pipeline output and save a log to
test-results/- Run
/test-flakiness registryto review tests already flagged as flaky intests/regression-suite.md"
Stop and ask the user which option to pursue.
3. Parse Test Results
For each CI log or result file found, parse:
JUnit XML format (GdUnit4):
- Grep for
<testcase name=to get test names - Grep for
<failureor<errorto identify failures - Parse
classnameandnameattributes for full test identifiers
NUnit XML format (Unity — the file whose <test-run> element /smoke-check
reads):
- Each test is a
<test-caseelement; itsfullnameattribute is the identifier - Its
resultattribute isPassed,Failed,InconclusiveorSkipped(docs/engine-reference/unity/current-best-practices.md, "Command Line"); onlyPassedandFailedenter the history
Plain text logs:
- Grep for pass/fail patterns:
- Godot:
PASSED/FAILEDadjacent to test names - Unreal:
Result={Success}/Result={Fail} - Unity:
Test passed/Test failed
- Godot:
Build a table: test_id → [run1_result, run2_result, run3_result, ...]
4. Identify Flaky Tests
A test is flaky if it appears in the result history with both PASS and FAIL outcomes across runs with no code changes between them.
Flakiness thresholds:
- High flakiness: Fails in >25% of runs — quarantine immediately
- Moderate flakiness: Fails in 5–25% of runs — investigate and fix soon
- Low/suspected flakiness: Fails in 1–5% of runs — monitor; may be genuinely rare failure
With fewer than 3 runs, every finding is suspected, whatever its fail rate. One failure in two runs reads as 50%, but it is one data point: do not quarantine it, label it suspected, and ask whether more run data is available. The tiers above, and quarantine, apply from
よくある質問
多くの実行が必要ですか?
はい。断続的な失敗は一度の実行では分からないため、複数回の実行後に最も効果を発揮します。
隔離とはどういう意味ですか?
不安定なテストをメインの結果から外し、本当の失敗を隠さないようにすることです。
ログはどこから探しますか?
指定した1つのログファイルを分析するか、標準のCIログフォルダをスキャンします。
詳細
作者による元の説明
Find flaky tests from CI logs — aggregates pass rates, spots intermittent failures, recommends quarantine. After multiple runs.
人気
- GitHubのスター
- 33k
- ランキング
- #8502
- ライセンス
- MIT
- 更新日
- 2026/10/18
コメント
- …
このリポジトリの他のスキル
adopt
33k既存のゲームプロジェクトの文書がスタジオのテンプレートの形式に従っているか確認し、ギャップを直すための番号付きの移行計画を書きます。
architecture-decision
33k技術的な選択についてアーキテクチャの判断記録を書き、背景、代替案、影響を記載し、適切な技術の役割によるレビューを受けます。
architecture-review
33k技術的な判断がすべての設計要件を満たし、互いに矛盾せず、エンジンのバージョンに合うかを確認し、明確な合格または懸念の判定を出します。
art-bible
33kゲームのビジュアルのアイデンティティを定義するアートバイブルを書き、アセット制作が一つの明確なスタイルのルールに従うようにします。
似ているスキル
test-driven-development
311k機能や修正を作る前に、まず失敗するテストを書き、それが失敗するのを確認してから、合格させる最小のコードを書くようエージェントに教えます。
verification-before-completion
311kタスク、修正、ビルドが完了した、または合格したと主張する前に、実際のチェックを実行し、その出力を読むようエージェントに教えます。
migrate-to-shoehorn
310kテストファイル内の危険な型キャストを、shoehornライブラリに置き換え、テストが部分的なデータを使いつつ型チェックを通るようにします。