| name | kt |
| description | Build, test, analyze, or start Docker for a Kotlin project Use when this capability is needed. |
| metadata | {"author":"ajvelo"} |
Kotlin build / test / analyze / docker
Arguments: $ARGUMENTS
Project paths & JDK
Resolve project paths from ~/.claude/project-repos.json. A Kotlin project
is any registry entry whose root contains build.gradle or build.gradle.kts.
JDK version is per-project and should be declared in the project's
projects/{shortname}.md. Set it before invoking Gradle:
export JAVA_HOME=$(/usr/libexec/java_home -v {version})
Actions
build
cd {repo-path} && ./gradlew build -x test
cd {repo-path} && ./gradlew :{module}:build -x test
On failure, suggest ./gradlew --refresh-dependencies for dependency
errors. For compilation errors, quote the file/line and the offending type.
test
cd {repo-path} && ./gradlew test
cd {repo-path} && ./gradlew :{module}:test
cd {repo-path} && ./gradlew test --tests "{filter}"
cd {repo-path} && ./gradlew :{module}:test --tests "{filter}"
If the project uses TestContainers, ensure Docker is running first.
Report: total / passed / failed / skipped. For failures, show class,
method, assertion error, and the first few lines of stack trace.
analyze
Detekt (common):
cd {repo-path} && ./gradlew detekt
cd {repo-path} && ./gradlew :{module}:detekt
cd {repo-path} && ./gradlew detekt --auto-correct
ktlint (alternative):
cd {repo-path} && ./gradlew ktlintCheck
cd {repo-path} && ./gradlew ktlintFormat
Report issues with: rule name, file:line, message, severity.
docker
Starts the project's docker-compose.yml services (Postgres, Redis, any
stub/mock servers):
cd {repo-path} && docker compose up -d
cd {repo-path} && docker compose up -d {service}
After start, wait ~5s and check health:
docker compose -f {repo-path}/docker-compose.yml ps
If any container is unhealthy:
docker compose logs --tail=20 {service}
Common fixes:
- Port conflict:
docker ps to find the claimant
- Stale volumes:
docker compose down -v && docker compose up -d
Process
- Parse arguments: action, shortname, optional module/filter/flags
- Set JDK (skip for
docker)
cd to the resolved project path
- Run the command
- Report result
Source: ajvelo/claude-toolkit — distributed by TomeVault.