kotlin-build

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

A command for diagnosing and fixing Kotlin projects that use Gradle, a build tool. It checks compilation, code-quality warnings, formatting, and dependency-resolution problems one at a time.

In plain words
What is it for?
Use it when Gradle builds fail, Kotlin compiler errors appear, static checks report violations, or dependencies cannot be resolved.
Why use it?
It helps identify the cause of a broken build and verify each small fix before moving on.

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 Gradle builds fail, Kotlin compiler errors appear, static checks report violations, or dependencies cannot be resolved.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/loulanyue/awesome-claude-notes/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/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 kotlin-build

README.md
[![agentmods](https://agentmods.dev/badge/commands/loulanyue/awesome-claude-notes/kotlin-build/github.svg)](https://agentmods.dev/commands/loulanyue/awesome-claude-notes/kotlin-build)
Your own site
<a href="https://agentmods.dev/commands/loulanyue/awesome-claude-notes/kotlin-build"><img src="https://agentmods.dev/badge/commands/loulanyue/awesome-claude-notes/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/loulanyue/awesome-claude-notes/kotlin-build"><img src="https://agentmods.dev/badge/commands/loulanyue/awesome-claude-notes/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,137 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.00031 $0.01137
Opus 5 $0.00015 $0.00568
Sonnet 5 $0.00006 $0.00227
Haiku 4.5 $0.00003 $0.00114

Measured 9d ago against content hash c0b5fcca2260, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 9d 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.

commands/kotlin-build.md · 182 lines

How it starts

The opening of the file, as written. The whole thing — 182 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 · 182 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. 9d ago First seen · 182 lines · 31 tokens per session scan A c0b5fcca2260

Subscribe to this mod's changes

kotlin-build is a command published in the GitHub repository loulanyue/awesome-claude-notes (270 stars, last pushed 9d ago), licensed MIT. It adds 31 tokens to every session and 1,137 once invoked, about $0.0002 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.