Kotlin Code Quality

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Run whichever Kotlin static-analysis tools a JVM project actually has wired — detekt and ktlint — and report every issue they find (file, line, rule id, severity, message), grouped by tool. This is a report-only skill: it never fixes issues and never adds or changes detekt, ktlint or Spotless configuration.

Purpose

iru-kotlin-code-quality gives plain Kotlin libraries, Kotlin Spring Boot services and Kotlin Quarkus services a single lint pass on Maven or Gradle (Kotlin DSL or Groovy, wrapper preferred, multi-module aware). It verifies each tool is genuinely wired before trusting a "zero issues" result, runs the wired tasks, then parses the generated reports (detekt Checkstyle-format XML or SARIF, ktlint checkstyle or plain reporter output, Spotless console output) instead of eyeballing console text. A tool that is not wired is reported as "not wired", never as a clean pass. Android modules belong to iru-android-code-quality, Kotlin Multiplatform modules to KMP Code Quality, and Java sources in a mixed Java+Kotlin module belong to iru-java-code-quality.

Plugin

Shipped by the iru-java plugin of the ai-catalog marketplace (install with /plugin install iru-java@ai-catalog; see Plugins).

Invocation

/iru-kotlin-code-quality
/iru-kotlin-code-quality <path-or-class-name>

Inputs

Argument Required Description Default

path-or-class-name

No

A file path, a class/file simple name, or a module name/path. detekt and ktlint always analyze whole modules, so a scoped run narrows the build to the owning module and filters the reported summary to the scope.

None — every module is analyzed and everything is reported.

key: value lines from a calling skill

No

Explicit values such as module: service, build: gradle, or a baseline (per-tool/per-rule counts or an itemized list from an earlier run) that replace the matching inference. With a baseline, only the new-vs-baseline diff is reported.

Inferred from the repository.

Outputs

  • A plain-text summary in the conversation — never a written file.

  • An overall total, then per tool (and per module when several ran): whether it ran or was skipped as "not wired", which config, baseline or .editorconfig governed it, the total, the severity breakdown, and one line per rule bucket (detekt rule name, ktlint ruleset:rule-id, Spotless formatting).

  • The file:line list with rule id, severity and message when the scope is smaller than the whole project.

  • Notes for skipped Android modules and for Java sources left to iru-java-code-quality.

  • With a baseline: only issues new since the baseline; a tool unwired in the baseline counts entirely as new.

  • "No Kotlin static analysis configured (detekt/ktlint not wired)" when neither tool is wired anywhere.

  • No source or configuration is modified: no ktlintFormat, spotlessApply, detekt autoCorrect or baseline creation.

Execution flow

flowchart TD A["Start /iru-kotlin-code-quality\n(optional scope)"] --> B["Step 0: Detect build tool\n(Gradle or Maven) and map scope to module"] B --> C["Skip Android and Kotlin Multiplatform\nmodules (use iru-kmp-code-quality);\nnote Java sources for iru-java-code-quality"] C --> D["Step 1: Verify detekt, ktlint,\nSpotless wiring in build files"] D --> E{"Any tool wired?"} E -- no --> F["Report 'not wired' and stop\n(no configuration added)"] E -- yes --> G["Step 2: Run each wired task\n(Gradle with --continue, or Maven goals)"] G --> H{"Build failed for an\nunrelated reason?"} H -- yes --> I["Report the failure for that tool;\ndo not read a stale report"] H -- no --> J["Step 3: Parse reports\n(Checkstyle XML, SARIF, ktlint plain,\nSpotless console)"] I --> K J --> K["Step 4: Bucket by tool, then rule id"] K --> L{"Baseline supplied?"} L -- yes --> M["Report only new-vs-baseline issues"] L -- no --> N["Report totals, severities,\nand per-rule counts"]

Dependencies

Invokes

None — iru-kotlin-code-quality is a leaf skill; it only runs detekt, ktlint and Spotless through the project’s build tool and reads their reports. It mentions iru-android-code-quality, iru-kmp-code-quality and iru-java-code-quality only as pointers for out-of-scope modules and sources.

Invoked by

None — this skill does not spawn agents itself; callers run it inside an iru-gate-runner sub-agent.

Source

SKILL.md on GitHub — the file this page was generated from.