Agent skill

Android Gradle Build Logic

by rcosteira79 in rcosteira79/android-skills

Sets up Android Gradle convention plugins in a build-logic composite build, including the version catalog wiring and shared configuration that are easy to get wrong.

MITAuto-check passedMobile

Install Android Gradle Build Logic

skills CLI
$ npx skills add rcosteira79/android-skills --skill android-gradle-logic -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rcosteira79/android-skills android-gradle-logic --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/android-skills/skills/android-gradle-logic .claude/skills/android-gradle-logic && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
android-gradle-logic
GitHub stars
153
Token cost
~959 tokens
SKILL.md length
369 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

Sets up Android Gradle convention plugins in a build-logic composite build, including the version catalog wiring and shared configuration that are easy to get wrong.

  • Setting up convention plugins for a multi-module Android project
  • SKILL.md covers The wiring gotcha, Applying the plugins from the…, AGP 9 Implications and Checklist
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Moving duplicated module build scripts into a build-logic composite build

What it does

The skill shows the agent how to centralize Android build configuration in reusable convention plugins inside a build-logic composite build, so each module's build.gradle.kts shrinks to a plugins block and a namespace. It points to the build-logic folder of the nowinandroid project as the worked example to start from instead of writing one from scratch.

Most of the guidance concerns wiring mistakes. The composite build has its own settings file and does not inherit the root version catalog, so the libs catalog must be declared again or the plugins fail with an unresolved reference. Plugin ids declared in the catalog must match the ones registered in build-logic. Shared settings such as compileSdk, minSdk, Compose and the JVM toolchain belong in the convention plugins, with jvmToolchain(21) given as the one-liner. A further section covers differences introduced by AGP 9.

When your agent uses it

  • Setting up convention plugins for a multi-module Android project
  • Moving duplicated module build scripts into a build-logic composite build
  • Fixing Unresolved reference: libs errors inside build-logic
  • Preparing shared Gradle configuration for AGP 9

Example prompts

  • “Set up a build-logic composite build with a convention plugin for Android libraries.”
  • “My convention plugin fails with Unresolved reference: libs, so fix the version catalog wiring.”
  • “Move compileSdk and the JVM toolchain out of each module into shared convention plugins.”

Requirements

  • An Android project built with Gradle

What it can do on your machine

Read from SKILL.md and the folder at commit 0f9af5a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin and toml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Android Gradle Build Logic loads about 959 tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 369 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~959

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rcosteira79/android-skills at commit 0f9af5a, republished under its MIT licence (© rcosteira79). 369 words, ~959 tokens.

Download SKILL.mdSave it as .claude/skills/android-gradle-logic/SKILL.md (or your agent's skills folder).
name
android-gradle-logic
description
Use when setting up or refactoring Android Gradle build logic — convention plugins, composite builds, version catalogs, and shared build configuration across modules.

Android Gradle Build Logic

Centralise build configuration in reusable Convention Plugins inside a build-logic/ composite build, so each module's build.gradle.kts collapses to plugins { alias(libs.plugins.myapp.android.library) } plus a namespace.

The canonical worked example is nowinandroid's build-logic/ — start from it rather than hand-rolling. This skill covers the wiring detail that is easy to get wrong, plus the AGP 9 deltas.

The wiring gotcha

build-logic does NOT inherit the root version catalog — recreate it. A composite build has its own settings.gradle.kts; the root libs catalog is invisible inside build-logic until you declare it. Without this the convention plugins can't reference libs.* and fail to compile with Unresolved reference: libs:

kotlin
// build-logic/settings.gradle.kts
dependencyResolutionManagement {
    versionCatalogs {
        create("libs") { from(files("../gradle/libs.versions.toml")) }
    }
}

Applying the plugins from the catalog

Declare the convention-plugin ids in [plugins] so modules can apply them by alias. The id must match the one you register(...) in build-logic — a mismatch is the usual cause of an alias that won't resolve:

toml
# gradle/libs.versions.toml
[plugins]
myapp-android-application = { id = "myapp.android.application" }
myapp-android-library     = { id = "myapp.android.library" }
myapp-android-compose     = { id = "myapp.android.compose" }

A version is not required for a locally-registered plugin — the included build supplies it, so the alias resolves whatever the catalog does or doesn't declare. nowinandroid writes version = "unspecified" explicitly, which is fine and self-documenting, just not load-bearing.

Set shared configuration — compileSdk / minSdk / Compose / the JVM toolchain — once inside the convention plugins rather than per module. For a Kotlin Android module kotlin { jvmToolchain(21) } is the idiomatic one-liner, and it sets the toolchain for both Kotlin and Java compilation:

kotlin
kotlin { jvmToolchain(21) }
Show full SKILL.md (145 more words)Show less

AGP 9 Implications

The convention plugin pattern above targets AGP 8. AGP 9 changes several things that hit build logic directly: it drops the standalone org.jetbrains.kotlin.android plugin (Kotlin is built into com.android.application / com.android.library), removes BaseExtension and the old variant APIs (applicationVariants → androidComponents { onVariants { … } }), moves kotlinOptions {} to a top-level kotlin { compilerOptions { … } }, and makes kapt incompatible (migrate to KSP). Any convention plugin that touches these needs updating.

Defer to the dedicated migration skills for the mechanics rather than duplicating the steps here: Google's agp-9-upgrade for pure-Android projects, JetBrains' kotlin-tooling-agp9-migration for KMP, and this repo's gradle-build-performance skill for the kapt → KSP step.

Checklist

  • build-logic included as a composite build (includeBuild("build-logic")) in the root settings.gradle.kts
  • build-logic/settings.gradle.kts recreates the libs catalog via from(files("../gradle/libs.versions.toml"))
  • Convention plugins register-ed with stable ids, and the [plugins] alias ids match them exactly
  • compileSdk / minSdk / Compose / JVM toolchain set once in the plugins, not per module

© rcosteira79, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/android-skills/skills/android-gradle-logic of rcosteira79/android-skills.

Open the folder on GitHubat commit 0f9af5a

Compare with similar skills

Android Gradle Build Logic next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Android Gradle Build Logic compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Android Gradle Build Logic this skillrcosteira79/android-skills153—~959Automated safety check: PassMIT
Architecture Overclocknekomangaorg/Neko2.8k—~1.4kAutomated safety check: PassApache-2.0
Architecture Renovatornekomangaorg/Neko2.8k—~1.2kAutomated safety check: PassApache-2.0
Understanding Hot Reload LimitsrosuH/EasyWatermark1.9k1 repos~2.6kAutomated safety check: PassApache-2.0
Android Developmentdpconde/claude-android-skill337—~1.7kAutomated safety check: PassMIT
Claude Android NinjaDrjacky/claude-android-ninja124—~5.2kAutomated safety check: PassApache-2.0

Similar skills

  • Architecture Overclock

    nekomangaorg/Neko

    Resolves deep, structural performance bottlenecks in the Kotlin Android codebase.

    2.8k GitHub stars~1.4k tokensUpdated yesterday
    MobileAuto-check passed
  • Architecture Renovator

    nekomangaorg/Neko

    Resolves deep architectural debt in the Kotlin Android codebase through macro-level refactoring.

    2.8k GitHub stars~1.2k tokensUpdated yesterday
    MobileAuto-check passed
  • A skill your agent uses to teach Claude exactly which Kotlin and Compose changes hot-reload under Compose HotSwan and which trigger a full incremental rebuild fallback.

    1.9k GitHub starsUsed in 1 repo~2.6k tokens
    MobileAuto-check passed
  • Android Development

    dpconde/claude-android-skill

    Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices.

    337 GitHub stars~1.7k tokensUpdated 10 mo ago
    MobileAuto-check passed
  • Claude Android Ninja

    Drjacky/claude-android-ninja

    Build and migrate Android apps with Kotlin, Jetpack Compose, MVVM, Hilt, Room 3 (KSP, SQLiteDriver, Flow/suspend DAOs), Navigation3, and multi-module Gradle.

    124 GitHub stars~5.2k tokensUpdated 10 days ago
    MobileAuto-check passed
  • Expo Brownfield Integration

    mweinbach/agent-coworker

    Helps add Expo and React Native to an existing native iOS or Android app, and choose between a prebuilt AAR or XCFramework and a fully integrated build.

    156 GitHub starsUsed in 2 repos~900 tokens
    MobileAuto-check: notes

More from rcosteira79/android-skills

All 21 skills in this repo
  • Guides writing correct, performant Compose and Compose Multiplatform UI across Android, desktop, iOS and web, from state and animation to design-to-code and crash fixes.

    153 GitHub stars~2.6k tokensUpdated 20 days ago
    Auto-check passed
  • Kotlin Multiplatform Boundaries

    rcosteira79/android-skills

    Helps choose how common Kotlin Multiplatform code reaches platform APIs: expect/actual, a common interface with platform bindings, or separate platform screens.

    153 GitHub stars~1.5k tokensUpdated 20 days ago
    Auto-check passed
  • Android Data Layer and Room in KMP

    rcosteira79/android-skills

    Sets out the repository pattern's error-propagation model for Android and Kotlin Multiplatform, plus the Room setup for commonMain.

    153 GitHub stars~1.2k tokensUpdated 20 days ago
    Auto-check passed
  • Android Debugging

    rcosteira79/android-skills

    Android and KMP debugging techniques for crashes, ANRs, memory leaks, R8 traces, Gradle failures and Compose recomposition, built on finding the root cause first.

    153 GitHub stars~2.6k tokensUpdated 20 days ago
    Auto-check passed
  • Android and KMP Baseline

    rcosteira79/android-skills

    Sets house defaults for Android and Kotlin Multiplatform work and routes to the right specialized skill for Compose, networking, testing or build tooling.

    153 GitHub stars~3k tokensUpdated 20 days ago
    Auto-check passed
  • Android Retrofit

    rcosteira79/android-skills

    A skill your agent uses when setting up or working with Retrofit in Android — service interface definitions, coroutines integration, OkHttp configuration, Hilt module setup, and error handling in…

    153 GitHub stars~942 tokensUpdated 20 days ago
    Auto-check passed

Questions about Android Gradle Build Logic

What does Android Gradle Build Logic do?

Sets up Android Gradle convention plugins in a build-logic composite build, including the version catalog wiring and shared configuration that are easy to get wrong. kts shrinks to a plugins block and a namespace. It points to the build-logic folder of the nowinandroid project as the worked example to start from instead of writing one from scratch.

When should I use Android Gradle Build Logic?

Android Gradle Build Logic fits situations like: setting up convention plugins for a multi-module Android project; moving duplicated module build scripts into a build-logic composite build; fixing Unresolved reference: libs errors inside build-logic; preparing shared Gradle configuration for AGP 9.

How do I install Android Gradle Build Logic in Claude Code?

Run `npx skills add rcosteira79/android-skills --skill android-gradle-logic -a claude-code`. Or copy the skill folder (plugins/android-skills/skills/android-gradle-logic in rcosteira79/android-skills) into .claude/skills/android-gradle-logic in your project. Claude Code loads it when a task matches its description.

How do I install Android Gradle Build Logic in Codex?

Run `npx skills add rcosteira79/android-skills --skill android-gradle-logic -a codex`. Or copy the skill folder (plugins/android-skills/skills/android-gradle-logic in rcosteira79/android-skills) into .agents/skills/android-gradle-logic in your project. Codex loads it when a task matches its description.

Can I use Android Gradle Build Logic in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rcosteira79/android-skills --skill android-gradle-logic -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/android-gradle-logic, .gemini/skills/android-gradle-logic, .github/skills/android-gradle-logic and .opencode/skills/android-gradle-logic in your project.

What does Android Gradle Build Logic need to run?

SKILL.md names no scripts, command-line tools or credentials: Android Gradle Build Logic is instructions for the agent only. Our summary lists: An Android project built with Gradle.

Does Android Gradle Build Logic access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Android Gradle Build Logic safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Android Gradle Build Logic use?

Android Gradle Build Logic is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Android Gradle Build Logic use?

About 959 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Android Gradle Build Logic?

Skills that share tags, products or a category with Android Gradle Build Logic: Architecture Overclock (nekomangaorg/Neko, 2.8k stars), Architecture Renovator (nekomangaorg/Neko, 2.8k stars), Understanding Hot Reload Limits (rosuH/EasyWatermark, 1.9k stars) and Android Development (dpconde/claude-android-skill, 337 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Android Gradle Build Logic?

rcosteira79 (a GitHub user) maintains it in rcosteira79/android-skills, which has 153 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on September 19, 2026.

Source: rcosteira79/android-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.