src/main/skills/gradle_expert/SKILL.md
Provides expert build engineer guidance on Gradle Kotlin DSL scripts, plugin development, and deep internals research; use for build failures, compilation errors, dependency conflicts, or complex build authoring. Do NOT use for executing builds/tests (use `running_gradle_builds`/`running_gradle_tests`).
npx skillsauth add rnett/gradle-mcp gradle_expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Provides authoritative guidance and automation for creating, modifying, and auditing Gradle build logic. Integrates official documentation, best practices, and deep-dive source research into a unified workflow for build logic maintenance.
.kts) unless the project explicitly uses Groovy.register instead of create) to maintain configuration performance.libs.versions.toml for dependency management if it exists.gradle_docs for authoritative documentation lookup instead of generic web searches.search_dependency_sources with gradleSource = true when researching core Gradle behavior.search_dependency_sources with sourceSetPath = ":buildscript" when researching plugin (buildscript) source code. This targets the virtual buildscript source set which aggregates all classpath plugins.query_build with kind="TESTS" and query="FullTestName" for individual test output instead of generic taskPath, captureTaskOutput, or shell grep.?.url?.toString()) and provide fallback values when accessing ArtifactRepository URLs in Gradle init scripts or plugins to prevent NullPointerException.query_build for all failure diagnostics. It is more token-efficient than reading raw console logs and provides structured access to failures, stack traces, and problems.query_buildAs a Senior Build Engineer, you must move beyond raw logs. The query_build tool is your surgical diagnostic suite.
Start with a summary to find IDs for specific failures or problems.
query_build(buildId="ID")CRITICAL: NEVER use taskPath or shell grep for tests. ALWAYS use kind="TESTS" with query="FullTestName" to see the full output and stack trace.
query_build(buildId="ID", kind="TESTS", query="com.example.MyTest.shouldWork")For compilation or configuration errors, use kind="FAILURES" with query="ID" found in the build summary.
query_build(buildId="ID", kind="FAILURES", query="F0")For deep-dives into specific problems (e.g., deprecations, plugin issues), use kind="PROBLEMS" with query="ID".
query_build(buildId="ID", kind="PROBLEMS", query="P1")gradle_docs and internal source search to understand "how it works" at the engine level. Use read_dependency_sources to explore implementation details. To search a plugin, use sourceSetPath=":buildscript".query_build with kind="TESTS" and query="FullTestName" to analyze test failures and stack traces instead of reading raw console logs. DO NOT use taskPath or captureTaskOutput for tests.inspect_dependencies and managing_gradle_dependencies for auditing and updates.
excludeBuildscript: false to include them in reports.sourceSetPath = ":buildscript" (or :app:buildscript) to precisely audit the plugin classpath. This aggregates all buildscript { ... } configurations.gradle_docs with tag:best-practices to retrieve the latest and most comprehensive
guidelines from the official documentation.envSource: SHELL if environment variables are missing: If Gradle fails to find expected environment variables (e.g., JAVA_HOME or specific JDKs), it may be because the host process started before the shell environment was
fully loaded. Set invocationArguments: { envSource: "SHELL" } to force a new shell process to query the environment.gradle tool with commandLine: ["projects"] or the introspecting_gradle_projects skill to find the correct parent path.run_shell_command with mkdir subproject/src/main/kotlin (or equivalent).settings.gradle.kts: Use replace or write_file to append include(":<module-name>").build.gradle.kts: Use idiomatic patterns (e.g., applying convention plugins).gradle tool with commandLine: [":<module-name>:tasks"] to ensure it's correctly integrated.lookup_maven_versions tool to find the artifact.libs.versions.toml: Add the dependency coordinates to the catalog.build.gradle.kts: Use the type-safe accessor from the catalog.inspect_dependencies(fresh: true) to check resolution.inspect_dependencies(sourceSetPath = ":buildscript").gradle tool with commandLine: ["help", "--configuration-cache"].Property, Provider) or using @Internal/@Input correctly.Tool: lookup_maven_versions
{
"coordinates": "com.google.guava:guava"
}
// Reasoning: Searching Maven Central for the exact coordinates and latest version.
Tool: run_shell_command
{
"command": "New-Item -ItemType Directory -Force -Path subproject/src/main/kotlin"
}
// Reasoning: Creating the standard directory structure for a Kotlin JVM project using correct PowerShell syntax.
Tool: search_dependency_sources
{
"query": "Property",
"searchType": "DECLARATION",
"gradleSource": true
}
tools
Provides authoritative guidance for ALL Gradle operations: executing builds, running tests with surgical filtering, introspecting project structure, creating modules, and diagnosing failures; ALWAYS use instead of raw shell `./gradlew` for build execution, test runs, task introspection, module creation, performance audits, and documentation research. Do NOT use for dependency graph auditing/updates (use `managing_gradle_dependencies`) or dependency/plugin/Gradle source exploration (use `exploring_dependency_sources`).
tools
Reads and searches source code across ALL scopes: external library dependencies, plugins (buildscript), and Gradle Build Tool internal source code; use whenever you need to UNDERSTAND an API — its shape, signature, parameters, overloads, or implementation — before writing any code that calls it; covers project dependencies (via project/configuration/source set scope), plugins (via `sourceSetPath=":buildscript"`), and Gradle internals (via `gradleSource: true`). Prefer this over the REPL for all API research; reading source is instantaneous and complete. Do NOT use for project source code (use grep/tilth), Gradle documentation (use `gradle_docs` via the `gradle` skill), or Maven Central discovery (use `managing_gradle_dependencies`).
development
Audits and manages Gradle dependency graphs with high-resolution update checks, transitive tree analysis, and Maven Central discovery; use for dependency auditing, finding stable updates, and resolving GAV coordinates. Do NOT use for exploring dependency source code (use `exploring_dependency_sources`) or running builds/tests (use `gradle`).
development
Executes Kotlin code interactively within the project's full JVM classpath. Use when you need to RUN code: verify runtime behavior, experiment with logic, or render Compose UI previews. Do NOT use to understand an API's shape or signature — read its source with `exploring_dependency_sources` instead.