kotlin-build
Fix Kotlin/Gradle build errors, compiler warnings, and dependency issues incrementally. Invokes the kotlin-build-resolver agent for minimal, surgical fixes.
by jaswanthsanjay88★ 24 GitHub stars
Install kotlin-build in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
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
- Run Diagnostics: Execute
./gradlew build,detekt,ktlintCheck - Parse Errors: Group by file and sort by severity
- Fix Incrementally: One error at a time
- Verify Each Fix: Re-run build after each change
- Report Summary: Show what was fixed and what remains
When to Use
Use /kotlin-build when:
./gradlew buildfails with errors- Kotlin compiler reports errors
./gradlew detektreports 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
# 1 error remaining
```
## Fix 3: Non-Exhaustive When
File: src/main/kotlin/com/example/routes/UserRoutes.kt:58
Error: 'when' expression must be exhaustive
```kotlin
// Added missing branch
when (user.role) {
Role.ADMIN -> handleAdmin(user)
Role.USER -> handleUser(user)
Role.MODERATOR -> handleModerator(user) // Added
}
```
```bash
$ ./gradlew build
# Build successful!
```
## Final Verification
```bash
$ ./gradlew detekt
# No issues
$ ./gradlew test
# All tests passed
```
## Summary
| Metric | Count |
|--------|-------|
| Build errors fixed | 3 |
| Detekt issues fixed | 0 |
| Files modified | 2 |
| Remaining issues | 0 |
Build Status: PASS: SUCCESS
Common Errors Fixed
| Error | Typical Fix |
|---|---|
Unresolved reference: X |
Add import or dependency |
Type mismatch |
Fix type conversion or assignment |
'when' must be exhaustive |
Add missing sealed class branches |
Suspend function can only be called from coroutine |
Add suspend modifier |
Smart cast impossible |
Use local val or let |
None of the following candidates is applicable |
Fix argument types |
Could not resolve dependency |
Fix version or add repository |
Fix Strategy
- Build errors first - Code must compile
- Detekt violations second - Fix code quality issues
- ktlint warnings third - Fix formatting
- One fix at a time - Verify each change
- Minimal changes - Don't refactor, just fix
Stop Conditions
The agent will stop and report if:
- Same error persists after 3 attempts
- Fix introduces more errors
- Requires architectural changes
- Missing external dependencies
Related Commands
/kotlin-test- Run tests after build succeeds/kotlin-review- Review code qualityverification-loopskill - Full verification loop
Related
- Agent:
agents/kotlin-build-resolver.md - Skill:
skills/kotlin-patterns/
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the kotlin-build skill do?
Fix Kotlin/Gradle build errors, compiler warnings, and dependency issues incrementally. Invokes the kotlin-build-resolver agent for minimal, surgical fixes.
How do I install the kotlin-build skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the kotlin-build skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…