compose-preview — community compose-preview, NeoDB-You, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Perfect for Android Development Agents utilizing Jetpack Compose for UI design and preview. A native Android app for NeoDB, crafted with Jetpack Compose and Material 3/You.

heddxh heddxh
[0]
[0]
Updated: 3/5/2026

Agent Capability Analysis

The compose-preview skill by heddxh is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Perfect for Android Development Agents utilizing Jetpack Compose for UI design and preview.

Core Value

Empowers agents to create interactive previews of Jetpack Compose functions, utilizing Material 3 and You design principles, and annotate them with @Preview for efficient UI testing and validation.

Capabilities Granted for compose-preview

Generating previews of custom composables
Testing UI components with different themes and modes
Debugging layout issues in Jetpack Compose functions

! Prerequisites & Limits

  • Requires Android Studio and Jetpack Compose setup
  • Limited to Android app development
  • Kotlin programming language required
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

compose-preview

Install compose-preview, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Compose Preview

为 Jetpack Compose 函数创建预览。

基本用法

kotlin
1@Preview 2@Composable 3private fun XxxPreview() { 4 AppTheme { 5 Xxx() 6 } 7}

@Preview 注解参数

参数说明示例
name预览名称@Preview(name = "Dark Mode")
group分组名称@Preview(group = "Buttons")
widthDp宽度 (dp)@Preview(widthDp = 320)
heightDp高度 (dp)@Preview(heightDp = 640)
showBackground显示背景@Preview(showBackground = true)
backgroundColor背景色 (ARGB Long)@Preview(backgroundColor = 0xFFFFFFFF)
showSystemUi显示系统 UI@Preview(showSystemUi = true)
device设备规格@Preview(device = "id:pixel_5")
uiModeUI 模式@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
locale语言@Preview(locale = "zh-rCN")
fontScale字体缩放@Preview(fontScale = 1.5f)
wallpaper壁纸@Preview(wallpaper = Wallpapers.GREEN_DOMINATED_EXAMPLE)

Multipreview 注解

创建自定义多预览注解以复用配置:

kotlin
1@Preview(name = "Light", uiMode = Configuration.UI_MODE_NIGHT_NO) 2@Preview(name = "Dark", uiMode = Configuration.UI_MODE_NIGHT_YES) 3annotation class ThemePreviews 4 5@Preview(name = "Phone", device = "spec:width=411dp,height=891dp") 6@Preview(name = "Tablet", device = "spec:width=1280dp,height=800dp,dpi=240") 7annotation class DevicePreviews

使用:

kotlin
1@ThemePreviews 2@DevicePreviews 3@Composable 4private fun MyComponentPreview() { 5 AppTheme { 6 MyComponent() 7 } 8}

设备规格

预定义设备

  • id:pixel_5, id:pixel_fold, id:pixel_tablet
  • id:wearos_small_round, id:wearos_large_round

自定义规格

kotlin
1@Preview(device = "spec:width=411dp,height=891dp,dpi=420") 2@Preview(device = "spec:width=1280dp,height=800dp,orientation=landscape")

项目约定

  1. Preview 函数命名: XxxPreviewPreviewXxx
  2. 使用 AppTheme: 始终用 AppTheme { } 包裹预览内容
  3. 私有函数: Preview 函数应为 private
  4. Mock 数据: 使用假数据填充预览,不依赖 ViewModel
  5. 放置位置: 在同一文件中,放在被预览组件下方

工作流程

  1. 找到需要预览的 Composable 函数
  2. 分析其参数,确定需要的 mock 数据
  3. 在函数下方创建 Preview 函数
  4. NeoDBYouTheme 包裹
  5. 根据需要添加多个 @Preview 变体(亮/暗主题、不同尺寸等),大多数情况下Preview不需要参数。

示例

简单组件预览

kotlin
1@Composable 2fun Greeting(name: String, modifier: Modifier = Modifier) { 3 Text(text = "Hello $name!", modifier = modifier) 4} 5 6@Preview(showBackground = true) 7@Composable 8private fun GreetingPreview() { 9 AppTheme { 10 Greeting("Android") 11 } 12}

状态变体预览

kotlin
1@Preview(name = "Empty") 2@Preview(name = "Loading") 3@Preview(name = "Content") 4@Composable 5private fun MyScreenPreview() { 6 AppTheme { 7 // 根据需要展示不同状态 8 } 9}

亮暗主题预览

kotlin
1@PreviewLightDark 2@Composable 3private fun CardPreview() { 4 AppTheme { 5 MyCard(title = "Sample", content = "Preview content") 6 } 7}

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is compose-preview?

Perfect for Android Development Agents utilizing Jetpack Compose for UI design and preview. A native Android app for NeoDB, crafted with Jetpack Compose and Material 3/You.

How do I install compose-preview?

Run the command: npx killer-skills add heddxh/NeoDB-You/compose-preview. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for compose-preview?

Key use cases include: Generating previews of custom composables, Testing UI components with different themes and modes, Debugging layout issues in Jetpack Compose functions.

Which IDEs are compatible with compose-preview?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for compose-preview?

Requires Android Studio and Jetpack Compose setup. Limited to Android app development. Kotlin programming language required.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add heddxh/NeoDB-You/compose-preview. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use compose-preview immediately in the current project.

Related Skills

Looking for an alternative to compose-preview or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI