android-clean-architecture
适用于 Android 和 Kotlin 多平台 (KMP) 项目的整洁架构 (Clean Architecture) 模式 —— 包括模块结构、依赖规则、UseCase、Repository 以及数据层模式。
Skill by lza6
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/lza6-android-clean-architecture
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/android-clean-architecture
What's inside
- Skill name
android-clean-architecture- Description
- 适用于 Android 和 Kotlin 多平台 (KMP) 项目的整洁架构 (Clean Architecture) 模式 —— 包括模块结构、依赖规则、UseCase、Repository 以及数据层模式。
- License
- Apache-2.0
- Instructions
- 335 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Android 整洁架构 (Android Clean Architecture)
适用于 Android 和 KMP 项目的整洁架构模式。涵盖模块边界、依赖倒置、UseCase/Repository 模式,以及使用 Room、SQLDelight 和 Ktor 进行的数据层设计。
## 何时激活
- 规划 Android 或 KMP 项目的模块结构
- 实现 UseCase、Repository 或 DataSource
- 设计各层(领域层、数据层、表现层)之间的数据流
- 使用 Koin 或 Hilt 设置依赖注入
- 在分层架构中使用 Room、SQLDelight 或 Ktor
## 模块结构 (Module Structure)
### 推荐布局
```
project/
├── app/ # Android 入口点、依赖注入配置、Application 类
├── core/ # 共享工具类、基类、错误类型
├── domain/ # UseCase、领域模型、Repository 接口(纯 Kotlin)
├── data/ # Repository 实现、DataSource、数据库、网络
├── presentation/ # 界面、ViewModel、UI 模型、导航
├── design-system/ # 可重用的 Compose 组件、主题、排版
31 └── feature/ # 功能模块(可选,用于大型项目)
32 ├── auth/
33 ├── settings/
34 └── profile/
```
### 依赖规则
```
app → presentation, domain, data, core
presentation → domain, design-system, core
data → domain, core
domain → core (或无依赖)
core → (无)
```
**关键原则**:`domain` 层绝不能依赖 `data` 层、`presentation` 层或任何框架。它应仅包含纯 Kotlin 代码。
## 领域层 (Domain Layer)
### UseCase 模式
每个 UseCase 代表一个业务操作。使用 `operator fun invoke` 使调用更简洁:
```kotlin
class GetItemsByCategoryUseCase(
private val repository: ItemRepository
) {
suspend operator fun invoke(category: String): Result<List<Item>> {
return repository.getItemsByCategory(category)
}
}
// 基于 Flow 的 UseCase,用于响应式流
class ObserveUserProgressUseCase(
private val repository: UserRepository
) {
operator fun invoke(userId: String): Flow<UserProgress> {
return repository.observeProgress(userId)
}
}
```
### 领域模型 (Domain Models)
领域模型是纯 Kotlin 数据类 —— 无需任何框架注解:
```kotlin
data class Item(
val id: String,
val title: String,
val description: String,
val tags: List<String>,
val status: Status,
val category: String
)
enum class Status { DRAFT, ACTIVE, ARCHIVED }
```
### Repository 接口
在领域层定义,在数据层实现:
```kotlin
interface ItemRepository {
suspend fun getItemsByCategory(category: String): Result<List<Item>>
suspend fun saveItem(item: Item): Result<Unit>
fun observeItems(): Flow<List<Item>>
}
```
## 数据层 (Data Layer)
### Repository 实现
负责协调本地和远程数据源:
```kotlin
class ItemRepositoryImpl(
private val localDataSource: ItemLocalDataSource,
private val remoteDataSource: ItemRemoteDataSource
) : ItemRepository {
override suspend fun getItemsByCategory(category: String): Result<List<Item>> {
return runCatching {
val remote = remoteDataSource.fetchItems(category)
localDataSource.insertItems(remote.map { it.toEntity() })
localDataSource.getItemsByCategory(category).map { it.toDomain() }
}
}
override suspend fun saveItem(item: Item): Result<Unit> {
return runCatching {
localDataSource.insertItems(listOf(item.toEntity()))From lza6/Claude-code-cli-config, Apache-2.0.
More from lza6/Claude-code-cli-config
- 0.472score
agent-orchestrator
lza6
通过自主子代理编排复杂任务。将宏观任务分解为子任务,生成带有动态 SKILL.md 文件的专用子代理,协调基于文件的通信,整合结果,并在完成后解散代理。强制触发词:orchestrate (编排), multi-agent (多代理), decompose task (分解任务), spawn agents…
SkillDFreshness: D★ 8Claude Code +9 - 0.470score
architecture-patterns
lza6
架构模式 - 后端架构模式,用于构建可维护、可测试的系统:整洁架构、六边形架构和领域驱动设计。适用于设计新后端系统、重构单体、建立架构标准、创建可测试代码库或规划微服务分解。
SkillDFreshness: D★ 8Claude Code +9 - 0.470score
architecture-designer
lza6
架构设计师 - 适用于设计新系统架构、审查现有设计或做出架构决策。用于系统设计、架构审查、设计模式、架构决策记录(ADR)、可扩展性规划。
SkillDFreshness: D★ 8Claude Code +9 - 0.469score
agent-guardian
lza6
Agent 体验守护系统。解决AI助手常见体验问题 :长时间无响应、任务卡死、中英文混用、状态不透明。包含看门狗监控、智能状态汇报、即时状态查询、语言一致性过滤、消息队列追踪。适用于所有渠道 ( QQ微信//Telegram飞书//Discord等 )。当用户抱怨等太久没回复、 “回复中英文混着”、…
SkillDFreshness: D★ 8Claude Code +9 - 0.469score
agent-sort
lza6
通过并行且具备仓库感知的审查过程,将技能、命令、规则、钩子和附加项分类到 DAILY (日常) 与 LIBRARY (库) 桶中,为特定仓库构建有证据支持的 ECC 安装计划。当需要将 ECC 裁剪到项目实际需要的内容,而非加载完整包时使用。
SkillDFreshness: D★ 8Claude Code +9 - 0.467score
1password
lza6
设置并使用 1Password CLI (op)。在安装 CLI、启用桌面应用集成、登录(单个或多个帐户)或通过 op 读取/注入/运行密钥时使用。
SkillDFreshness: D★ 8Claude Code +9 - 0.466score
automation-audit-ops
lza6
基于证据的自动化清单和重叠审计工作流,适用于 ECC。在修复任何内容之前,当用户想要了解哪些作业、钩子、连接器、MCP 服务器或封装程序是活跃的、损坏的、冗余的或缺失时使用。
SkillDFreshness: D★ 8Claude Code +9 - 0.466score
ai-regression-testing
lza6
AI 辅助开发的回归测试策略。包括无数据库依赖的沙盒模式 API 测试、自动化缺陷检查工作流,以及用于捕捉同一模型编写并评审代码时产生的 AI 盲区的模式。
SkillDFreshness: D★ 8Claude Code +9 - 0.466score
api-connector-builder
lza6
通过精确匹配目标仓库现有的集成模式,构建新的 API 连接器 (Connector) 或提供者 (Provider)。当需要增加一个集成点而不发明第二套架构时使用。
SkillDFreshness: D★ 8Claude Code +9 - 0.465score
aliyun-clawscan
lza6
分析用户 OpenClaw 环境和已安装技能的安全态势。在用户准备安装新技能并希望验证其安全性、对现有技能的行为有疑虑、或需要对整个 OpenClaw 配置进行全面安全检查时使用。适用于执行安全审计、调查可疑技能、或在安装前评估配置风险和潜在漏洞的用户。
SkillDFreshness: D★ 8Claude Code +9 - 0.463score
agent-memory
lza6
AI 代理的记忆管理工具 - 列表显示、搜索查找、摘要生成及记忆文件维护。包含 AI 驱动的摘要功能。
SkillDFreshness: D★ 8Claude Code +9 - 0.463score
agent-introspection-debugging
lza6
针对 AI 代理 (Agent) 失败的结构化自调试工作流,包括捕捉、诊断、受控恢复和内省报告。
SkillDFreshness: D★ 8Claude Code +9
Signals
- Stars
- 8
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- Apr 13, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/lza6/Claude-code-cli-config
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from lza6
- 0.608score
googletranslate-use
lza6
用 curl / OpenAI SDK / Cherry Studio 调用翻译 API(流式/非流式/批量/语言检测),含认证与错误码。
SkillBFreshness: B★ 49Claude Code +9 - 0.608score
googletranslate-debug
lza6
排查翻译失败 / 慢 / 限流 / 多 Key 切换 / 熔断,用 X-Trace-Summary、/v1/traces、/metrics 定位。
SkillBFreshness: B★ 49Claude Code +9 - 0.608score
googletranslate-extend
lza6
扩展 googletranslate-2api(新端点/多模态/新 SKILL)的规范:先分析后实施、TDD、真实验收、按主题提交。
SkillBFreshness: B★ 49Claude Code +9 - 0.605score
googletranslate-install
lza6
一条命令安装并启动 googletranslate-2api(Windows 优先),校验密钥后验证 /health。
SkillBFreshness: B★ 49Claude Code +9 - 0.472score
agent-orchestrator
lza6
通过自主子代理编排复杂任务。将宏观任务分解为子任务,生成带有动态 SKILL.md 文件的专用子代理,协调基于文件的通信,整合结果,并在完成后解散代理。强制触发词:orchestrate (编排), multi-agent (多代理), decompose task (分解任务), spawn agents…
SkillDFreshness: D★ 8Claude Code +9 - 0.470score
architecture-designer
lza6
架构设计师 - 适用于设计新系统架构、审查现有设计或做出架构决策。用于系统设计、架构审查、设计模式、架构决策记录(ADR)、可扩展性规划。
SkillDFreshness: D★ 8Claude Code +9
Cite this page
android-clean-architecture skill. Agent Mart. https://agentmart.dev/skills/lza6-android-clean-architecture (last updated 2026-10-24)