/hotswan:hotswan-setupfrom Compose HotSwan
Installs the HotSwan CLI, applies the Gradle plugin, and verifies hot reload in Android/Compose Multiplatform projects. Use when the user asks to add or set up HotSwan hot reload.
Ships in Compose HotSwan. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Done means: the app module applies the HotSwan Gradle plugin, the debug app runs with it on a device or
emulator, and one edit has been reloaded and verified on screen. After that, work with the hotswan
skill (edit, reload, verify).
Ask the user before you upgrade Kotlin, the Android Gradle plugin or Gradle, change build logic beyond adding the HotSwan plugin, or edit their shell profile. Do not commit; show the user the diff at the end.
adb from the Android SDK
platform-tools.Run hotswan --version. If the command is missing:
curl -fsSL https://hotswan.dev/install.sh | sh
~/.hotswan/bin/hotswan --version
The launcher lands in ~/.hotswan/bin/hotswan; call it by that path for the rest of the setup. The
second command confirms the install (the first one can fail quietly when the download fails). Offer the
user sh -s -- --add-to-path, which adds that directory to their shell profile, instead of running it.
hotswan doctor --json
The first command in a project reads the Gradle build once and can take a few minutes on a large
project; give it a long timeout. Read the HotSwan plugin check; doctor also reports the device and the
app, which are not ready yet. If that check is OK, the plugin is already applied: go to step 5. If it
names a HotSwan version older than 2.3.0, ask the user to update that version (setup does not change an
existing one).
Preferred: let the CLI plan the change, review the plan, then apply it.
hotswan setup --json # read-only: the files and lines it would change
hotswan setup --apply --json # makes those edits; `edits[].added` lists the lines it added
setup edits the standard shape: the version catalog, the root plugins {} block and the app module's
plugins {} block, the settings plugin when Gradle isolated projects is on, and mavenCentral() in
pluginManagement. --apply then checks that HotSwan reaches every Compose module, and applies it to the
modules Gradle configures too early for it to reach (a Kotlin Multiplatform UI module next to a thin Android
app, for one). With several Android application modules, pick one with --module :app. It refuses
with ok: false, a message and a remedy when the project needs a decision it should not guess.
Read them. If the remedy changes Kotlin, the Android Gradle plugin, Gradle or build logic, stop and ask
the user; otherwise follow it and run setup again.
If hotswan setup --json answers exitCode: 2 with unknown command 'setup' (CLI 2.4.0 has no
setup), or the project has a shape it refuses, apply the plugin by hand. Use the CLI's version
(hotswan --version) for <version>, and add the lines under the existing [versions] and [plugins]
tables (create a table only if it is missing):
# gradle/libs.versions.toml
# under [versions]
hotswan = "<version>"
# under [plugins]
hotswan-compiler = { id = "com.github.skydoves.compose.hotswan.compiler", version.ref = "hotswan" }
// build.gradle.kts (root): register it without applying it
plugins {
alias(libs.plugins.hotswan.compiler) apply false
}
// app/build.gradle.kts: apply it in the module that owns the app
plugins {
alias(libs.plugins.hotswan.compiler)
}
id("com.github.skydoves.compose.hotswan.compiler") version "<version>" apply false
in the root and id("com.github.skydoves.compose.hotswan.compiler") in the app module.settings.gradle(.kts) must list mavenCentral() in pluginManagement { repositories { } }, and in
dependencyResolutionManagement { repositories { } } when the project declares its repositories there.hotswan doctor reports HotSwan does not reach (with a thin Android app over a shared UI module, that
is the UI module). For the iOS simulator, the module that declares binaries.framework needs it; for
Compose Desktop, the module with the JVM app.org.gradle.unsafe.isolated-projects=true (in the project's or the user's gradle.properties), also add
id("com.github.skydoves.compose.hotswan.settings") version "<version>" to the plugins {} block of
settings.gradle.kts (Gradle 8.8 or newer), and keep the root apply false line.build-logic alone.hotswan doctor --json # the HotSwan plugin check is OK, and no `Compose modules` warning remains
hotswan run --json # builds the debug app, installs and launches it, waits until it can reload
If the build fails, read the errors:
mavenCentral() is missing from pluginManagement.hotswan report.Run hotswan run again whenever you change build files later, before the next reload.
Text call.hotswan reload --json. Success is outcome: APPLIED with screen.changed: true; look at
screen.images.compare to see it.hotswan reload --json again, so only the plugin change remains.git diff of the build files.hotswan agent init (skip it when the user installed the
HotSwan Claude Code plugin, which has the same skills). --mcp also registers hotswan mcp in
.mcp.json.hotswan skill: edit, hotswan reload, check the screen.To remove HotSwan later, delete the lines this setup added.
What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub skydoves/compose-hotswan --plugin hotswanOther plugins' skills for the same job