AGENT SKILL
kotlin-tooling
Standards for Gradle Kotlin DSL, Version Catalogs, and MockK for Kotlin projects. Use when configuring build.gradle.kts, setting up libs.versions.toml, adding MockK for tests, or choosing between Kotlin-compatible test assertion libraries. (triggers: build.gradle.kts, libs.versions.toml, detekt.yml, mockk, kts, version catalog, kotest)
- License 许可
- MIT
- 最近更新
- 2026-06-24
- Stars
- ★ 67
- Forks
- 24
01 前言 Front Matter
- name
- kotlin-tooling
- description
- Standards for Gradle Kotlin DSL, Version Catalogs, and MockK for Kotlin projects. Use when configuring build.gradle.kts, setting up libs.versions.toml, adding MockK for tests, or choosing between Kotlin-compatible test assertion libraries. (triggers: build.gradle.kts, libs.versions.toml, detekt.yml, mockk, kts, version catalog, kotest)
03 SKILL.md 正文
Kotlin Tooling Standards
Priority: P2 (RECOMMENDED)
Consistent build and quality verification tools.
Implementation Guidelines
- Gradle DSL: Use Kotlin DSL (
build.gradle.kts) exclusively — type safety and better IDE support. - Version Management: Use Version Catalogs (
libs.versions.toml). - Linter: Use Ktlint for formatting and Detekt for complexity/code-smell analysis.
- Testing: Use MockK for mocking (first-class Kotlin support). Use JUnit 5.
- Assertions: Use Truth or Kotest Assertions for fluent, readable test output.
Anti-Patterns
- No Groovy Gradle: Use Kotlin DSL (build.gradle.kts) exclusively; avoid legacy build.gradle.
- No Mockito in Kotlin:
when/thenconflicts with Kotlinwhen; use MockK (every/verify). - No Hardcoded Versions: Manage all versions in libs.versions.toml; never inline in build files.