agp-9-upgrade — Claude Code skill: what it does, how to install
Moves an Android project from AGP 8 to Android Gradle Plugin 9 step by step: dependency bumps, built-in Kotlin, the new DSL, kapt cleanup.
npx skills add android/skills --skill agp-9-upgrade -a claude-codeWhat agp-9-upgrade does
The skill takes an Android project from AGP 8 to Android Gradle Plugin 9. It reads the plugin version in your build first. Anything below 9 and it stops, telling you to run the AGP Upgrade Assistant in Android Studio and confirm when the update lands. You can ask it to skip that and bump the version itself.
Past that gate the work runs in a fixed order. KSP to 2.3.6 or higher, Hilt to 2.59.2 or higher, migration to built-in Kotlin, a rewrite of the build scripts onto the new AGP DSL, kapt swapped for KSP or legacy-kapt, custom BuildConfig fields, then removal of four temporary flags from gradle.properties. Each step points at its own reference file, and references/recipes.md holds before-and-after examples.
Two limits are worth knowing up front. Kotlin Multiplatform projects are unsupported, the skill says so in its own description. Paparazzi v2.0.0-alpha04 and older has issues under AGP 9, so a screenshot-test setup is the first thing to check before running this. Verification is plain: IDE sync, ./gradlew help, ./gradlew build --dry-run.
What it helps with
- carry a build from AGP 8 to AGP 9 without reading every breaking change
- move modules onto built-in Kotlin
- rewrite build scripts for the new AGP DSL
- swap kapt for KSP
- clear the temporary migration flags out of
gradle.properties
Example prompts for the agent
- Migrate this project to Android Gradle Plugin 9 using the agp-9-upgrade steps
- Check the AGP version here and tell me what to do if it is below 9
- Bump KSP and Hilt to the required versions and clean up
gradle.propertiesafter the migration
How to install agp-9-upgrade
1Skills CLI (Vercel)
npx skills add android/skills --skill agp-9-upgrade -a claude-code2Manually: put the files in place
~/.claude/skills/agp-9-upgrade/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/agp-9-upgrade/
1Skills CLI (Vercel)
npx skills add android/skills --skill agp-9-upgrade -a codex2Manually: put the files in place
.agents/skills/agp-9-upgrade/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add android/skills --skill agp-9-upgrade -a cursor2Manually: put the files in place
.cursor/skills/agp-9-upgrade/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install android/skills agp-9-upgrade2Manually: put the files in place
.github/skills/agp-9-upgrade/SKILL.md1Skills CLI (Vercel)
npx skills add android/skills --skill agp-9-upgrade -a gemini-cli2Platform CLI
gemini skills install https://github.com/android/skills --path build-system/agp/agp-9-upgradeManually: put the files in place
.devin/skills/agp-9-upgrade/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add android/skills --skill agp-9-upgrade -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about agp-9-upgrade
How do I install agp-9-upgrade in Claude Code?
Run npx skills add android/skills --skill agp-9-upgrade -a claude-code. The skill file ends up at ~/.claude/skills/agp-9-upgrade/SKILL.md.
What does agp-9-upgrade do?
It drives an Android project to AGP 9: higher KSP and Hilt versions, built-in Kotlin, the new DSL, plus kapt and BuildConfig work.
Which KSP and Hilt versions does AGP 9 require?
KSP 2.3.6 or higher and Hilt 2.59.2 or higher. That check is the first step the skill runs.
Source text
SKILL.md · Apache-2.0
--- name: agp-9-upgrade description: Upgrades, or migrates, an Android project to use Android Gradle Plugin (AGP) version 9. Do not use this skill for migrating Kotlin Multiplatform (KMP) projects. license: Complete terms in LICENSE.txt metadata: author: Google LLC last-updated: '2026-09-18' keywords: - Android Gradle Plugin 9 - AGP 9 - AGP Upgrade - AGP Migration - New AGP DSL - Migrate to built-in Kotlin --- ## Migration guide See the [AGP 9 migration guide](references/android/build/releases/agp-9-0-0-release-notes.md) for the major changes, many breaking, in AGP 9 compared to AGP 8. ## Requirements If the user requests to update or migrate to AGP 9, first check the AGP version used in the project. If it is lower than 9, stop and ask the user to run the AGP Upgrade Assistant in Android Studio to update to the latest stable version of AGP, and confirm when done. The user may also request that this requirement be skipped; if this is the case, you should update the version of AGP to the latest stable version as part of the AGP 9 migration. See the [AGP 9 migration guide](references/android/build/releases/agp-9-0-0-release-notes.md) for how to do this. Each version of AGP has its own set of compatibilities with other tools, such as Gradle, JDK, and Kotlin. The release notes for each of these versions will include a **Compatibility** table indicating the minimum versions for these tools. Do not use this skill for KMP projects, as they are unsupported. ## Steps If AGP is already at 9 or higher, then do the following: ### Step 1: Update dependencies If KSP (`com.google.devtools.ksp`) is used in the project, ensure it is on version 2.3.6 or higher. If Hilt is used in the project, ensure it is on version 2.59.2 or higher. ### Step 2: Migrate to built-in Kotlin See [the guide](references/android/build/migrate-to-built-in-kotlin.md) for detailed information. ### Step 3. Migrate to the new AGP DSL See [the guide](references/android/build/releases/agp-9-0-0-release-notes.md) for detailed information. See also [gradle-recipes](references/recipes.md) for examples on how to migrate old code to code that is compatible with AGP 9 and the new DSL. ### Step 4. Migrate kapt to KSP or legacy-kapt If KSP (`com.google.devtools.ksp`) or kapt (`org.jetbrains.kotlin.kapt`) are used in the project, see [KSP, kapt, and legacy-kapt](references/ksp-kapt.md) for detailed migration steps. ### Step 5. BuildConfig If any Android module contains custom BuildConfig fields, see [BuildConfig](references/buildconfig.md) for detailed information. ### Step 6. Update gradle.properties After the migration, check gradle.properties. Remove the following flags: 1. android.builtInKotlin 2. android.newDsl 3. android.uniquePackageNames 4. android.enableAppCompileTimeRClass Additionally, delete all temporary files you've created. ## Guidelines - Never write or run python scripts. - Only search the Gradle dependency cache when inspecting external dependencies, and only as a last resort. - Never add `android.disallowKotlinSourceSets=false` to `gradle.properties`. - When verifying changes, don't run the `clean` task. This is a waste of time. ## Verification After migration, verify the following: 1. Gradle IDE sync succeeds. 2. `./gradlew help` succeeds. 3. `./gradlew build --dry-run` succeeds. ## Troubleshooting Paparazzi v2.0.0-alpha04 and lower versions have issues with AGP 9. See [references/paparazzi-gradle-9.md](references/paparazzi-gradle-9.md) for details.
© Google LLC · Apache-2.0 · android/skills