claude-skills/

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

last sync 22h ago
スキルOfficialdevelopment

💳integrate-revenuecat

プラグイン
revenuecat

説明

RevenueCatのエンドツーエンド統合 — RevenueCat MCP経由でダッシュボード側のセットアップ(プロジェクト、アプリ、公開APIキー)を行い、アプリへのPurchases SDKのインストールおよび設定を実施します。 次のような場合に使用: ユーザーがRevenueCatの追加、Purchasesの統合、RevenueCat SDKのインストール、RevenueCat APIキーのセットアップ、起動時のPurchases設定、またはiOS・Android・Kotlin Multiplatform・Flutter・React NativeにおけるRevenueCat統合の新規構築を要求した場合。

原文を表示

End-to-end RevenueCat integration — sets up the dashboard side via the RevenueCat MCP (project, app, public API key) and installs/configures the Purchases SDK in the app. Use when the user asks to add RevenueCat, integrate Purchases, install the RevenueCat SDK, set up a RevenueCat API key, configure Purchases on launch, or set up a brand new RevenueCat integration on iOS, Android, Kotlin Multiplatform, Flutter, or React Native.

ユースケース

  • RevenueCatを新規で追加したいとき
  • Purchases SDKをインストール・設定するとき
  • RevenueCat APIキーをセットアップするとき
  • iOS・Android等でRevenueCat統合を構築するとき

本文(日本語訳)

integrate-revenuecat: RevenueCatのエンドツーエンド統合

次のような場合に使用: ユーザーが初めてプロジェクトにRevenueCatを追加したい場合、またはパブリックAPIキーを使ってSDKを再設定したい場合。 このスキルは以下の2つのフェーズをカバーします:

  1. ダッシュボード側 — RevenueCat MCPサーバーを通じて、プロジェクトのセットアップ、アプリの登録、パブリックAPIキーの取得を行う。
  2. アプリ側 — Purchases SDKのインストール、アプリエントリーポイントでの Purchases.configure(…) の呼び出し、ログ上の設定バナーによる確認を行う。

上記の順序に従って進めること。 ユーザーが「SDKをインストールするだけ」と言っても、ほとんどの統合では両方のフェーズが必要です — SDKにはダッシュボードから取得したAPIキーが必要なためです。

プロジェクトとアプリがすでに存在しており、ユーザーがSDKをコードに組み込むだけでよい場合は、以下の セクション3 へスキップしてください。 ユーザーが新規のRevenueCatプロジェクト(アプリ・プロダクト・エンタイトルメント・オファリング)をゼロから構築したい場合は、代わりに create-revenuecat-project スキルを使用し、その後SDKのインストールのためにここへ戻ってきてください。


引数

スラッシュコマンドとして呼び出された場合、$ARGUMENTS として利用できます:

  • platform(省略可): iosandroidkmpflutterreact-native のいずれか。省略時はセクション3aの検出アルゴリズムを実行する。
  • app_identifier(省略可): バンドルID(iOS)またはパッケージ名(Android)。省略時はプロジェクトファイル(Info.plistAndroidManifest.xmlapp.jsonpubspec.yaml)から読み取る。
  • project_name(省略可): 使用するRevenueCatプロジェクトの名前。省略時はMCP経由でプロジェクト一覧を取得し、ユーザーに確認する。

1. 現状の把握

ダッシュボードに触れる前に、以下の情報を収集してください:

  • プラットフォームターゲット: iOS / Apple App Store、Android / Google Play、またはその両方。 確認する前にまず作業ディレクトリを調べること — セクション3の検出アルゴリズムで大抵は明確になります。
  • 技術スタック: ネイティブiOS(Swift)、ネイティブAndroid(Kotlin / Java)、React Native、Flutter、Kotlin Multiplatform。 SDKの一覧: https://www.revenuecat.com/docs/getting-started/installation.md
  • アプリ識別子: バンドルID(iOS)またはパッケージ名(Android)。 ユーザーに確認するのではなく、Info.plist / AndroidManifest.xml / app.json / pubspec.yaml から取得すること。

2. ダッシュボード側 — RevenueCat MCP

以下のツール呼び出しにはすべてRevenueCat MCPサーバーを使用すること。

2a. プロジェクトの取得または作成

  • list-projects — アクセス可能なプロジェクトを一覧表示する。複数ある場合は、このアプリに対応するプロジェクトをユーザーに確認するか、新規作成を提案する。
  • プロジェクトが存在しない場合は、create-revenuecat-project スキルに引き継ぎ、完了後ここへ戻ること。
  • 以降のステップのために project_id を保持しておく。

2b. アプリの取得または作成

  • プロジェクトにすでに設定されているアプリを確認する。 test_store アプリは必ず存在するが、app_store および play_store アプリはユーザーがストア側のセットアップを完了している場合のみ存在する。
  • App Store Connect(iOS)またはGoogle Play Console(Android)でアプリがすでにセットアップ済みかどうかをユーザーに確認する。 ストア側のセットアップは後からでもできることを伝え、test_store アプリがあれば統合を開始するのに十分であることを安心させること。
  • ユーザーがストア側のセットアップ完了を確認した場合、create-app を呼び出す:
    • iOS: type: "app_store"、セクション1で取得した bundle_id
    • Android: type: "play_store"、セクション1で取得した package_name
    • name は識別子から導出するか、ユーザーに確認する。

2c. パブリックAPIキーの取得

  • 対象アプリIDを指定して list-public-api-keys を呼び出す:
    • ストア側アプリが存在する場合は app_store / play_store
    • そうでない場合は test_store アプリ。
  • 返却されるキーはパブリックキーであり、クライアントアプリのコードに埋め込んでも安全です。 iOSキーのプレフィックスは appl_…、Androidは goog_…、Amazonは amzn_…

シークレットAPIキーをクライアントコードに使用しないでください。 シークレットキーはサーバーサイド専用です。


3. アプリ側 — SDKのインストールと設定

3a. プラットフォームの検出

作業ディレクトリを調べ、上から順に最初に一致したものを選択します:

  1. React Native: package.jsonreact-native-purchases エントリがあるか、react-native が依存関係に含まれている → platforms/react-native.md を読む。expo も依存関係にある場合は、Expoプロジェクトとして記録する。
  2. Flutter: プロジェクトルートに pubspec.yaml が存在する → platforms/flutter.md を読む。
  3. Kotlin Multiplatform: build.gradle.ktskotlin { … } マルチプラットフォームのソースセットブロックが含まれているか、com.revenuecat.purchases:purchases-kmp* に依存している → platforms/kmp.md を読む。
  4. Android(ネイティブ): build.gradle(.kts)com.android.application が適用されている(かつKMPでない) → platforms/android.md を読む。
  5. iOS(ネイティブ): プロジェクトルートに Package.swift*.xcodeproj*.xcworkspace、または Podfile が存在する → platforms/ios.md を読む。

複数が一致する場合(例: Flutterプロジェクト内の ios/ フォルダ)は、ビルドを管理する最も外側のプロジェクトを選択すること。 それでも曖昧な場合は、どのプラットフォームを設定するかユーザーに確認する。

3b. 共通の概念(全プラットフォーム)

  • パブリックSDKキーを使用すること(シークレットキーは不可)。 RevenueCatはストア/プラットフォームごとに個別のパブリックSDKキーを発行します。 iOSアプリには appl_… キー、Androidアプリには goog_… キー(Amazonは amzn_…)を使用します。 サーバーサイドのシークレットキーはクライアントアプリに含めてはなりません。
  • アプリ起動ごとに1回だけ設定する。 Purchases.configure(…) はできる限り早い段階(アプリのエントリーポイント)で、かつ1回だけ呼び出すこと。 それ以降の呼び出しは何もしないか、警告が出ます。
  • デフォルトは匿名ユーザー。 appUserID を渡さない場合、RevenueCatは安定した匿名IDを自動生成します。 appUserID を渡すのは、起動時点ですでに認証済みユーザーがいる場合のみにすること。 そうでなければ、後から logIn(…) を呼び出してください(revenuecat-identify-user スキルを参照)。
  • 統合中はデバッグログを有効にする。 各プラットフォームのファイルに方法が記載されています。リリースビルドでは無効にすること。
  • キーはソース管理に含めない。 シークレット管理についてユーザーから質問があった場合は、.env(RN)、xcconfig(iOS)、local.properties / gradle.properties(Android)、または dart-define(Flutter)を推奨すること。

3c. 実装

検出結果に対応するプラットフォームファイルを読むこと:

  • platforms/ios.md
  • platforms/android.md
  • platforms/kmp.md
  • platforms/flutter.md
  • platforms/react-native.md

各プラットフォームファイルは独立して完結しており、インストールコマンド・configure の正確なコードスニペット・アプリエントリーポイントへの配置場所が記載されています。


4. 確認

以下がすべて満たされるまで、セットアップ完了を宣言しないこと:

  1. プロジェクトがビルドできる(Xcodeビルド、./gradlew assembleDebugflutter runnpx react-native run-ios、またはKMP相当のコマンド)。
  2. アプリが起動し、RevenueCat SDKがコンソール / logcat / Metroの出力に設定バナーをログ出力する(期待されるログ行は各プラットフォームファイルに記載)。
  3. SDKの最初のネットワーク呼び出しで認証エラーが発生しない。 APIキーが間違っている場合、アプリがオファリングを取得しようとした時点で認証エラーのログとして表れます。

ユーザーがアプリを実行せず「インストールするだけ」と言っている場合は、実際に実行したときにログで何を確認すべきかを伝えること。


5. 次のステップ

5a. プロダクト・エンタイトルメント・オファリング

プロジェクトにプロダクト、エンタイトルメント、オファリングがすでに設定されているか確認する。 設定されていない場合は、create-revenuecat-project スキルを通じてサポートを申し出ること。

5b. ストア側のセットアップ

iOS(App Store Connect)

  1. In-App Purchase Key(StoreKit 2推奨) — App Store Connect → ユーザーとアクセス → 統合 → In-App Purchase。キーを生成し、.p8 ファイルをダウンロードする。Key IDとIssuer IDを記録しておく。
  2. Shared Secret(レガシーStoreKit 1) — App Store Connect → アプリ → App情報 → App専用共有シークレット。
  3. ユーザーがこの情報を提供した場合は、create-app / update-app でRevenueCat側に登録する。

Android(Google Play Console)

  1. サービスアカウントの認証情報 — Google Cloud Consoleでサービスアカウントを作成する。「Service Account User」ロールを付与する。JSONキーを作成する。Play Consoleでサービスアカウントに「財務データの閲覧」権限でアクセスを付与する。
  2. リアルタイム デベロッパー通知(RTDN) — Cloud Pub/Subトピックを設定する。Play Console → 収益化のセットアップで設定する。
  3. ユーザーがこの情報を提供した場合は、create-app / update-app で登録する。

5c. 後続のスキル

integrate-revenuecat の後によく使われるスキル:

  • revenuecat-paywall — ダッシュボードで設定したペイウォールを表示する。
  • revenuecat-purchase-flow — 購入とリストアを手動で実装する。
  • revenuecat-entitlements-gate — アクティブなエンタイトルメントの背後に機能をゲートする。
  • revenuecat-identify-userlogIn / logOut をアプリの認証システムと連携させる。
  • revenuecat-testing-setup — サンドボックステスト環境をセットアップする。
  • revenuecat-troubleshoot — オファリング / プロダクト / エンタイトルメントのバグを診断する。
原文(English)を表示

integrate-revenuecat: end-to-end RevenueCat integration

Use this skill when the user wants to add RevenueCat to a project for the first time, or to reconfigure the SDK with a public API key. The skill covers two halves:

  1. Dashboard side — set up the project, register the app, and obtain the public API key, all through the RevenueCat MCP server.
  2. App side — install the Purchases SDK, call Purchases.configure(…) at app entry, and verify the configuration banner in the logs.

Walk them in order. Most integrations need both halves, even when the user asks "just install the SDK" — the SDK needs an API key from the dashboard.

If a project + app already exist and the user only wants to wire the SDK into code, jump to Section 3 below. If the user wants to bootstrap a brand new RevenueCat project (apps + products + entitlements + offerings), use the create-revenuecat-project skill instead, then come back here for the SDK install.

Arguments

Available as $ARGUMENTS when invoked as a slash command:

  • platform (optional): One of ios, android, kmp, flutter, react-native. If omitted, run the detection algorithm in Section 3a.
  • app_identifier (optional): Bundle ID (iOS) or package name (Android). If omitted, read it from the project files (Info.plist, AndroidManifest.xml, app.json, pubspec.yaml).
  • project_name (optional): Name of the RevenueCat project to use. If omitted, list projects via MCP and ask the user.

1. Understand the status quo

Before touching the dashboard, gather the facts:

  • Platform target: iOS / Apple App Store, Android / Google Play, or both. Inspect the working directory before asking — the detection algorithm in Section 3 makes this obvious for most projects.
  • Technology: native iOS (Swift), native Android (Kotlin / Java), React Native, Flutter, Kotlin Multiplatform. SDK list: https://www.revenuecat.com/docs/getting-started/installation.md.
  • App identifier: bundle ID (iOS), package name (Android). Pull from Info.plist / AndroidManifest.xml / app.json / pubspec.yaml rather than asking.

2. Dashboard side — RevenueCat MCP

Use the RevenueCat MCP server for every tool call below.

2a. Get or create the project

  • list-projects — list accessible projects. If multiple, ask the user which one matches this app, or offer to create a new one.
  • If there is no project, hand off to the create-revenuecat-project skill, then resume here.
  • Store the project_id for the rest of the steps.

2b. Get or create the app

  • Check which apps are already configured in the project. A test_store app is always present; app_store and play_store apps are present only if the user has finished store-side setup.
  • Ask the user whether their app is already set up in App Store Connect (iOS) or Google Play Console (Android). Reassure them that store-side setup can come later — the test_store app is enough to start integrating.
  • If the user confirms store-side setup is done, call create-app:
    • iOS: type: "app_store", bundle_id from Section 1.
    • Android: type: "play_store", package_name from Section 1.
    • name derived from the identifier or asked from the user.

2c. Get the public API key

  • Call list-public-api-keys with the relevant app ID:
    • app_store / play_store if the store-side app exists.
    • Otherwise the test_store app.
  • The returned key is public and safe to embed in client app code. iOS keys are prefixed appl_…, Android keys goog_…, Amazon amzn_….

Never use the secret API key in client code. Secret keys are server-side only.

3. App side — install and configure the SDK

3a. Detect the platform

Inspect the working directory and pick the first match, from top to bottom:

  1. React Native: package.json has a react-native-purchases entry, or react-native as a dependency → read platforms/react-native.md. If expo is also a dependency, note it as an Expo project.
  2. Flutter: pubspec.yaml exists at the project root → read platforms/flutter.md.
  3. Kotlin Multiplatform: build.gradle.kts contains a kotlin { … } multiplatform source sets block, or depends on com.revenuecat.purchases:purchases-kmp* → read platforms/kmp.md.
  4. Android (native): build.gradle(.kts) applies com.android.application (and is not KMP) → read platforms/android.md.
  5. iOS (native): Package.swift, *.xcodeproj, *.xcworkspace, or Podfile at the project root → read platforms/ios.md.

If several match (e.g. an ios/ folder inside a Flutter project), pick the outermost project, the one that owns the build. If still ambiguous, ask the user which platform they want to configure.

3b. Shared concepts (all platforms)

  • Public SDK key, not secret key. RevenueCat issues a separate public SDK key per store/platform. iOS apps use an appl_… key, Android apps use a goog_… key (Amazon uses amzn_…). Server-side secret keys must never appear in client apps.
  • Configure once per app launch. Call Purchases.configure(…) exactly once, as early as possible (app entry point). Later calls no-op or warn.
  • Anonymous users by default. If you don't pass an appUserID, RevenueCat creates a stable anonymous ID. Only pass appUserID if you already have an authenticated user at launch; otherwise call logIn(…) later (see the revenuecat-identify-user skill).
  • Enable debug logging during integration. Each platform file shows how. Turn it off for release builds.
  • Keep keys out of source control. Recommend .env (RN), xcconfig (iOS), local.properties / gradle.properties (Android), or dart-define (Flutter) when the user asks about secret management.

3c. Implementation

Read the platform file that matches detection:

  • platforms/ios.md
  • platforms/android.md
  • platforms/kmp.md
  • platforms/flutter.md
  • platforms/react-native.md

Each platform file is self-contained: install command, exact configure snippet, and where to place it in the app entry point.

4. Verify

Do not claim setup is complete until:

  1. The project builds (Xcode build, ./gradlew assembleDebug, flutter run, npx react-native run-ios, or the KMP equivalent).
  2. The app launches and the RevenueCat SDK logs a configuration banner in the console / logcat / Metro output (each platform file describes the expected log line).
  3. No authentication errors appear on the first SDK network call. A wrong API key surfaces as an auth error log as soon as the app fetches offerings.

If the user only asked to "install" without running the app, tell them what to look for in the logs when they do run it.

5. Next steps

5a. Products, entitlements, offerings

Check whether products, entitlements, and offerings are already set up in the project. If not, offer to help via the create-revenuecat-project skill.

5b. Store-side setup

iOS (App Store Connect)

  1. In-App Purchase Key (recommended for StoreKit 2) — App Store Connect → Users and Access → Integrations → In-App Purchase. Generate key, download the .p8 file. Note the Key ID and Issuer ID.
  2. Shared Secret (legacy StoreKit 1) — App Store Connect → App → App Information → App-Specific Shared Secret.
  3. If the user provides this information, register it on the RevenueCat side via create-app / update-app.

Android (Google Play Console)

  1. Service account credentials — Create a service account in Google Cloud Console. Grant "Service Account User" role. Create a JSON key. In Play Console, grant the service account access with "View financial data" permission.
  2. Real-time Developer Notifications (RTDN) — Set up a Cloud Pub/Sub topic. Configure in Play Console → Monetization setup.
  3. If the user provides this information, register it via create-app / update-app.

5c. Subsequent skills

Common follow-ups after integrate-revenuecat:

  • revenuecat-paywall — display a dashboard-configured paywall.
  • revenuecat-purchase-flow — implement purchase + restore manually.
  • revenuecat-entitlements-gate — gate features behind active entitlements.
  • revenuecat-identify-user — wire logIn / logOut to the app's auth system.
  • revenuecat-testing-setup — set up a sandbox testing channel.
  • revenuecat-troubleshoot — diagnose offerings / products / entitlement bugs.

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