kotlin-build

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

A Kotlin and Gradle build-fixing workflow that diagnoses compiler errors, warnings, code-quality violations, and dependency problems one at a time.

In plain words
What is it for?
Use it when Gradle builds, Detekt, Ktlint, or dependency resolution fails, including after pulling breaking changes.
Why use it?
It narrows a broken build into smaller fixes and checks the build again after each change.

Command for Claude Code

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

Good fit Use it when Gradle builds, Detekt, Ktlint, or dependency resolution fails, including after pulling breaking changes.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/fmarzochi/egc/kotlin-build/github.svg)](https://agentmods.dev/commands/fmarzochi/egc/kotlin-build)
Your own site
<a href="https://agentmods.dev/commands/fmarzochi/egc/kotlin-build"><img src="https://agentmods.dev/badge/commands/fmarzochi/egc/kotlin-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 kotlin-build

Your own site · 80×15
<a href="https://agentmods.dev/commands/fmarzochi/egc/kotlin-build"><img src="https://agentmods.dev/badge/commands/fmarzochi/egc/kotlin-build.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,088 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 97% 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.00031 $0.01088
Opus 5 $0.00015 $0.00544
Sonnet 5 $0.00006 $0.00218
Haiku 4.5 $0.00003 $0.00109

Measured 5d ago against content hash 57b57dc65a8f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

kotlin-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 5d 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

97% identical to kotlin-build — 2 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/kotlin-build.md · 175 lines

How it starts

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

Kotlin Build and Fix

This command invokes the kotlin-build-resolver agent to incrementally fix Kotlin build errors with minimal changes.

What This Command Does

  1. Run Diagnostics: Execute ./gradlew build, detekt, ktlintCheck
  2. Parse Errors: Group by file and sort by severity
  3. Fix Incrementally: One error at a time
  4. Verify Each Fix: Re-run build after each change
  5. Report Summary: Show what was fixed and what remains

When to Use

Use /kotlin-build when:

  • ./gradlew build fails with errors
  • Kotlin compiler reports errors
  • ./gradlew detekt reports violations
  • Gradle dependency resolution fails
  • After pulling changes that break the build

Diagnostic Commands Run

# Primary build check
./gradlew build 2>&1

# Static analysis
./gradlew detekt 2>&1 || echo "detekt not configured"
./gradlew ktlintCheck 2>&1 || echo "ktlint not configured"

# Dependency issues
./gradlew dependencies --configuration runtimeClasspath 2>&1 | head -100

# Optional deep refresh when caches or dependency metadata are suspect
./gradlew build --refresh-dependencies

Example Session

User: /kotlin-build

Agent:
# Kotlin Build Resolution

## Initial Diagnostics

```bash
$ ./gradlew build
e: src/main/kotlin/com/example/service/UserService.kt:25:15 Unresolved reference: UserRepository
e: src/main/kotlin/com/example/routes/UserRoutes.kt:42:9 Type mismatch: inferred type is String but Int was expected
e: src/main/kotlin/com/example/routes/UserRoutes.kt:58:5 'when' expression must be exhaustive
```

Errors found: 3

## Fix 1: Unresolved Reference

File: src/main/kotlin/com/example/service/UserService.kt:25
Error: Unresolved reference: UserRepository
Cause: Missing import

```kotlin
// Added import
import com.example.repository.UserRepository
```

```bash
$ ./gradlew build
# 2 errors remaining
```

## Fix 2: Type Mismatch

File: src/main/kotlin/com/example/routes/UserRoutes.kt:42
Error: Type mismatch: inferred type is String but Int was expected

```kotlin
// Changed
val count = call.parameters["count"]
// To
val count = call.parameters["count"]?.toIntOrNull()
    ?: return@get call.respond(HttpStatusCode.BadRequest, "Invalid count")
```

```bash
$ ./gradlew build

Read the full file on GitHub · 175 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. 5d ago First seen · 175 lines · 31 tokens per session scan A 57b57dc65a8f

Subscribe to this mod's changes

kotlin-build is a command published in the GitHub repository Fmarzochi/EGC (49 stars, last pushed today), licensed Apache-2.0. It adds 31 tokens to every session and 1,088 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 97% identical to kotlin-build, differing in 2 lines, and is treated as a copy.