kotlin-build

kotlin-build is a command for coding agents from mturac/everything-openai-codex. It costs 31 tokens per session (1,086 once invoked), scanned A, original, MIT.

A Kotlin build-fixing command that diagnoses Gradle errors, compiler warnings, code-style problems, and dependency failures one at a time.

In plain words
What is it for?
Use it when a Kotlin or Gradle project fails to build, resolve dependencies, or pass static checks.
Why use it?
It narrows a broken build into smaller fixes and checks the build again after each change.

Command

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.

agentmods
npx agentmods add commands/mturac/everything-openai-codex/kotlin-build
Clone the repo
git clone --depth 1 https://github.com/mturac/everything-openai-codex

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/mturac/everything-openai-codex/kotlin-build.svg)](https://agentmods.dev/commands/mturac/everything-openai-codex/kotlin-build)
Your own site
<a href="https://agentmods.dev/commands/mturac/everything-openai-codex/kotlin-build"><img src="https://agentmods.dev/badge/commands/mturac/everything-openai-codex/kotlin-build.svg" alt="Measured on agentmods" 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,086 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.01086
Opus 5 $0.00015 $0.00543
Sonnet 5 $0.00006 $0.00217
Haiku 4.5 $0.00003 $0.00109

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

3 near-identical copies found in the catalogue:

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. 2d ago First seen · 175 lines · 31 tokens per session scan A 2a5ea5ae245b

Subscribe to this mod's changes

kotlin-build is a command published in the GitHub repository mturac/everything-openai-codex (89 stars, last pushed 12d ago), licensed MIT. It adds 31 tokens to every session and 1,086 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.