compose-modifier-and-layout-style

Enforce Jetpack Compose modifier parameters and root-level application in composables.

1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/leogallego/ansible-jane --skill compose-modifier-and-layout-style-leogallego
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-modifier-and-layout-style
Source: https://github.com/leogallego/ansible-jane/tree/main/skills/compose-modifier-and-layout-style
Command: npx skills add https://github.com/leogallego/ansible-jane --skill compose-modifier-and-layout-style-leogallego

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Jetpack Compose components often bake layout decisions into their roots, hindering caller control and readability by forcing defaults like full-width roots or hardcoded padding.

Core Features & Use Cases

  • Exposes a modifier parameter to composables and applies it to the root layout, enabling caller control.
  • Promotes one-fluent-chain modifier construction and early conditional placement to improve readability and reusability.
  • Use Case: refactor a layout primitive to avoid hardcoded sizing so that different screens can opt-in to different padding or constraints.

Quick Start

Refactor a composable to expose a modifier parameter and apply it to the root layout.

Frequently Asked Questions about compose-modifier-and-layout-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make Jetpack Compose modifiers reusable across different layout containers?

To make Jetpack Compose modifiers reusable, expose a public modifier parameter in your composable and apply it to the root layout. This avoids hard-coded sizing decisions and allows callers to inject custom padding or constraints.

Why does my Kotlin Compose component ignore external layout constraints?

Your Kotlin Compose component ignores external layout constraints because it likely has hardcoded root sizing instead of a public modifier parameter. Applying a modifier parameter to the root layout ensures the composable respects caller-imposed layout constraints.

What is the best practice for modifier chaining in Jetpack Compose UI components?

The best practice for modifier chaining in Jetpack Compose UI components is constructing one fluent modifier chain and placing conditional modifiers early. This conventional chaining improves readability and ensures safer, reusable layout components.

Can I refactor an existing composable to accept a modifier parameter without breaking the layout?

Yes, you can refactor an existing composable to accept a modifier parameter without breaking the layout by adding a public modifier parameter and applying it to the root layout. This removes hardcoded defaults while preserving internal layout logic.

When do I need to expose a modifier parameter in a Kotlin Compose component?

You need to expose a modifier parameter in a Kotlin Compose component when writing or reviewing reusable UI elements that rely on layout containers. It prevents baked-in layout decisions and allows different screens to apply unique padding or constraints.