developing-with-compose-previews

Community

Make Compose previews reliable and fast.

Authorskydoves
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill fixes preview-driven development pain in Jetpack Compose by ensuring previews render consistently instead of failing, showing the wrong UI, or rotting as code evolves.

Core Features & Use Cases

  • Hoist state and keep previewable composables stateless: avoid requiring a ViewModel, repository, NavController, or Context inside previewable composables so Studio can render them immediately.
  • Cover real UI states with @PreviewParameter: generate loading, empty, error, content, and overflow cases from a PreviewParameterProvider to prevent missed edge cases.
  • Stabilize rendering across configurations: use multi-configuration previews (uiMode, fontScale, device specs, locale/RTL) to catch layout and localization issues early.
  • Quarantine environment-bound dependencies: use LocalInspectionMode for preview-only fallbacks (e.g., image loading placeholders) while keeping the rest of the UI previewable.

Quick Start

Ask your AI assistant to refactor your screen-level @Preview into previewable leaf composables that take plain parameters, then add a PreviewParameterProvider that outputs loading, content, empty, error, and overflow sample data for one consolidated preview entry point.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 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: developing-with-compose-previews
Download link: https://github.com/skydoves/android-testing-skills/archive/main.zip#developing-with-compose-previews

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.