Android Skills

仓库地址

github.com/kongxiaoan/...

Android Skills

这是一个面向 Android 开发的 Codex/Claude Skills 知识体系,覆盖 Kotlin、Jetpack Compose、协程、Flow、KMP 边界、UI 测试、性能诊断,以及基于 Clean Architecture + MVI 的 Compose Feature 架构设计。

本项目基于来源项目 chrisbanes/skills 整理和扩展:

  • 保留来源项目中高质量的 Kotlin 与 Jetpack Compose 专项 skills。
  • 新增 android-compose-clean-mvi-architecture,用于把 Compose 状态、Side Effect、Flow、协程、测试和稳定性规则串成完整的 Android Feature 架构审查路径。
  • docs/ 目录包含中文解析文档,用来解释各个 skill 背后的设计原则、适用边界、常见错误和工程判断。

安装

使用 skills CLI

bash 复制代码
npx skills add kongxiaoan/android-skills

或作为 Claude Code plugin 安装:

text 复制代码
/plugin marketplace add kongxiaoan/android-skills
/plugin install chrisbanes-skills@chrisbanes-skills

如何使用

推荐入口

Skills

Android 架构

  • android-compose-clean-mvi-architecture --- 使用 Clean Architecture + MVI 设计和审查 Android Compose Feature 架构,包括 ViewModel/state-holder 边界、不可变 UI State、Intent/Effect 建模、UseCase、Repository、导航/snackbar 副作用和测试策略。

Jetpack Compose

状态与副作用
  • compose-state-authoring --- 正确编写 Compose 本地 mutable state 与 read-only composable accessor。
  • compose-state-hoisting --- 判断 Compose UI element state 应留在本地、上提到父级、抽 plain state holder,还是交给 screen-level state holder。
  • compose-state-holder-ui-split --- 拆分 state-holder wiring 与 plain UI rendering,让 screen 更容易 preview、测试和复用。
  • compose-side-effects --- 选择并正确 key Compose effect API,用于 event Flow 收集、callback、cleanup、navigation、snackbar、analytics 等副作用。
性能
UI API、布局与交互
测试
  • compose-ui-testing-patterns --- 在 plain UI tests、semantics assertions、key/focus tests、MutableInteractionSource interaction tests、screenshot tests 和 integration tests 之间选择合适测试形态。

Kotlin

中文解析文档

docs/ 目录包含按知识顺序整理的中文深度解析。文档用于学习和体系化理解;真正触发 agent 行为的入口仍然是 skills/<skill-name>/SKILL.md

这些文档可以作为 Android/Compose 架构学习路线阅读:先看架构总览和 Compose runtime,再进入状态、副作用、性能、UI API、测试和 Kotlin 基础设施。每篇文档都围绕一个 skill 展开,补充背景模型、决策标准、典型反例和审查清单,帮助把零散规则整理成可执行的工程判断。

架构总览

Compose 状态与副作用

  • Compose State Authoring --- 深入解释 remembermutableStateOf、snapshot collection、rememberSaveable、State read 范围和 @ReadOnlyComposable
  • Compose State Hoisting --- 说明 local state、最低共同 owner、plain state holder、ViewModel/screen state holder 的状态归属判断。
  • Compose State Holder / UI Split --- 说明 Route/state-holder composable 与 plain UI composable 的职责拆分。
  • Compose Side Effects --- 说明 SideEffectLaunchedEffectDisposableEffectrememberCoroutineScoperememberUpdatedStatesnapshotFlow 的准确边界。

Compose 性能

Compose UI API、交互与测试

  • Compose Modifier and Layout Style --- 说明 modifier 参数、root modifier、modifier chain、布局职责和条件布局风格。
  • Compose Slot API Pattern --- 说明如何用 @Composable slots 设计可复用组件的可变视觉区域。
  • Compose Animations --- 说明 AnimatedVisibilityanimate*AsStaterememberTransitionAnimatedContentCrossfadeAnimatable 的选择。
  • Compose Focus Navigation --- 说明 keyboard、TV、D-pad、FocusRequester、focusProperties、key event 和 focus 测试。
  • Compose UI Testing Patterns --- 说明 plain UI test、semantics、callback、interaction source、focus/key、screenshot 和 integration test 的选择。

Kotlin

贡献约定

Skills 位于 skills/<skill-name>/SKILL.md,保持扁平结构,不按语言或主题嵌套目录。SKILL.md frontmatter 中的 name: 必须与目录名完全一致。

添加、重命名或删除 skill 时,也要同步更新本 README 的 skill 列表。

相关推荐
listening7773 分钟前
HarmonyOS 6.1 混沌工程实战:从“故障免疫”到“韧性架构”
华为·架构·harmonyos
晚风吹长发9 分钟前
Docker使用——Docker容器及相关命令
linux·运维·服务器·docker·容器·架构
电子科技圈17 分钟前
先进封装、芯粒架构和3D集成——先进异构集成亟需兼具标准化与定制化能力的互联及总线IP解决方案
tcp/ip·设计模式·架构·软件构建·代码规范·设计规范
小蠢驴打代码1 小时前
记忆库能通过测试,不等于回答值得信:Coding Agent Memory 的两层评估设计
github·ai编程
喂你一颗橘子糖1 小时前
我用 Codex 跑长任务:快照、Loop 和单线写入,解决三个失控问题
ai编程
AI小白Lin1 小时前
33 个 AI 专家全票通过?那问题才刚开始
人工智能·架构
李剑一2 小时前
瑞幸也AI上了?我用AI命令行帮我点了一杯咖啡,但是我花了不止一杯咖啡钱
aigc·openai·ai编程
leoZ2312 小时前
记忆系统与 Agent 定制完全指南(六):Agent 编排与调度
ai编程
人间凡尔赛2 小时前
AI-Native 云原生架构:2026 年从容器编排到智能体编排的范式革命
后端·云原生·架构