claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialdevelopment

🐛output-debug-workflow

プラグイン
outputai

説明

ワークフローの問題をOutput SDKを使用してデバッグします。 次のような場合に使用: - ユーザーがワークフローの失敗、エラー、ハング、誤った結果の発生を報告しているとき - ユーザーがワークフローの実行に対してデバッグ、トラブルシューティング、または調査を依頼しているとき

原文を表示

Debug Output SDK workflow issues. Use when user reports a workflow failing, erroring, hanging, producing wrong results, or asks to debug, troubleshoot, or investigate a workflow execution.

ユースケース

  • ワークフローの失敗やエラーをデバッグする
  • ワークフローのハングを調査する
  • ワークフローの誤った結果をトラブルシューティングする

本文(日本語訳)

ローカル開発環境において、Output SDK ワークフローの問題を体系的にデバッグするタスクです。

第一引数には、発生している問題のテキスト説明を指定します。特定のワークフロー ID がある場合は、説明に含めてください。

todo ツールを使用して、デバッグプロセスの進捗を追跡してください。

デバッグプロセス

概要

ワークフロー実行の問題を特定・解決するために、体系的なアプローチに従います: インフラの確認 → 証拠の収集 → トレースの分析 → 的を絞った修正の適用。

<pre_flight_check> 実行: Claude Skill: output-meta-pre-flight </pre_flight_check>

<process_flow>

<step number="1" name="verify_services">

ステップ 1: サービスの起動確認

デバッグを開始する前に、必要なすべてのサービスが正常に動作していることを確認します。 output-services-check スキルが包括的なガイダンスを提供します。

<verification_commands>

# Docker コンテナが起動していることを確認
docker ps | grep output

# Output サービスが応答するかを確認
curl -s http://localhost:3001/health || echo "API が応答していません"

# Temporal UI にアクセスできるかを確認
curl -s http://localhost:8080 > /dev/null && echo "Temporal UI にアクセス可能" || echo "Temporal UI にアクセスできません"

</verification_commands>

<decision_tree> docker が起動していない場合: 実行: docker compose up -d 待機: サービスが起動するまで待つ(30〜60秒) output dev が起動していない場合: 実行: npx output dev 待機: サービスが初期化されるまで待つ すべてのサービスが起動している場合: 次へ: ステップ 2 に進む </decision_tree>

期待される状態:

  • output の Docker コンテナが起動している
  • API サーバーが http://localhost:3001 で応答している
  • Temporal UI が http://localhost:8080 でアクセス可能である

</step>

<step number="2" name="list_workflow_runs">

ステップ 2: ワークフロー実行一覧の取得

最近の実行一覧を表示して、失敗したワークフローの実行を特定します。 output-workflow-runs-list スキルが詳細なフィルタリングのガイダンスを提供します。

<list_commands>

# 最近のすべてのワークフロー実行を一覧表示
npx output workflow runs list

# 特定のワークフロータイプでフィルタリング(判明している場合)
npx output workflow runs list <workflowName>

# 分析用に詳細な JSON 出力を取得
npx output workflow runs list --json

# 最新の結果に件数を制限
npx output workflow runs list --limit 10

</list_commands>

<identification_criteria> 以下の点に着目してください:

  • ステータス: FAILED または TERMINATED
  • 問題発生時刻に一致する直近のタイムスタンプ
  • 問題の説明に一致するワークフロータイプ </identification_criteria>

<decision_tree> ユーザーがワークフロー ID を指定した場合: 使用: 指定されたワークフロー ID 次へ: ステップ 3 に進む 失敗した実行が見つかった場合: 選択: 最も新しい失敗した実行 記録: 出力からワークフロー ID をメモする 次へ: ステップ 3 に進む 実行が見つからない場合: 確認: npx output workflow list でワークフローが存在するかを確認 ワークフローが見つからない場合: 報告: ワークフローが存在しない 提案: ワークフロー名と場所を確認する それ以外の場合: 提案: npx output workflow run <name> でワークフローを実行する </decision_tree>

</step>

<step number="3" name="debug_workflow" subagent="workflow-debugger">

ステップ 3: 特定のワークフローをデバッグ

特定したワークフローの実行トレースを取得して分析します。 output-workflow-trace スキルが分析テクニックを提供します。

<debug_commands>

# 実行トレースを表示(テキスト形式)
npx output workflow debug <workflowId>

# 完全な未省略のトレースを表示(JSON 形式)- 詳細な分析に推奨
npx output workflow debug <workflowId> --json

</debug_commands>

ヒント: 省略なしの完全なトレースデータを得るには --json を使用してください。

<analysis_checklist>

  1. どのステップで失敗したかを特定する
  2. エラーメッセージとスタックトレースを調査する
  3. 失敗したステップに渡された入力データを確認する
  4. 直前のステップからの出力データを確認する
  5. よくあるエラータイプに一致するパターンを探す </analysis_checklist>

<temporal_ui_guidance> ワークフローを視覚的に検査するには、http://localhost:8080 の Temporal Web UI を開いてください:

  • ID でワークフローの実行を探す
  • イベント履歴のタイムラインを確認する
  • 各ステップの入力と出力を調べる </temporal_ui_guidance>

</step>

<step number="4" name="suggest_fixes" subagent="workflow-quality">

ステップ 4: 修正案の提示

トレース分析の結果に基づいて、エラーパターンを特定し、的を絞った修正案を提示します。 Claude は症状に応じて関連するエラースキルを呼び出します。

<error_matching>

症状 スキル
"incompatible schema" エラー、型エラー output-error-zod-import
リプレイの失敗、不一致な結果 output-error-nondeterminism
リトライが機能しない、エラーが握り潰される output-error-try-catch
型エラー、ステップ境界での undefined プロパティ output-error-missing-schemas
ワークフローのハング、決定論性エラー output-error-direct-io
トレースされていないリクエスト、axios エラー output-error-http-client

</error_matching>

<decision_tree> エラーが既知のパターンに一致する場合: 呼び出し: 詳細な修正のために該当するエラースキルを呼び出す それ以外の場合: 相談: 追加パターンについて workflow-quality サブエージェントに相談する 提案: Temporal UI でのトレースの手動確認 </decision_tree>

<verification> 修正を適用した後:

# ワークフローを再実行して確認
npx output workflow run <workflowName> <input>

# または非同期で開始して結果を確認
npx output workflow start <workflowName> <input>
npx output workflow status <workflowId>
npx output workflow result <workflowId>

# または、修正が特定のステップのみに影響し、
# それ以前のステップが成功していた場合は、
# 最後に成功したステップの直後から再実行する
#(それ以前の処理を再実行せずにスキップ)
npx output workflow reset <workflowId> --step <lastGoodStep> --reason "<修正内容の説明>"

下流のステップの修正後に対象を絞って再実行する方法については、output-workflow-reset スキルを参照してください。 </verification>

</step>

</process_flow>

<post_flight_check> 実行: Claude Skill: output-meta-post-flight </post_flight_check>

---- 開始 ----

問題の説明(およびオプションのワークフロー ID):

$ARGUMENTS

原文(English)を表示

Your task is to systematically debug an Output SDK workflow issue in a local development environment.

The first argument is a textual description of the problem you're experiencing. If you have a specific workflow ID, include it in your description.

Use the todo tool to track your progress through the debugging process.

Debugging Process

Overview

Follow a systematic approach to identify and resolve workflow execution issues: verify infrastructure, gather evidence, analyze traces, and apply targeted fixes.

<pre_flight_check> EXECUTE: Claude Skill: output-meta-pre-flight </pre_flight_check>

<process_flow>

<step number="1" name="verify_services">

Step 1: Verify Services Running

Before debugging, confirm that all required services are operational. The output-services-check skill provides comprehensive guidance.

<verification_commands>

# Check Docker containers are running
docker ps | grep output

# Verify Output services respond
curl -s http://localhost:3001/health || echo "API not responding"

# Check Temporal UI is accessible
curl -s http://localhost:8080 > /dev/null && echo "Temporal UI accessible" || echo "Temporal UI not accessible"

</verification_commands>

<decision_tree> IF docker_not_running: RUN: docker compose up -d WAIT: for services to start (30-60 seconds) IF output_dev_not_running: RUN: npx output dev WAIT: for services to initialize IF all_services_running: PROCEED: to step 2 </decision_tree>

Expected State:

  • Docker containers for output are running
  • API server responds at http://localhost:3001
  • Temporal UI accessible at http://localhost:8080

</step>

<step number="2" name="list_workflow_runs">

Step 2: List Workflow Runs

Identify the failing workflow execution by listing recent runs. The output-workflow-runs-list skill provides detailed filtering guidance.

<list_commands>

# List all recent workflow runs
npx output workflow runs list

# Filter by specific workflow type (if known)
npx output workflow runs list <workflowName>

# Get detailed JSON output for analysis
npx output workflow runs list --json

# Limit results to most recent
npx output workflow runs list --limit 10

</list_commands>

<identification_criteria> Look for:

  • Status: FAILED or TERMINATED
  • Recent timestamp matching when the issue occurred
  • Workflow type matching the problem description </identification_criteria>

<decision_tree> IF user_provided_workflow_id: USE: provided workflow ID PROCEED: to step 3 IF failed_runs_found: SELECT: most recent failed run NOTE: workflow ID from output PROCEED: to step 3 IF no_runs_found: CHECK: workflow exists with npx output workflow list IF workflow_not_found: REPORT: workflow doesn't exist SUGGEST: verify workflow name and location ELSE: SUGGEST: run the workflow with npx output workflow run <name> </decision_tree>

</step>

<step number="3" name="debug_workflow" subagent="workflow-debugger">

Step 3: Debug Specific Workflow

Retrieve and analyze the execution trace for the identified workflow. The output-workflow-trace skill provides analysis techniques.

<debug_commands>

# Display execution trace (text format)
npx output workflow debug <workflowId>

# Display full untruncated trace (JSON format) - recommended for detailed analysis
npx output workflow debug <workflowId> --json

</debug_commands>

Tip: Use --json for complete trace data without truncation.

<analysis_checklist>

  1. Identify which step failed
  2. Examine the error message and stack trace
  3. Check input data passed to the failing step
  4. Check output data from preceding steps
  5. Look for patterns matching common error types </analysis_checklist>

<temporal_ui_guidance> For visual workflow inspection, open the Temporal Web UI at http://localhost:8080:

  • Find your workflow execution by ID
  • View the event history timeline
  • Inspect individual step inputs and outputs </temporal_ui_guidance>

</step>

<step number="4" name="suggest_fixes" subagent="workflow-quality">

Step 4: Suggest Fixes

Based on the trace analysis, identify the error pattern and suggest targeted fixes. Claude will invoke the relevant error skill based on symptoms.

<error_matching>

Symptom Skill
"incompatible schema" errors, type errors output-error-zod-import
Replay failures, inconsistent results output-error-nondeterminism
Retries not working, errors swallowed output-error-try-catch
Type errors, undefined properties at step boundaries output-error-missing-schemas
Workflow hangs, determinism errors output-error-direct-io
Untraced requests, axios errors output-error-http-client

</error_matching>

<decision_tree> IF error_matches_known_pattern: INVOKE: relevant error skill for detailed fix ELSE: CONSULT: workflow-quality subagent for additional patterns SUGGEST: Manual trace inspection in Temporal UI </decision_tree>

<verification> After applying fix:

# Re-run the workflow to verify
npx output workflow run <workflowName> <input>

# Or start asynchronously and check result
npx output workflow start <workflowName> <input>
npx output workflow status <workflowId>
npx output workflow result <workflowId>

# Or, if the fix only affects a specific step and earlier steps succeeded,
# re-run from after the last known-good step (skips re-executing earlier work)
npx output workflow reset <workflowId> --step <lastGoodStep> --reason "<fix description>"

For targeted rerun after fixing a downstream step, see the output-workflow-reset skill. </verification>

</step>

</process_flow>

<post_flight_check> EXECUTE: Claude Skill: output-meta-post-flight </post_flight_check>

---- START ----

Problem Description and Optional Workflow ID:

$ARGUMENTS

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。