rc-plan-changes
БесплатноБез исполняемых скриптовНе проверенUse this skill when implementing subscription upgrades, downgrades, and plan switches via RevenueCat on Android. Covers StoreReplacementMode, picking a…
от RevenueCat★ 80 звёзд на GitHubОб этом скилле
Plan Changes on Android with RevenueCat
You use this skill when a user already has an active Google Play subscription and you need to move them to a different SKU (upgrade, downgrade, cross-grade, or trial conversion). RevenueCat exposes Google's replacement modes through a single PurchaseParams builder and resolves the linkedPurchaseToken chain server side so you do not write token chaining code.
Phase 1: Preconditions
Confirm the following before invoking a plan change:
- The user has exactly one active Google Play subscription you intend to replace.
- You have a fresh
CustomerInfofromPurchases.sharedInstance.awaitCustomerInfo()or a cached value from a recent listener callback. - You have the target
Packageresolved fromofferings.current(see rc-subscriptions). - RevenueCat SDK 10.3.0 or later is on the classpath (
StoreReplacementModearrived in 10.3.0). This skill was checked against 11.1.0, which brings Play Billing Library 9.1.0. - If you will use
DEFERRED, Google Real Time Developer Notifications must be connected to RevenueCat (RevenueCat Play app settings > Connect to Google, then paste the topic in Play Console > Monetize > Monetization setup). RevenueCat requires this forDEFERRED.
Skip this skill if the user has no active subscription. For a fresh purchase, use rc-purchase-flow instead.
Phase 2: Plan (pick a replacement mode)
StoreReplacementMode is the type PurchaseParams.Builder.replacementMode() takes: a class with five constants (CHARGE_FULL_PRICE, CHARGE_PRORATED_PRICE, DEFERRED, WITHOUT_PRORATION, WITH_TIME_PRORATION; there is no KEEP_EXISTING), not an enum, so a when over it needs an else branch. Google validates the mode differently depending on whether the switch stays within one subscription product or crosses to a different one, so decide that first.
Check whether oldProductId and the new product share the same Google Play subscription ID and only the base plan or offer differs (for example premium:monthly to premium:annual), or point at different subscription products entirely (for example basic to premium).
Switching to a prepaid plan, within one subscription or to a different subscription product, allows only CHARGE_FULL_PRICE; any other mode fails the purchase.
Same subscription, different base plan or offer
| Scenario | Mode | Billing effect |
|---|---|---|
| Change billing period (for example monthly and annual base plans of one subscription) | CHARGE_FULL_PRICE (charge now) or WITHOUT_PRORATION (charge at next renewal) |
Any other mode fails the purchase |
| Switch to a prepaid plan | CHARGE_FULL_PRICE |
The only valid mode |
Google allows only CHARGE_FULL_PRICE or WITHOUT_PRORATION when switching base plans or offers of the same subscription product to an auto renewing plan. WITH_TIME_PRORATION, CHARGE_PRORATED_PRICE, and DEFERRED fail the purchase in this case.
Different subscription product (tier change)
| Scenario | Mode | Billing effect |
|---|---|---|
| Upgrade to a higher tier | CHARGE_PRORATED_PRICE |
Immediate switch, prorated charge, same billing date (only when the price per unit of time rises) |
| Change billing period across different subscription products (for example a monthly product to an annual product) | CHARGE_FULL_PRICE (charge now) or DEFERRED (at the next renewal) |
CHARGE_PRORATED_PRICE fails unless the price per unit of time rises |
| Upgrade during a free trial, keep the trial | WITHOUT_PRORATION |
Immediate switch, no charge until the trial ends |
| Upgrade during a free trial, charge now | CHARGE_PRORATED_PRICE |
Immediate switch, trial ends, prorated charge now |
| Downgrade to a lower tier | DEFERRED |
Switch applies at the next renewal (Google's recommendation) |
| Switch to a prepaid plan (upgrade or downgrade) | CHARGE_FULL_PRICE |
The only valid mode; any other mode fails the purchase |
Both free trial options are valid; pick based on whether the user should keep the trial or be charged immediately.
If you set no mode, PurchaseParams defaults to WITHOUT_PRORATION. Set the mode explicitly every time.
DEFERRED applies the change at the next renewal for upgrades or downgrades across different subscription products, except to a prepaid plan (Google recommends it for downgrades). It is not valid for a base plan or offer switch within the same subscription; use CHARGE_FULL_PRICE or WITHOUT_PRORATION there instead.
Phase 3: Execute
Derive currentProductId from CustomerInfo. Hardcoded SKUs break when a user has migrated between plans.
val customerInfo = Purchases.sharedInstance.awaitCustomerInfo()
// activeSubscriptions entries are "productId:basePlanId", strip the base plan suffix
val currentProductId = customerInfo.activeSubscriptions
.firstOrNull()
?.substringBefore(":")
?: return // nothing active, route to purchase-flow instead
// Upgrading
Установить rc-plan-changes в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл rc-plan-changes?
Use this skill when implementing subscription upgrades, downgrades, and plan switches via RevenueCat on Android. Covers StoreReplacementMode, picking a replacement mode, and letting the SDK manage linkedPurchaseToken chaining.
Как установить скилл rc-plan-changes?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rc-plan-changes запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic