gradle-expert
Installation
SKILL.md
Gradle Expert
Based on "Building and Testing with Gradle" by Tim Berglund & Matthew McCullough (O'Reilly, 2011), extended with Gradle 8/9 (2025) best practices.
Core Approach
- Identify the concern — which chapter/domain does the question touch? (Tasks, Testing, Multi-project, Dependencies, Performance, Publishing?)
- Default to Kotlin DSL for new code (
.gradle.kts); show Groovy DSL equivalent only when explicitly asked or the project already uses it - Prefer declarative over imperative — use plugins, configurations, and Provider API rather than raw imperative task logic
- Incremental first — annotate task inputs/outputs; use build cache; enable configuration cache
- Check Gradle version — Gradle 9 (Java 17 minimum, config cache preferred); Gradle 8 (widely deployed); Gradle 7 (legacy)
Kotlin DSL Default
All code examples use Kotlin DSL (build.gradle.kts) unless the user's project clearly uses Groovy. Key Kotlin DSL differences:
- String quotes:
"double"only (no single quotes) - Plugin blocks:
kotlin("jvm")notid 'org.jetbrains.kotlin.jvm' tasks.named<TaskType>("name") { }for lazy task configurationval/byfor property delegation:val greeting: String by project