一键导入
android-data-layer
Guidance on implementing the Data Layer using Repository pattern, Room (Local), and Retrofit (Remote) with offline-first synchronization.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guidance on implementing the Data Layer using Repository pattern, Room (Local), and Retrofit (Remote) with offline-first synchronization.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Koog 开发工具包:梳理 Tools/MCP/Prompt/LLM 参数/记忆/压缩/审核等规范并产出模板。用户提到 Koog、ToolRegistry、MCP、AskUser、ChatMemory 时调用。
将当前分支重组为一组小而清晰、适合代码评审的语义化提交。用户要求拆分提交、整理 commit 历史、重做提交顺序时调用。
Complete guide for BaseKit Network module, including Coroutines support (KCHttp), error handling, HTTPS, SSE, and caching strategies.
Expert guidance on setting up scalable Gradle build logic using Convention Plugins and Version Catalogs.
Solutions for common Android Gradle build errors. Invoke when encountering build failures, duplicate file conflicts, manifest merger issues, or dependency resolution errors.
Guide for Jetpack Navigation 3 in Compose. Invoke when user asks to set up Navigation 3, manage back stack, or use NavDisplay.
| name | android-data-layer |
| description | Guidance on implementing the Data Layer using Repository pattern, Room (Local), and Retrofit (Remote) with offline-first synchronization. |
The Data Layer coordinates data from multiple sources.
class NewsRepository @Inject constructor(
private val newsDao: NewsDao,
private val newsApi: NewsApi
) {
// Expose data from Local DB as the source of truth
val newsStream: Flow<List<News>> = newsDao.getAllNews()
// Sync operation
suspend fun refreshNews() {
val remoteNews = newsApi.fetchLatest()
newsDao.insertAll(remoteNews)
}
}
@Entity data classes.Flow<T> for observable data.suspend functions in interfaces.try-catch blocks or a Result wrapper to handle exceptions (NoInternet, 404, etc.) gracefully.WorkManager to push changes to server.