@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,365 @@
1
+ ---
2
+ name: cometchat-angular-theming
3
+ description: "CometChatThemeService palette — color tokens, light/dark mode, typography, per-component style objects, and CSS variable overrides for the CometChat Angular UI Kit v4."
4
+ license: "MIT"
5
+ compatibility: "Angular >=12 <=15; @cometchat/chat-uikit-angular ^4; @cometchat/chat-sdk-javascript ^4"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory, AskUserQuestion"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat angular theming colors dark-mode typography palette css-variables"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Teaches Claude how to theme the CometChat Angular UI Kit v4 via `CometChatThemeService` and per-component style objects. Covers palette tokens, light/dark mode switching, typography, per-component style classes, CSS variable overrides, and preset themes.
16
+
17
+ **Read `cometchat-angular-core` first** — `CometChatThemeService` is injected in `AppComponent`'s constructor, which is covered there.
18
+
19
+ Ground truth: `docs/ui-kit/angular/theme`, `docs/ui-kit/angular/colors`, `docs/ui-kit/angular/component-styling`, and `@cometchat/chat-uikit-angular@4.x` style exports.
20
+
21
+ ---
22
+
23
+ ## 0. Preset themes (quickest start)
24
+
25
+ Five built-in presets. Apply by setting these CSS variables in `src/styles.scss` after any existing imports:
26
+
27
+ | Preset | `--cometchat-primary-color` | `--cometchat-font-family` | `--cometchat-background-color-01` | `--cometchat-text-color-primary` | Notes |
28
+ |---|---|---|---|---|---|
29
+ | `slack` | `#611f69` | `Lato, sans-serif` | `#ffffff` | `#1d1c1d` | |
30
+ | `whatsapp` | `#25d366` | `'Segoe UI', Helvetica, sans-serif` | `#f0f2f5` | `#111b21` | |
31
+ | `imessage` | `#007aff` | `-apple-system, 'SF Pro Text', sans-serif` | `#ffffff` | `#000000` | |
32
+ | `discord` | `#5865f2` | `'gg sans', 'Noto Sans', Helvetica, sans-serif` | `#36393f` | `#dcddde` | Dark mode built-in |
33
+ | `notion` | `#2eaadc` | `-apple-system, Helvetica, sans-serif` | `#ffffff` | `#37352f` | |
34
+
35
+ Example — apply the Slack preset:
36
+
37
+ ```scss
38
+ /* src/styles.scss — after existing imports */
39
+ :root {
40
+ --cometchat-primary-color: #611f69;
41
+ --cometchat-font-family: Lato, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
42
+ --cometchat-background-color-01: #ffffff;
43
+ --cometchat-text-color-primary: #1d1c1d;
44
+ }
45
+ ```
46
+
47
+ Also set the matching `CometChatThemeService` palette so the Angular DI layer stays in sync:
48
+
49
+ ```typescript
50
+ // AppComponent constructor:
51
+ themeService.theme.palette.setPrimary({ light: "#611f69", dark: "#611f69" });
52
+ ```
53
+
54
+ ---
55
+
56
+ ## 1. How theming works in Angular
57
+
58
+ The Angular UI Kit uses two mechanisms for theming:
59
+
60
+ 1. **`CometChatThemeService`** — Angular DI service that controls the global palette (primary color, mode). Inject once in `AppComponent`.
61
+ 2. **Per-component style objects** — typed style classes (`ConversationsStyle`, `MessageListStyle`, etc.) passed as `[*Style]` inputs to individual components.
62
+
63
+ ```
64
+ CometChatThemeService (global palette)
65
+
66
+ every <cometchat-*> component reads palette via the service
67
+
68
+ component's default styles merge with palette + per-component style overrides
69
+ ```
70
+
71
+ ### Style precedence (highest to lowest)
72
+
73
+ 1. **Per-component `[*Style]` input** — wins always. Per-component tweak.
74
+ 2. **`CometChatThemeService` palette** — app-wide primary color + mode.
75
+ 3. **Default theme** — the UI Kit's built-in palette.
76
+
77
+ ---
78
+
79
+ ## 2. CometChatThemeService — global palette
80
+
81
+ Inject in `AppComponent`'s constructor (not `ngOnInit` — the palette must be set before any component renders):
82
+
83
+ ```typescript
84
+ import { Component } from "@angular/core";
85
+ import { CometChatThemeService } from "@cometchat/chat-uikit-angular";
86
+
87
+ @Component({ selector: "app-root", templateUrl: "./app.component.html" })
88
+ export class AppComponent {
89
+ constructor(private themeService: CometChatThemeService) {
90
+ // Set mode
91
+ themeService.theme.palette.setMode("light"); // "light" | "dark"
92
+
93
+ // Set primary brand color (light + dark variants)
94
+ themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" });
95
+
96
+ // Optional: set accent color
97
+ themeService.theme.palette.setAccent({ light: "#F76808", dark: "#FF8A3D" });
98
+ }
99
+ }
100
+ ```
101
+
102
+ ### Dynamic mode switching
103
+
104
+ ```typescript
105
+ @Component({ /* ... */ })
106
+ export class AppComponent {
107
+ constructor(private themeService: CometChatThemeService) {}
108
+
109
+ toggleDarkMode(isDark: boolean): void {
110
+ this.themeService.theme.palette.setMode(isDark ? "dark" : "light");
111
+ }
112
+ }
113
+ ```
114
+
115
+ The palette change propagates to all rendered CometChat components immediately — no page reload needed.
116
+
117
+ ---
118
+
119
+ ## 3. Color tokens
120
+
121
+ ### Primary (brand accent)
122
+
123
+ | Method | Controls |
124
+ |---|---|
125
+ | `setPrimary({ light, dark })` | Outgoing message bubbles, send button, active tabs, buttons |
126
+ | `setAccent({ light, dark })` | Secondary accent — links, highlights |
127
+
128
+ Both methods take `{ light: "#hex", dark: "#hex" }`. Always provide both variants.
129
+
130
+ ### Mode
131
+
132
+ | Mode | Effect |
133
+ |---|---|
134
+ | `"light"` | Light backgrounds, dark text |
135
+ | `"dark"` | Dark backgrounds, light text |
136
+
137
+ ### Palette methods reference
138
+
139
+ ```typescript
140
+ themeService.theme.palette.setMode("light" | "dark");
141
+ themeService.theme.palette.setPrimary({ light: "#hex", dark: "#hex" });
142
+ themeService.theme.palette.setAccent({ light: "#hex", dark: "#hex" });
143
+ themeService.theme.palette.setBackground({ light: "#hex", dark: "#hex" });
144
+ themeService.theme.palette.setSecondary({ light: "#hex", dark: "#hex" });
145
+ ```
146
+
147
+ ---
148
+
149
+ ## 4. Per-component style objects
150
+
151
+ Each component accepts a typed style object. Import from `@cometchat/uikit-shared`:
152
+
153
+ ```typescript
154
+ import {
155
+ ConversationsStyle,
156
+ MessagesStyle,
157
+ MessageListStyle,
158
+ MessageComposerStyle,
159
+ MessageHeaderStyle,
160
+ UsersStyle,
161
+ GroupsStyle,
162
+ AvatarStyle,
163
+ BadgeStyle,
164
+ StatusIndicatorStyle,
165
+ ListItemStyle,
166
+ DateStyle,
167
+ BackdropStyle,
168
+ ConfirmDialogStyle,
169
+ LoaderStyle,
170
+ } from "@cometchat/uikit-shared";
171
+ ```
172
+
173
+ ### ConversationsStyle
174
+
175
+ ```typescript
176
+ conversationsStyle = new ConversationsStyle({
177
+ width: "100%",
178
+ height: "100%",
179
+ border: "1px solid #e8e8e8",
180
+ borderRadius: "8px",
181
+ background: "#ffffff",
182
+ titleTextFont: "600 18px Inter, sans-serif",
183
+ titleTextColor: "#141414",
184
+ lastMessageTextFont: "400 14px Inter, sans-serif",
185
+ lastMessageTextColor: "#727272",
186
+ typingIndictorTextColor: "#6851D6",
187
+ onlineStatusColor: "#09C26F",
188
+ privateGroupIconBackground: "#F76808",
189
+ passwordGroupIconBackground: "#FFAB00",
190
+ });
191
+ ```
192
+
193
+ ```html
194
+ <cometchat-conversations [conversationsStyle]="conversationsStyle"></cometchat-conversations>
195
+ ```
196
+
197
+ ### MessageListStyle
198
+
199
+ ```typescript
200
+ messageListStyle = new MessageListStyle({
201
+ width: "100%",
202
+ height: "100%",
203
+ background: "#fafafa",
204
+ border: "none",
205
+ // Bubble colors
206
+ sendBubbleBackground: "#6851D6",
207
+ sendBubbleTextColor: "#ffffff",
208
+ sendBubbleTextFont: "400 15px Inter, sans-serif",
209
+ receiveBubbleBackground: "#f0f0f0",
210
+ receiveBubbleTextColor: "#141414",
211
+ receiveBubbleTextFont: "400 15px Inter, sans-serif",
212
+ });
213
+ ```
214
+
215
+ ### MessageComposerStyle
216
+
217
+ ```typescript
218
+ messageComposerStyle = new MessageComposerStyle({
219
+ width: "100%",
220
+ background: "#ffffff",
221
+ border: "1px solid #e8e8e8",
222
+ borderRadius: "0",
223
+ inputBackground: "#f5f5f5",
224
+ inputBorder: "none",
225
+ inputBorderRadius: "8px",
226
+ textFont: "400 15px Inter, sans-serif",
227
+ textColor: "#141414",
228
+ placeHolderTextColor: "#a1a1a1",
229
+ sendIconTint: "#6851D6",
230
+ attachmentIconTint: "#727272",
231
+ });
232
+ ```
233
+
234
+ ### AvatarStyle
235
+
236
+ ```typescript
237
+ avatarStyle = new AvatarStyle({
238
+ width: "40px",
239
+ height: "40px",
240
+ border: "none",
241
+ borderRadius: "50%",
242
+ backgroundColor: "#6851D6",
243
+ nameTextColor: "#ffffff",
244
+ nameTextFont: "600 16px Inter, sans-serif",
245
+ backgroundSize: "cover",
246
+ });
247
+ ```
248
+
249
+ ### BadgeStyle
250
+
251
+ ```typescript
252
+ badgeStyle = new BadgeStyle({
253
+ background: "#6851D6",
254
+ textColor: "#ffffff",
255
+ textFont: "600 11px Inter, sans-serif",
256
+ border: "none",
257
+ borderRadius: "10px",
258
+ width: "20px",
259
+ height: "20px",
260
+ });
261
+ ```
262
+
263
+ ---
264
+
265
+ ## 5. Common theming recipes
266
+
267
+ ### Match a brand color (most common)
268
+
269
+ ```typescript
270
+ // In AppComponent constructor:
271
+ themeService.theme.palette.setPrimary({ light: "#FF6B35", dark: "#FF8F66" });
272
+ ```
273
+
274
+ This single call changes the outgoing message bubble color, send button, active tab indicator, and every primary accent in the UI.
275
+
276
+ ### Dark mode + custom brand
277
+
278
+ ```typescript
279
+ themeService.theme.palette.setMode("dark");
280
+ themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#A594F3" });
281
+ themeService.theme.palette.setBackground({ light: "#ffffff", dark: "#1a1a1a" });
282
+ ```
283
+
284
+ ### Custom message bubble colors
285
+
286
+ ```typescript
287
+ messageListStyle = new MessageListStyle({
288
+ sendBubbleBackground: "#FF6B35",
289
+ sendBubbleTextColor: "#ffffff",
290
+ receiveBubbleBackground: "#f0f0f0",
291
+ receiveBubbleTextColor: "#1a1a1a",
292
+ });
293
+ ```
294
+
295
+ ### Custom font across the whole UI
296
+
297
+ The Angular UI Kit reads font from CSS. Override via global styles:
298
+
299
+ ```css
300
+ /* styles.css (global) */
301
+ :root {
302
+ --cometchat-font-family: "Inter", sans-serif;
303
+ }
304
+ ```
305
+
306
+ Or pass `textFont` / `titleTextFont` in each component's style object.
307
+
308
+ ---
309
+
310
+ ## 6. CSS variable overrides
311
+
312
+ The Angular UI Kit exposes CSS custom properties for fine-grained control. Override in `styles.css` (global):
313
+
314
+ ```css
315
+ /* styles.css */
316
+ :root {
317
+ /* Primary color */
318
+ --cometchat-primary-color: #6851D6;
319
+
320
+ /* Background colors */
321
+ --cometchat-background-color-01: #ffffff;
322
+ --cometchat-background-color-02: #fafafa;
323
+ --cometchat-background-color-03: #f5f5f5;
324
+
325
+ /* Text colors */
326
+ --cometchat-text-color-primary: #141414;
327
+ --cometchat-text-color-secondary: #727272;
328
+ --cometchat-text-color-tertiary: #a1a1a1;
329
+
330
+ /* Border */
331
+ --cometchat-border-color-default: #e8e8e8;
332
+
333
+ /* Font */
334
+ --cometchat-font-family: "Inter", sans-serif;
335
+ }
336
+ ```
337
+
338
+ CSS variable overrides apply globally and take effect immediately. Use them for app-wide changes that the `CometChatThemeService` palette methods don't cover.
339
+
340
+ ---
341
+
342
+ ## 7. Anti-patterns
343
+
344
+ 1. **Do NOT call `themeService.theme.palette.setMode()` in `ngOnInit`.** Call it in the constructor — the palette must be set before any CometChat component renders. `ngOnInit` runs after the first change detection cycle, which may be too late.
345
+
346
+ 2. **Do NOT mix `CometChatThemeService` and per-component `[*Style]` for the same property.** The per-component style wins — the service override becomes dead code. Pick one: service for app-wide, `[*Style]` for one-offs.
347
+
348
+ 3. **Do NOT use non-hex colors in style objects.** Some style properties expect hex strings. `rgb()` / named colors / `hsl()` may not work in all style properties.
349
+
350
+ 4. **Do NOT wrap `CometChatThemeService` injection in a lazy-loaded module.** The service is a singleton — inject it at the root level (`AppComponent`) so the palette is set before any component renders.
351
+
352
+ 5. **Do NOT forget to provide both `light` and `dark` variants** when calling `setPrimary()` or `setAccent()`. Providing only one variant leaves the other as the default, which may not match your brand in dark mode.
353
+
354
+ ---
355
+
356
+ ## Skill routing reference
357
+
358
+ | Skill | When to route |
359
+ |---|---|
360
+ | `cometchat-angular-core` | Init, login, module setup — always first |
361
+ | `cometchat-angular-components` | Per-component `[*Style]` prop reference |
362
+ | `cometchat-angular-placement` | Where to put chat |
363
+ | `cometchat-angular-theming` | This skill — palette, dark mode, typography |
364
+ | `cometchat-angular-customization` | Custom slot views, formatters |
365
+ | `cometchat-angular-troubleshooting` | Colors not applying, dark mode not switching |
@@ -0,0 +1,329 @@
1
+ ---
2
+ name: cometchat-angular-troubleshooting
3
+ description: "Diagnose CometChat Angular UI Kit v4 integration failures — init/login, CUSTOM_ELEMENTS_SCHEMA, assets config, module imports, height/layout issues, Angular Universal SSR, v3-to-v4 upgrade, and production auth errors."
4
+ license: "MIT"
5
+ compatibility: "Angular >=12 <=15; @cometchat/chat-uikit-angular ^4; @cometchat/chat-sdk-javascript ^4"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory, AskUserQuestion"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat angular troubleshooting schema assets module height ssr upgrade"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Teaches Claude how to diagnose and fix CometChat Angular UI Kit v4 integration failures. Covers every category of failure across NgModule and standalone component setups, with an up-front triage flow so Claude asks the right questions before assuming a fix.
16
+
17
+ **Read `cometchat-angular-core` first** — most "why doesn't this work" issues trace to the init/login/module setup explained there.
18
+
19
+ Ground truth: `docs/ui-kit/angular/troubleshooting`, `docs/ui-kit/angular/getting-started`, and first-hand failure modes from real integrations.
20
+
21
+ ---
22
+
23
+ ## 1. Triage — read project state before guessing
24
+
25
+ When the user reports a problem, gather facts before proposing a fix.
26
+
27
+ ### 1a. Is `CUSTOM_ELEMENTS_SCHEMA` in every module that uses `<cometchat-*>` tags?
28
+
29
+ ```bash
30
+ grep -r "CUSTOM_ELEMENTS_SCHEMA" src/
31
+ ```
32
+
33
+ If missing from any module or standalone component that uses `<cometchat-*>` tags, Angular throws "Unknown element" errors. Every module/component needs it independently.
34
+
35
+ ### 1b. Are the assets configured in `angular.json`?
36
+
37
+ ```bash
38
+ grep -A5 '"assets"' angular.json | grep cometchat
39
+ ```
40
+
41
+ If missing, icons render as broken images. The required entry:
42
+ ```json
43
+ { "glob": "**/*", "input": "./node_modules/@cometchat/chat-uikit-angular/assets/", "output": "assets/" }
44
+ ```
45
+
46
+ ### 1c. Is init complete before any `<cometchat-*>` component renders?
47
+
48
+ ```bash
49
+ grep -n "CometChatUIKit.init\|isReady\|APP_INITIALIZER" src/app/app.component.ts
50
+ ```
51
+
52
+ Look for the init promise + `isReady` flag or `APP_INITIALIZER`. Components rendered before init completes produce blank output.
53
+
54
+ ### 1d. Is `UIKitSettingsBuilder` used (not a flat object)?
55
+
56
+ ```bash
57
+ grep -n "UIKitSettingsBuilder\|CometChatUIKit.init" src/
58
+ ```
59
+
60
+ Angular requires `UIKitSettingsBuilder` from `@cometchat/uikit-shared`. A flat object passed to `init()` fails silently or throws a type error.
61
+
62
+ ### 1e. Are CometChat components imported in the module?
63
+
64
+ ```bash
65
+ grep -n "CometChatConversations\|CometChatMessages\|CometChatMessageList" src/app/app.module.ts
66
+ ```
67
+
68
+ Every `<cometchat-*>` component must be imported in the module (or standalone component) where it's used.
69
+
70
+ ### 1f. Is `BrowserAnimationsModule` imported?
71
+
72
+ ```bash
73
+ grep "BrowserAnimationsModule" src/app/app.module.ts
74
+ ```
75
+
76
+ Missing `BrowserAnimationsModule` causes runtime errors in components that use Angular animations.
77
+
78
+ ---
79
+
80
+ ## 2. Symptom → fix lookup tables
81
+
82
+ ### 2a. Initialization + login
83
+
84
+ | Symptom | Likely cause | Fix |
85
+ |---|---|---|
86
+ | Components render nothing after login | `init()` not awaited before mount | Use `*ngIf="isReady"` on the container; set `isReady = true` after init + login resolve |
87
+ | Blank screen, no errors | Component rendered before init completed | Gate with `*ngIf="isReady"` |
88
+ | `getLoggedinUser()` returns `null` | Login not called or session expired | Call `CometChatUIKit.login({ uid })` after init resolves |
89
+ | Login fails: "UID not found" | User doesn't exist in CometChat | Create via dashboard, SDK, or REST API. For dev, use `cometchat-uid-1` through `cometchat-uid-5` |
90
+ | `CometChatUIKit.init()` fails silently | Invalid `APP_ID` / `REGION` / `AUTH_KEY` | Re-verify from dashboard → your app → Credentials |
91
+ | `UIKitSettingsBuilder is not a constructor` | Imported from wrong package | Import from `@cometchat/uikit-shared`, not `@cometchat/chat-uikit-angular` |
92
+ | Production build exposes Auth Key | Using `authKey` in `environment.prod.ts` | Switch to server-minted auth tokens. See `cometchat-angular-production` |
93
+
94
+ ### 2b. Module / schema errors
95
+
96
+ | Symptom | Likely cause | Fix |
97
+ |---|---|---|
98
+ | `'cometchat-conversations' is not a known element` | Missing `CUSTOM_ELEMENTS_SCHEMA` | Add `schemas: [CUSTOM_ELEMENTS_SCHEMA]` to the module or standalone component |
99
+ | `'cometchat-conversations' is not a known element` (even with schema) | Component not imported in the module | Import `CometChatConversations` from `@cometchat/chat-uikit-angular` in the module's `imports` array |
100
+ | `Can't bind to 'user' since it isn't a known property` | Component not imported | Same fix — import the component in the module |
101
+ | `NullInjectorError: No provider for CometChatThemeService` | `CometChatThemeService` not available | It's `providedIn: 'root'` — ensure `AppModule` is the root module. If using standalone bootstrap, ensure `provideAnimations()` is in providers. |
102
+ | `BrowserAnimationsModule` error | Missing animation module | Add `BrowserAnimationsModule` to `AppModule` imports |
103
+
104
+ ### 2c. Assets / icons
105
+
106
+ | Symptom | Likely cause | Fix |
107
+ |---|---|---|
108
+ | Icons show as broken images (404) | Missing assets config in `angular.json` | Add the glob entry for `@cometchat/chat-uikit-angular/assets/` to `build.options.assets` |
109
+ | Icons broken only in production build | Assets config present but `outputPath` differs | Verify the `output` path in the assets config matches your production output directory |
110
+ | Icons broken after `ng build` | Assets not copied during build | Run `ng build` again after adding the assets config; check `dist/assets/` for the icon files |
111
+
112
+ ### 2d. Layout / height issues
113
+
114
+ | Symptom | Likely cause | Fix |
115
+ |---|---|---|
116
+ | Conversation list / message list renders empty | Container has no bounded height | Wrap in `<div style="height: 100vh;">` or `<div style="flex: 1; overflow: hidden;">` |
117
+ | Components collapse to zero height | Parent is a `display: block` with no height | Use `display: flex; flex-direction: column; height: 100vh` on the parent |
118
+ | Message list doesn't scroll | Container doesn't have `overflow: hidden` | Add `overflow: hidden` to the message list's container; the component handles its own internal scroll |
119
+ | Chat dialog too small | Angular Material dialog has no explicit size | Set `width` and `height` on the dialog container or pass `{ width: '480px', height: '600px' }` to `MatDialog.open()` |
120
+ | Sidebar chat panel has no height | Sidenav content has no height constraint | Add `height: 100%` or `height: 100vh` to the sidenav content |
121
+
122
+ ### 2e. Angular Router integration
123
+
124
+ | Symptom | Likely cause | Fix |
125
+ |---|---|---|
126
+ | Chat route shows blank | CometChat init not complete when route activates | Use `APP_INITIALIZER` or a route guard that waits for init |
127
+ | `window.location.reload()` after login breaks routing | Anti-pattern — reload destroys Angular state | Use `this.router.navigate(['/chat'])` instead |
128
+ | Lazy-loaded chat module fails to init | `CometChatUIKit.init()` called inside the lazy module | Move init to `APP_INITIALIZER` at the root level |
129
+ | Route guard `canActivate` always returns false | `getLoggedinUser()` called before init | Ensure init completes before the guard runs (use `APP_INITIALIZER`) |
130
+
131
+ ### 2f. Theming
132
+
133
+ | Symptom | Likely cause | Fix |
134
+ |---|---|---|
135
+ | Theme overrides don't apply | `setPrimary()` called in `ngOnInit` instead of constructor | Move to constructor — palette must be set before first render |
136
+ | Dark mode doesn't switch | `setMode()` called once but not reactive | Call `setMode()` again when the user toggles; the service is reactive |
137
+ | Custom color shows as default | Color not a valid CSS color string | Use valid CSS color values (`#hex`, `rgb()`, named colors) |
138
+ | `[conversationsStyle]` input has no effect | Style object not instantiated with `new ConversationsStyle({...})` | Use `new ConversationsStyle({...})` — don't pass a plain object |
139
+
140
+ ### 2g. Components
141
+
142
+ | Symptom | Likely cause | Fix |
143
+ |---|---|---|
144
+ | Slot view (`[listItemView]`, `[subtitleView]`, etc.) renders nothing | `@ViewChild` reference not resolved yet | Ensure `@ViewChild` is accessed after `ngAfterViewInit`, not `ngOnInit` |
145
+ | `[onItemClick]` callback not firing | Wrong binding syntax — using round brackets | Use `[onItemClick]="myFn"` (square brackets, Input callback), never `(onItemClick)="myFn($event)"` (round brackets) |
146
+ | `[user]` input has no effect | Passing a UID string instead of `CometChat.User` instance | `await CometChat.getUser(uid)` first, pass the resolved object |
147
+ | Conversations list empty but data exists | Wrong request builder filters | Check `[conversationsRequestBuilder]` filters (tags, types, limits) |
148
+ | "Reply in Thread" option does nothing | Thread panel not wired | Wire `[onThreadRepliesClick]="myFn"` on `<cometchat-message-list>` and render a thread panel — see `cometchat-angular-components` § 11 |
149
+ | `[onError]` callback fires with "not initialized" | Component rendered before init | Gate with `*ngIf="isReady"` |
150
+
151
+ ### 2h. Calling
152
+
153
+ | Symptom | Likely cause | Fix |
154
+ |---|---|---|
155
+ | Call buttons missing | `@cometchat/calls-sdk-javascript` not installed | `npm install @cometchat/calls-sdk-javascript` + rebuild |
156
+ | Incoming call UI doesn't show | `<cometchat-incoming-call>` not mounted or listener not registered | Register `CometChat.addCallListener(...)` in `AppComponent.ngOnInit` and mount `<cometchat-incoming-call>` at the app root |
157
+ | Call listener fires twice | Listener registered in a component that gets destroyed and re-created | Move listener registration to `AppComponent` (root, never destroyed) |
158
+
159
+ ### 2i. Extensions
160
+
161
+ | Symptom | Likely cause | Fix |
162
+ |---|---|---|
163
+ | Polls option missing from composer | Extension not enabled in dashboard | `cometchat features enable polls --json` or toggle in dashboard → Features |
164
+ | Extension enabled but UI doesn't appear | Cached session — hard reload needed | Stop `ng serve`, clear browser cache, restart |
165
+ | Extension says enabled but `auto_wired_in_uikit: false` | Needs `.setExtensions([...])` on `UIKitSettingsBuilder` | Add `new PollsExtension()` etc. to the builder — see `cometchat-angular-features` § 2 |
166
+
167
+ ### 2j. Production / auth tokens
168
+
169
+ | Symptom | Likely cause | Fix |
170
+ |---|---|---|
171
+ | `login({ authToken })` fails: "user does not exist" | User not created in CometChat before token mint | Create user server-side via REST API on your signup flow. See `cometchat-angular-production` § 6 |
172
+ | Token endpoint returns 401 | Backend auth check failing | Verify `Authorization: Bearer <jwt>` header is attached to the Angular `HttpClient` request |
173
+ | 429 rate limit on token endpoint | Minting tokens too often (e.g. per component init) | Cache client-side, reuse until expiry |
174
+ | `CometChatUIKit.loginWithAuthToken` not found | Wrong API name | It's `CometChatUIKit.login({ authToken })` — same method as dev, different key |
175
+
176
+ ### 2k. SSR / Angular Universal
177
+
178
+ | Symptom | Likely cause | Fix |
179
+ |---|---|---|
180
+ | `window is not defined` during SSR | CometChat uses browser APIs | Guard with `isPlatformBrowser(platformId)` — see `cometchat-angular-patterns` § 7 |
181
+ | `document is not defined` during SSR | Same cause | Same fix |
182
+ | Components render on server but throw | CometChat components use browser APIs | Wrap `<cometchat-*>` tags with `*ngIf="isBrowser"` |
183
+
184
+ ---
185
+
186
+ ## 3. Deep dives on common failures
187
+
188
+ ### 3a. "The most common 'why is my chat blank' bug"
189
+
190
+ CometChat components fill 100% of their parent's height. If the parent has no bounded height, the components render at 0px and look empty.
191
+
192
+ Diagnostic:
193
+
194
+ ```bash
195
+ # Check the parent container of the CometChat component
196
+ grep -B5 "cometchat-message-list\|cometchat-conversations" src/app/**/*.html
197
+ ```
198
+
199
+ Look for the component's parent. One of these must be true:
200
+ - Parent has `height: 100vh` or `height: 100%`
201
+ - Parent is a flex column with the component getting `flex: 1`
202
+ - Parent has an explicit `height: Npx`
203
+
204
+ Broken example:
205
+ ```html
206
+ <!-- ✗ WRONG — div has no height -->
207
+ <div>
208
+ <cometchat-message-list [user]="selectedUser"></cometchat-message-list>
209
+ </div>
210
+ ```
211
+
212
+ Fixed:
213
+ ```html
214
+ <!-- ✓ RIGHT -->
215
+ <div style="height: 100vh; display: flex; flex-direction: column;">
216
+ <cometchat-message-list
217
+ [user]="selectedUser"
218
+ style="flex: 1; overflow: hidden;"
219
+ ></cometchat-message-list>
220
+ </div>
221
+ ```
222
+
223
+ ### 3b. "Unknown element" errors for `<cometchat-*>` tags
224
+
225
+ Two separate fixes are both required:
226
+
227
+ 1. **Import the component** in the module's `imports` array:
228
+ ```typescript
229
+ import { CometChatConversations } from "@cometchat/chat-uikit-angular";
230
+ @NgModule({ imports: [CometChatConversations] })
231
+ ```
232
+
233
+ 2. **Add `CUSTOM_ELEMENTS_SCHEMA`** to the module's `schemas`:
234
+ ```typescript
235
+ import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
236
+ @NgModule({ schemas: [CUSTOM_ELEMENTS_SCHEMA] })
237
+ ```
238
+
239
+ Both are required. Missing either one produces the "Unknown element" error.
240
+
241
+ ### 3c. Components render before init completes
242
+
243
+ The most reliable fix is `APP_INITIALIZER` (see `cometchat-angular-patterns` § 1). If not using `APP_INITIALIZER`, use `*ngIf="isReady"`:
244
+
245
+ ```typescript
246
+ // app.component.ts
247
+ isReady = false;
248
+
249
+ ngOnInit(): void {
250
+ CometChatUIKit.init(settings)
251
+ .then(() => CometChatUIKit.getLoggedinUser())
252
+ .then((user) => user || CometChatUIKit.login({ uid: "cometchat-uid-1" }))
253
+ .then(() => (this.isReady = true))
254
+ .catch(console.error);
255
+ }
256
+ ```
257
+
258
+ ```html
259
+ <!-- app.component.html -->
260
+ <ng-container *ngIf="isReady">
261
+ <router-outlet></router-outlet>
262
+ </ng-container>
263
+ ```
264
+
265
+ ---
266
+
267
+ ## 4. v3 → v4 upgrade gotchas
268
+
269
+ If the user is upgrading from `@cometchat/chat-uikit-angular@3`, these are the common breakages.
270
+
271
+ | v3 | v4 | Notes |
272
+ |---|---|---|
273
+ | `CometChatTheme` class | `CometChatThemeService` (Angular DI) | Theme is now an injectable service |
274
+ | `CometChatConversationsWithMessages` composite | Still available but configuration API changed | Check `[conversationsConfiguration]` + `[messagesConfiguration]` props |
275
+ | `theme` prop on components | Theme via `CometChatThemeService` only | Per-component theme prop removed |
276
+ | `onClick` callback names | `onItemClick` callback names | Renamed for consistency |
277
+ | `CometChat.login(uid, authKey)` | `CometChatUIKit.login({ uid })` | Object-form argument |
278
+ | Flat settings object | `UIKitSettingsBuilder` | Builder pattern required |
279
+
280
+ ### Upgrade sequence
281
+
282
+ ```bash
283
+ # 1. Update the main kit
284
+ npm install @cometchat/chat-uikit-angular@latest
285
+
286
+ # 2. Update peer packages
287
+ npm install @cometchat/uikit-elements@latest @cometchat/uikit-resources@latest @cometchat/uikit-shared@latest
288
+
289
+ # 3. Replace flat settings object with UIKitSettingsBuilder
290
+ # 4. Replace CometChatTheme class with CometChatThemeService injection
291
+ # 5. Rename onClick → onItemClick throughout templates
292
+ # 6. Add CUSTOM_ELEMENTS_SCHEMA to all modules (new requirement in v4)
293
+ # 7. Add assets config to angular.json (new requirement in v4)
294
+ # 8. Rebuild + test
295
+ ```
296
+
297
+ ---
298
+
299
+ ## 5. Escalation — when the above doesn't solve it
300
+
301
+ 1. **Read the raw error.** Angular errors are usually specific — "Can't bind to 'user'" is different from "NullInjectorError".
302
+ 2. **Check the browser console + Angular DevTools.** Angular DevTools shows the component tree and change detection state.
303
+ 3. **Search the upstream docs MCP** (`cometchat-docs` if installed).
304
+ 4. **If the issue is a kit bug**, file at https://github.com/cometchat/cometchat-uikit-angular/issues with a minimal repro.
305
+
306
+ ---
307
+
308
+ ## 6. Hard rules (diagnostic best-practice)
309
+
310
+ 1. **Don't assume — triage first.** § 1 gets the schema, assets, init state, and module imports before proposing a fix.
311
+ 2. **Don't suggest "try reinstalling node_modules" as a first step.** Check the schema, assets config, and module imports first.
312
+ 3. **When recommending a rebuild, say why + what to rebuild.** "`ng build` after adding assets config" is more useful than "try rebuilding."
313
+ 4. **Never guess a fix that requires code changes without first gathering facts.**
314
+
315
+ ---
316
+
317
+ ## Skill routing reference
318
+
319
+ | Skill | When to route |
320
+ |---|---|
321
+ | `cometchat-angular-core` | Most "doesn't work" bugs trace back here — init/login/module setup |
322
+ | `cometchat-angular-components` | Wrong input / slot view / request builder |
323
+ | `cometchat-angular-placement` | Blank chat / bounded-height issues |
324
+ | `cometchat-angular-patterns` | Route guard, lazy loading, SSR, APP_INITIALIZER |
325
+ | `cometchat-angular-theming` | Theme not applying, dark mode not switching |
326
+ | `cometchat-angular-features` | Calls don't work, extension UI missing after enable |
327
+ | `cometchat-angular-customization` | Formatter not rendering, listener not firing, template not showing |
328
+ | `cometchat-angular-production` | 401 on token fetch, user-does-not-exist on login |
329
+ | `cometchat-angular-troubleshooting` | This skill — cross-category diagnosis + v3→v4 upgrade |