gradle-build

gradle-build is a command for Claude Code from loulanyue/awesome-claude-notes. It costs 11 tokens per session (661 once invoked), scanned A, original, MIT.

A command for fixing Gradle build and compilation errors in Android and Kotlin Multiplatform projects. Kotlin Multiplatform lets shared Kotlin code run across multiple platforms.

In plain words
What is it for?
Use it when Android or multiplatform builds fail, Kotlin compilation breaks, dependencies are missing, or static analysis reports errors.
Why use it?
It identifies whether a failure comes from project configuration, dependencies, or source code and fixes issues incrementally.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions AGENTS.md.

Part of the awesome-claude-notes plugin — 106 skills, 61 commands, 28 agents shipped together

Good fit Use it when Android or multiplatform builds fail, Kotlin compilation breaks, dependencies are missing, or static analysis reports errors.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/loulanyue/awesome-claude-notes/gradle-build
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/loulanyue/awesome-claude-notes

Made for: Claude Code.

Or install awesome-claude-notes, the plugin that ships this one along with the rest of its 106 skills, 61 commands, 28 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gradle-build

README.md
[![agentmods](https://agentmods.dev/badge/commands/loulanyue/awesome-claude-notes/gradle-build/github.svg)](https://agentmods.dev/commands/loulanyue/awesome-claude-notes/gradle-build)
Your own site
<a href="https://agentmods.dev/commands/loulanyue/awesome-claude-notes/gradle-build"><img src="https://agentmods.dev/badge/commands/loulanyue/awesome-claude-notes/gradle-build/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gradle-build

Your own site · 80×15
<a href="https://agentmods.dev/commands/loulanyue/awesome-claude-notes/gradle-build"><img src="https://agentmods.dev/badge/commands/loulanyue/awesome-claude-notes/gradle-build.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 661 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.00661
Opus 5 $0.00005 $0.00331
Sonnet 5 $0.00002 $0.00132
Haiku 4.5 $0.00001 $0.00066

Measured 6d ago against content hash 13a131ca03ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

gradle-build scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

4 near-identical copies found in the catalogue:

commands/gradle-build.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gradle Build Fix

Incrementally fix Gradle build and compilation errors for Android and Kotlin Multiplatform projects.

Step 1: Detect Build Configuration

Identify the project type and run the appropriate build:

Indicator Build Command
build.gradle.kts + composeApp/ (KMP) ./gradlew composeApp:compileKotlinMetadata 2>&1
build.gradle.kts + app/ (Android) ./gradlew app:compileDebugKotlin 2>&1
settings.gradle.kts with modules ./gradlew assemble 2>&1
Detekt configured ./gradlew detekt 2>&1

Also check gradle.properties and local.properties for configuration.

Step 2: Parse and Group Errors

  1. Run the build command and capture output
  2. Separate Kotlin compilation errors from Gradle configuration errors
  3. Group by module and file path
  4. Sort: configuration errors first, then compilation errors by dependency order

Step 3: Fix Loop

For each error:

  1. Read the file — Full context around the error line
  2. Diagnose — Common categories:
    • Missing import or unresolved reference
    • Type mismatch or incompatible types
    • Missing dependency in build.gradle.kts
    • Expect/actual mismatch (KMP)
    • Compose compiler error
  3. Fix minimally — Smallest change that resolves the error
  4. Re-run build — Verify fix and check for new errors
  5. Continue — Move to next error

Step 4: Guardrails

Stop and ask the user if:

  • Fix introduces more errors than it resolves
  • Same error persists after 3 attempts
  • Error requires adding new dependencies or changing module structure
  • Gradle sync itself fails (configuration-phase error)
  • Error is in generated code (Room, SQLDelight, KSP)

Step 5: Summary

Report:

  • Errors fixed (module, file, description)
  • Errors remaining
  • New errors introduced (should be zero)
  • Suggested next steps

Common Gradle/KMP Fixes

Error Fix
Unresolved reference in commonMain Check if the dependency is in commonMain.dependencies {}
Expect declaration without actual Add actual implementation in each platform source set
Compose compiler version mismatch Align Kotlin and Compose compiler versions in libs.versions.toml
Duplicate class Check for conflicting dependencies with ./gradlew dependencies
KSP error Run ./gradlew kspCommonMainKotlinMetadata to regenerate
Configuration cache issue Check for non-serializable task inputs

Read the full file on GitHub · 78 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 78 lines · 11 tokens per session scan A 13a131ca03ae

Subscribe to this mod's changes

gradle-build is a command published in the GitHub repository loulanyue/awesome-claude-notes (270 stars, last pushed 7d ago), licensed MIT. It adds 11 tokens to every session and 661 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.