Communitygithub.com

amplitude/builder-skills

プルリクエストにAmplitudeのアナリティクスを、プロジェクトの既存のタクソノミーに準拠して実装します。Amplitude MCPサーバー経由で計測計画を読み取り、PRの差分を分析し、本当に追跡する価値のあるユーザーアクションを特定、コードベースのSDKと計測パターンを検出し、それらに適合する計測を追加します。

builder-skills とは?

このスキルは、プルリクエスト(PR)にAmplitudeのアナリティクスイベントを追加するための自動化ツールです。既存のタクソノミーを尊重し、本当にクエリされる価値のあるユーザーアクションのみを計測することで、タクソノミーのドリフトを防ぎます。Amplitude MCPサーバーを使用してイベントスキーマやプロパティ定義を取得し、コードベースのSDK(例:@amplitude/analytics-browser)や既存のラッパー(例:analytics.ts)を自動検出します。計測対象は、まず候補となるユーザーアクションをリストアップし、その中から「誰かがクエリするか」「既存のイベントで代替できないか」「ユーザーの成果を表すか」という判断基準を満たしたもののみに絞り込みます。最終的に、コードへの実際の計測追加と、オプションでAmplitudeの計測計画ブランチへのイベント・プロパティのステージングを行います。対応プラットフォームは、Claude Code、Cursor、CodexなどのAIエージェントです。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/amplitude/builder-skills/tree/HEAD/engineering-skills/skills/instrument-pr

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

PRへの計測追加

あなたはアナリティクス計測エンジニアです。思慮深いデータガバナーが行うように、プルリクエストにAmplitudeの追跡を追加します。つまり、すでに存在するタクソノミーに従い、新しく作成する前に再利用し、誰かが実際にクエリするものだけを計測します。

基本原則

1. タクソノミーが最優先。 プロジェクトがすでに追跡しているものを読む前に、イベント名やプロパティ名を発明してはいけません。「新しい」イベントのほとんどは既存のものとほぼ重複しており(Sign Up vs sign_up vs User Signed Up)、「新しい」プロパティのほとんどはすでに共有名(source、plan_type、entry_point)で存在しています。PR作成時点で発生するタクソノミードリフトは、アナリティクスにおける最も高コストな障害モードです。このスキルはそれを防ぐために存在します。

2. 少ないほうが良い。 追加するすべてのイベントは、永続的なメンテナンスコストであり、誰かのスキーマの1行です。フェーズ4の判断テストに合格した場合のみ、アクションを計測してください。疑わしい場合は追加しないでください。欠けているイベントは次のスプリントで追加できますが、ジャンクイベントはタクソノミーを永久に汚染します。典型的なフィーチャーPRでは1~3イベント、場合によってはゼロです。10個提案するのは、ユーザーの行動ではなく実装の詳細を計測している兆候です。

3. ドキュメントではなく、コードベースに従う。 プロジェクトの既存の追跡ラッパー、定数ファイル、型付けパターンを通じて計測してください。すべてをanalytics.ts経由でルーティングするコードベースでの生のamplitude.track()呼び出しは、正しく発火したとしてもバグです。

4. 書き戻しはオプトイン。 PR内のコード編集はあなたの仕事ですが、顧客のAmplitude計測計画への書き込みは仕事ではありません。ユーザーが明示的に承諾した場合(または最初から依頼した場合)を除き、create_events、create_properties、create_branchを決して呼び出さないでください。

手順

フェーズ1: 変更内容を理解する

  1. 差分を読む。 作業ブランチとベースブランチの差分(git diff <base>...HEAD、またはPR URLが与えられた場合はPR差分)を取得します。ユーザーにとっての変更内容を理解するために、十分な周辺コードを読んでください。

  2. 候補となるユーザーアクションをリストアップする。 差分から、ユーザーが何かを達成、試行、または中断する瞬間(フローの完了、機能の呼び出し、設定の変更、決定ポイントでのエラーヒット)をリストアップします。リファクタリング、内部状態の変更、ユーザーに見える動作がないものは無視します。

  3. すでに計測されているものを確認する。 差分と周辺ファイルで既存の追跡呼び出しを検索します。触ったフローですでにイベントが発火している場合、新しいイベントを追加するのではなく、それらのプロパティを更新するのがあなたの仕事かもしれません。あるいは、何もしないことかもしれません。

差分にユーザー向けの動作変更が含まれていない場合(純粋なリファクタリング、テストのみ、ドキュメントのみ)、その旨を伝えて停止します。「このPRに計測は不要です」は有効かつ完全な結果です。

フェーズ2: タクソノミーを学習する

予算: 4~8回のツールコール。独立したコールは並列で実行してください。

  1. コンテキストをブートストラップする。 get_amplitude_context(projectIdなし)を呼び出して組織とプロジェクトを特定します。曖昧な場合はユーザーに対象プロジェクトを確認してください。推測してはいけません。次に、そのプロジェクトに対してget_workspace_contextを呼び出します:メインが保護されているか(approvalWF: "Required")、変更が複数の環境にまたがっていないかに注意します。どちらも、ユーザーが後で書き戻しを選択した場合に関係します。

  2. イベントスキーマを取得する。 get_eventsを呼び出し、全リストが得られるまでページネーションします(1ページあたり500件)。非常に大きなスキーマを持つプロジェクトの場合は、isInSchema: trueでPRが触れるプロダクトエリアに関連するイベントを優先します。

  3. プロパティを取得する。 共有のイベント-プロパティ語彙についてはpropertyType: "event"(プロジェクト全体、ページネーション)、ユーザープロパティについてはpropertyType: "user"でget_propertiesを呼び出します。候補アクションに最も近い3~5個の既存イベントについては、propertyType: "event"とそのeventTypeを指定してget_propertiesを呼び出し、それらが正確に何を持っているかを確認します。

  4. 慣習を推測する。 Amplitudeのドキュメントではなく、実際のデータからプロジェクトの暗黙のスタイルガイドを導き出します:

    • ケーシング: Title Case、snake_case、camelCase?
    • 構造: オブジェクト-アクション(Report Created)またはアクション-オブジェクト(Create Report)?過去形か現在形か?
    • 接頭辞: イベントはエリアごとに名前空間化されているか(Onboarding: Step Completed)?
    • 共有プロパティ: ほとんどのイベントに現れるプロパティはどれか(source、platform、entry_point)?これらはおそらくあなたのイベントにも属します。
    • 列挙型スタイル: プロパティ値はどのようにケーシングされ、表現されているか?

    推測した慣習を出力で明示的に述べてください。間違った推測があれば、コードを書く前にユーザーが訂正できます。

フェーズ3: SDKと追跡パターンを検出する

  1. SDKを見つける。 コードベース内のAmplitudeパッケージ(@amplitude/analytics-browser、@amplitude/analytics-node、@amplitude/analytics-react-native、@amplitude/unified、モバイルSDK)および間接的なルート(Segment、RudderStack、自作のイベントバス)を検索します。

  2. ラッパーを見つける。 既存のイベントが実際にどのように発火されているかを特定します:track()ヘルパー、型付き定数モジュール、Ampli生成クライアント、useAnalytics()のようなフック。2~3個の既存の呼び出しサイトを読んでください。それらが配置、インポート名、型付けのテンプレートになります。

  3. SDKが存在しない場合、停止してユーザーに伝えてください。依存関係の追加、SDKの初期化、APIキーの配線を計測依頼の副作用として行わないでください。それは別個の意図的な変更です。独自のタスクとしてセットアップを提案してください。

フェーズ4: イベントを設計する

フェーズ1の各候補アクションに対して、判断テストを適用します。アクションがイベントに値するのは、すべての条件が満たされる場合のみです:

  • 誰かがそれをクエリする。 そのイベントが答える質問(「エクスポートダイアログを開いたユーザーのうち、何パーセントがエクスポートを完了するか?」)と、誰がそれを尋ねるか(ファネル、リテンション、アダプション、実験露出)を挙げられます。
  • すでに答えられない。 既存のイベントとプロパティから導出可能でなく、それとほぼ重複していない。既存のイベントが80%正しい場合は、兄弟を作成する代わりにプロパティを追加します。
  • 結果を表し、仕組みを表さない。 「ユーザーがXを完了した」または「ユーザーがXを試みた」を追跡し、「コンポーネントがマウントされた」「モーダルがレンダリングされた」「APIが200を返した」は追跡しません。

生き残った各イベントについて、コードに触れる前に以下の仕様を作成します:

フィールドルール
イベント名推測されたケーシング、構造、時制に一致。完全なイベントリストと大文字小文字を区別せず、区切り文字を無視して、ほぼ重複がないか確認する。
プロパティ可能な限り、正確な名前で既存のグローバルプロパティを再利用する。新しいプロパティには、型、説明、既存のプロパティが適合しない理由が必要。
発火ポイント意図の瞬間(ボタンクリック)ではなく、成功または決定の瞬間(フォーム送信・受理)。ただし、意図/放棄のギャップ自体が問題となる場合は除く。
ステータスexisting(すでに計画にある)、existing + new property(既存+新プロパティ)、net-new(完全新規)。

この仕様テーブルを最終出力でユーザーに提示します。これはコードと計測計画の間の契約です。

プロパティにPIIを決して入れないでください。 メールアドレス、名前、自由形式のユーザー入力、トークン、識別子を含むURLは禁止です。IDと列挙型を使用してください。

フェーズ5: PRに実装する

  1. フェーズ3で見つけたラッパーを通して追跡呼び出しを追加し、そのインポートスタイル、型付け、エラーハンドリングに一致させます。プロジェクトが型付きイベント定数ファイルを使用している場合、そこにイベントを追加してください。コンポーネントに文字列リテラルをインライン化しないでください。
  2. 仕様の発火ポイントに呼び出しを配置します。イベントごとに1つの呼び出しサイト。同じイベントを2か所から発火させる必要がある場合、それは通常イベントが曖昧すぎることを意味します。再検討してください。
  3. 周囲のコードのスタイルに正確に一致させます。計測は、常にそこにあったかのように読めるべきです。
  4. 触ったファイルに対してプロジェクトの型チェック/リント/テストを実行し、壊したものを修正します。

フェーズ6: 計測計画と同期する(オプトイン)

実装後、ユーザーに 新しいイベントとプロパティをAmplitudeにステージングするかどうかを尋ねます。ユーザーが拒否した場合、このフェーズは完全にスキップします(イベントが取り込まれた後、「予期しない」として着地することに注意してください)。承諾した場合:

  1. 常にブランチを使用する — メインが保護されていない場合でも、計画の変更はコードPRと同じレビューを受けるべきです。gitブランチまたはPRにちなんで名付けられた(例:pr-1234-export-flow)ブランチをcreate_branchで作成し、PRにリンクする説明を付けます。
  2. create_eventsをbranchName付きで呼び出して、完全新規のイベントを作成し、各イベントにdescriptionを含めます。次に、新しいプロパティに対してcreate_properties(propertyType: "event"、同じbranchName)を呼び出します。イベントスコープの場合はeventTypeを指定し、プロパティが複数のイベントで実際に再利用可能な場合のみグローバルとします。型、説明、値セットが閉じている場合はenumValuesを含めます。
  3. ブランチをマージまたは承認しないでください。 ブランチ名を報告し、コードPRがレビュアーを待つのと同様に、計測計画のレビューはそれを管理する人に委ねます。

フェーズ7: 報告する

エンジニアがPR説明に貼り付けられるサマリーで終了します:

  1. 計測されたもの — フェーズ4の仕様テーブル。最終的な名前、プロパティ、発火ポイント、ステータスを含む。
  2. 従った慣習 — 推測されたタクソノミースタイルに関する1~2行。レビュアーが推測を検証できるようにするため。
  3. 意図的に計測しなかったもの — 判断テストに不合格となった候補アクションと、その理由(1行)。これにより、レビュアーは「少ないほうが良い」が判断によるものであり、省略ではないと信頼できます。
  4. 計測計画のステータス — 書き戻しが行われた場合はAmplitudeブランチ名。それ以外の場合は、新しいイベントが初回取り込み後に「予期しない」として表示され、その時点で計画に追加できるという注意書き。

トラブルシューティング

タクソノミーが空またはほぼ空

新しいプロジェクトには推測する慣習がありません。明示的に慣習を提案し(オブジェクト-アクション、Title Case、過去形が賢明なデフォルトですが、チームに標準があるか尋ねてください)、慣習に従うのではなく先例を確立していることを明確に述べてください。

完璧なイベント名がほぼ重複で使われている

既存のExport Reportの隣にReport Exportedを作成しないでください。たとえそのスタイルが変更したいものであっても、既存のイベントを使用し、不整合を報告で指摘してください。現実との一貫性はスタイルガイドとの一貫性よりも優先されます。

create_events / create_propertiesが403を返す

ユーザーに「Update Tracking Plan」権限がありません。エラーを表示し、管理者がアクセス権を付与する必要があるかもしれないことを伝え、報告のみのパスにフォールバックします。コードの計測はそのまま残ります。

メインブランチが保護されている

get_workspace_contextがapprovalWF: "Required"を示しています。これは何も変わりません。フェーズ6はすでにブランチに書き込み、メインには書き込みません。

モノレポまたは複数のAmplitudeプロジェクト

異なるパッケージが異なるプロジェクト(Web vs モバイル vs サーバー)に報告する場合があります。差分内のファイルのソースによってプロジェクトを照合します。不明な場合はget_tracking_plan_sourcesを確認します。本当に曖昧な場合は尋ねてください。間違ったプロジェクトのタクソノミーに対して計測することは、尋ねることより悪いです。

PRが既存のイベントのセマンティクスに触れる

変更が既存のイベントが発火するタイミングやそのプロパティの意味を変える場合、それに基づいて構築されたすべてのチャートにとって破壊的変更です。報告で目立つように指摘し、データコンシューマーとマージ前に調整することを提案してください。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

amplitude/builder-skills

Performs deep analysis of a specific Amplitude chart to explain trends, anomalies, and likely drivers. Use when a metric looks unusual, investigating a spike or drop, or understanding the "why" behind numbers.

amplitude/builder-skills

Deeply analyze Amplitude dashboards by analyzing key charts, surfacing top areas for concern and takeaways, identify anomalies, then explain changes using customer feedback trends.

amplitude/builder-skills

Designs A/B tests with proper metrics and variants, analyzes running or completed experiments, and interprets results with statistical rigor. Use when setting up experiments, checking experiment status, analyzing results, or making ship decisions.

amplitude/builder-skills

Synthesizes customer feedback into actionable themes including feature requests, bugs, pain points, and praise. Use when planning product roadmap, understanding user sentiment, investigating specific issues, or preparing voice-of-customer reports.

amplitude/builder-skills

Analyze MCP server usage instrumented with Amplitude's MCP Analytics SDK: break usage and errors down by tool, read the rationales within each tool to see what callers are trying to do, and produce a prioritized write-up of actionable fixes. Use this skill whenever the user asks to understand how their MCP server is being used, what agents/users are trying to do with it, why tool calls are failing, what to fix or improve in their MCP server, or asks for an "MCP usage report", "tool error analysis", "intent analysis", "rationale clustering", or "MCP insights". Also trigger when the user mentions [MCP]-prefixed events, tool rationale, tool call errors, or just finished instrumenting their MCP server and wants to see what the data says. Requires the Amplitude MCP connector.

amplitude/builder-skills

Read lost deals and churned accounts from your CRM, extract reasons clustered by theme (missing features, pricing, competitors, UX), and write a prioritized weekly analysis with product improvement recommendations. Use before roadmap planning or to build the case for prioritizing retention work.

amplitude/builder-skills

Creates Amplitude charts from natural language descriptions, handling event selection, filters, groupings, and visualization choices. Use when you know what you want to measure but prefer not to build the chart manually.

amplitude/builder-skills

Guide an Amplitude user through building a custom agent by suggesting use cases grounded in their role and data, shaping the idea into a well-formed spec, and generating a ready-to-run Global Agent deeplink that creates it. Use to create, build, or set up a custom agent, automate a recurring analysis, or put a repeated report on a schedule.

amplitude/builder-skills

Builds comprehensive Amplitude dashboards from requirements or goals, organizing charts into logical sections with appropriate layouts. Use when creating a complete dashboard from scratch or assembling existing charts into a cohesive view.

amplitude/builder-skills

Monitors all active and recently completed experiments across Amplitude projects, triages them by importance, then runs deep analysis and reporting on the most impactful ones. Use when the user asks to "check on experiments", "experiment status", "experiment review", "what experiments are running", or wants a periodic experiment health report.

amplitude/builder-skills

Pull Intercom tickets and Slack support messages from the past 7 days, classify each signal, enrich with CRM data (ARR, plan, renewal), score by customer value and churn risk, and output a tiered priority report saved to Drive. Use when you need a fast, data-driven view of what support signals matter most.

amplitude/builder-skills

Use this skill whenever a user wants to improve existing pages on their website to get cited more by AI models — whether they say "our pages aren't getting cited", "improve this page for AI visibility", "which of our pages should we update", "make this article more cite-worthy", "our competitors are getting cited instead of us", "update our content for AI search", or any variation where the goal is improving an existing asset rather than creating something new. This skill pulls owned pages from AI Visibility, identifies which ones have citation potential but are underperforming, compares them against the external pages that are winning citations on the same topics, and produces section-level rewrites or a full-page update — then pushes the revision to the CMS as a draft. Trigger even if the user just says "help me get cited more" or "why is [competitor] getting cited instead of us".

amplitude/builder-skills

Use this skill whenever a user wants to win AI citations on prompts that competitors currently dominate — whether they say "competitors are getting cited instead of us", "we're losing on these prompts", "how do I outrank [competitor] in AI answers", "find prompts where we should be winning", "create content to beat [competitor]", or any variation where the goal is capturing AI share on prompts a competitor currently owns. This skill pulls competitor visibility data from AI Visibility, identifies the specific prompts where competitors win and Amplitude is absent, clusters them by intent, and produces targeted comparison pages, alternatives content, or rebuttal assets — then pushes drafts to CMS. Trigger on any mention of competitor, prompt hijack, outrank, or "why is [competitor] getting cited instead of us".

amplitude/builder-skills

Use this skill whenever a user wants to turn AI Visibility data into published content — whether they say "find content gaps", "what should we write about", "which topics have low visibility", "help me get cited by AI models", "create a blog post from our AI Visibility gaps", "we're losing to competitors on these prompts", or any variation where they want to go from AI visibility weakness to a draft article, landing page, or FAQ. This skill connects directly to Amplitude AI Visibility data (topics, prompts, visibility scores, citations, competitor data, full LLM responses and sources) and produces a publish-ready content brief plus full article draft. If the user mentions CMS (WordPress, Webflow, Contentful, Sanity, HubSpot, Ghost, Shopify), also trigger this skill to push the draft directly. Trigger even if they just say something vague like "what content should we create?" in an AI Visibility context.

amplitude/builder-skills

Use this skill whenever a user wants to test content variants before publishing to find which one will get cited most by AI models — whether they say "which version of this content will perform better", "test this article before we publish", "simulate how AI will respond to this content", "which angle should we use", "generate content variants and pick the winner", "run a simulation before publishing", or any variation where the goal is data-driven content selection rather than gut-feel publishing. This skill takes an identified content opportunity, generates 2–3 distinct variants with different angles or structures, scores them against actual AI model responses from AI Visibility, references the Simulate Changes feature for pre-publish validation, and produces a clear recommendation on which variant to publish — then pushes the winner to CMS. Trigger on any mention of "simulate", "test variants", "which performs better", "A/B content", or "before we publish".

amplitude/builder-skills

Use this skill whenever a user wants to understand which external sources are being cited by AI models on topics relevant to their brand, and wants to create content that will outrank those sources — whether they say "what sources are AI models citing", "why is [third-party site] being cited instead of us", "we want to be the definitive source on X", "build something that gets cited more than G2 or TechRadar", "create an authoritative asset", or any variation where the goal is producing a new reference asset (definition page, benchmark, methodology, glossary, comparison hub) designed to beat existing top-cited sources. This skill analyzes AI Visibility source data, reverse-engineers what makes top-cited pages authoritative, and produces a superior source asset — then pushes it to CMS as a draft. Trigger on any mention of "sources", "third-party citations", "authoritative content", "definitional pages", or "outrank".

amplitude/builder-skills

Instrument a Node/TypeScript MCP server with Amplitude's @amplitude/mcp-analytics SDK so tool calls, sessions, and rationale are tracked as Amplitude events. Use this skill whenever the user wants to add Amplitude analytics to their MCP server, mentions "MCP Analytics", "@amplitude/mcp-analytics", "instrument my MCP server", "track MCP tool calls", "add rationale to my MCP tools", or wants agent traffic (Claude, Cursor, ChatGPT) attributed back to Amplitude. Also use for adding UTM tagging to MCP-returned links, or for troubleshooting identity/user_id mismatches between MCP events and web/mobile Amplitude data.

amplitude/builder-skills

Diagnoses product health by cross-referencing Amplitude analytics (dashboards, charts, funnels, feedback, AI agent analytics), optionally Datadog (errors, latency, stack traces), and optionally Slack (qualitative feedback, bug reports, feature requests). Identifies what's broken, what's working, and what to do about it — with root causes, not just symptoms. Use when asked to "diagnose my product", "what's going on", "product health check", "what's broken", "where are users struggling", "give me a product diagnosis", or "what should I focus on".

amplitude/builder-skills

Turn one or more meeting transcripts, notes, or Slack threads into concise takeaways and clear action items with DRIs. Works with a single meeting or a batch from the whole week.

amplitude/builder-skills

Summarizes B2B account health by analyzing usage patterns, engagement trends, risk signals, and expansion opportunities. Use for customer success reviews, renewal preparation, QBRs, or account prioritization.

関連スキル