claude-skills/

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

last sync 22h ago
スキルOfficialmonitoring

🐛debug-replay

プラグイン
amplitude

説明

バグレポートを再現可能な手順に変換します。Amplitude Session Replay からエラーセッションを検索し、インタラクションのタイムラインを抽出して、障害発生前に共通して行われたアクションシーケンスを特定します。 次のような場合に使用: - ユーザーからバグが報告されたとき - エラーイベントが急増したとき - 「どうすれば再現できる?」「ユーザー X に何が起きた?」「再現手順を教えて」といった質問があったとき - エラー発生前にユーザーが何をしていたかを把握する必要があるとき

原文を表示

Turns bug reports into reproducible steps by finding error sessions in Amplitude Session Replay, extracting interaction timelines, and identifying the common action sequence that precedes the failure. Use when a user reports a bug, an error event spikes, someone says "how do I reproduce this", "what happened to user X", "repro steps", or you need to understand what a user did before an error occurred.

ユースケース

  • ユーザーからバグが報告されたとき
  • エラーイベントが急増したとき
  • バグの再現手順を特定する必要があるとき
  • エラー発生前のユーザーアクションを把握する

本文(日本語訳)

Debug Replay

セッションリプレイを活用してバグを調査するSkillです。エラーが発生したセッションリプレイを特定し、インタラクションのタイムラインを抽出して、エンジニアが実行できる番号付きの再現手順にまとめます。「ユーザーからバグ報告があった」という状況から「具体的な再現方法」までのギャップを埋めます。


重要: ツールリファレンス

このSkillは、3つのAmplitude Session Replayツールを使用します。以下の順序で使用してください:

  1. Amplitude:get_session_replays — イベントフィルター(エラー、特定ユーザー、時間帯など)に一致するセッションを検索します。セッションのメタデータとリプレイリンクを返します。
  2. Amplitude:list_session_replays — ユーザー/デバイスIDが既にわかっている場合や、最近のセッションを一覧表示したい場合に使用するシンプルなページネーション付きリスト表示。device_id/session_id 形式の replay_id を返します。
  3. Amplitude:get_session_replay_events — 特定のリプレイをインタラクションタイムライン(ナビゲーション、クリック、入力、スクロール)にデコードします。上記ツールから取得した replay_id が必要です。

このSkillで使用するサポートツール:

  • Amplitude:get_users — メールアドレス、ユーザーID、その他の識別子でユーザーを検索します。
  • Amplitude:get_events — フィルタリング前に有効なイベント名を確認します。イベント名を推測しないでください。
  • Amplitude:get_event_properties — フィルタリングに使用できるイベントのプロパティを確認します。
  • Amplitude:get_deployments — エラーが直近のデプロイと関連していないかを確認します。

手順

ステップ1: バグ報告の内容を把握する

ユーザーのリクエストを解析し、以下の情報を抽出します:

  • エラーの識別子: エラーメッセージ、エラーイベント名、またはイベントタイプ(例: [Amplitude] Error Logged、カスタムエラーイベント)
  • ユーザーの識別子(提供されている場合): メールアドレス、ユーザーID、デバイスID、またはアカウント名
  • 時間帯: 報告された時刻や発生開始時刻。指定がない場合は直近7日間をデフォルトとします。
  • プロダクトの該当箇所(言及がある場合): バグが発生するページ、機能、またはフロー

報告内容が曖昧な場合(例: 「チェックアウトで何かおかしい」)、進める前に確認事項を1つだけ質問してください。複数の質問は行わないでください。

ステップ2: コンテキストの取得とエラーイベントの確認

  1. Amplitude:get_context を呼び出します。複数のプロジェクトがある場合は、調査対象を確認します。
  2. Amplitude:get_events を呼び出して、エラーイベント名がプロジェクト内に存在することを確認します。よく使われるパターン:
    • [Amplitude] Error Logged — 自動キャプチャされるJSエラー
    • [Amplitude] Network Request(ステータスコードフィルター付き) — APIの失敗
    • プロダクト固有のカスタムエラーイベント
  3. ユーザーの識別子が提供されている場合は、Amplitude:get_users を呼び出してユーザーを検索し、ユーザーIDとデバイスIDを取得します。

ステップ3: エラーが発生したセッションを検索する

Amplitude:get_session_replays を使用して、エラーが発生したセッションを検索します。把握している情報を基にフィルターを作成します:

特定ユーザーがわかっている場合:

{
  "eventCountFilters": [
    {
      "count": "1",
      "operator": "greater or equal",
      "event": {
        "event_type": "_all",
        "filters": [{"group_type": "User", "subprop_key": "gp:email", "subprop_op": "is", "subprop_type": "user", "subprop_value": ["user@example.com"]}],
        "group_by": []
      }
    },
    {
      "count": "1",
      "operator": "greater or equal",
      "event": {"event_type": "[Amplitude] Error Logged", "filters": [], "group_by": []}
    }
  ],
  "limit": 5
}

エラーメッセージはわかっているが特定ユーザーがいない場合:

{
  "eventCountFilters": [
    {
      "count": "1",
      "operator": "greater or equal",
      "event": {
        "event_type": "[Amplitude] Error Logged",
        "filters": [{"group_type": "User", "subprop_key": "Error Message", "subprop_op": "contains", "subprop_type": "event", "subprop_value": ["TypeError"]}],
        "group_by": []
      }
    }
  ],
  "limit": 5
}

3〜5件のセッションを取得してください。セッション数が多いほどパターンを抽出しやすくなりますが、少ない方がコンテキストを節約できます。

ステップ4: インタラクションタイムラインを抽出する

ステップ3で見つかった各セッションについて、replay_id を使って Amplitude:get_session_replay_events を呼び出します。

  • 標準的なセッションには event_limit: 500 を使用します
  • 4件以上のセッションを分析する場合は event_limit: 200 を使用します(コンテキストを管理するため)

各タイムラインから記録すべき内容:

  • ページのナビゲーション(訪問したURL)
  • エラー発生時点までのクリックと入力操作
  • 異常なパターン: 連続クリック(レイジクリック)、長い一時停止、前後への行き来
  • エラーが発生したと思われるおおよそのタイムスタンプ(セッション終了前またはユーザーが離脱する直前の最後の意味ある操作を確認してください)

ステップ5: 共通の再現パスを抽出する

これが分析の核心となるステップです。複数セッションのタイムラインを比較し、エラーに先行する共通のプレフィックス(共通する一連の操作)を特定します。

  1. エラー発生地点でタイムラインを揃える。 エラーが発生したと思われる箇所から遡ります。
  2. 共通する操作を特定する。 セッション間で同じページナビゲーション、クリック、入力操作のシーケンスを探します。
  3. 相違点を記録する。 タイムラインが異なる箇所では、その差異を記録します — 複数のトリガーパスや任意ステップが存在する可能性があります。
  4. シンプルにまとめる。 繰り返しや不要な操作(スクロールなど)をまとめ、必要最小限のステップに絞り込みます。

セッションが1件しかない場合は、タイムラインをそのまま抽出し、複数セッションでの検証が行われていない旨を記録します。

ステップ6: デプロイのコンテキストを確認する

Amplitude:get_deployments を1回呼び出します。エラーの急増が直近のデプロイと一致する場合は、その旨を記録してください — エンジニアにとって重要なコンテキスト情報となります。

ステップ7: 再現手順を提示する

エンジニアがすぐに使えるバグレポートとして出力を構造化します。

必須セクション:

  1. バグサマリー(1〜2文): 何が壊れているか、誰が影響を受けているか、いつから発生しているか。エンジニアがチケットのタイトルとして使えるような見出し形式で記述します。

  2. 環境コンテキスト:

    • プロジェクトとプラットフォーム
    • 調査した時間帯
    • 分析したセッション数
    • 関連するデプロイ(判明した場合)
  3. 再現手順 — 番号付き、具体的、コピー&ペーストして使えること:

## 再現手順

1. [URL] に移動する
2. [おおよその位置] にある [要素/エリアの説明] をクリックする
3. [フィールドの説明] に "[値]" を入力する
4. [要素/エリアの説明] をクリックする
5. 確認: [エラーの動作 — ユーザーが見るもの]

**期待される動作:** [本来どうなるべきか]
**実際の動作:** [実際に何が起きているか]
  1. エラーコンテキスト(入手できた場合):

    • エラーメッセージ / タイプ
    • 失敗したエンドポイント(ネットワークエラーの場合)
    • エラーが発生したページ
  2. セッション証跡:

    • 分析した各セッションのリプレイリンク(クリック可能)
    • 信頼度: (3件以上のセッションで同じパスを確認)、(2件のセッション)、(1件のみ)
    • セッション間の差異を記録
  3. 観察事項(任意): デバッグに役立つ可能性のあるパターン — UIの無応答を示唆するレイジクリック、ローディングの問題を示唆する長い一時停止、エラーをトリガーする特定の入力値など。


エッジケース

  • エラーイベントが見つからない場合。 プロジェクトで自動キャプチャが有効になっていないか、エラーがカスタムイベント名で記録されている可能性があります。Amplitude:get_events を呼び出してエラー関連のイベントを検索してください。見つかった内容を報告し、何も存在しない場合は計装すべき内容を提案します。

  • ユーザーが見つからない場合。 get_users が何も返さない場合は、別の識別子(メールドメイン、部分一致など)で検索を試みてください。それでも見つからない場合は、ユーザーフィルタリングなしでエラーイベントのみで検索を進めます。

  • セッションは見つかったがリプレイイベントがない場合。 一部のセッションにはrrwebデータが存在しないことがあります(リプレイ無効、広告ブロッカーなど)。該当セッションはスキップして記録し、次のセッションを試してください。

  • セッションが1件しかない場合。 タイムラインを「未検証の再現手順」として信頼度「低」で提示します。ユーザーに手動での再現を試みて確認するよう提案します。

  • エラーが断続的な場合。 セッションでエラーまでのパスが異なる場合は、別々の再現パスとして提示します: 「パスA(5件中3件のセッションで確認)」と「パスB(5件中2件のセッションで確認)」のように記述します。

  • nodeIdの値が解決できない場合。 get_session_replay_events はDOM要素名ではなくDOMノードIDを返します。要素の識別ではなく、位置(x, y座標)、ページのコンテキスト、操作の順序で操作を説明してください。コンテキストから推測できる場合を除き、「送信ボタンをクリックする」ではなく「フォームの右上エリアをクリックする」のような表現を使用します。

使用例

例1: ユーザー報告のバグ

ユーザーの発言: 「jane@acme.com のお客様からエクスポートボタンが動かないと連絡がありました」

実行する操作:

  1. コンテキストを取得してプロジェクトを確認する
  2. get_usersjane@acme.com を検索する
  3. get_session_replays で彼女のメールアドレスとエラーイベントを組み合わせて最近のセッションを検索する
  4. 2〜3件のセッションからインタラクションタイムラインを抽出する
  5. 共通パスを特定する: レポートページに移動 → エクスポートをクリック → 何も起きない(またはエラー)
  6. リプレイリンクとともに番号付きの再現手順を提示する

例2: エラー急増の調査

ユーザーの発言: 「昨日からTypeErrorが倍増しています。再現手順を出してもらえますか?」

実行する操作:

  1. コンテキストを取得し、[Amplitude] Error Logged の存在を確認する
  2. get_session_replays で直近48時間のTypeErrorを含むセッションを検索
原文(English)を表示

Debug Replay

Investigate bugs by finding session replays where the error occurred, extracting the interaction timeline, and distilling it into numbered reproduction steps an engineer can follow. This skill bridges the gap between "a user reported a bug" and "here's exactly how to reproduce it."


CRITICAL: Tool Reference

This skill operates on three Amplitude Session Replay tools. Use them in this order:

  1. Amplitude:get_session_replays — Find sessions matching event filters (errors, specific users, time windows). Returns session metadata and replay links.
  2. Amplitude:list_session_replays — Simple paginated listing when you already have a user/device ID or just need recent sessions. Returns replay_id in device_id/session_id format.
  3. Amplitude:get_session_replay_events — Decode a specific replay into an interaction timeline: navigations, clicks, inputs, scrolls. Requires replay_id from the tools above.

Supporting tools used in this skill:

  • Amplitude:get_users — Look up users by email, user ID, or other identifiers.
  • Amplitude:get_events — Discover valid event names before filtering. Never guess event names.
  • Amplitude:get_event_properties — Discover properties available on an event for filtering.
  • Amplitude:get_deployments — Check if error aligns with a recent deploy.

Instructions

Step 1: Understand the Bug Report

Parse the user's request to extract:

  • Error identifier: Error message, error event name, or event type (e.g., [Amplitude] Error Logged, a custom error event)
  • User identifier (if provided): Email, user ID, device ID, or account name
  • Time window: When it was reported or when it started. Default to last 7 days if unspecified.
  • Product area (if mentioned): Page, feature, or flow where the bug occurs

If the report is vague (e.g., "something is broken in checkout"), ask one clarifying question before proceeding. Do not ask more than one.

Step 2: Get Context and Find the Error Event

  1. Call Amplitude:get_context. If multiple projects, ask which to investigate.
  2. Call Amplitude:get_events to confirm the error event name exists in the project. Common patterns:
    • [Amplitude] Error Logged — auto-captured JS errors
    • [Amplitude] Network Request with status code filters — API failures
    • Custom error events specific to the product
  3. If a user identifier was provided, call Amplitude:get_users to look up the user and get their user ID and device ID.

Step 3: Find Error Sessions

Use Amplitude:get_session_replays to find sessions where the error occurred. Build filters based on what you know:

If you have a specific user:

{
  "eventCountFilters": [
    {
      "count": "1",
      "operator": "greater or equal",
      "event": {
        "event_type": "_all",
        "filters": [{"group_type": "User", "subprop_key": "gp:email", "subprop_op": "is", "subprop_type": "user", "subprop_value": ["user@example.com"]}],
        "group_by": []
      }
    },
    {
      "count": "1",
      "operator": "greater or equal",
      "event": {"event_type": "[Amplitude] Error Logged", "filters": [], "group_by": []}
    }
  ],
  "limit": 5
}

If you have an error message but no specific user:

{
  "eventCountFilters": [
    {
      "count": "1",
      "operator": "greater or equal",
      "event": {
        "event_type": "[Amplitude] Error Logged",
        "filters": [{"group_type": "User", "subprop_key": "Error Message", "subprop_op": "contains", "subprop_type": "event", "subprop_value": ["TypeError"]}],
        "group_by": []
      }
    }
  ],
  "limit": 5
}

Request 3-5 sessions. More sessions give better pattern extraction; fewer saves context.

Step 4: Extract Interaction Timelines

For each session found in Step 3, call Amplitude:get_session_replay_events with the replay_id.

  • Use event_limit: 500 for standard sessions
  • Use event_limit: 200 if analyzing 4+ sessions (to manage context)

What to capture from each timeline:

  • Page navigations (URLs visited)
  • Clicks and inputs leading up to the error point
  • Any unusual patterns: rapid repeated clicks (rage clicks), long pauses, back-and-forth navigation
  • The approximate timestamp where the error likely occurred (look for the last meaningful action before the session ends or the user navigates away in frustration)

Step 5: Extract Common Repro Path

This is the core analytical step. Compare the timelines from multiple sessions to find the common prefix — the shared sequence of actions that precedes the error.

  1. Align timelines by the error point. Work backwards from where the error appears to occur.
  2. Identify shared actions. Look for the same sequence of page navigations, clicks, and inputs across sessions.
  3. Note divergences. Where timelines differ, note the variations — these may indicate multiple trigger paths or optional steps.
  4. Simplify. Collapse repeated or irrelevant actions (e.g., scrolling) into the minimal set of steps needed.

If only 1 session is available, extract the timeline as-is and note that it hasn't been validated across multiple sessions.

Step 6: Check Deployment Context

Call Amplitude:get_deployments once. If an error spike aligns with a recent deploy, note it — this is critical context for the engineer.

Step 7: Present Reproduction Steps

Structure the output as an engineering-ready bug report.

Required sections:

  1. Bug Summary (1-2 sentences): What's broken, who's affected, since when. Written as a headline an engineer would put in a ticket title.

  2. Environment Context:

    • Project and platform
    • Time window investigated
    • Number of sessions analyzed
    • Related deployment (if found)
  3. Reproduction Steps — Numbered, specific, copy-paste-ready:

## Reproduction Steps

1. Navigate to [URL]
2. Click [element/area description] at [approximate location]
3. Enter "[value]" in [field description]
4. Click [element/area description]
5. Observe: [error behavior — what the user sees]

**Expected:** [what should happen]
**Actual:** [what happens instead]
  1. Error Context (if available):

    • Error message / type
    • Failing endpoint (if network error)
    • Page where error occurs
  2. Session Evidence:

    • Replay links for each analyzed session (clickable)
    • Confidence level: High (3+ sessions show same path), Medium (2 sessions), Low (1 session only)
    • Note any variations between sessions
  3. Observations (optional): Patterns that may help debugging — rage clicks suggesting UI unresponsiveness, long pauses suggesting loading issues, specific input values that trigger the error.


Edge Cases

  • No error events found. The project may not have auto-capture enabled, or the error may be tracked under a custom event name. Call Amplitude:get_events and search for error-related events. Report what you find and suggest what to instrument if nothing exists.
  • User not found. If get_users returns nothing, try searching with alternative identifiers (email domain, partial match). If still nothing, proceed without user filtering and search by error event alone.
  • Sessions found but no replay events. Some sessions may not have rrweb data (replay disabled, ad blocker, etc.). Skip those sessions and note it. Try the next session.
  • Only 1 session available. Present the timeline as "unvalidated reproduction steps" with Low confidence. Suggest the user try to reproduce manually to confirm.
  • Error is intermittent. If sessions show different paths to the same error, present them as separate reproduction paths: "Path A (seen in 3/5 sessions)" and "Path B (seen in 2/5 sessions)."
  • nodeId values can't be resolved. get_session_replay_events returns DOM node IDs, not element names. Describe interactions by position (x, y coordinates), page context, and sequence rather than element identity. Use phrasing like "click in the upper-right area of the form" rather than "click the Submit button" unless you can infer from context.

Examples

Example 1: User-Reported Bug

User says: "Customer jane@acme.com says the export button doesn't work"

Actions:

  1. Get context and confirm project
  2. Look up jane@acme.com via get_users
  3. Find her recent sessions with get_session_replays filtered to her email + any error events
  4. Extract interaction timelines from 2-3 sessions
  5. Identify the common path: navigates to reports → clicks export → nothing happens (or error)
  6. Present numbered repro steps with replay links

Example 2: Error Spike Investigation

User says: "TypeError errors doubled yesterday, can you get repro steps?"

Actions:

  1. Get context, confirm [Amplitude] Error Logged exists
  2. Find sessions with TypeError in the last 48 hours via get_session_replays
  3. Extract timelines from 3-5 sessions
  4. Compare timelines to find the common action sequence before the TypeError
  5. Check deployments for what shipped yesterday
  6. Present repro steps anchored to the deployment

Example 3: Vague Bug Report

User says: "Users are having trouble with checkout"

Actions:

  1. Ask one clarifying question: "Do you have a specific error event or user in mind, or should I look for any errors on checkout pages?"
  2. Search for error events on checkout-related pages
  3. Find sessions, extract timelines, identify friction patterns
  4. Present repro steps for the most common failure path

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