jpskill.com
💬 コミュニケーション コミュニティ 🟡 少し慣れが必要 👤 幅広いユーザー

💬 テストFixing

test-fixing

テストを実行し、失敗したテストをスマートなエラーグルーピングで体系的に修正するSkill。

⏱ お礼メール定型化 5分/通 → 30秒/通

📺 まず動画で見る(YouTube)

▶ 【最新版】Claude(クロード)完全解説!20以上の便利機能をこの動画1本で全て解説 ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Run tests and systematically fix all failing tests using smart error grouping. Use when user asks to fix failing tests, mentions test failures, runs test suite and failures occur, or requests to make tests pass.

🇯🇵 日本人クリエイター向け解説

一言でいうと

テストを実行し、失敗したテストをスマートなエラーグルーピングで体系的に修正するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o test-fixing.zip https://jpskill.com/download/504.zip && unzip -o test-fixing.zip && rm test-fixing.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/504.zip -OutFile "$d\test-fixing.zip"; Expand-Archive "$d\test-fixing.zip" -DestinationPath $d -Force; ri "$d\test-fixing.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して test-fixing.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → test-fixing フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • test-fixing の使い方を教えて
  • test-fixing で何ができるか具体例で見せて
  • test-fixing を初めて使う人向けにステップを案内して

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[スキル名] test-fixing

テストの修正

スマートなグループ化戦略を用いて、失敗しているすべてのテストを体系的に特定し、修正します。

使用する場面

  • 明示的にテストの修正を求められた場合(「これらのテストを修正してください」「テストがパスするようにしてください」)
  • テストの失敗が報告された場合(「テストが失敗しています」「テストスイートが壊れています」)
  • 実装が完了し、テストをパスさせたい場合
  • テストが原因で CI/CD が失敗したと述べられた場合

体系的なアプローチ

1. 初回テスト実行

make test を実行して、失敗しているすべてのテストを特定します。

出力から以下を分析します。

  • 失敗の総数
  • エラーの種類とパターン
  • 影響を受けるモジュール/ファイル

2. スマートなエラーのグループ化

類似する失敗を以下でグループ化します。

  • エラータイプ: ImportError、AttributeError、AssertionError など
  • モジュール/ファイル: 同じファイルが複数のテスト失敗を引き起こしている場合
  • 根本原因: 依存関係の不足、API の変更、リファクタリングの影響

グループを以下で優先順位付けします。

  • 影響を受けるテストの数(最も影響の大きいものから)
  • 依存関係の順序(機能の前にインフラストラクチャを修正する)

3. 体系的な修正プロセス

各グループ(最も影響の大きいものから)について:

  1. 根本原因の特定

    • 関連するコードを読む
    • git diff で最近の変更を確認する
    • エラーパターンを理解する
  2. 修正の実装

    • コード変更には Edit ツールを使用する
    • プロジェクトの慣例に従う(CLAUDE.md を参照)
    • 最小限で焦点を絞った変更を行う
  3. 修正の検証

    • このグループのテストのサブセットを実行する
    • pytest マーカーまたはファイルパターンを使用する:
      uv run pytest tests/path/to/test_file.py -v
      uv run pytest -k "pattern" -v
    • 次に進む前にグループがパスすることを確認する
  4. 次のグループへ移動

4. 修正順序戦略

インフラストラクチャを最初に:

  • Import errors
  • 依存関係の不足
  • 設定の問題

次に API の変更:

  • 関数シグネチャの変更
  • モジュールの再編成
  • 変数/関数の名前変更

最後に、ロジックの問題:

  • Assertion failures
  • ビジネスロジックのバグ
  • エッジケースの処理

5. 最終検証

すべてのグループが修正された後:

  • 完全なテストスイートを実行する: make test
  • 回帰がないことを確認する
  • テストカバレッジが維持されていることを確認する

ベストプラクティス

  • 一度に一つのグループを修正する
  • 各修正後に焦点を絞ったテストを実行する
  • git diff を使用して最近の変更を理解する
  • 失敗のパターンを探す
  • 現在のグループがパスするまで次のグループに進まない
  • 変更は最小限に、焦点を絞って行う

ワークフロー例

ユーザー: 「リファクタリング後、テストが失敗しています」

  1. make test を実行 → 15 件の失敗を特定
  2. エラーをグループ化:
    • 8 件の ImportError(モジュール名変更)
    • 5 件の AttributeError(関数シグネチャ変更)
    • 2 件の AssertionError(ロジックのバグ)
  3. まず ImportError を修正 → サブセットを実行 → 検証
  4. AttributeError を修正 → サブセットを実行 → 検証
  5. AssertionError を修正 → サブセットを実行 → 検証
  6. フルスイートを実行 → すべてパス ✓
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Test Fixing

Systematically identify and fix all failing tests using smart grouping strategies.

When to Use

  • Explicitly asks to fix tests ("fix these tests", "make tests pass")
  • Reports test failures ("tests are failing", "test suite is broken")
  • Completes implementation and wants tests passing
  • Mentions CI/CD failures due to tests

Systematic Approach

1. Initial Test Run

Run make test to identify all failing tests.

Analyze output for:

  • Total number of failures
  • Error types and patterns
  • Affected modules/files

2. Smart Error Grouping

Group similar failures by:

  • Error type: ImportError, AttributeError, AssertionError, etc.
  • Module/file: Same file causing multiple test failure
  • Root cause: Missing dependencies, API changes, refactoring impacts

Prioritize groups by:

  • Number of affected tests (highest impact first)
  • Dependency order (fix infrastructure before functionality)

3. Systematic Fixing Process

For each group (starting with highest impact):

  1. Identify root cause

    • Read relevant code
    • Check recent changes with git diff
    • Understand the error pattern
  2. Implement fix

    • Use Edit tool for code changes
    • Follow project conventions (see CLAUDE.md)
    • Make minimal, focused changes
  3. Verify fix

    • Run subset of tests for this group
    • Use pytest markers or file patterns:
      uv run pytest tests/path/to/test_file.py -v
      uv run pytest -k "pattern" -v
    • Ensure group passes before moving on
  4. Move to next group

4. Fix Order Strategy

Infrastructure first:

  • Import errors
  • Missing dependencies
  • Configuration issues

Then API changes:

  • Function signature changes
  • Module reorganization
  • Renamed variables/functions

Finally, logic issues:

  • Assertion failures
  • Business logic bugs
  • Edge case handling

5. Final Verification

After all groups fixed:

  • Run complete test suite: make test
  • Verify no regressions
  • Check test coverage remains intact

Best Practices

  • Fix one group at a time
  • Run focused tests after each fix
  • Use git diff to understand recent changes
  • Look for patterns in failures
  • Don't move to next group until current passes
  • Keep changes minimal and focused

Example Workflow

User: "The tests are failing after my refactor"

  1. Run make test → 15 failures identified
  2. Group errors:
    • 8 ImportErrors (module renamed)
    • 5 AttributeErrors (function signature changed)
    • 2 AssertionErrors (logic bugs)
  3. Fix ImportErrors first → Run subset → Verify
  4. Fix AttributeErrors → Run subset → Verify
  5. Fix AssertionErrors → Run subset → Verify
  6. Run full suite → All pass ✓