Skip to content
cccskills
FreePublished on GitHub

Flaky Test Risk Check

Detects patterns that make tests flaky and proposes stabilization steps.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Pattern declaration

Primary pattern: Reviewer Secondary patterns: Inversion Why: Flakyテストリスク検出はチェックリスト型評価が主だが、テストファイルが差分に含まれない場合は実行を止める必要がある。

Rule / ルール

  • テストを決定的にし、実行順や環境依存を避ける。
  • タイミング依存(sleep/timeout)、乱数、時刻依存のまま放置しない。
  • ネットワークや外部サービス呼び出しはモック/スタブに置き換える。

Heuristics / 判定の手がかり

  • setTimeout/sleep/waitFor で待ち時間を固定している。
  • Math.random()/Date.now()/new Date() をシード・固定値なしで使っている。
  • ネットワーク/DB/ファイル I/O への直接依存がある(モックが無い)。
  • 並列実行で共有状態を操作している、またはテスト順序に依存している。
  • 未 await の Promise が残っている、cleanup が afterEach で行われていない。

Good / Bad Examples

  • Good: vi.useFakeTimers(); jest.runAllTimers(); でタイマーを制御。
  • Good: Math.random = () => 0.42; などで乱数を固定。
  • Bad: await sleep(1000); に依存するテスト。
  • Bad: 実際の外部 API を呼ぶ統合テストをユニットテストに混在させる。

Actions / 改善案

  • タイマー/日時/乱数をモックし、シードを固定する。
  • ネットワーク・DB・外部サービスをモック/スタブ化し、リトライやバックオフをテストしない。
  • 共有状態を隔離し、beforeEach/afterEach でクリーンアップする。
  • 並列実行に耐えるようテストデータを分離し、副作用を最小化する。

Non-goals / 扱わないこと

  • E2E/負荷試験の設計や実行環境のチューニング。
  • テストフレームワークの全面移行。
  • 監視/アラートの設計。

Pre-execution Gate / 実行前ゲート

このスキルは以下の条件がすべて満たされない限りNO_REVIEWを返す。

  • 差分にテストファイル(*.test.*, *.spec.*, tests/**/*)の変更が含まれている
  • 差分にテストの実行内容に影響する変更がある(コメントや説明文のみの変更ではない)
  • inputContextにdiffが含まれている

ゲート不成立時の出力: NO_REVIEW: flaky-test — Flakyテストリスク検出の対象となるテスト変更が検出されない

False-positive guards / 抑制条件

  • テスト対象が純粋関数で、時間・乱数・外部I/Oを一切使っていない。
  • すでにフェイクタイマー/固定シードが導入済みで、差分で逸脱がない。

評価指標(Evaluation)

  • 合格基準: 指摘が差分に紐づき、根拠と次アクションが説明されている。
  • 不合格基準: 差分と無関係な指摘、根拠のない断定、抑制条件の無視。

人間に返す条件(Human Handoff)

  • 仕様や意図が不明確で解釈が分かれる場合は質問として返す。
  • 影響範囲が広い設計判断やトレードオフは人間レビューへ返す。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

<What this skill does>

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

画像・ボタン・フォーム要素に適切なアクセシブルネームがあるか確認する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

Ensure ADRs capture context, decision, alternatives, tradeoffs, and follow-ups in a way that prevents future drift.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

敵対的分析手法を統合したレビューの entry skill。認知バイアス対策の3手法 (Pre-mortem / War Game / Logic Torturing)と、宣言・主張と実態の乖離を突く claim-vs-actual 検出3パターン(Self-Contradiction / Refactor-Claim Audit / Cross-File Leakage)へルーティングし、通常のレビューでは見えない設計の盲点・ 防御の穴・論理の弱点・宣言と実装のズレを可視化する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

Review changes to the Agent Skills import/export bridge for path safety, round-trip fidelity, and validation correctness.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

Checks whether AI-assisted work defines review criteria, accessible context, explicit review loop, human judgment boundary, and feedback capture before delegating to an agent.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 23, 2026

See all skills by s977043

Report a problem with this skill