ktlint
Installation
SKILL.md
Ktlint
Use this skill to format and lint Kotlin code with ktlint, and to set up or maintain ktlint tooling in a project.
Quick start
- Detect how the project runs ktlint (Gradle tasks vs CLI).
- Run ktlint check or format on the target paths.
- Fix or configure rules via existing project config (usually
.editorconfig).
Determine the integration
- Prefer existing build tasks: look for
ktlintCheck/ktlintFormat(or custom ktlint tasks) in Gradle. - If there are no build tasks, fall back to the
ktlintCLI if it is installed. - Before changing setup, search for existing config and automation:
.editorconfigand anyktlintsectionsbuild.gradle/build.gradle.kts- CI files (GitHub Actions, GitLab CI, etc.)
- pre-commit hooks