android-gradle-architecture-pro
Skill8 starsChanged 12 days agoMITView on GitHub
Reviews multi-module Android Gradle builds against the Now in Android convention-plugin pattern — `build-logic/convention/` factoring, version-catalog discipline, AGP/Kotlin/Compose-compiler co-versioning, KSP over kapt. Use when reading, writing, or reviewing Gradle build files in non-trivial Android projects.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- android-accessibility-proSkill
- android-adaptive-layout-proSkill
- android-compose-proSkill
- android-coroutines-proSkill
- android-design-system-proSkill
- android-library-proSkill
- android-memory-storage-proSkill
- android-modularization-proSkill
- app-intents-proSkill
- beta-deployment-proSkill
- coredata-swift6-proSkill
- cross-platform-parity-proSkill
- flaky-tests-proSkill
- foundation-models-proSkill
- instruments-profiling-proSkill
- linting-proSkill
- localization-proSkill
- motion-design-proSkill
- r8-shrink-proSkill
- store-compliance-proSkill
- swift-accessibility-proSkill
- swift-adaptive-layout-proSkill
- swift-concurrency-proSkill
- swiftdata-proSkill
- swift-design-system-proSkill
- swift-docc-proSkill
- swift-error-handling-proSkill
- swift-library-proSkill
- swift-logging-proSkill
- swift-memory-storage-proSkill
- swift-modularization-proSkill
- swift-package-proSkill
- swift-testing-proSkill
- swiftui-proSkill
- visionos-proSkill
- xcode-security-proSkill
- xml-to-compose-migration-proSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Check the convention-plugin factoring using references/convention-plugins.md — is repeated config extracted?
- Very specific: line 19
Check AGP / Kotlin / Compose-compiler co-versioning using references/agp-versioning.md.
- Very specific: line 20
Verify KSP is used over kapt for all supported annotation processors using references/ksp-over-kapt.md.
- Very specific: line 21
Check build-script mechanics (DSL, catalog use, toolchain, api vs implementation, publishing, committed files) using …
- Distinctive: line 23
If doing a partial review, load only the relevant reference files.
- Very specific: line 27
Now in Android is the reference: When in doubt, check what NiA does.
- Very specific: line 29
Version catalogs are the single source of truth: Every version literal in a build.gradle.kts is a regression — there's always a [versions] …
- Very specific: line 86
Architecture (high): No convention plugins; three :feature:* modules duplicate android {} configuration.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Review Android Gradle build configuration for adherence to modern multi-module conventions. The reference pattern is Now in Android (NiA) — Google's official reference app — which factors all repeated android { ... } and dependency declarations into convention plugins under build-logic/convention/. Report only genuine problems; don't nitpick.
Review process:
- Inventory the build-file landscape using
references/inventory.md— which files exist, what each is responsible for. - Check the convention-plugin factoring using
references/convention-plugins.md— is repeated config extracted? Where does it live? - Validate version-catalog discipline using
references/version-catalogs.md— no inlineimplementation("group:artifact:version")strings, no hardcoded versions inbuild.gradle.kts. - Validate the multi-module graph using
references/multi-module-graph.md—:app+:feature:*+:data:*+:core:*shape, dependency direction. - Check AGP / Kotlin / Compose-compiler co-versioning using
references/agp-versioning.md. - Verify KSP is used over kapt for all supported annotation processors using
references/ksp-over-kapt.md. - Check build-script mechanics (DSL, catalog use, toolchain,
apivsimplementation, publishing, committed files) usingreferences/build-script-conventions.md.
If doing a partial review, load only the relevant reference files.
Core Instructions
- Now in Android is the reference. When in doubt, check what NiA does. Their convention plugins under
build-logic/convention/are the canonical examples. - Convention plugins are non-negotiable past 3 modules. Once you have a
:feature:home,:feature:settings,:feature:profile, the third repeatedandroid { compileSdk = 34; defaultConfig { minSdk = 26; ... } }block is a smell. Factor. - Version catalogs are the single source of truth. Every version literal in a
build.gradle.ktsis a regression — there's always a[versions]entry it should reference. - AGP version is grounded in AGP 8.x for this skill. AGP 9 specifics are unverified; if the project uses AGP 9, defer to the actual release notes rather than this skill's guidance.
- Don't suggest applying convention plugins where they're not warranted. A single-module app doesn't need
build-logic/convention/. Convention plugins are a multi-module concern. - Don't introduce
buildSrc/for new code. Thebuild-logic/composite-build pattern supersededbuildSrcbecause the latter invalidates Gradle's cache more aggressively. NiA usesbuild-logic; new projects should too.
Output Format
Organize findings by file. For each issue:
- State the file and relevant line(s).
- Name the rule being violated.
- Show a brief before/after.
Skip files with no issues. End with a prioritized summary.
Example output:
feature/home/build.gradle.kts
Line 12: Repeated android { } block — extract to a convention plugin.
// Before
android {
namespace = "com.kozinga.feature.home"
compileSdk = 34
defaultConfig { minSdk = 26 }
buildFeatures { compose = true }
}
// After
plugins {
alias(libs.plugins.kozinga.android.feature)
alias(libs.plugins.kozinga.android.library.compose)
}
android {
namespace = "com.kozinga.feature.home"
}Line 28: Inline dependency string — use the version catalog.
// Before
implementation("androidx.core:core-ktx:1.15.0")
// After
implementation(libs.androidx.core.ktx)build-logic/convention/build.gradle.kts (missing)
No build-logic/ convention-plugin module — three feature modules repeat the same android {} block. Create build-logic/convention/ and factor AndroidFeatureConventionPlugin.
Summary
- Architecture (high): No convention plugins; three
:feature:*modules duplicateandroid {}configuration. - Catalog discipline (medium): Four inline dependency strings across
feature/home/build.gradle.ktsandfeature/settings/build.gradle.kts— migrate tolibs.versions.toml. - kapt → KSP (low):
kaptfor Hilt — switch toksp(libs.hilt.compiler)for faster builds.
End of example.
References
references/inventory.md— what every Android Gradle file is responsible for (settings.gradle.kts, rootbuild.gradle.kts, modulebuild.gradle.kts,libs.versions.toml,gradle.properties,build-logic/).references/convention-plugins.md— how to author a convention plugin inbuild-logic/convention/, the NiA factoring (AndroidApplicationConventionPlugin,AndroidLibraryConventionPlugin,AndroidComposeConventionPlugin,AndroidFeatureConventionPlugin,AndroidHiltConventionPlugin,AndroidApplicationJacocoConventionPlugin).references/version-catalogs.md—libs.versions.tomldepth,[bundles], plugin entries, migration patterns from inline strings.references/multi-module-graph.md—:app+:feature:*+:data:*+:core:*shape, dependency direction, how features avoid depending on each other.references/agp-versioning.md— AGP/Kotlin/Compose-compiler version matrix (AGP 8.x), the Kotlin 2.0+ Compose plugin model, common upgrade pitfalls.references/ksp-over-kapt.md— KSP-first stance for Hilt / Room / Moshi / Glide, what migration looks like, what still requires kapt.references/build-script-conventions.md— Full build-script conventions: Kotlin DSL, catalog migration, plugin stack, SDK levels,jvmToolchain,apivsimplementation, composite builds, library modules, Maven publishing, wrapper and lockfiles.
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.

