gradle-build

gradle-build is a command for Claude Code from Fmarzochi/EGC. It costs 11 tokens per session (607 once invoked), scanned A, a copy of gradle-build, Apache-2.0.

A command that diagnoses and fixes Gradle build and Kotlin compilation errors in Android and Kotlin Multiplatform projects. Gradle is the build system that assembles code, dependencies, and project modules.

In plain words
What is it for?
Use it to troubleshoot Android or Kotlin Multiplatform builds, missing dependencies, type errors, unresolved references, and mismatches between shared and platform-specific code.
Why use it?
It helps identify whether a failure comes from project configuration, dependencies, or Kotlin code, then works through the errors in a useful order.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it to troubleshoot Android or Kotlin Multiplatform builds, missing dependencies, type errors, unresolved references, and mismatches between shared and platform-specific code.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/fmarzochi/egc/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/Fmarzochi/EGC

Made for: Claude Code.

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/fmarzochi/egc/gradle-build/github.svg)](https://agentmods.dev/commands/fmarzochi/egc/gradle-build)
Your own site
<a href="https://agentmods.dev/commands/fmarzochi/egc/gradle-build"><img src="https://agentmods.dev/badge/commands/fmarzochi/egc/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/fmarzochi/egc/gradle-build"><img src="https://agentmods.dev/badge/commands/fmarzochi/egc/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 607 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 95% copy Near-identical to another mod 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.00607
Opus 5 $0.00005 $0.00303
Sonnet 5 $0.00002 $0.00121
Haiku 4.5 $0.00001 $0.00061

Measured 7d ago against content hash 2af9668d33d6, 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 7d 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

This is a copy

95% identical to gradle-build — 17 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

commands/gradle-build.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 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 · 71 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. 7d ago First seen · 71 lines · 11 tokens per session scan A 2af9668d33d6

Subscribe to this mod's changes

gradle-build is a command published in the GitHub repository Fmarzochi/EGC (51 stars, last pushed today), licensed Apache-2.0. It adds 11 tokens to every session and 607 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 95% identical to gradle-build, differing in 17 lines, and is treated as a copy.