agentsclimarketplace

Cometchat android v6 extensions

Skill cometchat/cometchat-skills/skills/cometchat-android-v6-extensions

CometChat Android UIKit v6 extension architecture — DataSource/Repository pattern, custom message types, and data-layer overridesFrom its SKILL.md

Install
npx -y skills add cometchat/cometchat-skills --skill cometchat-android-v6-extensions

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

8.9 KB, ~2.0k tokens by cl100k_base, as published. Nobody here has run it

Ground truth: com.cometchat:chatuikit-{compose,kotlin}-android:6.x (+ calls-sdk-android:5.x) — resolved AAR (javap) + ui-kit/android/v6. Official docs: https://www.cometchat.com/docs/fundamentals/extensions-overview · Docs MCP: claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.

Companion skills: cometchat-android-v6-features (feature catalog), cometchat-android-v6-kotlin-customization, cometchat-android-v6-compose-customization

Purpose

Extend the CometChat UIKit v6 data layer using the clean architecture DataSource/Repository pattern. Create custom DataSource implementations, override repository behavior, and register custom message types.

Use this skill when

  • Creating a custom DataSource implementation to change how data is fetched
  • Overriding default repository behavior
  • Registering custom message types
  • Understanding the data flow from DataSource → Repository → ViewModel

Do not use this skill when

  • Customizing UI/bubble rendering (use cometchat-*-customization — that's the BubbleFactory layer)
  • Working with component APIs (use cometchat-*-components)

1. Clean Architecture Overview

The chatuikit-core module follows clean architecture with three layers:

┌─────────────────────────────────────────┐
│  UI Layer (chatuikit-kotlin / compose)  │
│  Components observe ViewModel state     │
├─────────────────────────────────────────┤
│  ViewModel Layer (core/viewmodel/)      │
│  Calls use cases / repositories         │
├─────────────────────────────────────────┤
│  Domain Layer (core/domain/)            │
│  Repository interfaces, Use cases       │
├─────────────────────────────────────────┤
│  Data Layer (core/data/)                │
│  DataSource interfaces + impls          │
│  Repository implementations            │
└─────────────────────────────────────────┘

2. DataSource Pattern

Each feature area has a DataSource interface and default implementation:

core/data/datasource/
├── ConversationListDataSource.kt       (interface)
├── ConversationListDataSourceImpl.kt   (default implementation)
├── MessageListDataSource.kt
├── MessageListDataSourceImpl.kt
├── ...

2.1 All DataSource Types

DataSourceImplementationWhat it provides
CallButtonsDataSourceCallButtonsDataSourceImplCall button actions
CallLogsDataSourceCallLogsDataSourceImplCall history fetching
CollaborativeDataSourceCollaborativeDataSourceImplDocument/whiteboard data
ConversationListDataSourceConversationListDataSourceImplConversation list fetching
GroupMembersDataSourceGroupMembersDataSourceImplGroup member operations
GroupsDataSourceGroupsDataSourceImplGroup list fetching
MessageComposerDataSourceMessageComposerDataSourceImplComposer actions/attachments
MessageHeaderDataSourceMessageHeaderDataSourceImplHeader data (name, status)
MessageInformationDataSourceMessageInformationDataSourceImplRead receipts, delivery info
MessageListDataSourceMessageListDataSourceImplMessage fetching/pagination
PollDataSourcePollDataSourceImplPoll creation/voting
ReactionListDataSourceReactionListDataSourceImplReaction data
SearchDataSourceSearchDataSourceImplGlobal search
StickerDataSourceStickerDataSourceImplSticker fetching
UsersDataSourceUsersDataSourceImplUser list fetching

2.2 Additional DataSource

FilePurpose
MessageReceiptEventListener.ktListens for receipt events at the data layer

3. Repository Pattern

Repositories in core/data/repository/ implement domain interfaces from core/domain/repository/:

core/data/repository/
├── CallButtonsRepositoryImpl.kt
├── CallLogsRepositoryImpl.kt
├── ConversationListRepositoryImpl.kt
├── GroupMembersRepositoryImpl.kt
├── GroupsRepositoryImpl.kt
├── MessageComposerRepositoryImpl.kt
├── MessageHeaderRepositoryImpl.kt
├── MessageInformationRepositoryImpl.kt
├── MessageListRepositoryImpl.kt
├── PollRepositoryImpl.kt
├── ReactionListRepositoryImpl.kt
├── SearchRepositoryImpl.kt
├── StickerRepositoryImpl.kt
├── UsersRepositoryImpl.kt

Each repository wraps a DataSource and adds business logic, caching, or transformation.

4. ViewModel Layer

ViewModels in core/viewmodel/ consume repositories and expose UI state:

// Example: CometChatConversationsViewModel
// - Injected via CometChatConversationsViewModelFactory
// - Exposes StateFlow<ConversationListUIState>
// - Calls ConversationListRepositoryImpl internally

ViewModel factories in core/factory/ handle dependency injection:

FactoryViewModel
CometChatConversationsViewModelFactoryCometChatConversationsViewModel
CometChatMessageListViewModelFactoryCometChatMessageListViewModel
CometChatGroupsViewModelFactoryCometChatGroupsViewModel
CometChatUsersViewModelFactoryCometChatUsersViewModel
CometChatCallLogsViewModelFactoryCometChatCallLogsViewModel
CometChatMessageComposerViewModelFactoryCometChatMessageComposerViewModel
CometChatMessageHeaderViewModelFactoryCometChatMessageHeaderViewModel
CometChatGroupMembersViewModelFactoryCometChatGroupMembersViewModel
CometChatMessageInformationViewModelFactoryCometChatMessageInformationViewModel
CometChatReactionListViewModelFactoryCometChatReactionListViewModel
CometChatSearchViewModelFactoryCometChatSearchViewModel
CometChatCallButtonsViewModelFactoryCometChatCallButtonsViewModel
CometChatCreatePollViewModelFactoryCometChatCreatePollViewModel
CometChatThreadHeaderViewModelFactoryCometChatThreadHeaderViewModel
CometChatStickerKeyboardViewModelFactoryCometChatStickerKeyboardViewModel
CometChatIncomingCallViewModelFactoryCometChatIncomingCallViewModel
CometChatOutgoingCallViewModelFactoryCometChatOutgoingCallViewModel
CometChatAIAssistantChatHistoryViewModelFactoryCometChatAIAssistantChatHistoryViewModel

5. UI State Classes

Each ViewModel exposes a sealed UI state from core/state/:

State ClassUsed By
CallLogsUIStateCall logs
MessageListUIStateMessage list
GroupsUIStateGroups list
UsersUIStateUsers list
GroupMembersUIStateGroup members
MessageComposerUIStateComposer
MessageHeaderUIStateHeader
MessageInformationUIStateMessage info
ReactionListUIStateReactions
SearchUIStateSearch
CallButtonsUIStateCall buttons
CreatePollUIStatePoll creation
ThreadHeaderUIStateThread header
StickerKeyboardUIStateSticker keyboard
IncomingCallUIStateIncoming call
OutgoingCallUIStateOutgoing call
ChatHistoryUIStateAI chat history
ConversationStarterUIStateAI conversation starter
ConversationSummaryUIStateAI conversation summary
SmartRepliesUIStateAI smart replies
DeleteStateDelete operations
UIStateBase UI state

6. Data Flow

User Action → Component → ViewModel → Repository → DataSource → CometChat SDK
                                                                      ↓
UI Update  ← Component ← ViewModel ← StateFlow ← Repository ← SDK Response

Hard rules

  • DataSources are the DATA layer — they fetch and mutate data. Do NOT confuse with BubbleFactory which is the UI rendering layer
  • The v5 DataSource decorator / ChatConfigurator pattern for bubble customization does NOT exist in v6 — use BubbleFactory instead (see cometchat-*-customization)
  • ViewModels are shared across both UI stacks (Kotlin Views and Compose) — they live in chatuikit-core
  • Always use the provided ViewModel factories — do not instantiate ViewModels directly

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.