android-gradle-build
Skill3 starsChanged 7 months agoMITView on GitHub
Android build engineering skill for Gradle architecture, convention plugins, dependency management, and build performance. Use whenever users ask to optimize build time, modular build setup, or dependency strategy.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- android-engineering-skillSkill
- android-architectureSkill
- android-code-reviewSkill
- android-composeSkill
- android-debuggingSkill
- android-kotlin-concurrencySkill
- android-performanceSkill
- android-release-engineeringSkill
- android-securitySkill
- android-testingSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
If baseline metrics are missing, propose measurement-first phase before structural changes.
- Very specific: line 81
keep kapt where migration risk is high or ecosystem support is incomplete
- Distinctive: line 87
if release cadence is tight, gate risky build changes behind opt-in CI paths first
- Very specific: line 91
Use measurable gates and label each pass | at-risk | fail:
- Distinctive: line 98
If baseline build metrics are missing, run measurement-first and postpone irreversible build-graph changes.
- Distinctive: line 102
When used with other skills:
- Distinctive: line 111
avoid build optimizations that hide runtime regressions by weakening validation paths
- Distinctive: line 121
Do not represent temporary debt as steady-state architecture.
- Very specific: line 148
Use the standard payload defined in ../../AGENTS.md (section: Cross-skill handoff contract).
- Very specific: line 153
Follow global order from ../../AGENTS.md:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Purpose
Improve Android build reliability, determinism, and throughput through measurable Gradle architecture decisions and rollback-safe migrations.
Scope and authority
This skill is the lead authority for:
- build logic structure (convention plugins, build-logic topology)
- dependency and version governance
- build performance interventions and CI cache strategy
- migration sequencing for build system changes
This skill must defer when applicable:
- architecture ownership boundaries to
android-architecture - runtime performance constraints to
android-performance - production rollout gates to
android-release-engineering
When to use
- build time optimization and CI throughput issues
- multi-module Gradle structure changes
- convention plugin/build-logic migration decisions
- annotation processing strategy (KSP vs kapt) planning
- dependency governance and reproducibility hardening
Required inputs
Collect minimum evidence first:
- baseline metrics (configuration time, clean/incremental build times)
- CI topology (agents, cache behavior, matrix strategy)
- module graph shape and dependency hotspots
- plugin/version management approach
- delivery pressure and acceptable migration risk
If baseline metrics are missing, propose measurement-first phase before structural changes.
Decision engine workflow
- Baseline current build and CI behavior.
- Classify dominant bottleneck domain (configuration, task execution, dependency graph, cache reliability).
- Select intervention branch with expected impact and cost.
- Validate against architecture and release constraints.
- Define phased rollout with stop/rollback gates.
- Specify verification metrics and regression monitors.
Branching decision tree
Branch A: bottleneck classification
Configuration-heavy:- consolidate duplicated Gradle logic
- migrate reusable setup to convention plugins
Execution-heavy:- optimize hot tasks and annotation processing strategy
- reduce unnecessary task invalidation
Dependency graph-heavy:- reduce
apileakage and classpath bloat - tighten dependency exposure boundaries
- reduce
Cache instability-heavy:- fix root-cause cache misses before scaling cache infra
- enforce deterministic inputs and normalized build environments
Branch B: build logic architecture
- small module count + low duplication:
- lightweight centralization may be enough
- medium/high module count + repeated scripts:
- adopt convention plugins with explicit ownership
Branch C: annotation processing strategy
- choose
KSPwhere ecosystem support and ROI are proven - keep
kaptwhere migration risk is high or ecosystem support is incomplete - mixed mode is acceptable temporarily with migration criteria
Branch D: CI strategy
- prioritize reproducibility and deterministic cache keys before aggressive parallelization
- if release cadence is tight, gate risky build changes behind opt-in CI paths first
Quantitative gates
Use measurable gates and label each pass | at-risk | fail:
- configuration-time regression budget gate
- clean-build-time regression budget gate
- incremental-build-time regression budget gate
- cache-effectiveness gate (hit-rate and determinism trend)
If baseline build metrics are missing, run measurement-first and postpone irreversible build-graph changes.
Conflict handling and composition
When used with other skills:
- With
android-architecture:- reject build-driven module splits that violate ownership logic
- With
android-release-engineering:- release stability overrides aggressive build tuning near launch windows
- With
android-testing:- preserve test reliability while optimizing build pipeline
- With
android-performance:- avoid build optimizations that hide runtime regressions by weakening validation paths
Real-world tradeoff guidance
Accept justified non-ideal choices when explicit:
- temporary duplicated scripts may remain during phased plugin migration
- partial cache adoption is acceptable if deterministic misses are still being stabilized
- delaying deep dependency cleanup may be valid under strict deadlines if guardrails are defined
Do not represent temporary debt as steady-state architecture.
Anti-pattern detection
- repeated Gradle snippets with no central ownership
- pervasive
apidependencies increasing classpath and recompilation scope - unpinned plugin/dependency versions
- caching strategy treated as infra-only instead of input-determinism problem
- optimization proposals without baseline and post-change evidence
Uncertainty protocol
Always report confidence:
High(>= 0.80)Medium(0.60-0.79)Low(< 0.60)
For medium/low confidence:
- state assumptions and missing metrics
- provide at least one lower-risk alternative
- request the minimum additional measurements needed
- escalate to
android-release-engineeringfor near-release risk conflicts
Cross-skill handoff payload
Use the standard payload defined in ../../AGENTS.md (section: Cross-skill handoff contract).
Set requesting_skill to android-gradle-build.
Output contract
Follow global order from ../../AGENTS.md:
Context and constraintsDecision and rationaleAlternatives consideredTradeoffsRisks and mitigationsConfidence and unknownsCross-skill impactsNext implementation steps
Include build-specific artifacts:
Current build pain pointsProposed build layoutDependency/version strategyPerformance interventionsCI/cache strategyMigration plan with rollback gates
Related resources
references/build-optimization-checklist.mdreferences/quantitative-gates.md
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.

