[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79HSZFR74RWKCK4R5MKEFNT":3,"skill-same:01M79HSZFR74RWKCK4R5MKEFNT":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M79HSZFR74RWKCK4R5MKEFNT","android-data-layer",null,"Data layer patterns for Android\u002FKMP - data sources, repositories, DTOs, mappers, Room entities, Ktor HttpClient, safe call helpers, token storage, and offline-first. Use this skill whenever writing or reviewing a data source or repository, creating DTOs or Room entities, writing mappers, setting up the Ktor HttpClient, handling network errors, or implementing token refresh. Trigger on phrases like \"create a repository\", \"create a data source\", \"add a DAO\", \"Ktor client\", \"write a mapper\", \"DTO\", \"Room entity\", \"network call\", \"token storage\", or \"offline-first\".","cosmictaserdev-creator\u002FConvx","cosmictaserdev-creator","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F278399831?v=4","01M79HSPX02ZNGBSR0HA77WMX1","Aryan sharma","01M79HSPY09R4SAB7DAFCQWSKV",1420,"GPL-3.0","https:\u002F\u002Fgithub.com\u002Fcosmictaserdev-creator\u002FConvx\u002Fblob\u002Fmain\u002Fcontributor\u002Fskills\u002Fandroid-data-layer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: android-data-layer\ndescription: |\n  Data layer patterns for Android\u002FKMP - data sources, repositories, DTOs, mappers, Room entities, Ktor HttpClient, safe call helpers, token storage, and offline-first. Use this skill whenever writing or reviewing a data source or repository, creating DTOs or Room entities, writing mappers, setting up the Ktor HttpClient, handling network errors, or implementing token refresh. Trigger on phrases like \"create a repository\", \"create a data source\", \"add a DAO\", \"Ktor client\", \"write a mapper\", \"DTO\", \"Room entity\", \"network call\", \"token storage\", or \"offline-first\".\n---\n \n# Android \u002F KMP Data Layer\n \n## Error Handling\n\nThis skill uses `Result\u003CT, E>`, `DataError`, and the extension helpers defined in the **android-error-handling** skill. Refer to that skill for the full `Result` wrapper, `DataError` sealed interface, and `map`\u002F`onSuccess`\u002F`onFailure`\u002F`asEmptyResult` extensions.\n\n---\n\n## Data Source vs Repository\n\n- **Data source** — accesses a single data source (local DB, remote API, file system). Most classes in the data layer are data sources.\n- **Repository** — combines multiple data sources (e.g., a remote API + a local DB for offline-first). Only use the term \"repository\" when the class genuinely coordinates multiple sources.\n\n```kotlin\n\u002F\u002F Single source → data source\ninterface NoteLocalDataSource {\n    suspend fun getNotes(): Result\u003CList\u003CNote>, DataError.Local>\n    suspend fun insertNote(note: Note): EmptyResult\u003CDataError.Local>\n}\n\ninterface NoteRemoteDataSource {\n    suspend fun fetchNotes(): Result\u003CList\u003CNote>, DataError.Network>\n}\n\n\u002F\u002F Multiple sources → repository\ninterface NoteRepository {\n    suspend fun getNotes(): Result\u003CList\u003CNote>, DataError>\n    suspend fun sync(): EmptyResult\u003CDataError>\n}\n```\n\n## Domain Layer Contracts\n\n- Pure Kotlin — no Android\u002Fframework imports.\n- Contains: domain models, data source\u002Frepository **interfaces**, error types.\n- **Every data source or repository used by a ViewModel must have an interface in `domain`** — enforces that `presentation` never depends on `data`, and enables testing.\n \n---\n \n## DTOs and Domain Models\n \n- Always separate: DTOs (data layer) ↔ Domain Models (domain layer).\n- Domain models never go directly into Room entities or Ktor request\u002Fresponse bodies.\n- Mappers are simple extension functions living in the data layer alongside the DTO:\n \n```kotlin\nfun NoteDto.toNote(): Note = Note(id = id, title = title, ...)\nfun Note.toNoteDto(): NoteDto = NoteDto(id = id, title = title, ...)\nfun NoteEntity.toNote(): Note = ...\nfun Note.toNoteEntity(): NoteEntity = ...\n```\n \n---\n \n## Implementations\n\nName implementations for what makes them unique — never suffix with `Impl`.\n\n### Data source (single source)\n\n```kotlin\nclass RoomNoteDataSource(private val dao: NoteDao) : NoteLocalDataSource {\n    override suspend fun getNotes(): Result\u003CList\u003CNote>, DataError.Local> {\n        return try {\n            Result.Success(dao.getAllNotes().map { it.toNote() })\n        } catch (e: Exception) {\n            Result.Error(DataError.Local.UNKNOWN)\n        }\n    }\n}\n```\n\n### Repository (multiple sources)\n\n```kotlin\nclass OfflineFirstNoteRepository(\n    private val localDataSource: NoteLocalDataSource,\n    private val remoteDataSource: NoteRemoteDataSource\n) : NoteRepository {\n    override suspend fun getNotes(): Result\u003CList\u003CNote>, DataError> {\n        return remoteDataSource.fetchNotes()\n            .onSuccess { notes -> localDataSource.insertAll(notes) }\n            .onFailure { localDataSource.getNotes() }\n    }\n}\n```\n\nUse names like `RoomNoteDataSource`, `KtorNoteDataSource`, `OfflineFirstNoteRepository`. The name should tell you what the class wraps or how it behaves.\n \n---\n \n## Ktor — HttpClient Factory (`core:data`)\n \nConfigure the client once. Accept the engine externally so tests can swap in a mock engine:\n \n```kotlin\nobject HttpClientFactory {\n    fun create(engine: HttpClientEngine): HttpClient = HttpClient(engine) {\n        install(ContentNegotiation) { json() }\n        install(Auth) {\n            bearer {\n                loadTokens { \u002F* load from DataStore *\u002F }\n                refreshTokens { \u002F* call refresh endpoint, save new tokens *\u002F }\n            }\n        }\n        install(Logging) { logger = Logger.DEFAULT; level = LogLevel.ALL }\n        defaultRequest { contentType(ContentType.Application.Json) }\n    }\n}\n```\n \nInject `HttpClient` via Koin. For KMP, use the platform default engine.\n \n---\n \n## Ktor — Safe Call Helpers (`core:data`)\n\nUse `safeCall` \u002F `responseToResult` helpers and typed extension functions (`HttpClient.get`, `HttpClient.post`, `HttpClient.delete`) to keep data source call sites clean and uniform. See the **android-error-handling** skill for the full implementation of these helpers.\n\n```kotlin\nsuspend fun getNotes(): Result\u003CList\u003CNoteDto>, DataError.Network> {\n    return httpClient.get(route = \"\u002Fnotes\")\n}\n```\n \n---\n \n## Token Storage\n \nStore tokens in DataStore (in `core:data` or a dedicated `:core:auth` \u002F `:feature:auth:data` module). The Ktor `Auth` plugin reads\u002Fwrites tokens and handles 401 refresh automatically.\n \n---\n \n## Room Migrations\n \nPrefer `@Database(autoMigrations = [AutoMigration(from = 1, to = 2)])`. Use manual `Migration` objects when the schema change is too complex for auto-migration.\n \n---\n \n## Offline-First (when applicable)\n \nFollow **Room as single source of truth**: fetch from network → persist to Room → expose DB `Flow` to the ViewModel. The ViewModel never observes network responses directly.\n \nThis pattern is optional — apply it when the project requires offline support.\n \n---\n \n## Naming Conventions\n \n| Thing | Convention | Example |\n|---|---|---|\n| Data source interface | `\u003CEntity>\u003CLocal\u002FRemote>DataSource` | `NoteLocalDataSource`, `NoteRemoteDataSource` |\n| Data source impl | describe what makes it unique | `RoomNoteDataSource`, `KtorNoteDataSource` |\n| Repository interface | `\u003CEntity>Repository` (multi-source only) | `NoteRepository` |\n| Repository impl | describe what makes it unique | `OfflineFirstNoteRepository` |\n| DTO | `\u003CModel>Dto` | `NoteDto` |\n| Room entity | `\u003CModel>Entity` | `NoteEntity` |\n| Mapper | extension fun on source type | `fun NoteDto.toNote()` |\n \n---\n \n## Checklist: Adding a New Data Source or Repository\n\n- [ ] Define domain model(s) in `feature:domain`\n- [ ] Define data source or repository interface in `feature:domain`\n- [ ] Define feature-specific error type(s) in `feature:domain` (implement `Error`) — see **android-error-handling** skill\n- [ ] Define DTOs and Room entities in `feature:data`\n- [ ] Write mappers as extension functions in `feature:data`\n- [ ] Implement data source (single source) or repository (multi-source) in `feature:data`, named for what makes it unique\n ","# Android \u002F KMP Data Layer\n \n## Error Handling\n\nThis skill uses `Result\u003CT, E>`, `DataError`, and the extension helpers defined in the **android-error-handling** skill. Refer to that skill for the full `Result` wrapper, `DataError` sealed interface, and `map`\u002F`onSuccess`\u002F`onFailure`\u002F`asEmptyResult` extensions.\n\n---\n\n## Data Source vs Repository\n\n- **Data source** — accesses a single data source (local DB, remote API, file system). Most classes in the data layer are data sources.\n- **Repository** — combines multiple data sources (e.g., a remote API + a local DB for offline-first). Only use the term \"repository\" when the class genuinely coordinates multiple sources.\n\n```kotlin\n\u002F\u002F Single source → data source\ninterface NoteLocalDataSource {\n    suspend fun getNotes(): Result\u003CList\u003CNote>, DataError.Local>\n    suspend fun insertNote(note: Note): EmptyResult\u003CDataError.Local>\n}\n\ninterface NoteRemoteDataSource {\n    suspend fun fetchNotes(): Result\u003CList\u003CNote>, DataError.Network>\n}\n\n\u002F\u002F Multiple sources → repository\ninterface NoteRepository {\n    suspend fun getNotes(): Result\u003CList\u003CNote>, DataError>\n    suspend fun sync(): EmptyResult\u003CDataError>\n}\n```\n\n## Domain Layer Contracts\n\n- Pure Kotlin — no Android\u002Fframework imports.\n- Contains: domain models, data source\u002Frepository **interfaces**, error types.\n- **Every data source or repository used by a ViewModel must have an interface in `domain`** — enforces that `presentation` never depends on `data`, and enables testing.\n \n---\n \n## DTOs and Domain Models\n \n- Always separate: DTOs (data layer) ↔ Domain Models (domain layer).\n- Domain models never go directly into Room entities or Ktor request\u002Fresponse bodies.\n- Mappers are simple extension functions living in the data layer alongside the DTO:\n \n```kotlin\nfun NoteDto.toNote(): Note = Note(id = id, title = title, ...)\nfun Note.toNoteDto(): NoteDto = NoteDto(id = id, title = title, ...)\nfun NoteEntity.toNote(): Note = ...\nfun Note.toNoteEntity(): NoteEntity = ...\n```\n \n---\n \n## Implementations\n\nName implementations for what makes them unique — never suffix with `Impl`.\n\n### Data source (single source)\n\n```kotlin\nclass RoomNoteDataSource(private val dao: NoteDao) : NoteLocalDataSource {\n    override suspend fun getNotes(): Result\u003CList\u003CNote>, DataError.Local> {\n        return try {\n            Result.Success(dao.getAllNotes().map { it.toNote() })\n        } catch (e: Exception) {\n            Result.Error(DataError.Local.UNKNOWN)\n        }\n    }\n}\n```\n\n### Repository (multiple sources)\n\n```kotlin\nclass OfflineFirstNoteRepository(\n    private val localDataSource: NoteLocalDataSource,\n    private val remoteDataSource: NoteRemoteDataSource\n) : NoteRepository {\n    override suspend fun getNotes(): Result\u003CList\u003CNote>, DataError> {\n        return remoteDataSource.fetchNotes()\n            .onSuccess { notes -> localDataSource.insertAll(notes) }\n            .onFailure { localDataSource.getNotes() }\n    }\n}\n```\n\nUse names like `RoomNoteDataSource`, `KtorNoteDataSource`, `OfflineFirstNoteRepository`. The name should tell you what the class wraps or how it behaves.\n \n---\n \n## Ktor — HttpClient Factory (`core:data`)\n \nConfigure the client once. Accept the engine externally so tests can swap in a mock engine:\n \n```kotlin\nobject HttpClientFactory {\n    fun create(engine: HttpClientEngine): HttpClient = HttpClient(engine) {\n        install(ContentNegotiation) { json() }\n        install(Auth) {\n            bearer {\n                loadTokens { \u002F* load from DataStore *\u002F }\n                refreshTokens { \u002F* call refresh endpoint, save new tokens *\u002F }\n            }\n        }\n        install(Logging) { logger = Logger.DEFAULT; level = LogLevel.ALL }\n        defaultRequest { contentType(ContentType.Application.Json) }\n    }\n}\n```\n \nInject `HttpClient` via Koin. For KMP, use the platform default engine.\n \n---\n \n## Ktor — Safe Call Helpers (`core:data`)\n\nUse `safeCall` \u002F `responseToResult` helpers and typed extension functions (`HttpClient.get`, `HttpClient.post`, `HttpClient.delete`) to keep data source call sites clean and uniform. See the **android-error-handling** skill for the full implementation of these helpers.\n\n```kotlin\nsuspend fun getNotes(): Result\u003CList\u003CNoteDto>, DataError.Network> {\n    return httpClient.get(route = \"\u002Fnotes\")\n}\n```\n \n---\n \n## Token Storage\n \nStore tokens in DataStore (in `core:data` or a dedicated `:core:auth` \u002F `:feature:auth:data` module). The Ktor `Auth` plugin reads\u002Fwrites tokens and handles 401 refresh automatically.\n \n---\n \n## Room Migrations\n \nPrefer `@Database(autoMigrations = [AutoMigration(from = 1, to = 2)])`. Use manual `Migration` objects when the schema change is too complex for auto-migration.\n \n---\n \n## Offline-First (when applicable)\n \nFollow **Room as single source of truth**: fetch from network → persist to Room → expose DB `Flow` to the ViewModel. The ViewModel never observes network responses directly.\n \nThis pattern is optional — apply it when the project requires offline support.\n \n---\n \n## Naming Conventions\n \n| Thing | Convention | Example |\n|---|---|---|\n| Data source interface | `\u003CEntity>\u003CLocal\u002FRemote>DataSource` | `NoteLocalDataSource`, `NoteRemoteDataSource` |\n| Data source impl | describe what makes it unique | `RoomNoteDataSource`, `KtorNoteDataSource` |\n| Repository interface | `\u003CEntity>Repository` (multi-source only) | `NoteRepository` |\n| Repository impl | describe what makes it unique | `OfflineFirstNoteRepository` |\n| DTO | `\u003CModel>Dto` | `NoteDto` |\n| Room entity | `\u003CModel>Entity` | `NoteEntity` |\n| Mapper | extension fun on source type | `fun NoteDto.toNote()` |\n \n---\n \n## Checklist: Adding a New Data Source or Repository\n\n- [ ] Define domain model(s) in `feature:domain`\n- [ ] Define data source or repository interface in `feature:domain`\n- [ ] Define feature-specific error type(s) in `feature:domain` (implement `Error`) — see **android-error-handling** skill\n- [ ] Define DTOs and Room entities in `feature:data`\n- [ ] Write mappers as extension functions in `feature:data`\n- [ ] Implement data source (single source) or repository (multi-source) in `feature:data`, named for what makes it unique\n ",{"name":5,"description":7},"main","f3dd4f71d603f8eb5828696fa7bab18c6172fb55","contributor\u002Fskills\u002Fandroid-data-layer",82,"https:\u002F\u002Fgithub.com\u002Fcosmictaserdev-creator\u002FConvx","https:\u002F\u002Fcosmictaser.de5.net","https:\u002F\u002Fgithub.com\u002Fcosmictaserdev-creator","Android developer who do side quest on backend and other things 😗","2026-11-14 01:39:13",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add cosmictaserdev-creator\u002FConvx --skill android-data-layer",{"tool":39,"command":40},"bunx","bunx skills add cosmictaserdev-creator\u002FConvx --skill android-data-layer",{"tool":42,"command":43},"pnpm","pnpm dlx skills add cosmictaserdev-creator\u002FConvx --skill android-data-layer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcosmictaserdev-creator\u002FConvx\u002Fblob\u002Fmain\u002Fcontributor\u002Fskills\u002Fandroid-data-layer\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M79HYWSY9H6DNW14YM28D5NH","review-animations","Reviews animation and motion code against a high craft bar derived from Emil Kowalski's design engineering philosophy. Default to flagging; approval is earned.","https:\u002F\u002Fgithub.com\u002Fcosmictaserdev-creator\u002FConvx\u002Fblob\u002Fmain\u002Fcontributor\u002Fskills\u002Freview-animations\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M79HYS6N1DJE11T0B8HZKHQP","prototype","Build multiple genuinely different versions of a UI piece you describe, rendered behind a visual picker so you can flip through them live and promote the one that feels right. Only runs when explicitly invoked; it does not trigger on its own.","https:\u002F\u002Fgithub.com\u002Fcosmictaserdev-creator\u002FConvx\u002Fblob\u002Fmain\u002Fcontributor\u002Fskills\u002Fprototype\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M79HYNBQ5NK2STBY5E1JMDZS","pick-ui-library","Pick the right library for a given frontend task from a curated, opinionated list — numbers, OTP inputs, charts, command menus, virtualization, drag and drop, toasts, state, styling, and more. Only runs when explicitly invoked; it does not trigger on its own.","https:\u002F\u002Fgithub.com\u002Fcosmictaserdev-creator\u002FConvx\u002Fblob\u002Fmain\u002Fcontributor\u002Fskills\u002Fpick-ui-library\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M79HYG5N018C9KB5SZAJ03VK","improve-animations","Survey a codebase's animation and motion code as a senior motion advisor, then produce a prioritized audit and self-contained implementation plans for other agents (or cheaper models) to execute. Read-only on source code — it plans improvements, it does not apply them. Use when the user asks to \"improve the animations\", \"audit the motion\", \"make this app feel better\", or wants a roadmap of animation fixes rather than a review of a single diff.","https:\u002F\u002Fgithub.com\u002Fcosmictaserdev-creator\u002FConvx\u002Fblob\u002Fmain\u002Fcontributor\u002Fskills\u002Fimprove-animations\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M79HYD3F6PR68BVEK4NYQT66","grilling","Interview the user relentlessly about a plan or design. Use when the user wants to stress-test a plan before building, or uses any 'grill' trigger phrases.","https:\u002F\u002Fgithub.com\u002Fcosmictaserdev-creator\u002FConvx\u002Fblob\u002Fmain\u002Fcontributor\u002Fskills\u002Fgrilling\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M79HYAYH7PR194SMGTP7NZWZ","grill-with-docs","A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.","https:\u002F\u002Fgithub.com\u002Fcosmictaserdev-creator\u002FConvx\u002Fblob\u002Fmain\u002Fcontributor\u002Fskills\u002Fgrill-with-docs\u002FSKILL.md",[],[]]