compose-modifier-system

Community

Fix modifier performance with the right phase reads.

Authorsantimattius
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps you stop Compose modifier code from triggering expensive recompositions by reading state in the wrong phase, and it shows how to build custom modifiers that invalidate only what’s necessary.

Core Features & Use Cases

  • Defer state reads to Layout/Drawing: Use lambda overloads like Modifier.offset { ... } and Modifier.graphicsLayer { ... } so frequently changing values don’t force Composition restarts.
  • Use production-ready custom modifiers: Replace deprecated Modifier.composed with ModifierNodeElement + Modifier.Node, using correct equality semantics and fine-grained invalidation.
  • Pick the right drawing tier: Choose drawBehind, drawWithContent, or drawWithCache based on whether drawing is simple, ordering-sensitive, or requires cached expensive objects.
  • Avoid common layout/draw pitfalls: Prevent measuring children twice in custom layout and ensure pixel-vs-dp correctness in drawing.

Quick Start

Use this skill to revise a custom modifier so that scroll/animation state is read in the Layout or Drawing phase, and to ensure the modifier node invalidates only placement or drawing when its inputs change.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: compose-modifier-system
Download link: https://github.com/santimattius/performance-compose-skills/archive/main.zip#compose-modifier-system

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.