Android Code Quality

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

Run whichever static-analysis tools an Android/Kotlin module actually has wired — Android Lint (always available via AGP), Detekt (only when its plugin is applied), and ktlint (only when wired, either through Spotless’s spotlessCheck or the standalone org.jlleitschuh.gradle.ktlint plugin) — then read each tool’s generated report to summarize every issue found, grouped by tool and classified by id/severity. This is a read-only reporting skill: it runs static analysis and reports results, it does not fix issues or modify lint/Detekt/Spotless configuration unless asked to as an explicit follow-up.

Purpose

iru-android-code-quality gives a lint/static-analysis pass called out separately from iru-android-test/ iru-android-coverage, without trusting console output alone. Before running anything it verifies each tool is actually wired (plugin applied, config file present) so a "zero issues" result from a tool that was never configured is never reported as a clean pass — an absent tool is explicitly called "not wired" instead of being silently omitted or misreported as passing. It parses each tool’s own generated report (Lint’s XML, Detekt’s Checkstyle-format XML or SARIF, Spotless’s console output, ktlint’s text/XML report) directly rather than relying on the Gradle console, and can scope its summary to a single file/class even though none of these tools expose a per-file CLI selector — the underlying Gradle run always analyzes the whole module.

Kotlin Multiplatform projects are out of scope: when the Kotlin Multiplatform plugin is applied anywhere in the build (a KMP app’s Android host module included), the skill stops and hands the request to KMP Code Quality instead.

Plugin

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

Invocation

/iru-android-code-quality
/iru-android-code-quality <scope>

Inputs

Argument Required Description Default

scope

No

A file/class name or path used to filter the reported summary — Lint, Detekt, and Spotless/ktlint all analyze the whole module in one Gradle invocation (none exposes a per-file CLI selector), so a scoped invocation still runs everything and only filters which parsed entries are shown. Also used to infer which module (:lib or :app) to target, the same way iru-android-test/iru-android-coverage do.

None — reports every issue project-wide.

module

No

An explicit module: <lib|app> key/value line passed by a calling skill, honored instead of inferring the module from scope.

lib

baseline

No

A prior run’s per-tool/per-id issue counts or itemized list, passed by a calling skill (e.g. iru-android-code-one-task-group). When given, the report is limited to the new-vs-baseline diff.

None — reports the full current result.

Outputs

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

  • For Android Lint, an Accessibility line — the count and ids of category="Accessibility" issues (ContentDescription, ClickableViewAccessibility, LabelFor, …​) or "0 accessibility issues" — even when zero, so a UI change’s accessibility lint result is always visible (see Building user interfaces).

  • Findings grouped by tool (Android Lint, Detekt, ktlint/Spotless), then by id/rule, with a severity breakdown per tool (Lint: Fatal/Error/Warning/Informational; Detekt/ktlint: error/warning; Spotless: a single formatting bucket).

  • An overall total and a per-tool total; a tool that isn’t wired is called out as "not wired" rather than omitted or shown as a false "0 issues" pass.

  • When a baseline was supplied, only the new-vs-baseline issues (increased counts, newly appearing ids/entries).

  • No source, Lint, Detekt, Spotless, or ktlint configuration is ever modified.

Execution flow

flowchart TD A["Start /iru-android-code-quality\n(optional scope, module:, baseline)"] --> B["Resolve module (:lib default or :app)\nand scope from inputs"] A -. "KMP plugin applied" .-> KMP["Stop: hand off to iru-kmp-code-quality"] B --> C["Verify which tools are wired:\nLint (always), Detekt (plugin applied?),\nktlint (Spotless spotlessCheck or\nstandalone ktlintCheck?)"] C --> D["Run each wired tool via Gradle\n(lintDebug, detekt, spotlessCheck/ktlintCheck)"] D --> E{"Underlying compile step\nfailed outright?"} E -- yes --> F["Report failure for that tool, stop\n(report wasn't regenerated)"] E -- no --> G["Parse lint-results-debug.xml\n(keep each issue's category;\nreport an Accessibility line)"] G --> H["Parse detekt.xml or detekt.sarif\n(if Detekt wired)"] H --> I["Parse Spotless console output or\nktlint text/XML report (if wired)"] I --> J{"Scope given?"} J -- yes --> K["Filter each tool's parsed entries\nto the matching file/class"] J -- no --> L["Keep full module-wide results"] K --> M L --> M["Classify by tool, then by id/rule\nand severity"] M --> N{"Baseline supplied?"} N -- yes --> O["Diff against baseline;\nreport only new/increased issues"] N -- no --> P["Report full current totals,\nseverity breakdown, per-id counts"]

Dependencies

Invokes

None — iru-android-code-quality is a leaf skill; it only runs Gradle tasks and reads the generated Lint/Detekt/ Spotless/ktlint reports, it does not call any other skill in this catalog.

It stops and redirects Kotlin Multiplatform projects to KMP Code Quality (a hand-off, not an invocation).

Invoked by

  • Code — Step 3 and 7, quality baseline and comparison for Android plans, via the iru-gate-runner agent.

  • Android Code One Task Group — Steps 1 and 3.6, once per task group’s bucket, via the iru-gate-runner agent, to capture a pre-change baseline covering every class the bucket touches and later diff the post-change result against it.

  • React Native Code One Task Group — Step 1 and 3, only when the app’s android/ directory can be targeted as the Gradle root (otherwise it runs Android Lint directly), via the iru-gate-runner agent, for the baseline and the post-change comparison.

  • iru-gate-runner — both callers above always invoke this skill from inside a iru-gate-runner sub-agent they spawn, not inline.

Source

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