Android Clean Architecture
affaan-m/ECC
适用于Android和Kotlin多平台项目的Clean Architecture模式——模块结构、依赖规则、用例、仓库以及数据层模式。
Sets out the repository pattern's error-propagation model for Android and Kotlin Multiplatform, plus the Room setup for commonMain.
$ npx skills add rcosteira79/android-skills --skill android-data-layer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install rcosteira79/android-skills android-data-layer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/android-skills/skills/android-data-layer .claude/skills/android-data-layer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "android-data-layer" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/android-data-layer into .claude/skills/android-data-layer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "android-data-layer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/android-data-layerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add rcosteira79/android-skills --skill android-data-layer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install rcosteira79/android-skills android-data-layer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/android-skills/skills/android-data-layer .agents/skills/android-data-layer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "android-data-layer" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/android-data-layer into .agents/skills/android-data-layer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "android-data-layer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add rcosteira79/android-skills --skill android-data-layer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install rcosteira79/android-skills android-data-layer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/android-skills/skills/android-data-layer .cursor/skills/android-data-layer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "android-data-layer" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/android-data-layer into .cursor/skills/android-data-layer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "android-data-layer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/rcosteira79/android-skills.git --path plugins/android-skills/skills/android-data-layer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add rcosteira79/android-skills --skill android-data-layer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install rcosteira79/android-skills android-data-layer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/android-skills/skills/android-data-layer .gemini/skills/android-data-layer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "android-data-layer" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/android-data-layer into .gemini/skills/android-data-layer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "android-data-layer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install rcosteira79/android-skills android-data-layerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add rcosteira79/android-skills --skill android-data-layer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/android-skills/skills/android-data-layer .github/skills/android-data-layer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "android-data-layer" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/android-data-layer into .github/skills/android-data-layer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "android-data-layer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add rcosteira79/android-skills --skill android-data-layer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install rcosteira79/android-skills android-data-layer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/android-skills/skills/android-data-layer .opencode/skills/android-data-layer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "android-data-layer" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/android-data-layer into .opencode/skills/android-data-layer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "android-data-layer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
android-data-layerSets out the repository pattern's error-propagation model for Android and Kotlin Multiplatform, plus the Room setup for commonMain.
The data layer's public API is a set of repository interfaces, and its internals never leak upward. The core of this skill is a layered error model: data sources throw platform exceptions such as IOException, HttpException or SQLiteException, the repository is the error boundary and remaps them to a sealed DataError hierarchy, and the ViewModel never sees raw platform types. Without a domain layer the repository returns Result directly; with one, the repository throws DataError and the use case turns it into a Result with a domain error model.
It also covers Room in commonMain, which has been KMP-stable since 2.7.0. The shared setup differs from Android-only Room in three places: @ConstructedBy on the database paired with an expect object, BundledSQLiteDriver from androidx.sqlite to pin one SQLite version across targets, and per-target KSP configuration. Room types default to an Entity suffix unless the project already has a convention. Related skills handle Retrofit wiring and overall app architecture.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 0f9af5a. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Android Data Layer and Room in KMP loads about 1.2k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 342 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from rcosteira79/android-skills at commit 0f9af5a, republished under its MIT licence (© rcosteira79). 342 words, ~1,187 tokens.
.claude/skills/android-data-layer/SKILL.md (or your agent's skills folder).The data layer coordinates data from multiple sources; its public API is repository interfaces, and its internals (DAOs, API services, DTOs) never leak upward. This skill is the canonical home for the error-propagation model, plus the KMP-Room setup. Related: android-skills:android-retrofit (Retrofit service/OkHttp/Hilt wiring), android-skills:android-dev (overall app architecture).
The goal: data-layer errors (IOException / HttpException / SQLiteException) must never reach the ViewModel. Map them to a domain error type at the repository boundary. If the project already has an error convention, match it; otherwise a sealed DataError hierarchy is a reasonable default:
sealed class DataError(message: String, cause: Throwable? = null) : Exception(message, cause) {
class Network(cause: Throwable) : DataError("Network error", cause)
class Server(val code: Int, message: String?) : DataError("Server error $code: $message")
class Local(cause: Throwable) : DataError("Local storage error", cause)
}
// repository = error boundary: catch platform exceptions, return Result<T> (no domain layer) or throw DataError (with one)
suspend fun refreshNews(): Result<Unit> = withContext(io) {
try { newsDao.insertAll(newsApi.fetchLatest().map(NewsDto::toEntity)); Result.success(Unit) }
catch (e: IOException) { Result.failure(DataError.Network(e)) }
catch (e: HttpException) { Result.failure(DataError.Server(e.code(), e.message())) }
}The boundary moves outward by one layer when a domain layer exists:
IOException, HttpException, SQLiteException).DataError; never let raw platform types leak. Without a domain layer (simple MVVM): the repository returns Result<T> directly and the ViewModel handles it without knowing about platform exceptions.Result boundary — the repository instead throws DataError, and the use case catches it and returns Result<T> with a domain-specific error model. Use cases never catch platform exception types.Result<T> and map it to UI state (explicit loading / success / error).(Default to the Entity suffix — ArticleEntity — for Room types; match an existing convention such as a Cached prefix if the project already uses one.)
commonMain)Room has been KMP-stable since 2.7.0. The shared setup differs from the Android-only setup in three places:
@ConstructedBy(...) on the @Database, paired with an expect object Room generates per-platform actuals for.BundledSQLiteDriver (from androidx.sqlite:sqlite-bundled) — pins the same SQLite version across Android/iOS/JVM/web (Android's system SQLite drifts between API levels and devices).setQueryCoroutineContext(Dispatchers.IO) — Android Room defaults this; KMP doesn't.// commonMain
@Database(entities = [ArticleEntity::class], version = 1, exportSchema = true)
@ConstructedBy(AppDatabaseConstructor::class)
abstract class AppDatabase : RoomDatabase() { abstract fun articleDao(): ArticleDao }
@Suppress("KotlinNoActualForExpect")
expect object AppDatabaseConstructor : RoomDatabaseConstructor<AppDatabase>
fun getRoomDatabase(builder: RoomDatabase.Builder<AppDatabase>): AppDatabase =
builder.setDriver(BundledSQLiteDriver()).setQueryCoroutineContext(Dispatchers.IO).build()Each platform provides its own builder — Android Room.databaseBuilder(context, AppDatabase::class.java, "app.db"); iOS/JVM Room.databaseBuilder<AppDatabase>(databasePath = …). KSP must be wired per target (ksp(libs.androidx.room.compiler) is Android-only):
dependencies {
add("kspAndroid", libs.androidx.room.compiler)
add("kspIosArm64", libs.androidx.room.compiler)
add("kspIosSimulatorArm64", libs.androidx.room.compiler)
// … one per target
}
room { schemaDirectory("$projectDir/schemas") } // export the schema for migration-history trackingFor pure-Android projects, skip @ConstructedBy and call Room.databaseBuilder(context, AppDatabase::class.java, "app.db") directly — Room behaves identically; the KMP setup is opt-in when the data layer must live in commonMain.
© rcosteira79, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in plugins/android-skills/skills/android-data-layer of rcosteira79/android-skills.
Open the folder on GitHubat commit 0f9af5a
Android Data Layer and Room in KMP next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Android Data Layer and Room in KMP this skillrcosteira79/android-skills | 151 | — | ~1.2k | Automated safety check: Pass | MIT | |
| Android Clean Architectureaffaan-m/ECC | 275k | 2 repos | ~1.8k | Automated safety check: Pass | MIT | |
| Android Clean Architectureaffaan-m/ECC | 275k | 4 repos | ~2.2k | Automated safety check: Pass | MIT | |
| Quality Test Pilotnekomangaorg/Neko | 2.8k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| Architecture Overclocknekomangaorg/Neko | 2.8k | — | ~1.4k | Automated safety check: Pass | Apache-2.0 | |
| Architecture Renovatornekomangaorg/Neko | 2.8k | — | ~1.2k | Automated safety check: Pass | Apache-2.0 |
affaan-m/ECC
适用于Android和Kotlin多平台项目的Clean Architecture模式——模块结构、依赖规则、用例、仓库以及数据层模式。
affaan-m/ECC
Applies Clean Architecture to Android and Kotlin Multiplatform projects: module layout, dependency rules, UseCases, Repositories and data layer patterns.
nekomangaorg/Neko
Writes high-quality unit tests for Kotlin Android codebases to increase meaningful test coverage.
nekomangaorg/Neko
Resolves deep, structural performance bottlenecks in the Kotlin Android codebase.
nekomangaorg/Neko
Resolves deep architectural debt in the Kotlin Android codebase through macro-level refactoring.
parkwoocheol/compose-webview
Manages MkDocs documentation site and API references for ComposeWebView.
rcosteira79/android-skills
Guides writing correct, performant Compose and Compose Multiplatform UI across Android, desktop, iOS and web, from state and animation to design-to-code and crash fixes.
rcosteira79/android-skills
Helps choose how common Kotlin Multiplatform code reaches platform APIs: expect/actual, a common interface with platform bindings, or separate platform screens.
rcosteira79/android-skills
Android and KMP debugging techniques for crashes, ANRs, memory leaks, R8 traces, Gradle failures and Compose recomposition, built on finding the root cause first.
rcosteira79/android-skills
Sets house defaults for Android and Kotlin Multiplatform work and routes to the right specialized skill for Compose, networking, testing or build tooling.
rcosteira79/android-skills
Sets up Android Gradle convention plugins in a build-logic composite build, including the version catalog wiring and shared configuration that are easy to get wrong.
rcosteira79/android-skills
A skill your agent uses when setting up or working with Retrofit in Android — service interface definitions, coroutines integration, OkHttp configuration, Hilt module setup, and error handling in…
Categories
Sets out the repository pattern's error-propagation model for Android and Kotlin Multiplatform, plus the Room setup for commonMain. The data layer's public API is a set of repository interfaces, and its internals never leak upward. The core of this skill is a layered error model: data sources throw platform exceptions such as IOException, HttpException or SQLiteException, the repository is the error boundary and remaps them to a sealed DataError hierarchy, and the ViewModel never sees raw platform types.
Android Data Layer and Room in KMP fits situations like: designing how repository errors reach the ViewModel in an Android app; deciding where Result is created with or without a domain layer; setting up Room in commonMain for Kotlin Multiplatform; replacing leaked IOException or HttpException handling with a DataError type.
Run `npx skills add rcosteira79/android-skills --skill android-data-layer -a claude-code`. Or copy the skill folder (plugins/android-skills/skills/android-data-layer in rcosteira79/android-skills) into .claude/skills/android-data-layer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add rcosteira79/android-skills --skill android-data-layer -a codex`. Or copy the skill folder (plugins/android-skills/skills/android-data-layer in rcosteira79/android-skills) into .agents/skills/android-data-layer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rcosteira79/android-skills --skill android-data-layer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/android-data-layer, .gemini/skills/android-data-layer, .github/skills/android-data-layer and .opencode/skills/android-data-layer in your project.
SKILL.md names no scripts, command-line tools or credentials: Android Data Layer and Room in KMP is instructions for the agent only. Our summary lists: An Android or Kotlin Multiplatform project.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Android Data Layer and Room in KMP is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Android Data Layer and Room in KMP: Android Clean Architecture (affaan-m/ECC, 275k stars), Android Clean Architecture (affaan-m/ECC, 275k stars), Quality Test Pilot (nekomangaorg/Neko, 2.8k stars) and Architecture Overclock (nekomangaorg/Neko, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
rcosteira79 (a GitHub user) maintains it in rcosteira79/android-skills, which has 151 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on September 19, 2026.
Source: rcosteira79/android-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.