Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

android-compose安卓撰写

Agent Skill

android-compose 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

343

周安装

14

GitHub Stars

4

下载量

110
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:android-compose(安卓撰写)
来源仓库:https://github.com/alphaonedev/openclaw-graph
仓库路径:skills/android-compose
安装命令:
npx skills add https://github.com/alphaonedev/openclaw-graph --skill android-compose
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/alphaonedev/openclaw-graph --skill android-compose

简介

android-compose 提供 Jetpack Compose 声明式 UI 的开发支持与代码生成。

  • 适用于现代化 Android 应用界面构建,支持动态列表与主题适配。
  • 可自动生成可复用组件、状态管理与屏幕导航逻辑。
  • 安装命令为 npx skills add https://github.com/alphaonedev/openclaw-graph --skill android-compose。
  • 推荐用于新项目或从 XML 迁移至 Compose 的重构场景。

SKILL.md

android-compose

Purpose

This skill equips the AI to generate and manipulate Android UI code using Jetpack Compose, focusing on declarative syntax for efficient, reactive interfaces. Use it to handle UI components, state management, and navigation in Android apps.

When to Use

Apply this skill when building or refactoring Android apps that require modern UI patterns, such as dynamic lists, theme-aware designs, or screen navigation. Use it for new projects with Material 3 or to migrate from XML layouts to Compose for better performance and code simplicity.

Key Capabilities

  • Define reusable UI elements with @Composable annotations.
  • Manage state via state hoisting to avoid bugs in recomposition.
  • Render efficient lists with LazyColumn for large datasets.
  • Implement Material 3 components like Button and Scaffold for consistent theming.
  • Access global context with CompositionLocal for sharing data across composables.
  • Handle navigation using navigation-compose for multi-screen apps.

Usage Patterns

To build a UI, start by creating a top-level @Composable function in your Activity or Fragment. Always hoist state to parent composables to enable proper recomposition. For lists, wrap items in LazyColumn to lazy-load content. Use MaterialTheme for styling and CompositionLocalProvider to inject values. When navigating, set up a NavHost with composable destinations.

Common Commands/API

  • Use @Composable annotation: Import androidx.compose.runtime.Composable; annotate functions like @Composable fun MyScreen() {Text("Hello")}
  • Manage state: Use remember and mutableStateOf, e.g., val count by remember {mutableStateOf(0)}
  • Lazy lists: Import androidx.compose.foundation.lazy.LazyColumn; use LazyColumn {items(list) {ItemRow(it)}}
  • Material 3: Import androidx.compose.material3.MaterialTheme; wrap UI in MaterialTheme {Surface {MyContent()}}
  • CompositionLocal: Define with compositionLocalOf, e.g., val LocalUser = compositionLocalOf {null}; access with LocalUser.current
  • Navigation: Add dependency in build.gradle: implementation "androidx.navigation:navigation-compose:2.5.3"; set up with NavHost(navController) {composable("route") {Screen()}}

Integration Notes

Integrate Compose into an Android project by adding the Compose BOM in build.gradle: dependencies {implementation platform('androidx.compose:compose-bom:2023.10.01') implementation 'androidx.compose.ui:ui' implementation 'androidx.compose.material3:material3'}. Enable Compose in the module's build.gradle with composeOptions {kotlinCompilerExtensionVersion '1.4.7'}. For navigation, combine with ViewModel by injecting it via hilt or manual dependency. Use $ANDROID_HOME environment for SDK paths if needed, and set $COMPOSE_VERSION for custom versions in scripts.

Error Handling

Handle recomposition errors by ensuring state is hoisted; for example, if a composable crashes due to stale state, wrap it in a function that passes state as parameters. Common issues: Invalid changes during composition—use rememberUpdatedState for callbacks. For LazyColumn errors like IndexOutOfBounds, ensure data is loaded before rendering. Log errors with Log.e("ComposeError", "Message") and use try-catch in non-UI code. If navigation fails, check navController setup and routes; debug with Android Studio's Compose preview.

Concrete Usage Examples

  1. Simple composable with state: Create a counter UI by writing: @Composable fun Counter() {var count by remember {mutableStateOf(0)} Button(onClick = {count++}) {Text("$count")}} Then, call it from your Activity: setContent {Counter()}
  2. Navigation with LazyColumn: Set up a screen with a list: @Composable fun HomeScreen(navController: NavController) {LazyColumn {items(10) {Text("Item $it"); if (it == 5) Button(onClick = {navController.navigate("detail")}) {Text("Go")}}}} In your app: NavHost {composable("home") {HomeScreen(navController)}}

Graph Relationships

  • Related to cluster: mobile
  • Connected via tags: compose (e.g., links to other UI skills), android (e.g., integrates with Android core skills), ui (e.g., shares patterns with web UI skills), material (e.g., aligns with design system skills)
  • Dependencies: navigation-compose (for routing), material3 (for theming)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.48%
按下载量换算40

Claude

28.19%
按下载量换算31

Cursor

19.11%
按下载量换算21

Gemini CLI

9.4%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills