@cometchat/skills 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -17
  3. package/bin/install.js +389 -43
  4. package/package.json +19 -9
  5. package/skills/cometchat/SKILL.md +1066 -265
  6. package/skills/cometchat-android-v5/SKILL.md +120 -0
  7. package/skills/cometchat-android-v5-components/SKILL.md +430 -0
  8. package/skills/cometchat-android-v5-core/SKILL.md +468 -0
  9. package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
  10. package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
  11. package/skills/cometchat-android-v5-features/SKILL.md +130 -0
  12. package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
  13. package/skills/cometchat-android-v5-production/SKILL.md +94 -0
  14. package/skills/cometchat-android-v5-push/SKILL.md +620 -0
  15. package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
  16. package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
  17. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
  18. package/skills/cometchat-android-v6/SKILL.md +107 -0
  19. package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
  20. package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
  21. package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
  22. package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
  23. package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
  24. package/skills/cometchat-android-v6-core/SKILL.md +354 -0
  25. package/skills/cometchat-android-v6-events/SKILL.md +212 -0
  26. package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
  27. package/skills/cometchat-android-v6-features/SKILL.md +130 -0
  28. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
  29. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
  30. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
  31. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
  32. package/skills/cometchat-android-v6-production/SKILL.md +187 -0
  33. package/skills/cometchat-android-v6-push/SKILL.md +274 -0
  34. package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
  35. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
  36. package/skills/cometchat-angular-components/SKILL.md +706 -0
  37. package/skills/cometchat-angular-core/SKILL.md +444 -0
  38. package/skills/cometchat-angular-customization/SKILL.md +424 -0
  39. package/skills/cometchat-angular-features/SKILL.md +447 -0
  40. package/skills/cometchat-angular-patterns/SKILL.md +447 -0
  41. package/skills/cometchat-angular-placement/SKILL.md +685 -0
  42. package/skills/cometchat-angular-production/SKILL.md +415 -0
  43. package/skills/cometchat-angular-theming/SKILL.md +365 -0
  44. package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
  45. package/skills/cometchat-astro-patterns/SKILL.md +3 -3
  46. package/skills/cometchat-components/SKILL.md +11 -0
  47. package/skills/cometchat-core/SKILL.md +11 -6
  48. package/skills/cometchat-customization/references/component-catalog.md +1 -1
  49. package/skills/cometchat-features/SKILL.md +176 -108
  50. package/skills/cometchat-flutter-v5/SKILL.md +167 -0
  51. package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
  52. package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
  53. package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
  54. package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
  55. package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
  56. package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
  57. package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
  58. package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
  59. package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
  60. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
  61. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
  62. package/skills/cometchat-flutter-v6/SKILL.md +445 -0
  63. package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
  64. package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
  65. package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
  66. package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
  67. package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
  68. package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
  69. package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
  70. package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
  71. package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
  72. package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
  73. package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
  74. package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
  75. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
  76. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
  77. package/skills/cometchat-ios/SKILL.md +323 -0
  78. package/skills/cometchat-ios-components/SKILL.md +651 -0
  79. package/skills/cometchat-ios-core/SKILL.md +822 -0
  80. package/skills/cometchat-ios-customization/SKILL.md +825 -0
  81. package/skills/cometchat-ios-features/SKILL.md +725 -0
  82. package/skills/cometchat-ios-placement/SKILL.md +750 -0
  83. package/skills/cometchat-ios-production/SKILL.md +730 -0
  84. package/skills/cometchat-ios-push/SKILL.md +582 -0
  85. package/skills/cometchat-ios-theming/SKILL.md +631 -0
  86. package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
  87. package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
  88. package/skills/cometchat-native-components/SKILL.md +594 -0
  89. package/skills/cometchat-native-core/SKILL.md +407 -0
  90. package/skills/cometchat-native-customization/SKILL.md +594 -0
  91. package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
  92. package/skills/cometchat-native-features/SKILL.md +608 -0
  93. package/skills/cometchat-native-placement/SKILL.md +500 -0
  94. package/skills/cometchat-native-production/SKILL.md +694 -0
  95. package/skills/cometchat-native-push/SKILL.md +593 -0
  96. package/skills/cometchat-native-testing/SKILL.md +583 -0
  97. package/skills/cometchat-native-theming/SKILL.md +656 -0
  98. package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
  99. package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
  100. package/skills/cometchat-production/SKILL.md +60 -0
  101. package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: cometchat-android-v5-testing
3
+ description: "Testing patterns for CometChat Android — JUnit + Mockito setup, mocking the SDK, Espresso UI tests, E2E with Maestro, and CI integration."
4
+ license: "MIT"
5
+ compatibility: "Android 7.0+; Java 8+; Kotlin 1.8+; com.cometchat:chat-uikit-android:5.x; JUnit 4 (kit sample apps); Mockito/MockK"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat android testing junit espresso maestro mockito ci"
11
+ ---
12
+
13
+ > **Companion skills:** `cometchat-android-v5-core` covers init/login patterns you're testing;
14
+ > `cometchat-android-v5-components` covers component APIs to assert against.
15
+
16
+ ## Purpose
17
+
18
+ This skill teaches how to write and run tests against a CometChat Android integration. Covers unit tests with JUnit + Mockito/MockK, UI tests with Espresso, E2E with Maestro, and CI integration.
19
+
20
+ ---
21
+
22
+ ## Use this skill when
23
+
24
+ - "Add tests for my CometChat integration"
25
+ - "How do I mock CometChat in tests?"
26
+ - "Set up E2E testing"
27
+ - "CI pipeline for chat tests"
28
+
29
+ ## Do not use this skill when
30
+
31
+ - Setting up the integration → use `cometchat-android-v5-core`
32
+ - Diagnosing runtime issues → use `cometchat-android-v5-troubleshooting`
33
+
34
+ ---
35
+
36
+ ## 1. What to test vs what to skip
37
+
38
+ **Worth testing:**
39
+ - Custom components you wrote (custom bubbles, headers, empty states)
40
+ - Navigation logic triggered by CometChat events (push tap → deep-link)
41
+ - Init/login lifecycle (init before login, already-logged-in skip)
42
+ - Production auth token refresh logic
43
+ - User-ID mapping (your auth system → CometChat UID)
44
+
45
+ **Skip:**
46
+ - UIKit internals — that's CometChat's responsibility
47
+ - Realtime delivery (A sends, B receives) — requires real servers, flaky
48
+ - Presence/typing indicators — race-prone
49
+ - Snapshot tests of CometChat components — theme changes churn them
50
+
51
+ **Golden rule:** if the test fails because YOUR code changed, it's valuable. If it fails because the UIKit updated, it's churn.
52
+
53
+ ---
54
+
55
+ ## 2. Toolchain
56
+
57
+ | Layer | Tool | Why |
58
+ |---|---|---|
59
+ | Unit tests | JUnit 4 + Mockito / MockK | Standard Android unit testing |
60
+ | Component tests | Robolectric | Run Android component tests without emulator |
61
+ | UI tests | Espresso | Android's native UI testing framework |
62
+ | E2E | Maestro | Declarative YAML flows, fast, stable |
63
+ | CI | GitHub Actions / Bitrise | Automated test runs |
64
+
65
+ ---
66
+
67
+ ## 3. Mocking the CometChat SDK
68
+
69
+ **Java (Mockito):**
70
+ ```java
71
+ @RunWith(MockitoJUnitRunner.class)
72
+ public class ChatViewModelTest {
73
+ @Test
74
+ public void testLoginCallsInit() {
75
+ try (MockedStatic<CometChatUIKit> mocked = mockStatic(CometChatUIKit.class)) {
76
+ mocked.when(CometChatUIKit::getLoggedInUser).thenReturn(null);
77
+ mocked.when(CometChatUIKit::isSDKInitialized).thenReturn(true);
78
+
79
+ // Test your ViewModel or helper that calls login
80
+ // Verify init was called before login
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ **Kotlin (MockK):**
87
+ ```kotlin
88
+ @Test
89
+ fun `already logged in skips login`() {
90
+ mockkStatic(CometChatUIKit::class)
91
+ every { CometChatUIKit.getLoggedInUser() } returns mockk<User>()
92
+
93
+ // Your code should skip login
94
+ verify(exactly = 0) { CometChatUIKit.login(any(), any()) }
95
+
96
+ unmockkAll()
97
+ }
98
+ ```
99
+
100
+ ---
101
+
102
+ ## 4. Espresso UI tests
103
+
104
+ ```java
105
+ @RunWith(AndroidJUnit4.class)
106
+ public class MessagesActivityTest {
107
+ @Rule
108
+ public ActivityScenarioRule<MessagesActivity> rule =
109
+ new ActivityScenarioRule<>(MessagesActivity.class);
110
+
111
+ @Test
112
+ public void messageListIsDisplayed() {
113
+ onView(withId(R.id.messageList)).check(matches(isDisplayed()));
114
+ }
115
+
116
+ @Test
117
+ public void composerIsDisplayed() {
118
+ onView(withId(R.id.composer)).check(matches(isDisplayed()));
119
+ }
120
+ }
121
+ ```
122
+
123
+ ---
124
+
125
+ ## 5. E2E with Maestro
126
+
127
+ `.maestro/chat-happy-path.yaml`:
128
+ ```yaml
129
+ appId: com.yourapp.android
130
+ ---
131
+ - launchApp
132
+ - tapOn: "Login"
133
+ - inputText: "cometchat-uid-1"
134
+ - tapOn: "Continue"
135
+ - assertVisible: "Chats"
136
+ - tapOn:
137
+ id: "conversations"
138
+ index: 0
139
+ - assertVisible: "Type a message"
140
+ - inputText: "Hello from Maestro"
141
+ - tapOn:
142
+ id: "send_button"
143
+ - assertVisible: "Hello from Maestro"
144
+ ```
145
+
146
+ Run: `maestro test .maestro/chat-happy-path.yaml`
147
+
148
+ ---
149
+
150
+ ## 6. CI integration
151
+
152
+ ```yaml
153
+ # .github/workflows/test.yml
154
+ name: test
155
+ on: [push, pull_request]
156
+ jobs:
157
+ unit-tests:
158
+ runs-on: ubuntu-latest
159
+ steps:
160
+ - uses: actions/checkout@v4
161
+ - uses: actions/setup-java@v4
162
+ with:
163
+ java-version: 17
164
+ distribution: temurin
165
+ - run: ./gradlew test
166
+ ```
167
+
168
+ ---
169
+
170
+ ## 7. Common failure modes
171
+
172
+ | Symptom | Cause | Fix |
173
+ |---|---|---|
174
+ | `NoClassDefFoundError: CometChat` | SDK not mocked | Add Mockito/MockK mock for static methods |
175
+ | Espresso test hangs | Async CometChat operation | Register `IdlingResource` |
176
+ | Tests pass locally, fail on CI | Emulator not booted | Pin emulator API level in CI |
177
+ | `IllegalStateException: not initialized` | `init()` not called in test setup | Mock `isSDKInitialized()` to return `true` |
178
+
179
+ ---
180
+
181
+ ## Hard rules
182
+
183
+ - **Mock the SDK in every unit test.** Running real CometChat requires network + servers.
184
+ - **Don't test UIKit internals.** You're responsible for YOUR code.
185
+ - **Skip realtime tests.** They require real servers and produce flaky suites.
186
+ - **Assert on view IDs and state, not pixels.** Theme changes churn pixel assertions.
187
+ - **E2E runs on emulator/device, not JUnit.** Don't test real CometChat flow in unit tests.
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: cometchat-android-v5-theming
3
+ description: "Customize CometChat UI to match your app's design system. Covers CometChatTheme, XML attributes, style classes, dark mode, and color system."
4
+ license: "MIT"
5
+ compatibility: "Android 7.0+; Java 8+; Kotlin 1.8+; com.cometchat:chat-uikit-android:5.x"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat android theming customization branding dark-mode colors styles"
11
+ ---
12
+
13
+ > **Companion skills:** `cometchat-android-v5-core` covers initialization;
14
+ > `cometchat-android-v5-components` provides the component catalog;
15
+ > `cometchat-android-v5-customization` covers deeper component-level overrides.
16
+
17
+ ## Purpose
18
+
19
+ This skill teaches how to theme CometChat Android UI Kit v5 to match your app's design system. CometChat uses a combination of XML theme attributes, the `CometChatTheme` static class, and per-component style resources.
20
+
21
+ ---
22
+
23
+ ## Use this skill when
24
+
25
+ - Changing CometChat colors to match brand
26
+ - Customizing fonts or typography
27
+ - Enabling dark mode
28
+ - Applying per-component styles
29
+ - "How do I change the primary color?"
30
+ - "How do I make CometChat match my app theme?"
31
+
32
+ ## Do not use this skill when
33
+
34
+ - Writing custom message templates → use `cometchat-android-v5-customization`
35
+ - Adding features → use `cometchat-android-v5-features`
36
+
37
+ ---
38
+
39
+ ## 1. How CometChat theming works
40
+
41
+ CometChat's visual identity is driven by XML theme attributes defined in `attrs.xml` files. Every `CometChat*` component reads these attributes from the current theme. To override: define the attributes in your app's theme.
42
+
43
+ ### The CometChatTheme class
44
+
45
+ `CometChatTheme` is a static utility class that provides programmatic access to theme colors. It reads from XML theme attributes and supports runtime overrides.
46
+
47
+ **Key static methods:**
48
+
49
+ | Method | Description |
50
+ |---|---|
51
+ | `setPrimaryColor(int)` | Override primary color at runtime |
52
+ | `getPrimaryColor(Context)` | Get current primary color |
53
+ | `getExtendedPrimaryColor50(Context)` through `getExtendedPrimaryColor900(Context)` | Get extended primary color shades (auto-generated from primary) |
54
+ | `getBackgroundColor1(Context)` | Primary background color |
55
+ | `getTextColorPrimary(Context)` | Primary text color |
56
+ | `getTextColorSecondary(Context)` | Secondary text color |
57
+ | `getIconTintHighlight(Context)` | Highlighted icon tint |
58
+ | `getIconTintSecondary(Context)` | Secondary icon tint |
59
+
60
+ ### Setting primary color programmatically
61
+
62
+ **Java:**
63
+ ```java
64
+ CometChatTheme.setPrimaryColor(Color.parseColor("#6C63FF"));
65
+ ```
66
+
67
+ **Kotlin:**
68
+ ```kotlin
69
+ CometChatTheme.setPrimaryColor(Color.parseColor("#6C63FF"))
70
+ ```
71
+
72
+ This must be called before any CometChat component is inflated. The extended color shades (50–900) are auto-generated by blending the primary color with white (light mode) or black (dark mode).
73
+
74
+ ---
75
+
76
+ ## 2. XML theme attributes
77
+
78
+ Override CometChat colors in your app's `themes.xml`:
79
+
80
+ ```xml
81
+ <style name="AppTheme" parent="CometChatTheme.DayNight">
82
+ <!-- CometChat primary color -->
83
+ <item name="cometchatPrimaryColor">#6C63FF</item>
84
+
85
+ <!-- Background colors -->
86
+ <item name="cometchatBackgroundColor1">#FFFFFF</item>
87
+ <item name="cometchatBackgroundColor2">#F5F5F5</item>
88
+
89
+ <!-- Text colors -->
90
+ <item name="cometchatTextColorPrimary">#141414</item>
91
+ <item name="cometchatTextColorSecondary">#727272</item>
92
+
93
+ <!-- Extended primary shades (optional — auto-generated if not set) -->
94
+ <item name="cometchatExtendedPrimaryColor50">#F0EEFF</item>
95
+ <item name="cometchatExtendedPrimaryColor100">#D9D5FF</item>
96
+ </style>
97
+ ```
98
+
99
+ ---
100
+
101
+ ## 3. Per-component styles
102
+
103
+ Each component has its own style attribute that can be overridden in your theme. The naming convention is `cometchat<ComponentName>Style`.
104
+
105
+ | Component | Style attribute | Example |
106
+ |---|---|---|
107
+ | `CometChatConversations` | `cometchatConversationsStyle` | `@style/CustomConversationsStyle` |
108
+ | `CometChatMessageList` | `cometchatMessageListStyle` | `@style/CustomMessageListStyle` |
109
+ | `CometChatMessageComposer` | `cometchatMessageComposerStyle` | `@style/CustomComposerStyle` |
110
+ | `CometChatMessageHeader` | `cometchatMessageHeaderStyle` | `@style/CustomHeaderStyle` |
111
+ | `CometChatUsers` | `cometchatUsersStyle` | `@style/CustomUsersStyle` |
112
+ | `CometChatGroups` | `cometchatGroupsStyle` | `@style/CustomGroupsStyle` |
113
+ | `CometChatAvatar` | `cometchatAvatarStyle` | `@style/CustomAvatarStyle` |
114
+ | `CometChatBadge` | `cometchatBadgeStyle` | `@style/CustomBadgeStyle` |
115
+ | `CometChatStatusIndicator` | `cometchatStatusIndicatorStyle` | `@style/CustomStatusStyle` |
116
+ | `CometChatMessageReceipt` | `cometchatMessageReceiptStyle` | `@style/CustomReceiptStyle` |
117
+
118
+ ---
119
+
120
+ ## 4. Programmatic styling
121
+
122
+ Every component exposes setter methods for colors, text appearances, and drawables:
123
+
124
+ **Java:**
125
+ ```java
126
+ CometChatConversations conversations = findViewById(R.id.conversations);
127
+ conversations.setBackgroundColor(Color.WHITE);
128
+ conversations.setTitleTextColor(Color.BLACK);
129
+ conversations.setTitleTextAppearance(R.style.MyTitleStyle);
130
+ conversations.setSeparatorColor(Color.LTGRAY);
131
+ conversations.setAvatarStyle(R.style.MyAvatarStyle);
132
+ conversations.setStatusIndicatorStyle(R.style.MyStatusStyle);
133
+ ```
134
+
135
+ ---
136
+
137
+ ## 5. Dark mode
138
+
139
+ CometChat respects Android's `DayNight` theme. Define separate values in `values-night/themes.xml`:
140
+
141
+ ```xml
142
+ <!-- values/themes.xml (light) -->
143
+ <style name="AppTheme" parent="CometChatTheme.DayNight">
144
+ <item name="cometchatPrimaryColor">#6C63FF</item>
145
+ <item name="cometchatBackgroundColor1">#FFFFFF</item>
146
+ <item name="cometchatTextColorPrimary">#141414</item>
147
+ </style>
148
+
149
+ <!-- values-night/themes.xml (dark) -->
150
+ <style name="AppTheme" parent="CometChatTheme.DayNight">
151
+ <item name="cometchatPrimaryColor">#7B73FF</item>
152
+ <item name="cometchatBackgroundColor1">#1A1A2E</item>
153
+ <item name="cometchatTextColorPrimary">#E0E0E0</item>
154
+ </style>
155
+ ```
156
+
157
+ The `CometChatTheme` class auto-detects the current night mode and adjusts extended color shades accordingly.
158
+
159
+ ---
160
+
161
+ ## Hard rules
162
+
163
+ - **Set primary color BEFORE inflating components.** `CometChatTheme.setPrimaryColor()` must be called before `setContentView()` or component inflation.
164
+ - **Use XML theme attributes for global overrides.** Per-component setters are for fine-tuning.
165
+ - **Extended primary shades are auto-generated.** Only override them if you need exact brand colors at each shade level.
166
+ - **Dark mode uses `values-night/`.** Follow Android's standard `DayNight` theme pattern.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: cometchat-android-v5-troubleshooting
3
+ description: "Diagnose and fix problems with a CometChat Android integration. Gradle errors, runtime crashes, rendering issues, and version compatibility."
4
+ license: "MIT"
5
+ compatibility: "Android 7.0+; Java 8+; Kotlin 1.8+; com.cometchat:chat-uikit-android:5.x"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory, grepSearch"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat android troubleshooting fix diagnose errors crashes gradle proguard"
11
+ ---
12
+
13
+ > **Companion skills:** `cometchat-android-v5-core` covers correct init/login patterns;
14
+ > `cometchat-android-v5-production` covers ProGuard rules.
15
+
16
+ ## Purpose
17
+
18
+ This skill teaches how to diagnose CometChat Android integration problems systematically. It covers Gradle build errors, runtime crashes, rendering issues, and version compatibility.
19
+
20
+ ---
21
+
22
+ ## Use this skill when
23
+
24
+ - "CometChat isn't working"
25
+ - "I'm getting a build error"
26
+ - "The chat screen is blank"
27
+ - "Messages aren't loading"
28
+ - Gradle sync failures
29
+ - Runtime crashes with CometChat in the stack trace
30
+
31
+ ## Do not use this skill when
32
+
33
+ - Setting up a new integration → use `cometchat-android-v5-core`
34
+ - Customizing appearance → use `cometchat-android-v5-theming`
35
+
36
+ ---
37
+
38
+ ## 1. Common issues
39
+
40
+ | Symptom | Likely cause | Fix |
41
+ |---|---|---|
42
+ | `Could not resolve com.cometchat:chat-uikit-android` | Missing Maven repo | Add `maven { url "https://dl.cloudsmith.io/public/cometchat/cometchat/maven/" }` to repositories |
43
+ | `Duplicate class com.cometchat.*` | Multiple CometChat versions | Check dependency tree: `./gradlew app:dependencies` |
44
+ | Blank conversation list | Not logged in, or no conversations exist | Verify `getLoggedInUser() != null`. Send a test message from dashboard. |
45
+ | `CometChatException: ERR - Authentication null` | `init()` not called or failed | Call `init()` before `login()`. Check `isSDKInitialized()`. |
46
+ | `CometChatException: appIdErr` | App ID not set in UIKitSettings | Verify `setAppId()` in UIKitSettingsBuilder |
47
+ | Components show but no data | Login succeeded but wrong region | Verify region matches dashboard: `"us"`, `"eu"`, `"in"` |
48
+ | `ClassNotFoundException` in release build | ProGuard stripping CometChat classes | Add `-keep class com.cometchat.** { *; }` to proguard-rules.pro |
49
+ | `UnsupportedOperationException: Failed to resolve attribute` when inflating CometChat views | App theme inherits `Theme.AppCompat.*` or `Theme.Material3.*` — the kit's attrs are resolved against Material 2 (`CometChatTheme.DayNight` itself parents on `Theme.MaterialComponents.DayNight.NoActionBar`) | Change app theme parent to `CometChatTheme.DayNight` |
50
+ | `NetworkOnMainThreadException` | Calling CometChat sync methods on main thread | Use callbacks (all CometChat methods are async) |
51
+ | `minSdkVersion 21` error | CometChat requires API 24+ | Set `minSdkVersion 24` in build.gradle |
52
+ | Message list shows wrong messages | `setUser()`/`setGroup()` called with wrong object | Verify UID/GUID matches the intended conversation |
53
+ | Calling buttons not showing | Calling SDK not added | Add `com.cometchat:calls-sdk-android:4.+` dependency |
54
+ | `java.lang.NoSuchMethodError` | Version mismatch between UI Kit and Chat SDK | Use compatible versions — UI Kit 5.x requires Chat SDK 4.x |
55
+
56
+ ---
57
+
58
+ ## 2. Diagnostic steps
59
+
60
+ 1. **Check init:** `CometChatUIKit.isSDKInitialized()` — must be `true`
61
+ 2. **Check login:** `CometChatUIKit.getLoggedInUser()` — must not be `null`
62
+ 3. **Check Gradle:** `./gradlew app:dependencies | grep cometchat` — verify versions
63
+ 4. **Check manifest:** Verify `INTERNET` permission
64
+ 5. **Check region:** Must match dashboard exactly
65
+ 6. **Check logs:** Filter logcat for `CometChat` tag
66
+
67
+ ---
68
+
69
+ ## Hard rules
70
+
71
+ - **Always check init + login first.** 90% of "it's not working" issues are init/login failures.
72
+ - **Never guess at the cause.** Check logcat, check the dependency tree, check the dashboard.
73
+ - **ProGuard is the #1 release-build issue.** Always add keep rules before the first release build.
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: cometchat-android-v6
3
+ description: "Entry-point dispatcher for CometChat Android UIKit v6 — routes to the correct skill based on project stack and task"
4
+ license: "MIT"
5
+ compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-compose-android:6.x / com.cometchat:chatuikit-kotlin-android:6.x"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat, android, uikit, kotlin, jetpack-compose, dispatcher"
11
+ ---
12
+
13
+ > **Companion skills:** cometchat-android-v6-core, cometchat-android-v6-events, cometchat-android-v6-kotlin-components, cometchat-android-v6-compose-components, cometchat-android-v6-kotlin-theming, cometchat-android-v6-compose-theming, cometchat-android-v6-kotlin-customization, cometchat-android-v6-compose-customization, cometchat-android-v6-kotlin-placement, cometchat-android-v6-compose-placement, cometchat-android-v6-builder-settings, cometchat-android-v6-features, cometchat-android-v6-extensions, cometchat-android-v6-push, cometchat-android-v6-production, cometchat-android-v6-troubleshooting, cometchat-android-v6-testing
14
+
15
+ ## Purpose
16
+
17
+ This is the entry-point skill for the CometChat Android UIKit v6. It detects the project's UI stack (Kotlin Views, Jetpack Compose, or both) and routes to the correct specialized skill.
18
+
19
+ ## Use this skill when
20
+
21
+ - The user mentions "CometChat" in an Android/Kotlin project
22
+ - The user wants to add chat, messaging, or calling features to an Android app
23
+ - You need to determine which CometChat skill to activate
24
+ - The user asks a general CometChat question without specifying a stack
25
+
26
+ ## Do not use this skill when
27
+
28
+ - You already know which specific skill to use (go directly to it)
29
+ - The project is React, React Native, iOS, Flutter, or Web (this skill is Android-only)
30
+
31
+ ## 1. Project Detection
32
+
33
+ Detect the UI stack by inspecting the project's Gradle files:
34
+
35
+ ```kotlin
36
+ // Check build.gradle.kts or build.gradle for dependencies:
37
+
38
+ // Jetpack Compose stack
39
+ implementation("com.cometchat:chatuikit-compose-android:6.x")
40
+
41
+ // Kotlin Views stack
42
+ implementation("com.cometchat:chatuikit-kotlin-android:6.x")
43
+
44
+ // Core only (shared module, no UI)
45
+ implementation("com.cometchat:chatuikit-core-android:6.x")
46
+ ```
47
+
48
+ Also check for module includes in `settings.gradle`:
49
+ - `:chatuikit-compose` → Compose stack
50
+ - `:chatuikit-kotlin` → Kotlin Views stack
51
+ - `:chatuikit-core` → Core module
52
+
53
+ ## 2. Architecture Overview
54
+
55
+ v6 uses a 3-module architecture:
56
+
57
+ | Module | Package | Purpose |
58
+ |---|---|---|
59
+ | `chatuikit-core` | `com.cometchat.uikit.core` | Shared: init, login, ViewModels, events, data layer |
60
+ | `chatuikit-kotlin` | `com.cometchat.uikit.kotlin` | Kotlin Views UI: custom Views, RecyclerView, XML themes |
61
+ | `chatuikit-compose` | `com.cometchat.uikit.compose` | Compose UI: @Composable functions, CompositionLocal themes |
62
+
63
+ Both UI modules depend on `chatuikit-core`. The core module holds all business logic.
64
+
65
+ ## 3. Routing Table
66
+
67
+ | User wants to... | Route to skill |
68
+ |---|---|
69
+ | Add CometChat to a project / Gradle setup | `cometchat-android-v6-core` |
70
+ | Initialize the SDK / login / logout | `cometchat-android-v6-core` |
71
+ | Configure UIKitSettings in detail | `cometchat-android-v6-builder-settings` |
72
+ | Use a component (Kotlin Views) | `cometchat-android-v6-kotlin-components` |
73
+ | Use a component (Jetpack Compose) | `cometchat-android-v6-compose-components` |
74
+ | Place components in Activities/Fragments | `cometchat-android-v6-kotlin-placement` |
75
+ | Place components in Compose screens | `cometchat-android-v6-compose-placement` |
76
+ | Change colors/fonts (Kotlin Views) | `cometchat-android-v6-kotlin-theming` |
77
+ | Change colors/fonts (Compose) | `cometchat-android-v6-compose-theming` |
78
+ | Customize bubble rendering (Kotlin Views) | `cometchat-android-v6-kotlin-customization` |
79
+ | Customize bubble rendering (Compose) | `cometchat-android-v6-compose-customization` |
80
+ | Use AI features, reactions, polls, stickers | `cometchat-android-v6-features` |
81
+ | Extend with custom DataSources / message types | `cometchat-android-v6-extensions` |
82
+ | Listen to chat/call/user events | `cometchat-android-v6-events` |
83
+ | Add push notifications / FCM / VoIP | `cometchat-android-v6-push` |
84
+ | Prepare for production release | `cometchat-android-v6-production` |
85
+ | Debug issues | `cometchat-android-v6-troubleshooting` |
86
+ | Write tests | `cometchat-android-v6-testing` |
87
+
88
+ ## 4. Quick-Start Decision Tree
89
+
90
+ 1. **New project?** → `cometchat-android-v6-core` (Gradle setup + init)
91
+ 2. **Which UI stack?**
92
+ - Jetpack Compose → `cometchat-compose-*` skills
93
+ - Kotlin Views (XML layouts) → `cometchat-kotlin-*` skills
94
+ - Both → Use the appropriate stack-specific skill for each task
95
+ 3. **What task?**
96
+ - Show a component → `*-components`
97
+ - Style/theme → `*-theming`
98
+ - Customize bubbles → `*-customization`
99
+ - Place in navigation → `*-placement`
100
+
101
+ ## Hard rules
102
+
103
+ - ALWAYS detect the project stack before routing to a stack-specific skill
104
+ - NEVER mix Kotlin Views APIs with Compose APIs in the same code example
105
+ - NEVER reference v5 Java UIKit APIs — v6 is Kotlin-only
106
+ - When both stacks are present, ask the user which stack they're working with before proceeding
107
+ - Route to the most specific skill possible — don't try to answer from this dispatcher skill
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: cometchat-android-v6-builder-settings
3
+ description: "CometChat Android UIKit v6 UIKitSettings configuration — all builder options for SDK init, presence, calling, and host overrides"
4
+ license: "MIT"
5
+ compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-core-android:6.x"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat, android, settings, builder, configuration, calling"
11
+ ---
12
+
13
+ > **Companion skills:** cometchat-android-v6-core (init/login), cometchat-android-v6-push (FCM/VoIP)
14
+
15
+ ## Purpose
16
+
17
+ Detailed reference for `UIKitSettings.UIKitSettingsBuilder` — all configuration options for initializing the CometChat SDK, including presence subscriptions, calling features, and host overrides.
18
+
19
+ ## Use this skill when
20
+
21
+ - Configuring presence subscription types (all users, roles, friends)
22
+ - Enabling calling features and configuring `CallSettingsBuilder`
23
+ - Overriding admin or client host URLs
24
+ - Controlling socket connection behavior
25
+ - Understanding the full `UIKitSettingsBuilder` API
26
+
27
+ ## Do not use this skill when
28
+
29
+ - Just doing basic init/login (use `cometchat-android-v6-core` for quick setup)
30
+ - Working with UI components or theming
31
+
32
+ ## 1. UIKitSettingsBuilder — Complete API
33
+
34
+ ```kotlin
35
+ import com.cometchat.uikit.core.UIKitSettings
36
+
37
+ val settings = UIKitSettings.UIKitSettingsBuilder()
38
+
39
+ // Required
40
+ .setAppId("APP_ID") // CometChat App ID
41
+ .setRegion("us") // "us" or "eu"
42
+
43
+ // Authentication (dev only — use token auth in production)
44
+ .setAuthKey("AUTH_KEY") // Auth key from dashboard
45
+
46
+ // Presence subscriptions
47
+ .subscribePresenceForAllUsers() // Subscribe to all users' presence
48
+ .subscribePresenceForRoles(listOf("admin")) // Subscribe by roles
49
+ .subscribePresenceForFriends() // Subscribe to friends' presence
50
+
51
+ // Socket connection
52
+ .setAutoEstablishSocketConnection(true) // Auto-connect (default: true)
53
+
54
+ // Calling
55
+ .setEnableCalling(true) // Auto-init CometChatCalls SDK (default: false)
56
+ .setCallSettingsBuilder(callSettingsBuilder) // Custom call config (optional)
57
+
58
+ // Host overrides (advanced — for on-premise deployments)
59
+ .overrideAdminHost("https://custom-admin.example.com")
60
+ .overrideClientHost("https://custom-client.example.com")
61
+
62
+ .build()
63
+ ```
64
+
65
+ ## 2. Presence Subscription Types
66
+
67
+ Only one subscription type is active at a time. The last one set wins.
68
+
69
+ | Method | Subscription Type | Use Case |
70
+ |---|---|---|
71
+ | (none) | `"NONE"` | No presence updates (default) |
72
+ | `subscribePresenceForAllUsers()` | `"ALL_USERS"` | Small apps where you want all online statuses |
73
+ | `subscribePresenceForRoles(roles)` | `"ROLES"` | Subscribe to specific user roles |
74
+ | `subscribePresenceForFriends()` | `"FRIENDS"` | Social apps with friend lists |
75
+
76
+ ## 3. Calling Configuration
77
+
78
+ When `setEnableCalling(true)` is set, `CometChatUIKit.init()` automatically initializes the CometChatCalls SDK after the Chat SDK succeeds:
79
+
80
+ ```kotlin
81
+ // Basic calling setup
82
+ val settings = UIKitSettings.UIKitSettingsBuilder()
83
+ .setAppId("APP_ID")
84
+ .setRegion("us")
85
+ .setAuthKey("AUTH_KEY")
86
+ .setEnableCalling(true)
87
+ .build()
88
+ ```
89
+
90
+ For custom call settings:
91
+
92
+ ```kotlin
93
+ import com.cometchat.calls.core.CometChatCalls
94
+
95
+ val callSettingsBuilder = CometChatCalls.CallSettingsBuilder(context, null)
96
+ .setDefaultAudioMode("SPEAKER")
97
+ .startWithVideoMuted(true)
98
+
99
+ val settings = UIKitSettings.UIKitSettingsBuilder()
100
+ .setAppId("APP_ID")
101
+ .setRegion("us")
102
+ .setAuthKey("AUTH_KEY")
103
+ .setEnableCalling(true)
104
+ .setCallSettingsBuilder(callSettingsBuilder)
105
+ .build()
106
+ ```
107
+
108
+ After init, retrieve the stored builder:
109
+
110
+ ```kotlin
111
+ val builder: CometChatCalls.CallSettingsBuilder? = CometChatUIKit.getCallSettingsBuilder()
112
+ ```
113
+
114
+ ## 4. Checking Initialization State
115
+
116
+ ```kotlin
117
+ // Chat SDK initialized?
118
+ CometChatUIKit.isSDKInitialized()
119
+
120
+ // Calls SDK initialized? (only true if enableCalling was true AND init succeeded)
121
+ CometChatUIKit.isCallsSDKInitialized()
122
+ ```
123
+
124
+ ## 5. Application-Level Init Pattern
125
+
126
+ From `master-app-jetpack`, the recommended pattern separates SDK init from Calls SDK init:
127
+
128
+ ```kotlin
129
+ class MyApplication : Application() {
130
+ fun onSDKInitialized() {
131
+ // Called after CometChatUIKit.init() succeeds
132
+ // CometChatCalls is auto-initialized if enableCalling = true
133
+ // Register call listeners here
134
+ addCallListener()
135
+ }
136
+ }
137
+ ```
138
+
139
+ ## Hard rules
140
+
141
+ - NEVER set both `subscribePresenceForAllUsers()` and `subscribePresenceForRoles()` — only the last one takes effect
142
+ - NEVER use `setAuthKey()` in production — use `loginWithAuthToken()` instead
143
+ - `setEnableCalling(true)` requires the CometChatCalls SDK dependency in your Gradle file
144
+ - If CometChatCalls init fails, the Chat SDK still reports success — check `isCallsSDKInitialized()` separately
145
+ - `overrideAdminHost()` and `overrideClientHost()` are for on-premise deployments only — do not use with cloud-hosted CometChat