Setup Android App

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

Generate a complete, buildable Gradle Kotlin-DSL Android application project — wrapper, root build files, and a single app/ com.android.application module — from explicit example templates genericized line for line from a real reference repository’s Gradle toolchain.

Purpose

iru-setup-android-app bootstraps a standalone Android application’s Gradle project: the wrapper, root build.gradle.kts, settings.gradle.kts, gradle.properties, and gradle/libs.versions.toml, plus a single app/ module wired with applicationId/namespace, versionCode/versionName, build-info buildConfigField`s, an env-var-driven `signingConfigs { release {…} } block that never fails configuration when signing secrets are absent, a Compose-by-default UI (or a classic AppCompat + ViewBinding views variant), Robolectric + MockK
JUnit 4 unit-test tooling, an instrumented-test skeleton, and an optional inline sonar { properties {…} } } block. It also scaffolds UI tests per the catalog’s UI contract (see Building user interfaces): a .ui-quality.yml at the repository root, Roborazzi plus the Accessibility Test Framework on Robolectric, a shared testing/UiScreenshots.kt helper, and a sample screen test that captures .ui-screenshots/ across left-to-right/right-to-left × light/dark with the accessibility check (and, unless accessibility: none, assistive-technology attributes such as contentDescription, sp font sizes and 48dp touch targets); the sample layouts use Start/End constraints and localized string resources. It never writes a Maven Central publishing block — iru-setup-android-library is the companion skill for a library module. Every Gradle/Kotlin/plugin version is looked up at run time against the real package registries, falling back to a recorded, CI-verified combination when a lookup fails. It announces whether it is scaffolding from scratch or updating an existing Gradle project; for each file group it owns that already exists (each build file, the wrapper, the app/ skeleton, .ui-quality.yml, detekt.yml) it warns and asks Update / Keep as is / Replace (and Stop on the first question), even under mode: existing, unless on-existing decides. It never overwrites hand-edited application source.

Purpose group

Plugin

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

Invocation

/iru-setup-android-app

Inputs

Argument Required Description Default

args

No

Pre-resolved parameters passed by an orchestrating skill (e.g. Setup Android Repository) as newline-separated key: value lines covering every field below, parsed in Step 0 so this skill doesn’t ask about any field already resolved this way.

None — if absent or unrecognized, every field is asked interactively.

application-id

Yes (unless supplied via args)

Reverse-DNS application id, written to defaultConfig.applicationId and used to derive the Kotlin package path.

None

namespace

No

The module’s Kotlin/resource namespace (android.namespace).

`application-id’s value

app-name

Yes (unless supplied via args)

Display name shown under the launcher icon (strings.xml’s `app_name).

None

min-sdk

No

Minimum supported Android API level.

26

compile-sdk / target-sdk

No

Compile and target Android API levels, looked up in Step 4.

Current stable Android API level (e.g. 36)

version-name / version-code

No

App version string and monotonic build integer.

1.0.0 / 1

license

Yes (unless supplied via args)

Resolved via AskUserQuestion: MIT License, Apache License 2.0, No license, or Other.

None — user must choose

developer-name / developer-email / organization-url

Yes (unless supplied via args)

Recorded in Step 8’s report only (no publishing block exists here to embed them in).

None

open-source

No

Whether the repository is open source; drives the sonar default.

Asked via AskUserQuestion when unresolved

sonar (+ sonar-organization/sonar-project-key/sonar-host-url)

No

cloud, self-hosted, or none — whether/how to wire the org.sonarqube Gradle plugin and sonar {} block.

cloud only if open source and public, otherwise none recommended

visibility

No

public, private or internal (GitHub repository visibility). Only used to pick the sonar recommendation: SonarCloud is recommended only for a public open-source repository, since it is free only for public projects.

Unset (treated as matching open-source)

ci

No

yes/no — whether CI workflows will exist to send Sonar reports. With no, the skill says plainly that no CI step would send reports and recommends sonar: none; if Sonar is still chosen, only the sonar {} block is written and the report says nothing sends results.

Unset

ui

No

compose (Jetpack Compose Material 3) or views (AppCompat + ViewBinding).

compose

distribution

No

none, internal (Firebase App Distribution plugin), or store (Google Play, workflow action or Gradle Play Publisher plugin).

store only when open source; otherwise asked

built-in-kotlin

No

no (separate Kotlin Android plugin) or yes (AGP’s built-in Kotlin compilation support).

no

junit

No

4 (Robolectric + MockK, matches the reference project) or 5 (adds JUnit 5 Jupiter alongside).

4

coverage-tool

No

jacoco (AGP’s built-in coverage task) or kover (Kotlin-native coverage plugin).

jacoco

static-analysis

No

lint (Android Lint only) or lint+detekt+ktlint (adds Detekt + Spotless/ktlint).

lint

accessibility

No

enforce, report, off or none — the accessibility level, written to .ui-quality.yml; none opts out entirely (no accessibility test tooling, no accessibility attributes in the templates). Asked as a bounded choice when unresolved.

enforce

mode

No

new or existing (the catalog’s shared front-door signal). existing no longer means "gap-fill silently": Step 1 still warns about and asks about every pre-existing file group unless on-existing decides.

new

on-existing

No

ask/keep/update/replace — how every pre-existing file group is treated without asking (the warning is still printed). keep creates only missing files (the old mode: existing behavior). Hand-edited application source is never overwritten either way. Meant for scripted runs; an orchestrator passes it only if it received it itself.

ask

Outputs

  • Gradle wrapper files, root build.gradle.kts, settings.gradle.kts, gradle.properties, and gradle/libs.versions.toml at the repository root.

  • An app/ module: build.gradle.kts, proguard-rules.pro, AndroidManifest.xml, theme/color/string/launcher-icon resources, MainActivity.kt (+ Compose theme wrapper, or a ViewBinding layout for ui: views), robolectric.properties, a placeholder unit test, an instrumented-test skeleton, and app/.gitignore. Resources use Start/End constraints and localized strings (greeting).

  • .ui-quality.yml at the repository root (accessibility, directions: [ltr, rtl], themes: [light, dark]), the shared app/src/test/java/<package>/testing/UiScreenshots.kt helper, a sample screen test (GreetingTest.kt for ui: compose, MainActivityScreenTest.kt for ui: views) capturing .ui-screenshots/, and the accessibility checks in the instrumented test; Roborazzi, Compose UI test or Espresso accessibility dependencies in the version catalog and app/build.gradle.kts (unitTests.isIncludeAndroidResources = true).

  • Any opt-in Gradle plugin blocks selected (Detekt/Spotless, Kover, JUnit 5, Firebase App Distribution, Gradle Play Publisher) applied on top of the base templates.

  • A report of resolved inputs, which toolchain versions came from a live lookup versus a recorded fallback, whether the run scaffolded from scratch or updated an existing project, the action taken per file group (created / updated / replaced / kept as is, and whether the user or on-existing chose it, with any mismatch listed for a kept group), and explicit warnings (license/keystore/google-services.json/Sonar token/distribution credentials review).

The generated files' bytes come from template files under templates/ (and, where a template needs variant-specific notes, reference/) in .claude/skills/iru-setup-android-app/; the skill reads only the files for the variant it resolved, not the whole set, which keeps its SKILL.md small.

Execution flow

flowchart TD A[Start /iru-setup-android-app] --> B{"Step 0: args supplied?"} B -- yes --> C[Parse key: value pairs from args] B -- no --> D[Treat every field as unset] C --> E{"Step 1: settings.gradle.kts /\napp/build.gradle.kts or other\nStep 5 files already exist?"} D --> E E -- none exist --> E1["Announce: scaffolding from scratch"] E1 --> F["Step 2: Collect inputs\n(application-id, namespace, app-name,\nSDK levels, version, license, UI,\nopen-source, sonar using visibility and ci,\ndistribution)"] E -- "owned files exist" --> E2["Announce: updating existing Gradle project\nlist files, group into artifacts"] E2 --> H{"on-existing set?"} H -- yes --> J["Apply keep / update / replace\nto every artifact"] H -- no --> H2{"AskUserQuestion per artifact:\nUpdate / Keep as is / Replace\n(Stop on first question)"} H2 -- stop --> I[Report untouched; end] H2 -- choices --> F J --> F E -- "conflicting scaffold\n(library-only / no app module)" --> K["Warn user;\nask to add app module or stop"] K -- stop --> I K -- add module --> F F --> L["Step 3: Infer owner/repo/host\nfrom git remote"] L --> M["Step 4: Look up Gradle/AGP/Kotlin/\nDokka/Sonar/test-library versions\n(fallback to recorded values on failure)"] M --> N["Step 5-6: Fill templates and scaffold wrapper,\nroot build files and app/ module, applying opt-ins\nand each artifact's Update / Keep / Replace choice"] N --> O["Step 7: Verify via iru-gate-runner\n(gradlew --offline help,\n:app:assembleDebug)"] O --> P["Step 8: Report mode, per-artifact actions,\nversions used, warnings"]

Dependencies

Invokes

None — iru-setup-android-app is a leaf skill; it does not call any other skill in this catalog. It is self-contained and does not read iru-setup-android-library’s files at run time even when a repository ends up with both a `lib/ and an app/ module.

Invoked by

  • Setup Android Repository — Step 4, via the iru-isolated-skill-executor agent, when the repository’s project type is an Android application.

  • iru-gate-runner — Step 7 runs ./gradlew --offline help and ./gradlew :app:assembleDebug through this agent so its (potentially long) build output doesn’t fill this skill’s own context.

Source

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