kotlin/gradle_expert
> 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`) or dependency graph auditing.
npx skills add https://github.com/Kotlin/kotlinx-rpc --skill gradle_expert
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.inspect_build with testName and mode="details" 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.inspect_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.inspect_buildAs a Senior Build Engineer, you must move beyond raw logs. The inspect_build tool is your surgical diagnostic suite.
Start with a summary to find IDs for specific failures or problems.
inspect_build(buildId="ID")CRITICAL: NEVER use taskPath or shell grep for tests. ALWAYS use testName with mode="details" to see the full output and stack trace.
inspect_build(buildId="ID", mode="details", testName="com.example.MyTest.shouldWork")For compilation or configuration errors, use failureId found in the build summary.
inspect_build(buildId="ID", mode="details", failureId="F0")For deep-dives into specific problems (e.g., deprecations, plugin issues), use problemId.
inspect_build(buildId="ID", mode="details", problemId="P1")gradle_docs and internal source search to understand "how it works" at the engine level. Use read_dependency_sources to explore implementation details.inspect_build with testName and mode="details" 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.gradle_docs with tag:best-practices to retrieve the latest and most comprehensiveguidelines 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 wasfully 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.gradle tool with commandLine: ["dependencies"] to check resolution.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
}
Take kotlin/gradle_expert from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.