gradle
Skill15 starsChanged 9 months agoMITView on GitHub
Gradle build system for Android AI agents. Use this skill whenever configuring Gradle, managing dependencies with Version Catalog, Gradle Kotlin DSL, Convention Plugins, composite builds, build variants, product flavors, build types, signing configs, Gradle properties, build optimization, configuration cache, parallel execution, dependency conflicts, version resolution, kapt vs KSP migration, buildSrc vs includeBuild, or any Gradle build issue. Triggers on: build.gradle.kts, libs.versions.toml, Gradle error, dependency, plugin, flavor, buildType, convention plugin, build speed.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- OmicoDev/skillstheir own version, first seen Aug 31, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- OmicoDev/skills★ 9same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibilitySkill
- adaptive-uiSkill
- android-architectureSkill
- android-setupSkill
- android-testingSkill
- biometricsSkill
- ci-cd-androidSkill
- compose-animationSkill
- compose-navigationSkill
- compose-uiSkill
- datastoreSkill
- design-systemSkill
- design-tokensSkill
- firebaseSkill
- hilt-diSkill
- kotlin-patternsSkill
- material3Skill
- notificationsSkill
- offline-firstSkill
- performanceSkill
- permissionsSkill
- play-store-releaseSkill
- retrofitSkill
- room-databaseSkill
- securitySkill
- supabase-androidSkill
The file
Files
Gradle Build System
Rule 1: Version Catalog is the only place for versions
# gradle/libs.versions.toml — single source of truth
[versions]
agp = "8.5.2"
kotlin = "2.0.21"
ksp = "2.0.21-1.0.25"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }// ✅ Use catalog aliases everywhere — never hardcode versions
implementation(libs.androidx.core.ktx)
plugins { alias(libs.plugins.android.application) }
// ❌ Hardcoded versions anywhere in build files
implementation("androidx.core:core-ktx:1.13.1")Rule 2: Convention Plugins for multi-module consistency
// buildSrc/src/main/kotlin/AndroidLibraryConventionPlugin.kt
class AndroidLibraryConventionPlugin : Plugin<Project> {
override fun apply(target: Project) = with(target) {
pluginManager.apply("com.android.library")
pluginManager.apply("org.jetbrains.kotlin.android")
extensions.configure<LibraryExtension> {
compileSdk = 35
defaultConfig.minSdk = 24
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
}
}
// buildSrc/build.gradle.kts
plugins { `kotlin-dsl` }
dependencies {
implementation(libs.android.gradlePlugin)
implementation(libs.kotlin.gradlePlugin)
}
// Any feature module build.gradle.kts
plugins {
id("convention.android.library") // one line instead of 20
}Rule 3: Build variants for environments
// ✅ Product flavors for different environments
android {
flavorDimensions += "environment"
productFlavors {
create("dev") {
dimension = "environment"
applicationIdSuffix = ".dev"
versionNameSuffix = "-dev"
buildConfigField("String", "BASE_URL", "\"https://dev-api.myapp.com/\"")
}
create("staging") {
dimension = "environment"
applicationIdSuffix = ".staging"
versionNameSuffix = "-staging"
buildConfigField("String", "BASE_URL", "\"https://staging-api.myapp.com/\"")
}
create("prod") {
dimension = "environment"
buildConfigField("String", "BASE_URL", "\"https://api.myapp.com/\"")
}
}
}
// Results in: devDebug, devRelease, stagingDebug, stagingRelease, prodDebug, prodReleaseRule 4: Signing config
// ✅ Read signing from environment — never commit keystore or passwords
android {
signingConfigs {
create("release") {
val keystorePath = System.getenv("KEYSTORE_PATH") ?: ""
val keystorePassword = System.getenv("KEYSTORE_PASSWORD") ?: ""
val keyAlias = System.getenv("KEY_ALIAS") ?: ""
val keyPassword = System.getenv("KEY_PASSWORD") ?: ""
if (keystorePath.isNotEmpty()) {
storeFile = file(keystorePath)
storePassword = keystorePassword
this.keyAlias = keyAlias
this.keyPassword = keyPassword
}
}
}
buildTypes {
release {
signingConfig = signingConfigs.getByName("release")
}
}
}Rule 5: Build performance — always enabled
# gradle.properties
org.gradle.jvmargs=-Xmx4096m -XX:+UseParallelGC
org.gradle.configuration-cache=true
org.gradle.parallel=true
org.gradle.caching=true
android.nonTransitiveRClass=true
android.enableR8.fullMode=trueRule 6: KSP migration from kapt
// ❌ kapt — slow, requires Java stub generation
plugins { id("kotlin-kapt") }
kapt(libs.hilt.compiler)
kapt(libs.room.compiler)
// ✅ KSP — 2-3× faster, Kotlin-native
plugins { alias(libs.plugins.ksp) }
ksp(libs.hilt.compiler)
ksp(libs.room.compiler)Common Mistakes
❌ Version numbers in build files — always use libs.* catalog references
❌ kapt — migrate to ksp for all annotation processors
❌ Missing org.gradle.configuration-cache=true — 30-50% slower builds
❌ Root build.gradle.kts with dependencies — root is plugins only
❌ Hardcoded signing credentials — read from environment variables
❌ No product flavors — use dev/staging/prod for env-specific config
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

