Skip to content
Back to skills

Jetpack Compose Knowledge Patch

ASecurity

Jetpack Compose

  • 25 stars
  • 0 votes
  • 0 copies
  • 13 views
  • Added September 5, 2026
developmentgokotlinnodetestingapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill jetpack-compose-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Jetpack Compose Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Jetpack Compose Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-jetpack-compose-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-jetpack-compose-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: jetpack-compose-knowledge-patch
description: Jetpack Compose
version: null
license: MIT
metadata:
  author: Nevaberry
---


# Jetpack Compose Compatibility Guidance

Load this skill when migrating Compose APIs, configuring its toolchain,
implementing custom layouts or input, or diagnosing runtime and UI test behavior.
Use the relevant topic reference for detailed migrations and examples.
Version labels in those references scope the advice, including historical API names,
temporary behavior flags, experimental APIs, and subsequent stabilization.

## Reference index

| Reference | Topics |
| --- | --- |
| [Setup, runtime, and state](references/setup-runtime-state.md) | Build requirements, BOMs, compiler setup, snapshots, retention, saved state, effects, diagnostics |
| [Input, scrolling, and focus](references/input-scroll-focus.md) | Pointer and keyboard input, focus, indications, drag anchors, flings, lazy layouts, prefetch |
| [Layout, animation, and graphics](references/layout-animation-graphics.md) | Measurement, modifier nodes, coordinates, rulers, lookahead, shared transitions, drawing, blur |
| [Text, autofill, and resources](references/text-autofill-resources.md) | Editing, transformations, selection, annotations, text layout, fonts, autofill, credentials |
| [Material 3 components](references/material3-components.md) | Theme and motion, navigation, sheets, fields, pickers, menus, sliders, carousels, indicators |
| [Platform, window, and interop](references/platform-window-interop.md) | Compose hosts, Android Views, insets, dialogs, popups, clipboard, surfaces, feedback |
| [Semantics, accessibility, and testing](references/semantics-accessibility-testing.md) | Accessibility properties, test scheduling, assertions, input injection, screenshots, previews |

## Breaking changes and deprecations

### Build requirements

For stable Compose 1.13 core modules, use BOM `2026.11.01`, Kotlin 2.2 or newer,
and `compileSdk` 37.1.

```kotlin
dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.11.01"))
}
```

Compose lint checks require AGP 8.8.2 or newer on the command line and Android
Studio Ladybug or newer in the IDE. With older AGP, set
`android.experimental.lint.version=8.8.2` in `gradle.properties`.
When supplying the Compose Compiler Gradle plugin through `buildscript`, use its
plugin marker artifact and the same version as the project's Kotlin plugin.
See the setup reference for product-specific build requirements and artifact changes.

### Layout, animation, and cache migrations

- Replace `EnterTransition.with` with `togetherWith` when upgrading to Animation
  1.13.0; an `AnimatedContent` spec can use
  `transitionSpec = { fadeIn() togetherWith fadeOut() }`.
- The November release deprecates Compose `ConstraintLayout` and `MotionLayout`
  from `androidx.constraintlayout:constraintlayout-compose`.
- `ContextualFlowRow` and `ContextualFlowColumn` are deprecated. Use `FlowRow` or
  `FlowColumn` where ordinary wrapping suffices; overloads without `overflow` clip overflow.
- Move lazy list and staggered grid `LazyLayoutCacheWindow` configuration from
  the scroll state holder to the lazy layout composable. The default ahead
  prefetch window is sized from the viewport; custom ahead and behind windows
  control prefetching and offscreen retention.
- For shared transitions in Compose 1.10, replace `ScaleToBounds` with
  `scaleToBounds` and remove `clipInOverlayDuringTransition` from
  `renderInSharedTransitionOverlay`.

### Indications, dragging, and focus

On recompilation with Compose 1.9.0, `clickable`, `combinedClickable`, `selectable`,
`toggleable`, and `triStateToggleable` overloads that read `LocalIndication`
crash with legacy `Indication` implementations. Migrate to `IndicationNodeFactory`
or pass the legacy instance to an overload with an explicit `indication` parameter.

`AnchoredDraggableState` deprecates `confirmValueChange`. Omit unavailable
destinations from the active anchor set and use an `OverscrollEffect` for feedback.
Migrate `FocusProperties.enter` and `exit` to receiver-based `onEnter` and `onExit`.
In those callbacks, `cancelFocusChange()` blocks the pending focus move.
`Modifier.onFocusedBoundsChanged` is a no-op in 1.13.0-alpha01;
use `FocusTargetModifierNode.getFocusedRect()` to obtain the focused bounds.

### Material 3 component migrations

In Material 3 1.5.0, stateless `Slider` and `RangeSlider` overloads are deprecated.
Use stable state-backed overloads and pass the now-required `onValueChange` by name
because its position changed. Pass `onValueChangeFinished` to the composable too.
Rename `RangeSliderState.activeRangeStart` and `activeRangeEnd` to `startValue` and `endValue`.

```kotlin
val sliderState = remember { SliderState(value = 0.5f) }
Slider(state = sliderState, onValueChange = {})
```

`SecureTextField` and `OutlinedSecureTextField` default to `TextObfuscationMode.System`,
following the system password visibility setting. Pass
`textObfuscationMode = TextObfuscationMode.RevealLastTyped` for unconditional last-character reveal.
Rename `isAtTop` to `isAtStart` on `TopAppBarDefaults` scroll behaviors.
Rename `maxItemWidth` to `preferredItemWidth` on `HorizontalCenteredHeroCarousel`.
The revised checkbox size and indicator alignment are enabled by default in 1.5.0;
set `ComposeMaterial3Flags.isCheckboxStylingFixEnabled = false` for the previous styling.

### Text, autofill, and saved state

Replace removed `AutoSize` overloads with `TextAutoSize`, using
`BasicText("Title", autoSize = TextAutoSize.StepBased(12.sp, 24.sp))` for a fitting size range.
`BasicText` dropped its implicit graphics layer and the flag that restored it;
add `Modifier.graphicsLayer()` when drawing depends on that layer.

For text autofill, use Compose UI and Foundation 1.8 or later together.
Replace legacy autofill nodes with field semantics such as
`Modifier.semantics { contentType = ContentType.Username }`.
For custom fields, migrate the text-only `onAutofillText` action to `fillableData`
and `onFillData`; `FillableData.createFrom(value)` supports text, toggles, list indices,
and dates in milliseconds.

Remove the deprecated custom `key` argument from `rememberSaveable` to use positional
scoping and avoid accidental reuse or loss of state, especially in nested lazy layouts.
Replace `Snapshot.id` with `Snapshot.snapshotId`; `SnapshotId` uses a `Long` on JVM.
Dispose a composition after cancelling paused work because reusing it throws.

### Test API and semantics migrations

Use `create*ComposeRule` from `androidx.compose.ui.test.junit4.v2` or
`run*ComposeUiTest` from `androidx.compose.ui.test.v2`. These default to
`StandardTestDispatcher`; use the shared `TestCoroutineScheduler` to run queued work
before assertions that depend on it.
In 1.13.0-alpha01, migrate v2 overloads with individual options to `ComposeUiTestConfig`.
Default configuration starts Android tests in `InputMode.Touch`; set `inputMode`
explicitly for tests expecting keyboard focus.

For `enableAccessibilityChecks()`, add `androidx.compose.ui:ui-test-junit4-accessibility`
for test rules or `androidx.compose.ui:ui-test-accessibility` for direct `ComposeUiTest` use.
Migrate removed experimental `GlobalAssertions` checks to `enableAccessibilityChecks()`.
`background`, `border`, and `graphicsLayer` can add semantics nodes: use the target's
own `testTag` or a matcher when structural queries reach a different node.
`StateRestorationTester` always uses platform state encoding; Android savers must
produce values that can be parcelled.

## Frequently used features

### Computed state and retention

In Runtime 1.13.0, use `computedStateOf` for a cheap calculation over other state.
Observers invalidate when the result changes, and each `value` read reruns the calculation.
Use `derivedStateOf` when repeated reads benefit from caching or stable result identity.

```kotlin
val listState = rememberLazyListState()
val showScrollToTop by remember(listState) {
    computedStateOf { listState.firstVisibleItemIndex > 0 }
}
```

Use `retain { … }` for in-memory objects that should survive Android configuration changes.
The store retains both values and keys: keep short-lived references such as an Activity
out of the keys, and mark types that should never be retained with `@DoNotRetain`.
Use `RetainedEffect` when cleanup should follow the retained value's lifetime even
if its composable leaves composition.

### Lookahead and shared transitions

Use `Modifier.animateBounds` inside `LookaheadScope` to animate size and position.
Lazy grids and pagers use lookahead results for scrolling and item animation targets.
In `SharedTransitionScope`, `skipToLookaheadPosition()` and `skipToLookaheadSize()`
skip by default only while a shared transition is active.
`SharedTransitionScope.isTransitionActive` is true only while a matched shared element
is animating; track ordinary enter and exit animations through their own state.
Animation 1.13.0 removes the need for opt-ins used solely for `DeferredTransitionState`,
`rememberDeferredTransition`, `DeferredAnimatedContent`, `DeferredAnimatedVisibility`, or `TransformScope`.

### Progressive blur

Supply a `BlurRadiusSpec` directly to `Modifier.blur`, or assign `blurRadiusSpec`
inside its configuration block. Specs can use linear or radial gradients or a custom
AGSL `RuntimeShader`. Use the layer's `size: DpSize` and the scope's `Density` conversions.

```kotlin
val uniformBlur = Modifier.blur(BlurRadiusSpec.uniform(12.dp), alpha = 0.8f)

fun Modifier.blurWithSize(specForSize: (DpSize) -> BlurRadiusSpec): Modifier =
    blur {
        blurRadiusSpec = specForSize(size)
    }
```

`edgeTreatment` defaults to `BlurredEdgeTreatment.Rectangle`; `alpha` defaults to `1f`
and ranges from `0..1`. Uniform specs require Android 12 (API 31), spatially varying
specs Android 13 (API 33); the modifier has no effect below the applicable minimum.
Leave room inside the layer bounds for the blur radius to avoid clipping.
Read `WindowInfo.isCrossWindowBlurEnabled` to choose cross-window blur or a fallback.

### Overscroll and text transformations

Use `LocalOverscrollFactory` in place of `LocalOverscrollConfiguration`.
Provide `null` to disable overscroll, or use `rememberPlatformOverscrollFactory(color, padding)`
to customize glow. To render elsewhere, give the scrollable `effect.withoutVisualEffect()`
and put `Modifier.overscroll(effect.withoutEventHandling())` on the drawing container.

Call `TextFieldBuffer.addStyle` within an `OutputTransformation` to style displayed text.
Each `TextFieldState.edit { ... }` creates a standalone undo entry; call
`state.undoState.clearHistory()` afterward if the edit should reset the undo stack.
`SemanticsProperties.InputText` exposes the value before output transformation,
and autofill saves this input value.

### Material shapes and loading indicators

Experimental `LoadingIndicator` and `ContainedLoadingIndicator` morph through
`RoundedPolygon` shapes and support determinate and indeterminate progress.
Use `PullToRefreshDefaults.LoadingIndicator` in a pull-to-refresh indicator slot.
Experimental `MaterialShapes` provides normalized `RoundedPolygon` presets;
convert a preset or `Morph` with `toShape()` or `toPath()`.

Files in this skill

  • SKILL.md8.7 KB
  • coverage.json1.3 KB
  • references/input-scroll-focus.md7.8 KB
  • references/layout-animation-graphics.md5.8 KB
  • references/material3-components.md6.2 KB
  • references/platform-window-interop.md3.6 KB
  • references/semantics-accessibility-testing.md4.1 KB
  • references/setup-runtime-state.md6.9 KB
  • references/text-autofill-resources.md5.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.