Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

rc-testing

БесплатноБез исполняемых скриптовНе проверен

Use this skill when testing a RevenueCat Android integration. Covers the RevenueCat Test Store (test_ API key prefix, in dialog choice of Test valid purchase…

RevenueCatот RevenueCat★ 80 звёзд на GitHub

Об этом скилле

Testing RevenueCat on Android

Use this skill to stand up a fast test loop for a RevenueCat Android integration. The Test Store replaces the Google Play sandbox for most work, a BillingService interface makes Purchases mockable, and a small GitHub Actions job runs unit tests on every push.

Full source: see the full chapter on revenuecat.com.


Phase 1: Discovery

Before changing anything, learn what already exists. Answer each question with a file or a "no".

Check Where to look What you want
Test API key configured? app/build.gradle.kts, local.properties, env A test_... value bound to BuildConfig.RC_API_KEY in debug
Release key separate? build.gradle.kts release block A goog_... key, never test_...
Purchases wrapped? app/src/main/java/**/*Billing*.kt An interface that hides Purchases.sharedInstance
CI present? .github/workflows/*.yml A job running ./gradlew testDebugUnitTest
Secret wired? GitHub repo settings, workflow env: RC_TEST_STORE_KEY referenced from secrets
Test library? app/build.gradle.kts dependencies io.mockk:mockk and kotlinx-coroutines-test

If the project has none of these, start from scratch in Phase 3. If some exist, only fill the gaps.


Phase 2: Plan

Pick the test path per scenario. The Test Store is the default; fall back to Google Play sandbox only when you need store behavior the Test Store does not simulate.

Scenario Use
Success, failure, cancel paths Test Store
Unit tests of ViewModels mockk against BillingService
CI on every push Test Store + unit tests
Subscription renewal cycles (up to 5 accelerated renewals) Test Store
Grace period, account hold Google Play Sandbox
Pending purchase (parental approval) Google Play Sandbox
Full end-to-end payment Google Play Sandbox

Write the plan as a short checklist in tasks/todo.md before coding. If the app ships subscriptions, keep one Sandbox pass in the pre-ship checklist even if the Test Store covers daily iteration.


Phase 3: Execute

Step 1: Generate the test API key

In the RevenueCat dashboard, open your app, go to Apps & providers, then Create Test Store. Copy the test_... key. Do not commit it. Put it in local.properties or a CI secret.

Step 2: Wire the key into debug builds

// build.gradle.kts
import com.android.build.api.variant.BuildConfigField

android {
    buildFeatures {
        buildConfig = true
    }
    buildTypes {
        debug {
            buildConfigField("String", "RC_API_KEY", "\"test_YOUR_KEY\"")
        }
    }
}

// Read the production key only when a release variant builds, so debug
// builds work without it.
androidComponents {
    onVariants(selector().withBuildType("release")) { variant ->
        variant.buildConfigFields?.put(
            "RC_API_KEY",
            providers.gradleProperty("RC_API_KEY").map { BuildConfigField("String", "\"$it\"", null) },
        )
    }
}

AGP 8.0+ does not generate BuildConfig by default; buildFeatures { buildConfig = true } is required or the fields above fail to build.

Do not read the production key with .get() inside buildTypes { release { } } or defaultConfig { }. Gradle runs those blocks on every build, so assembleDebug fails with "Cannot query the value of Gradle property 'RC_API_KEY'" on any machine without the production key. If you followed configuring-the-sdk, replace its defaultConfig field with the androidComponents block above. A release build without the property still fails, at generateReleaseBuildConfig with "property 'items' doesn't have a configured value", so a release never ships without a key.

For CI, read the debug key from env so it never lands in git. Change only the debug field from Step 2. Release builds read the same RC_API_KEY Gradle property as configuring-the-sdk, so pass it to release jobs (-PRC_API_KEY=... or ORG_GRADLE_PROJECT_RC_API_KEY). Never put the test_ key in defaultConfig, or it ships in release builds too:

// build.gradle.kts
import com.android.build.api.variant.BuildConfigField

val testKey = System.getenv("RC_TEST_STORE_KEY") ?: "test_placeholder"
android {
    buildFeatures {
        buildConfig = true
    }
    buildTypes {
        debug {
            buildConfigField("String", "RC_API_KEY", "\"$testKey\"")
        }
    }
}

androidComponents {
    onVariants(selector().withBuildType("release")) { variant ->
        variant.buildConfigFields?.put(
            "RC_API_KEY",
            providers.gradleProperty("RC_API_KEY").map { BuildConfigField("String", "\"$it\"", null) },
        )
    }
}

Step 3: Configure Purchases with the build config key

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        if (BuildConfig.DEBUG) Pu
Полный SKILL.md на GitHub

Установить rc-testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл rc-testing?

Use this skill when testing a RevenueCat Android integration. Covers the RevenueCat Test Store (test_ API key prefix, in dialog choice of Test valid purchase, Test failed purchase, or Cancel), mockk based unit testing with an interface wrapper around Purchases, and a GitHub Actions CI pattern. Avoids Google Play sandbox for day to day test iteration.

Как установить скилл rc-testing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл rc-testing запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить rc-testing с