detekt

Configure and enforce Kotlin static analysis with detekt in Gradle projects.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/ClankerGuru/opsx --skill detekt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detekt
Source: https://github.com/ClankerGuru/opsx/tree/main/cli/src/main/resources/content/skills/detekt
Command: npx skills add https://github.com/ClankerGuru/opsx --skill detekt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps configure, run, and extend Kotlin detekt static analysis within Gradle-enabled projects, enabling consistent code quality checks.

Core Features & Use Cases

  • Detekt plugin setup for Kotlin projects (JVM, Android, or multiplatform)
  • Configuration of tool versions, source sets, and reports (HTML, SARIF, XML/Checkstyle)
  • Baseline and suppression management, and extensibility via custom rule sets

Quick Start

Install the detekt plugin in your Gradle project, provide a config file, and run the detekt task to start scanning.

Frequently Asked Questions about detekt

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Kotlin static analysis with detekt in a Gradle project?

To configure Kotlin static analysis with detekt, install the Gradle plugin, provide a config file for rule sets, and run the detekt task to scan your Kotlin source sets. It supports JVM, Android, and multiplatform environments.

What is a detekt baseline and when do I need it for Kotlin code quality?

A detekt baseline captures existing static analysis violations to prevent new code quality issues from surfacing in legacy code. You need it when introducing static analysis to an established Kotlin project without fixing all prior warnings immediately.

Can I use detekt for Kotlin multiplatform and Android projects?

Yes, detekt supports Kotlin static analysis across JVM, Android, and multiplatform projects. You can configure tool versions and source sets within your Gradle build to enforce code quality rules in these environments.

What report formats does detekt generate for Kotlin static analysis?

Detekt generates Kotlin static analysis reports in HTML, SARIF, and XML/Checkstyle formats. You can configure these multi-format reports within your Gradle plugin setup to integrate with CI pipelines and IDE inspections.

How do I suppress detekt rules or warnings in my Kotlin code?

You can suppress detekt warnings by configuring suppression rules in your config file or using baseline management to ignore specific violations. This allows you to bypass static analysis checks for specific code segments or legacy issues.

Does detekt support custom rule sets for Kotlin static analysis?

Yes, detekt supports extensibility via custom rule sets for Kotlin static analysis. You can define and integrate custom rules alongside the standard configuration to enforce specialized code quality constraints in your Gradle build.