Agent Skill · Android

play-billing-library-version-upgrade

Use this skill when upgrading or migrating an Android project from any legacy Google Play Billing Library (PBL) version to the latest stable version of PBL.

Provider: Android Path in repo: play/play-billing-library-version-upgrade/SKILL.md

Skill body

Phase 0: Intent Message

Reporting Action: Before proceeding, immediately tell the user: “I will upgrade Play Billing Library to the latest version.”

Phase 1: Discovery \& Situational Awareness

  1. Primary Check (Build Version) : Locate the project’s billing dependency (e.g., com.android.billingclient:billing) in build.gradle, build.gradle.kts, or libs.versions.toml.
  2. Initial Compilation Test: Attempt to sync and build the project immediately.
  3. Fallback Discovery (Effective Version) :
    • Trigger: Only if the build fails immediately, scan the source code for deprecated artifacts.
    • Logic : The presence of deprecated APIs indicates the “Effective Version” —defined as the version where those specific APIs were last available, not when they were introduced.
    • Example : If SkuDetails is present, treat the baseline as PBL v7 or earlier (regardless of the version string in build.gradle).
  4. Identify Target \& Path: Access the version tool or release notes to find the latest stable version and calculate a [Direct/Stepped] migration path based on the Effective Version baseline.

Phase 2: Contextual Document Mapping \& Planning

For every major version jump identified in your path, you MUST synthesize instructions from:

Phase 3: Instructions for Execution

Reporting Action: For each of the following steps, give a brief explanation of what you will be doing prior to execution, and a brief summary of what you accomplished afterwards.

Step 1: SDK \& Environment Alignment

Step 2: Intent-based Refactoring

Analyze the intent of the existing code rather than performing purely textual string replacement.

Step 3: Sequential Verification (Only applicable for Stepped Migrations)

  1. Upgrade to the first major intermediate version in your path.
  2. Run ./gradlew assembleDebug to verify no intermediate breaking changes were missed.
  3. Repeat until you reach the final target version.

Step 4: Final Validation Checklist

  1. Smart Checklist Verification:
  2. Open references/version-checklist.md and locate the Smart Version-Specific Checklist.
  3. Action: For every version between your [Detected Effective Version] and [Detected New Version], verify that every item has been addressed in the code using “Find in Files” or structural analysis.
  4. Tests : Run all unit and implementation tests (./gradlew test).
  5. Clean Build : Verify the project completes a full clean build: ./gradlew clean assembleDebug. Then, run ./gradlew sync and ./gradlew build so that the user can immediately test the new version manually.

Final Report

Explain the “Why” to the developer:

Skill frontmatter

license: Complete terms in LICENSE.txt metadata: {"author"=>"Google LLC", "last-updated"=>"2026-05-20", "keywords"=>["android", "play billing", "play billing library", "pbl", "upgrade", "migration", "deprecation", "google play"]}