
rc-subscriptions
Use this skill when modeling subscriptions through RevenueCat's object model on Android. Covers Offerings, Packages, StoreProduct, SubscriptionOption, PricingPhase, and how they map to Google Play's Subscription, Base Plan, and Offer hierarchy.
- Installs
- 647
- 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-subscriptions- 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-subscriptions 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.
Subscriptions on Android with RevenueCat
Google Play exposes subscriptions through a three tier hierarchy: Subscription, Base Plan, and Offer. RevenueCat wraps that hierarchy in a flatter model you configure from the dashboard: Offerings, Packages, and SubscriptionOptions. You fetch an Offering, pick a Package, and in most flows let the SDK choose the right SubscriptionOption for you.
Phase 1: Understand
The mapping from Google Play to RevenueCat:
| Google Play | RevenueCat |
|---|---|
| Subscription (product ID) | StoreProduct |
| Base Plan | SubscriptionOption (base plan) |
| Offer | SubscriptionOption (offer) |
| Group of base plans grouped in dashboard | Package inside an Offering |
Key types you will touch:
Offering: a dashboard configured group ofPackageobjects.offerings.currentis the one you show by default.Package: a purchasable slot (monthly, annual, weekly, custom). Exposes aproduct: StoreProduct.StoreProduct: the Google Play subscription product. HassubscriptionOptions: List<SubscriptionOption>?and adefaultOption.SubscriptionOption: either a base plan or an offer. HaspricingPhases,tags, and anid.PricingPhase: one billing segment (intro trial, intro price, or recurring). HasbillingPeriod,price,offerPaymentMode, andrecurrenceMode.
See the Subscriptions chapter on revenuecat.com for the object model diagram showing the full Offerings hierarchy alongside the CustomerInfo hierarchy used for entitlement checks.
Phase 2: Plan
Before you write code, map your paywall to the object model. Answer these three questions.
2.1 Which Offering drives the paywall?
- Default paywall: use
offerings.current. This is the Offering marked current in the dashboard and is the standard choice. - Experiment or segment specific paywall: fetch
offerings.all["experiment-a"]. You keep the dashboard in charge of which products appear, so no app update ships when the catalog changes.
2.2 Which Packages do you show?
Two access patterns, pick the one that matches your layout:
| Pattern | API | When to use |
|---|---|---|
| Named slots | offering.monthly, offering.annual, offering.weekly | Fixed paywall with known durations |
| Iteration | offering.availablePackages | Dynamic layout, unknown durations, or custom package types |
Standard PackageType values: MONTHLY, ANNUAL, WEEKLY, TWO_MONTH, THREE_MONTH, SIX_MONTH, LIFETIME. Anything else is PackageType.CUSTOM.
2.3 Does the paywall need a specific offer, or is the default fine?
| Situation | What to pass to PurchaseParams |
|---|---|
| Standard paywall, user gets best eligible offer automatically | Package |
| You need a specific offer (win back, promo, tag selected) | SubscriptionOption |
The SDK's defaultOption logic:
- Filters out options tagged
"rc-ignore-offer"or"rc-customer-center". - Picks the option with the longest free trial or the cheapest first phase.
- Falls back to the base plan if no offer qualifies.
Trial eligibility is not filtered by the SDK. Google Play only returns offers the user is eligible for, so if a user already consumed a free trial, that option simply will not appear in subscriptionOptions and the base plan becomes the default.
Phase 3: Execute
3.1 Pull Offerings and pick a Package
val offerings = Purchases.sharedInstance.awaitOfferings()
val offering = offerings.current ?: return
val monthly = offering.monthly ?: return
val product = monthly.product
val price = product.price.formatted
val period = product.period?.iso8601 // "P1M", "P1Y", null for one time
For a dynamic list:
for (pkg in offering.availablePackages) {
render(pkg.product.title, pkg.product.price.formatted, pkg.packageType)
}
3.2 Purchase with the default option
When the paywall shows a Package and you want the SDK to pick the best offer, pass the Package directly.
val params = PurchaseParams.Builder(activity, monthly).build()
val result = Purchases.sharedInstance.awaitPurchase(params)
3.3 Drill into subscriptionOptions for a specific offer
Use this when the paywall targets an offer by tag or offer ID, for example a win back offer.
val product = offering.monthly?.product ?: return
val winBack = product.subscriptionOptions
?.firstOrNull { it.tags.contains("win-back") }
val option = winBack ?: product.defaultOption ?: return
val params = PurchaseParams.Builder(activity, option).build()
Always fall back to defaultOption so the paywall still works when the targeted offer is absent (for example, the user is not eligible).
3.4 Render trial and intro pricing from pricingPhases
The first PricingPhase is the trial or intro price when present. Use offerPaymentMode for trial detection.
val option = pkg.product.defaultOption ?: return
val first = option.pricingPhases.first()
val isTrial = first.offerPaymentMode == OfferPaymentMode.FREE_TRIAL
billingPeriod.value is the count in the period's unit, not days. A P1W period gives value = 1, unit = WEEK. Build labels off both fields:
val p = first.billingPeriod
val label = when (p.unit) {
Period.Unit.DAY -> "${p.value} day"
Period.Unit.WEEK -> "${p.value} week"
Period.Unit.MONTH -> "${p.value} month"
Period.Unit.YEAR -> "${p.value} year"
else -> p.iso8601
}
3.5 Prepaid plans
Prepaid base plans use the same SubscriptionOption API. Their pricingPhases report RecurrenceMode.NON_RECURRING. To accept pending purchases for prepaid plans, enable the flag at configuration time.
PurchasesConfiguration.Builder(context, apiKey)
.pendingTransactionsForPrepaidPlansEnabled(true)
.build()
3.6 Check access after purchase
Prefer entitlements. They reflect server computed access state including grace period, account hold, and cancellation with remaining time.
val info = result.customerInfo
val isPro = info.entitlements["pro"]?.isActive == true
If you need the raw product ID, use customerInfo.activeSubscriptions. It returns a Set<String> of "subscriptionId:basePlanId" entries.
Decision summary
| Question | Answer |
|---|---|
| How do I fetch products? | Purchases.sharedInstance.awaitOfferings() then offerings.current. |
| How do I present durations? | offering.monthly/annual/weekly or iterate availablePackages. |
| How do I purchase? | Pass the Package to PurchaseParams and let defaultOption apply. |
| How do I target a specific offer? | Filter product.subscriptionOptions by tag or ID, pass the SubscriptionOption. |
| How do I detect a free trial? | pricingPhases.first().offerPaymentMode == OfferPaymentMode.FREE_TRIAL. |
| How do I check access? | customerInfo.entitlements["<id>"]?.isActive. |
References
FAQ
What does the rc-subscriptions skill do?
Use this skill when modeling subscriptions through RevenueCat's object model on Android. Covers Offerings, Packages, StoreProduct, SubscriptionOption, PricingPhase, and how they map to Google Play's Subscription, Base Plan, and Offer hierarchy.
How do I install rc-subscriptions?
Run npx skills add https://github.com/revenuecat/ai-toolkit --skill rc-subscriptions 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-subscriptions/ (personal) or .claude/skills/rc-subscriptions/ (project).
Which AI agents can use rc-subscriptions?
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-subscriptions 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-subscriptions?
It is published by revenuecat in revenuecat/ai-toolkit. It has 647 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.