Repository navigation
v6.2.0
v6.2.0 teaches the kit to plan screens for every window an app runs in: phones, tablets, foldables, desktop and web. Layouts follow the window size class, never the device. It also ships the guard-script fixes prepared as v6.1.2, which was never published. It replaces v6.1.1 as Latest.
What's new
Layouts follow the window size class, never the device (#28)
-
compose-ui rule 12 (non-negotiable). Each destination keeps one
<Dest>Screen:- The composition root computes the window size class once.
- The Route maps it to a
<Dest>Layoutvalue. - The Screen branches once on that value.
Variants are named after the smallest class they serve (
NotesCompactLayout,NotesExpandedLayout) and share their leaves. Device-named screens (NotesTabletScreen) andisTabletchecks are declined even when a request names them: an iPad in Split View, a folded phone and a narrow desktop window are all narrow windows. -
compose-ui rule 10 reworded: a pane gets a width, not a size class. A destination that can show inside a list-detail pane picks its arrangement from the width it is given, never from the window size class.
-
New reference
compose-ui/references/adaptive-layouts.md. It holds:- a Choose tree: reflow, layout variants or multi-pane;
- reflow caps the content width, cap before fill (
Modifier.widthIn(max = …).fillMaxWidth()); - breakpoints come from the library's
WindowSizeClassconstants; - list state sits above the layout branch, so a resize keeps the scroll position;
- gotchas: use the V2 adaptive-info function, and never the deprecated width-class enum.
-
Router. The
composeentry tree sends tablet, foldable and window-size tasks to that reference.
Targets recorded when a project starts (#29)
- compose-project bootstrap (default).
## Project decisionsrecords the targets the app ships and the window size classes every screen works in. Compact through Expanded is the default. Example:Targets: Android phones and tablets, iPhone and iPad, desktop. Every screen works in Compact through Expanded windows. - Choose tree. Only the request text or a provided design adds a wider arrangement. Recorded targets make the width cap necessary; they never add a layout on their own.
Guard-script fixes (#26, prepared as v6.1.2)
-
check-file-level-state.sh(arch rule 13) now reports, in every main source set:- a top-level
varwith any annotations or modifiers before it (lateinit,@Volatile, visibility,actual); - a top-level
valcreated as a mutable holder:MutableStateFlow,MutableSharedFlow,mutableStateOfand its variants, mutable collections,Channel; - either form as a direct member of an
objectorcompanion object.
Before, it checked only
navigation/andpresentation/. Test source sets, strings and comments are skipped. - a top-level
-
check-contract-shape.shskips annotations on the declaration's own line. So@Immutable data class …UiStatepasses, and a one-line@Serializable enum classcounts as a fourth declaration.
How it was tested
- #28 and #29 were built test-first on new dev-set scenarios (UI-05, UI-06, FEAT-07, FEAT-07b). Each used routed agent runs on Claude Haiku (5 per arm) and Sonnet (1 per arm), comparing the old kit with the new one.
- Asked for
NotesPhoneScreen/NotesTabletScreenwith anisTabletcheck, Haiku declined and built one Screen with size-class variants in 0 of 5 runs before and 5 of 5 after. Sonnet also moved to computing the class once at the root with the current API. - A detail inside a list-detail pane picked its arrangement from the pane's own width in 3 of 5 Haiku runs before and 5 of 5 after.
- With no targets in context, no run (Haiku 0 of 5, Sonnet 0 of 1) capped a new editor's width on wide windows. With targets recorded and the final wording, every run passed (Haiku 5 of 5, Sonnet 1 of 1).
- Evidence: the #28 description and
evals-v2/results/2026-10-22-compose-feature.md. - Not re-run: the v6 held-out benchmark, and the new rules were not tested on DeepSeek, Gemini or GPT. The v6.1 benchmark results describe v6.1.0's guidance.
Behaviour changes
-
Layout checks in new code and reviews.
- New code and reviews treat device-named screens (
*TabletScreen,*PhoneScreen) andisTabletor platform checks used for layout as findings. - A wide arrangement is a size-class variant inside the one Screen.
- A screen with no wide design gets one layout with a capped width.
- New code and reviews treat device-named screens (
-
compose-ui/references/adaptive-and-insets.mdis gone. It is split intoadaptive-layouts.mdandedge-to-edge-and-insets.md; the inset and IME rules are unchanged but renumbered. Update any project notes or links that named the old file or its rule numbers. -
The targets line in
## Project decisions. New projects get it at bootstrap. Existing projects should add it (see Upgrade). -
check-file-level-statecan fail on code it used to pass. It now scans data, domain, DI, core, app and platform source sets. Typical new findings:- a platform handle kept in a file (
private lateinit var applicationContext: Context); - a top-level
mutableMapOf()cache; companion object { lateinit var instance: App }.
Fix: move the value into a class the DI graph owns as a
@Singleand inject it. - a platform handle kept in a file (
-
.composekit.confis unchanged, and no setting is new.
Upgrade
- Update the skills:
npx skills:npx skills update.gh skill:gh skill update --all. If you installed with--pin, rungh skill update --unpin --allonce:gh skill updateskips pinned skills.- Claude Code plugin:
claude plugin marketplace update compose-kit, thenclaude plugin update compose-kit@compose-kit, then restart Claude Code. - Codex plugin:
codex plugin marketplace upgrade.
- Update the installed guards in each project: run the
compose-architectureskill'sscripts/install-guards.sh <project-root>. Your.composekit.confis kept. To check,grep -c module-level scripts/composekit/check-file-level-state.shprints1or more; the v6.1.1 copy prints0. Then runrun-checks.shand fix any newcheck-file-level-statefindings as above. - Record your targets: add one line to
## Project decisionsin the project'sAGENTS.md/CLAUDE.md, for exampleTargets: Android phones and tablets, iPhone and iPad, desktop. Every screen works in Compact through Expanded windows.
Install
See the README or https://compose.avinya.dev/install/. The install commands there always install the latest release.