
rc-plan-changes
Use this skill when implementing subscription upgrades, downgrades, and plan switches via RevenueCat on Android. Covers GoogleProductChangeInfo, picking a Google replacement mode, and letting the SDK manage linkedPurchaseToken chaining.
- Installs
- 630
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/revenuecat/ai-toolkit --skill rc-plan-changes- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads rc-plan-changes automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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(seefetch-offeringsskill). - Google Play Billing Library 7+ is on the classpath via the RevenueCat SDK.
Skip this skill if the user has no active subscription. For a fresh purchase, use make-purchase instead.
Phase 2: Plan (pick a replacement mode)
GoogleReplacementMode maps one to one onto Google's billing modes. Pick based on the user intent:
| Scenario | Mode | Billing effect |
|---|---|---|
| Standard upgrade (monthly to annual) | WITH_TIME_PRORATION | Immediate switch, remaining time credited |
| Upgrade, keep the existing billing date | CHARGE_PRORATED_PRICE | Immediate switch, prorated charge now |
| Switch to or from a prepaid plan | CHARGE_FULL_PRICE | Immediate switch, full charge now |
| Upgrade during an active free trial | CHARGE_PRORATED_PRICE | Immediate switch, prorated charge now |
| Downgrade (annual to monthly) | DEFERRED | Switch applies at next renewal |
Do not default to WITHOUT_PRORATION for trial upgrades. WITHOUT_PRORATION applies the new plan immediately but charges nothing until the next renewal, which gives the user free premium access they did not pay for. Use CHARGE_PRORATED_PRICE to charge the upgrade price on the spot.
If you set no mode, PurchaseParams defaults to WITHOUT_PRORATION. Set the mode explicitly every time.
DEFERRED is valid only for downgrades. Google rejects deferred upgrades.
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 make-purchase instead
val newPackage = offerings.current
?.availablePackages
?.firstOrNull { it.identifier == "premium_annual_package" }
?: return
val params = PurchaseParams.Builder(activity, newPackage)
.googleProductChangeInfo(
GoogleProductChangeInfo(
oldProductId = currentProductId,
replacementMode = GoogleReplacementMode.WITH_TIME_PRORATION,
)
)
.build()
try {
val result = Purchases.sharedInstance.awaitPurchase(params)
// result.customerInfo reflects the new subscription
} catch (e: PurchasesTransactionException) {
if (!e.userCancelled) showError(e.error.message)
}
Notes on oldProductId:
- Pass the subscription product ID only. If you pass
"basic_monthly:monthly_plan", the SDK strips:monthly_planfor you, but the intent is clearer when you slice it yourself. CustomerInfo.activeSubscriptionsuses theproductId:basePlanIdshape.substringBefore(":")gives you the correct value.
Phase 4: Verify
After the suspending call returns, read the updated CustomerInfo:
customerInfo.activeSubscriptionsnow contains the newproductId:basePlanId.customerInfo.entitlements["pro"]?.isActivestaystrueacross the switch; do not gate UI on the SKU string.- For
DEFERREDmode,activeSubscriptionsstill reports the old product until the next renewal. RevenueCat tracks the pending switch server side and flips the entitlement after Google sends the renewal RTDN.
You do not write linkedPurchaseToken traversal code. RevenueCat resolves the chain, marks the old token as replaced, and attributes both tokens to the same App User ID. Client code reads entitlements and trusts them.
Common mistakes
| Mistake | Fix |
|---|---|
Hardcoding oldProductId as a constant | Derive it from customerInfo.activeSubscriptions.firstOrNull()?.substringBefore(":") |
Passing "productId:basePlanId" as oldProductId | Slice off the base plan with substringBefore(":") |
Using WITHOUT_PRORATION for a trial upgrade | Use CHARGE_PRORATED_PRICE so the user is charged now |
Using DEFERRED for an upgrade | DEFERRED is downgrade only; Google rejects deferred upgrades |
Writing backend code to follow linkedPurchaseToken | RevenueCat does this server side, delete the code |
| Reading the SKU to decide UI state | Read entitlements[...]?.isActive instead |
References
FAQ
What does the rc-plan-changes skill do?
Use this skill when implementing subscription upgrades, downgrades, and plan switches via RevenueCat on Android. Covers GoogleProductChangeInfo, picking a Google replacement mode, and letting the SDK manage linkedPurchaseToken chaining.
How do I install rc-plan-changes?
Run npx skills add https://github.com/revenuecat/ai-toolkit --skill rc-plan-changes in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/rc-plan-changes/ (personal) or .claude/skills/rc-plan-changes/ (project).
Which AI agents can use rc-plan-changes?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is rc-plan-changes safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains rc-plan-changes?
It is published by revenuecat in revenuecat/ai-toolkit. It has 630 recorded installs.
More from revenuecat/ai-toolkit
revenuecat-paywall
revenuecat/ai-toolkit
Display a RevenueCat paywall inside an app using the RevenueCatUI SDK. Use when the user asks to add a paywall, show a RevenueCat paywall, present PaywallView, integrate RevenueCatUI, gate a premium screen with a paywall, launch PaywallActivity, call presentPaywall or presentPaywallIfNeeded, or show the dashboard configured paywall UI on iOS, Android, Kotlin Multiplatform, Flutter, or React Native. To create, edit, evaluate, or audit the dashboard paywall itself, use revenuecat-paywall-design.
integrate-revenuecat
revenuecat/ai-toolkit
End-to-end RevenueCat integration — sets up the dashboard side via the RevenueCat MCP or the rc CLI (project, app, public API key) and installs/configures the Purchases SDK in the app. Use when the user asks to add RevenueCat, hook up RevenueCat, add subscriptions or in-app purchases to an app, 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-purchase-flow
revenuecat/ai-toolkit
Implement the RevenueCat purchase and restore flow. Use when the user asks to buy a package, purchase a subscription, fetch offerings, build the purchase logic behind a custom (hand-coded) paywall, handle purchase errors, detect user cancelled, or restore previous purchases on iOS, Android, Kotlin Multiplatform, Flutter, or React Native.
revenuecat-testing-setup
revenuecat/ai-toolkit
Set up a testing environment for RevenueCat purchases without charging real money. Use when the user says test RevenueCat purchases, sandbox setup, StoreKit configuration file, license tester, how do I test purchases without real money, set up sandbox account, internal testing track, or test paywall on iOS, Android, Kotlin Multiplatform, Flutter, or React Native.
create-revenuecat-project
revenuecat/ai-toolkit
Set up a complete RevenueCat project from scratch — creates apps, products, entitlements, offerings, and packages in the correct order. Use when the user wants to create a new RevenueCat project, configure in-app purchases, set up subscriptions or monetization, or bootstrap IAP infrastructure for iOS, Android, or Web.
revenuecat-troubleshoot
revenuecat/ai-toolkit
Diagnose and resolve RevenueCat integration issues — inspects dashboard configuration through the RevenueCat MCP, walks the SDK debug logs, and covers code-side gotchas. Use when the user says offerings are empty, products not loading, entitlement not active after purchase, paywall won't load, transactions not appearing, customer info shows no entitlements, sandbox purchase not working, an SDK-gated RevenueCat feature not working, or RevenueCat is broken on iOS, Android, Kotlin Multiplatform, Flutter, or React Native. Also use when asked to check or validate the store / product setup.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.