flow-debugging
フローの不具合を修正する際、まず根本原因を4段階の体系的な調査で特定し、原因を特定せずに安易な修正をしないようにするためのデバッグを支援するSkill。
📜 元の英語説明(参考)
4-phase systematic debugging for flow-fix. NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
🇯🇵 日本人クリエイター向け解説
フローの不具合を修正する際、まず根本原因を4段階の体系的な調査で特定し、原因を特定せずに安易な修正をしないようにするためのデバッグを支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o flow-debugging.zip https://jpskill.com/download/18690.zip && unzip -o flow-debugging.zip && rm flow-debugging.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18690.zip -OutFile "$d\flow-debugging.zip"; Expand-Archive "$d\flow-debugging.zip" -DestinationPath $d -Force; ri "$d\flow-debugging.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
flow-debugging.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
flow-debuggingフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Flow Debugging - 体系的なデバッグ手法
鉄則
根本原因の調査なしに修正は行わない
バグ修正は当てずっぽうなゲームではありません。体系的なデバッグ = より迅速な修正 + より少ないリグレッション。
4段階のプロセス
Phase 1: 根本原因の調査 (まだ修正は行わない)
↓
Phase 2: パターン分析
↓
Phase 3: 仮説とテスト
↓
Phase 4: 実装 (TDD)
Phase 1: 根本原因の調査
鉄則: このフェーズでは、コードの修正は一切禁止です。
Step 1: エラーを完全に読む
- 細部を省略しない
- 記録: エラーの種類、メッセージ、スタックトレース
- 記録: いつ発生するか、頻度、影響
Step 2: 安定した再現
- 信頼できる再現手順を見つける
- 記録: 入力、環境、前提条件
- 再現できない場合 → より多くの情報を収集する
Step 3: 最近の変更を確認する
- git log --oneline -20
- git diff HEAD~5
- 質問: 何が変わったか? いつから失敗し始めたか?
Step 4: データフローを逆方向に追跡する
- エラーポイントから開始する
- 上流を追跡する
- データがどこで間違っているかを見つける
出力: 根本原因の仮説 (証拠に基づいたもので、推測ではない)
Phase 2: パターン分析
Step 1: 動作する例を見つける
- 類似の機能はどこで動作するか?
- 比較: 動作するもの vs 壊れているもの
Step 2: リファレンスと比較する
- 公式ドキュメントには何と書いてあるか?
- 他のプロジェクトはどのように行っているか?
- 何が違うか?
Step 3: パターンを特定する
- これは既知のバグパターンか?
- 検索: エラーメッセージ + フレームワーク名
出力: 確認済みまたは改良された根本原因の仮説
Phase 3: 仮説とテスト
Step 1: 単一の仮説を立てる
- 「問題はXが原因である」
- 仮説は検証可能でなければならない
Step 2: 一度に1つの変数をテストする
- 1つの要素のみを変更する
- 結果を観察する
- 記録: 何を変更したか、何が起こったか
Step 3: 3回以上の修正失敗 → STOP
- 3回以上の修正試行が失敗した場合
- 停止してアーキテクチャを再検討する
- 問題は考えられているよりも深い可能性がある
危険信号: 「あれこれ試している」場合は、推測であり、デバッグではありません。
Phase 4: 実装 (TDD)
前提条件: フェーズ1〜3が完了し、根本原因が確認されていること
Step 1: 最初に失敗するテストを書く
- テストはバグを再現する必要がある
- テストを実行し、失敗することを確認する
- これがあなたの「赤信号」です
Step 2: 単一の修正を実装する
- 根本原因のみを修正する
- 「ついでに」他のことをしない
- 最小限の変更
Step 3: 検証する
- テストを実行し、合格することを確認する
- 関連するテストを実行し、リグレッションがないことを確認する
- 元の問題が解決されたことを手動で検証する
合理化の防止
| 言い訳 | 現実 |
|---|---|
| 「問題の場所はわかっている」 | 証明してください。最初に調査してください。 |
| 「クイックフィックス」 | クイックフィックス = クイックリグレッション。体系的なデバッグ。 |
| 「テストをする時間がない」 | テストがない = 本当に修正されたかどうかわからない。 |
| 「小さな変更」 | 小さな変更が大きなバグを引き起こす可能性があります。テストしてください。 |
| 「最初に修正し、後で調査する」 | 理解せずに修正する = 推測する。 |
| 「これを試してみよう」 | 「試す」ことはデバッグではありません。仮説を立て、検証してください。 |
| 「それは明らかだ」 | 明らかなことは何もありません。証拠で証明してください。 |
| 「以前にこれを見たことがある」 | すべてのバグはユニークです。このバグを調査してください。 |
危険信号 - STOP
もしあなたが以下のような状況に陥っている場合:
- 再現せずに修正している
- 「あれこれ試している」
- 3回以上の修正試行が失敗している
- テストなしに「修正済み」と言っている
- 1つのバグに対して多くのファイルを変更している
STOP。フェーズ1に戻ります。根本原因を調査してください。
デバッグ出力テンプレート
# バグ分析 - ${BUG_ID}
## Phase 1: 根本原因の調査
### エラーの詳細
- 種類: [エラーの種類]
- メッセージ: [エラーメッセージ]
- スタック: [主要なスタックフレーム]
### 再現
- 手順: [1, 2, 3...]
- 頻度: [常に/時々/まれ]
- 環境: [条件]
### 最近の変更
- [関連するコミット]
### データフロー分析
- [データがどこで間違っているか]
### 根本原因の仮説
[証拠に基づいた仮説]
## Phase 2: パターン分析
### 動作する例
[類似のコードが動作する場所]
### 比較
[動作するものと壊れているものの違い]
### 確認済みの根本原因
[改良された仮説]
## Phase 3: 仮説テスト
### 仮説
[単一のテスト可能な仮説]
### テスト結果
| 変更 | 結果 |
|--------|--------|
| [変更 1] | [結果] |
## Phase 4: 実装
### 失敗するテスト
[バグを再現するテストコード]
### 修正
[最小限の修正コード]
### 検証
- [ ] テスト合格
- [ ] リグレッションなし
- [ ] 手動検証
flow-fix との統合
このスキルは、/flow-fix コマンドの中核となる方法論です。
/flow-fix phases:
阶段 1: Root Cause Investigation → This skill Phase 1
阶段 2: Pattern Analysis & Planning → This skill Phase 2
阶段 3: 修复执行 (TDD) → This skill Phase 3-4
阶段 4: 验证与发布 → verification-before-completion
相互参照
- flow-fix.md - バグ修正コマンド
- flow-tdd/SKILL.md - TDD の強制
- verification-before-completion - 検証スキル
[PROTOCOL]: 変更時はこのヘッダーを更新し、CLAUDE.md を確認してください
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Flow Debugging - Systematic Debugging Method
The Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
Bug fixing is not a guessing game. Systematic debugging = faster fixes + fewer regressions.
The 4-Phase Process
Phase 1: ROOT CAUSE INVESTIGATION (NO FIXES YET)
↓
Phase 2: PATTERN ANALYSIS
↓
Phase 3: HYPOTHESIS AND TESTING
↓
Phase 4: IMPLEMENTATION (TDD)
Phase 1: Root Cause Investigation
Iron Law: In this phase, NO FIX CODE ALLOWED.
Step 1: Read Error Completely
- Don't skip any details
- Record: error type, message, stack trace
- Record: when it happens, frequency, impact
Step 2: Stable Reproduction
- Find reliable reproduction steps
- Record: inputs, environment, preconditions
- If can't reproduce → gather more information
Step 3: Check Recent Changes
- git log --oneline -20
- git diff HEAD~5
- Ask: What changed? When did it start failing?
Step 4: Trace Data Flow Backwards
- Start from error point
- Trace upstream
- Find where data goes wrong
Output: Root cause hypothesis (evidence-based, not a guess)
Phase 2: Pattern Analysis
Step 1: Find Working Examples
- Where does similar functionality work?
- Compare: working vs broken
Step 2: Compare with Reference
- What does official documentation say?
- How do other projects do it?
- What's different?
Step 3: Identify Patterns
- Is this a known bug pattern?
- Search: error message + framework name
Output: Confirmed or refined root cause hypothesis
Phase 3: Hypothesis and Testing
Step 1: Form Single Hypothesis
- "The problem is because X"
- Hypothesis must be verifiable
Step 2: Test One Variable at a Time
- Change only one factor
- Observe result
- Record: what changed, what happened
Step 3: 3+ Failed Fixes → STOP
- If 3+ fix attempts fail
- Stop and question architecture
- Problem may be deeper than thought
Red Flag: If you're "trying this, trying that", you're guessing, not debugging.
Phase 4: Implementation (TDD)
Prerequisite: Phases 1-3 complete, root cause confirmed
Step 1: Write Failing Test First
- Test must reproduce the bug
- Run test, confirm it fails
- This is your "red light"
Step 2: Implement Single Fix
- Fix only the root cause
- Don't "while I'm here" other things
- Minimal change
Step 3: Verify
- Run test, confirm it passes
- Run related tests, confirm no regression
- Manual verify original issue resolved
Rationalization Prevention
| Excuse | Reality |
|---|---|
| "I know where the problem is" | Prove it. Investigate first. |
| "Quick fix" | Quick fix = quick regression. Systematic debug. |
| "No time for tests" | No tests = don't know if really fixed. |
| "Small change" | Small changes can introduce big bugs. Test it. |
| "Fix first, investigate later" | Fixing without understanding = guessing. |
| "Let me try this" | "Trying" is not debugging. Form hypothesis, verify it. |
| "It's obvious" | Nothing is obvious. Prove with evidence. |
| "I've seen this before" | Every bug is unique. Investigate this one. |
Red Flags - STOP
If you find yourself:
- Fixing without reproduction
- "Trying this, trying that"
- 3+ failed fix attempts
- Saying "fixed" without tests
- Changing many files for one bug
STOP. Go back to Phase 1. Investigate root cause.
Debug Output Template
# Bug Analysis - ${BUG_ID}
## Phase 1: Root Cause Investigation
### Error Details
- Type: [error type]
- Message: [error message]
- Stack: [key stack frames]
### Reproduction
- Steps: [1, 2, 3...]
- Frequency: [always/sometimes/rare]
- Environment: [conditions]
### Recent Changes
- [relevant commits]
### Data Flow Analysis
- [where data goes wrong]
### Root Cause Hypothesis
[Evidence-based hypothesis]
## Phase 2: Pattern Analysis
### Working Example
[Where similar code works]
### Comparison
[Difference between working and broken]
### Confirmed Root Cause
[Refined hypothesis]
## Phase 3: Hypothesis Testing
### Hypothesis
[Single testable hypothesis]
### Test Results
| Change | Result |
|--------|--------|
| [change 1] | [result] |
## Phase 4: Implementation
### Failing Test
[Test code that reproduces bug]
### Fix
[Minimal fix code]
### Verification
- [ ] Test passes
- [ ] No regression
- [ ] Manual verification
Integration with flow-fix
This skill is the core methodology for /flow-fix command:
/flow-fix phases:
阶段 1: Root Cause Investigation → This skill Phase 1
阶段 2: Pattern Analysis & Planning → This skill Phase 2
阶段 3: 修复执行 (TDD) → This skill Phase 3-4
阶段 4: 验证与发布 → verification-before-completion
Cross-Reference
- flow-fix.md - Bug fix command
- flow-tdd/SKILL.md - TDD enforcement
- verification-before-completion - Verification skill
[PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md