Logo van Understanding Hot Reload Limits

Understanding Hot Reload Limits

Community
skydoves
understanding-hot-reload-limits

Gebruik deze skill om Claude precies te leren welke wijzigingen in Kotlin en Compose met Compose HotSwan via hot reload kunnen worden toegepast en welke leiden tot een volledige incrementele rebuild. De oorzaak is dat de klasseschema's van Android Runtime (ART) onveranderlijk zijn: alleen method bodies kunnen tijdens runtime worden gewijzigd. Elke wijziging aan velden, signatures, constructors, interfaces, inline functies of nieuwe resource-id's vereist daarom een rebuild. Behandelt de tabel met ondersteunde wijzigingen, de lijst met wijzigingen die een rebuild afdwingen, de workflow van wijzigingen bekijken en daarna in batches toepassen om een hot-reloadsessie op het snelle pad te houden, en de valkuilen rond inline functies en nieuwe resource-id's. Activeer de skill wanneer de gebruiker vraagt: ‘waarom is dit opnieuw gebouwd?’ of ‘waarom werkt hot reload niet?’, de grenzen van HotSwan wil begrijpen voordat die het gaat gebruiken, of een refactor wil laten nakijken die een hot-reloadsessie mogelijk laat overschakelen op een volledige rebuild.

Add to TypingMind

Overzicht

Uitgeverskydoves
Repositorycompose-performance-skills
Skillnaamunderstanding-hot-reload-limits
Sterren
515
Forks
19
Meegeleverde bestanden
Alleen instructies
LicentieApache-2.0
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door skydoves op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Understanding Hot Reload Limits in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/skydoves/compose-performance-skills/tree/main/hot-reload/understanding-hot-reload-limits
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/skydoves/compose-performance-skills.git /tmp/compose-performance-skills
mkdir -p .claude/skills
cp -r /tmp/compose-performance-skills/hot-reload/understanding-hot-reload-limits .claude/skills/understanding-hot-reload-limits
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Understanding Hot Reload Limits in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Understanding Hot Reload Limits automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Understanding Hot Reload Limits niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Understanding Hot Reload Limits: stay inside the fast path

Android Runtime (ART) enforces strict rules for class redefinition: a redefined class must have an identical schema (fields, method signatures, interfaces) as the previous version. Only method bodies are mutable at runtime. HotSwan automatically detects schema changes and falls back to a full incremental build, so failures are not silent. Knowing the boundary in advance is what keeps an iteration loop sub-second instead of multi-second.

When to use this skill

  • The developer asks "why did this trigger a full rebuild?", "why isn't this hot reloading?", or "what does HotSwan support?".
  • A PR review surfaces a refactor (parameter change, constructor change, interface extraction, new resource id) that would push a hot-reload session into a rebuild.
  • The developer is planning a session and wants to order edits so the slow ones happen at the end.
  • The developer reports an inline fun change that "didn't reload" and is debugging.

When NOT to use this skill

  • Setup or first-run troubleshooting. See ../setting-up-compose-hotswan/SKILL.md.
  • Pure state-preservation question (the reload happened but state was lost). See the state-preservation sibling skill.
  • Configuration of the AI iteration loop or MCP server. See the AI-loop sibling skill.

Prerequisites

  • HotSwan installed and verified per ../setting-up-compose-hotswan/SKILL.md (tool window status WATCHING, body-only edit reloads in under one second).
  • Familiarity with the Kotlin compiler's distinction between method-body changes and class-schema changes.

Boundary tables

Hot-reloadable (no rebuild)

ChangeNotes
Composable function bodytext, colors, modifiers, layout, control flow inside the function
Non-composable function bodyViewModel methods, mappers, utilities, repositories
Adding a new composablesame file or new file
Reordering composablesHotSwan 1.2.0+
Resource value changesstrings.xml value, colors.xml value, dimens.xml value
Extension functionsincluding suspend, including vararg
Adding data class propertiesAPI 30+ only
Numeric, string, float literal patchescompiled separately for fastest reload

Forces full rebuild (fallback)

ChangeReason
Adding or removing function parametersmethod signature changes
Constructor changesparameter list, default values, init blocks affecting fields
Interface or superclass changesclass hierarchy is part of the schema
Adding new resource idsnew R.string, R.drawable, R.id entries require generated R class regeneration
Inline functionsexpanded at every call site; no discrete unit to swap
Lambda count change inside a functioninternal lambda class renumbering
Removing a previously defined functionmethod table shrinks; schema changes
Adding data class properties below API 30constructor schema change without ART support

Workflow when a change does not hot-reload

  1. Watch the HotSwan tool window status at the moment of save. A schema change surfaces as a "falling back to incremental build" status. That is the explicit signal, not a silent failure.
  2. Read the change diff. Decide: is this a body-only change, or a schema change (signature, constructor, interface, field, new resource id, inline body, lambda count)?
  3. If a refactor must change a signature, batch it. First make the body-only changes that get the screen to a working visual state and hot-reload them. Then, in a separate save, change the signature and accept the rebuild as the last step of the session.
  4. For inline functions, drop inline for the duration of iteration. Refactor the function out of inline while iterating, hot-reload as needed, and restore inline before commit. If iteration is rare or the perf characteristic must be preserved, accept the rebuild.
  5. For new resource ids, batch all id additions first, accept one rebuild, then iterate on values. Editing <string name="title">Updated Title</string> (existing id) hot-reloads; adding <string name="brand_new_id">...</string> does not.

Patterns

Pattern: function-body change (fast path) vs signature change (rebuild)

kotlin
// RIGHT (body-only change, hot-reloads)
@Composable
fun Greeting() {
    Text("Hello, World", color = Color.Blue)
}
kotlin
// WRONG for the fast path (signature change, forces rebuild)
@Composable
fun Greeting(name: String) {
    Text("Hello, $name")
}
// WRONG because: adding a parameter changes the method signature, which violates ART's class
// schema constraint. To stay inside the fast path, introduce the parameter with a default value
// in one save (still a rebuild; accept it once), then iterate on the body across subsequent saves.

Pattern: adding a new composable (fast path) vs changing a constructor (rebuild)

kotlin
// RIGHT (new composable in the same file, hot-reloads on HotSwan 1.2.0+)
@Composable
fun SecondaryAction() {
    Text("New")
}
kotlin
// WRONG for the fast path (constructor change)
data class User(val id: Long, val name: String, val age: Int)
// WRONG because: adding `age` extends the constructor. On API 30+ HotSwan supports adding
// data class properties; below API 30 the schema change forces a rebuild. When targeting older
// minSdk, batch property additions and accept a rebuild for each.

Pattern: inline function body change (rebuild)

kotlin
// WRONG for the fast path
inline fun <T> Modifier.observer(value: T, body: (T) -> Modifier): Modifier = body(value)
// WRONG because: inline functions are expanded at every call site at compile time. There is no
// discrete unit to swap, so editing the inline body forces a full rebuild of every call site.
// Drop `inline` for the duration of iteration, or accept the rebuild.
kotlin
// RIGHT for the fast path (non-inline variant during iteration)
fun <T> Modifier.observer(value: T, body: (T) -> Modifier): Modifier = body(value)

Pattern: resource value change (fast path) vs new resource id (rebuild)

xml
<!-- RIGHT: value change on an existing id, hot-reloads -->
<string name="title">Updated Title</string>
xml
<!-- WRONG for the fast path: new id, forces rebuild -->
<string name="brand_new_id">Hello</string>
<!-- WRONG because: adding a new string id grows the generated R class. R class regeneration
     is a schema change that ART cannot redefine in place. -->

Pattern: lambda count change (rebuild)

kotlin
// RIGHT (body change inside the existing lambda, hot-reloads)
@Composable
fun Row() {
    Button(onClick = { log("tapped") }) { Text("Tap") }
}
kotlin
// WRONG for the fast path (adds a second lambda, renumbers inner lambda classes)
@Composable
fun Row() {
    Button(onClick = { log("tapped") }) { Text("Tap") }
    Button(onClick = { log("second") }) { Text("Second") }
}
// WRONG because: a Kotlin function's compiled lambdas are anonymous classes named like
// Row$lambda$1, Row$lambda$2. Adding a lambda renumbers them and changes the class table,
// which is a schema change. The fix is to add the second composable as a separate top-level
// function (which is supported), then call it from Row once the structural change has rebuilt.

Mandatory rules

  • MUST consult the boundary tables before suggesting a change to a composable that the developer is iterating on. Suggesting a parameter add when the developer wanted speed wastes the iteration loop.
  • MUST NOT claim a change will hot-reload without checking it against the supported-changes table above.
  • MUST NOT disable HotSwan to "force a clean rebuild". Use Gradle's :app:clean for a clean build; HotSwan auto-falls-back when needed and turning it off costs the next round-trip.
  • MUST treat new resource ids and inline-function body changes as rebuild-forcing on every Android API level. The data-class-property exception is API 30+ only.
  • PREFERRED: order an iteration session so body-only edits come first and signature, constructor, interface, or new-resource-id changes are batched at the end.
  • PREFERRED: when a refactor needs a parameter add, introduce it once with a default value (accept the rebuild), then iterate on the body across subsequent saves.

Verification

  • A body-only change to a composable hot-reloads on save with the tool window status remaining WATCHING.
  • Adding a parameter to a composable triggers the fallback status in the tool window.
  • Adding a new <string> resource triggers the fallback; editing an existing <string> value does not.
  • Editing the body of an inline function triggers the fallback; converting it to a non-inline function and editing the body hot-reloads.
  • Adding a property to a data class hot-reloads on a device running API 30+; on API 29 and below it triggers the fallback.

References

Veelgestelde vragen

Wat doet de AI-skill Understanding Hot Reload Limits?

Gebruik deze skill om Claude precies te leren welke wijzigingen in Kotlin en Compose met Compose HotSwan via hot reload kunnen worden toegepast en welke leiden tot een volledige incrementele rebuild. De oorzaak is dat de klasseschema's van Android Runtime (ART) onveranderlijk zijn: alleen method bodies kunnen tijdens runtime worden gewijzigd. Elke wijziging aan velden, signatures, constructors, interfaces, inline functies of nieuwe resource-id's vereist daarom een rebuild. Behandelt de tabel met ondersteunde wijzigingen, de lijst met wijzigingen die een rebuild afdwingen, de workflow van wi...

Waarom Understanding Hot Reload Limits gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Understanding Hot Reload Limits bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Understanding Hot Reload Limits in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/skydoves/compose-performance-skills/tree/main/hot-reload/understanding-hot-reload-limits. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Understanding Hot Reload Limits gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Understanding Hot Reload Limits gebruiken?

Zoveel als je wilt. Je kunt Understanding Hot Reload Limits gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Understanding Hot Reload Limits gratis?

Ja. Deze skill is door skydoves op GitHub gepubliceerd onder de licentie Apache-2.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇