@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,447 @@
1
+ ---
2
+ name: cometchat-angular-patterns
3
+ description: "Angular-specific integration patterns for CometChat UI Kit v4 — lazy loading, route guards, Angular Router integration, APP_INITIALIZER setup, standalone vs NgModule, and SSR/Universal considerations."
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 patterns routing lazy-loading guards app-initializer standalone ssr"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Teaches Claude Angular-specific integration patterns for CometChat — how to wire init into Angular's bootstrap lifecycle, lazy-load the chat module, protect chat routes with guards, handle SSR/Universal, and integrate with Angular Material. Assumes a working base integration (see `cometchat-angular-core` + `cometchat-angular-placement`).
16
+
17
+ **Read `cometchat-angular-core` and `cometchat-angular-placement` first** — this skill builds on top of the base integration.
18
+
19
+ Ground truth: `docs/ui-kit/angular/getting-started`, Angular Router docs, `@cometchat/chat-uikit-angular@4.x` exports.
20
+
21
+ ---
22
+
23
+ ## 1. APP_INITIALIZER pattern (production-grade init)
24
+
25
+ For production apps, use Angular's `APP_INITIALIZER` token to ensure CometChat is initialized before the app renders any component. This is cleaner than calling `init()` in `AppComponent.ngOnInit()`.
26
+
27
+ ```typescript
28
+ // cometchat-init.service.ts
29
+ import { Injectable } from "@angular/core";
30
+ import { UIKitSettingsBuilder } from "@cometchat/uikit-shared";
31
+ import { CometChatUIKit } from "@cometchat/chat-uikit-angular";
32
+ import { environment } from "../environments/environment";
33
+
34
+ @Injectable({ providedIn: "root" })
35
+ export class CometChatInitService {
36
+ private initialized = false;
37
+
38
+ initialize(): Promise<void> {
39
+ if (this.initialized) return Promise.resolve();
40
+
41
+ const settings = new UIKitSettingsBuilder()
42
+ .setAppId(environment.cometchat.appId)
43
+ .setRegion(environment.cometchat.region)
44
+ .setAuthKey(environment.cometchat.authKey)
45
+ .subscribePresenceForAllUsers()
46
+ .build();
47
+
48
+ return CometChatUIKit.init(settings).then(() => {
49
+ this.initialized = true;
50
+ });
51
+ }
52
+ }
53
+ ```
54
+
55
+ ```typescript
56
+ // app.module.ts
57
+ import { APP_INITIALIZER, NgModule } from "@angular/core";
58
+ import { CometChatInitService } from "./cometchat-init.service";
59
+
60
+ export function initCometChat(service: CometChatInitService): () => Promise<void> {
61
+ return () => service.initialize();
62
+ }
63
+
64
+ @NgModule({
65
+ providers: [
66
+ {
67
+ provide: APP_INITIALIZER,
68
+ useFactory: initCometChat,
69
+ deps: [CometChatInitService],
70
+ multi: true,
71
+ },
72
+ ],
73
+ })
74
+ export class AppModule {}
75
+ ```
76
+
77
+ With `APP_INITIALIZER`, Angular waits for the init promise to resolve before bootstrapping the root component. No `*ngIf="isReady"` guard needed on the root template.
78
+
79
+ **⚠️ `APP_INITIALIZER` blocks the entire app bootstrap.** If CometChat init fails (network error, wrong credentials), the app never renders. Add error handling:
80
+
81
+ ```typescript
82
+ initialize(): Promise<void> {
83
+ return CometChatUIKit.init(settings).then(() => {
84
+ this.initialized = true;
85
+ }).catch((err) => {
86
+ console.error("CometChat init failed:", err);
87
+ // Don't re-throw — let the app render and show an error state
88
+ });
89
+ }
90
+ ```
91
+
92
+ ---
93
+
94
+ ## 2. Route guard for authenticated chat
95
+
96
+ Protect chat routes so only logged-in users can access them.
97
+
98
+ ```typescript
99
+ // cometchat-auth.guard.ts
100
+ import { Injectable } from "@angular/core";
101
+ import { CanActivate, Router } from "@angular/router";
102
+ import { CometChatUIKit } from "@cometchat/chat-uikit-angular";
103
+
104
+ @Injectable({ providedIn: "root" })
105
+ export class CometChatAuthGuard implements CanActivate {
106
+ constructor(private router: Router) {}
107
+
108
+ canActivate(): Promise<boolean> {
109
+ return CometChatUIKit.getLoggedinUser().then((user) => {
110
+ if (user) return true;
111
+ this.router.navigate(["/login"]);
112
+ return false;
113
+ });
114
+ }
115
+ }
116
+ ```
117
+
118
+ ```typescript
119
+ // app-routing.module.ts
120
+ import { CometChatAuthGuard } from "./cometchat-auth.guard";
121
+
122
+ export const routes: Routes = [
123
+ {
124
+ path: "chat",
125
+ canActivate: [CometChatAuthGuard],
126
+ loadChildren: () => import("./chat/chat.module").then((m) => m.ChatModule),
127
+ },
128
+ { path: "login", component: LoginComponent },
129
+ ];
130
+ ```
131
+
132
+ ---
133
+
134
+ ## 3. Lazy loading the chat module
135
+
136
+ For apps where chat is a secondary feature, lazy-load the CometChat module to keep the initial bundle small.
137
+
138
+ ```typescript
139
+ // chat/chat.module.ts
140
+ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
141
+ import { RouterModule, Routes } from "@angular/router";
142
+ import { CommonModule } from "@angular/common";
143
+ import {
144
+ CometChatConversations,
145
+ CometChatMessageHeader,
146
+ CometChatMessageList,
147
+ CometChatMessageComposer,
148
+ } from "@cometchat/chat-uikit-angular";
149
+ import { ConversationsComponent } from "./conversations/conversations.component";
150
+ import { MessagesComponent } from "./messages/messages.component";
151
+
152
+ const routes: Routes = [
153
+ { path: "", component: ConversationsComponent },
154
+ { path: "messages/user/:uid", component: MessagesComponent },
155
+ { path: "messages/group/:guid", component: MessagesComponent },
156
+ ];
157
+
158
+ @NgModule({
159
+ imports: [
160
+ CommonModule,
161
+ RouterModule.forChild(routes),
162
+ CometChatConversations,
163
+ CometChatMessageHeader,
164
+ CometChatMessageList,
165
+ CometChatMessageComposer,
166
+ ],
167
+ declarations: [ConversationsComponent, MessagesComponent],
168
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
169
+ })
170
+ export class ChatModule {}
171
+ ```
172
+
173
+ ```typescript
174
+ // app-routing.module.ts
175
+ export const routes: Routes = [
176
+ {
177
+ path: "chat",
178
+ loadChildren: () => import("./chat/chat.module").then((m) => m.ChatModule),
179
+ },
180
+ ];
181
+ ```
182
+
183
+ **⚠️ CometChat init must still happen at the app root level**, not inside the lazy-loaded module. The `APP_INITIALIZER` pattern (§ 1) or `AppComponent.ngOnInit()` ensures init completes before the lazy module loads.
184
+
185
+ ---
186
+
187
+ ## Standalone components with Angular Router (Angular 14+)
188
+
189
+ For apps using standalone components (no NgModule), wire routing directly:
190
+
191
+ ```typescript
192
+ // main.ts
193
+ import { bootstrapApplication } from "@angular/platform-browser";
194
+ import { provideRouter } from "@angular/router";
195
+ import { provideAnimations } from "@angular/platform-browser/animations";
196
+ import { APP_INITIALIZER } from "@angular/core";
197
+ import { AppComponent } from "./app/app.component";
198
+ import { routes } from "./app/app.routes";
199
+ import { CometChatInitService } from "./app/cometchat-init.service";
200
+
201
+ bootstrapApplication(AppComponent, {
202
+ providers: [
203
+ provideRouter(routes),
204
+ provideAnimations(),
205
+ {
206
+ provide: APP_INITIALIZER,
207
+ useFactory: (service: CometChatInitService) => () => service.initialize(),
208
+ deps: [CometChatInitService],
209
+ multi: true,
210
+ },
211
+ ],
212
+ });
213
+ ```
214
+
215
+ ```typescript
216
+ // app.routes.ts
217
+ import { Routes } from "@angular/router";
218
+
219
+ export const routes: Routes = [
220
+ {
221
+ path: "chat",
222
+ loadComponent: () =>
223
+ import("./chat/conversations.component").then((m) => m.ConversationsComponent),
224
+ },
225
+ {
226
+ path: "messages/user/:uid",
227
+ loadComponent: () =>
228
+ import("./chat/messages.component").then((m) => m.MessagesComponent),
229
+ },
230
+ ];
231
+ ```
232
+
233
+ ---
234
+
235
+ ## 5. Login flow integration
236
+
237
+ Wire CometChat login to your app's existing auth flow.
238
+
239
+ ### Pattern A — Login on app startup (dev mode)
240
+
241
+ ```typescript
242
+ // app.component.ts
243
+ import { Component, OnInit } from "@angular/core";
244
+ import { CometChatUIKit } from "@cometchat/chat-uikit-angular";
245
+
246
+ @Component({ selector: "app-root", templateUrl: "./app.component.html" })
247
+ export class AppComponent implements OnInit {
248
+ isReady = false;
249
+
250
+ ngOnInit(): void {
251
+ // CometChat.init() already called via APP_INITIALIZER
252
+ CometChatUIKit.getLoggedinUser()
253
+ .then((user) => {
254
+ if (!user) {
255
+ return CometChatUIKit.login({ uid: "cometchat-uid-1" });
256
+ }
257
+ return user;
258
+ })
259
+ .then(() => (this.isReady = true))
260
+ .catch(console.error);
261
+ }
262
+ }
263
+ ```
264
+
265
+ ### Pattern B — Login after your app's auth (production)
266
+
267
+ ```typescript
268
+ // auth.service.ts
269
+ import { Injectable } from "@angular/core";
270
+ import { HttpClient } from "@angular/common/http";
271
+ import { CometChatUIKit } from "@cometchat/chat-uikit-angular";
272
+ import { environment } from "../environments/environment";
273
+
274
+ @Injectable({ providedIn: "root" })
275
+ export class AuthService {
276
+ constructor(private http: HttpClient) {}
277
+
278
+ loginWithCometChat(appJwt: string): Promise<void> {
279
+ // 1. Fetch CometChat auth token from your backend
280
+ return this.http
281
+ .post<{ authToken: string }>(environment.cometchat.tokenEndpoint, {}, {
282
+ headers: { Authorization: `Bearer ${appJwt}` },
283
+ })
284
+ .toPromise()
285
+ .then((response) => {
286
+ // 2. Login with the auth token
287
+ return CometChatUIKit.login({ authToken: response!.authToken });
288
+ })
289
+ .then(() => {
290
+ // 3. CometChat session established
291
+ });
292
+ }
293
+
294
+ logout(): Promise<void> {
295
+ return CometChatUIKit.logout();
296
+ }
297
+ }
298
+ ```
299
+
300
+ ---
301
+
302
+ ## 6. Angular Material integration
303
+
304
+ CometChat works alongside Angular Material. Common integration points:
305
+
306
+ ### Theming coexistence
307
+
308
+ CometChat uses its own `CometChatThemeService` — it does NOT read from Angular Material's theme. Set both independently:
309
+
310
+ ```typescript
311
+ // app.component.ts
312
+ import { Component } from "@angular/core";
313
+ import { CometChatThemeService } from "@cometchat/chat-uikit-angular";
314
+
315
+ @Component({ selector: "app-root", templateUrl: "./app.component.html" })
316
+ export class AppComponent {
317
+ constructor(private cometChatTheme: CometChatThemeService) {
318
+ // Set CometChat palette to match your Material theme's primary color
319
+ cometChatTheme.theme.palette.setPrimary({ light: "#6200EE", dark: "#BB86FC" });
320
+ cometChatTheme.theme.palette.setMode("light");
321
+ }
322
+ }
323
+ ```
324
+
325
+ ### MatSidenav + CometChat sidebar
326
+
327
+ ```html
328
+ <!-- app.component.html -->
329
+ <mat-sidenav-container style="height: 100vh;">
330
+ <mat-sidenav mode="side" opened style="width: 320px;">
331
+ <cometchat-conversations
332
+ [onItemClick]="handleConvClick"
333
+ style="height: 100%;"
334
+ ></cometchat-conversations>
335
+ </mat-sidenav>
336
+ <mat-sidenav-content style="display: flex; flex-direction: column;">
337
+ <cometchat-message-header [user]="selectedUser" [hideBackButton]="true"></cometchat-message-header>
338
+ <cometchat-message-list [user]="selectedUser" style="flex: 1; overflow: hidden;"></cometchat-message-list>
339
+ <cometchat-message-composer [user]="selectedUser"></cometchat-message-composer>
340
+ </mat-sidenav-content>
341
+ </mat-sidenav-container>
342
+ ```
343
+
344
+ ---
345
+
346
+ ## 7. SSR / Angular Universal considerations
347
+
348
+ CometChat's UI Kit uses browser APIs (`window`, `document`, `localStorage`) that are not available in Node.js during SSR. If the project uses Angular Universal:
349
+
350
+ ```typescript
351
+ // cometchat-init.service.ts
352
+ import { isPlatformBrowser } from "@angular/common";
353
+ import { PLATFORM_ID, Inject } from "@angular/core";
354
+
355
+ @Injectable({ providedIn: "root" })
356
+ export class CometChatInitService {
357
+ constructor(@Inject(PLATFORM_ID) private platformId: object) {}
358
+
359
+ initialize(): Promise<void> {
360
+ // Skip CometChat init on the server
361
+ if (!isPlatformBrowser(this.platformId)) {
362
+ return Promise.resolve();
363
+ }
364
+ // ... normal init
365
+ }
366
+ }
367
+ ```
368
+
369
+ ```typescript
370
+ // In any component that renders CometChat components:
371
+ @Component({
372
+ template: `
373
+ <ng-container *ngIf="isBrowser">
374
+ <cometchat-conversations></cometchat-conversations>
375
+ </ng-container>
376
+ `,
377
+ })
378
+ export class ChatComponent {
379
+ isBrowser: boolean;
380
+ constructor(@Inject(PLATFORM_ID) platformId: object) {
381
+ this.isBrowser = isPlatformBrowser(platformId);
382
+ }
383
+ }
384
+ ```
385
+
386
+ **⚠️ CometChat components must not render during SSR.** They use browser APIs that throw in Node.js. Always guard with `isPlatformBrowser()`.
387
+
388
+ ---
389
+
390
+ ## 8. Change detection optimization
391
+
392
+ CometChat components use Angular's default change detection. For performance-sensitive apps using `OnPush`:
393
+
394
+ ```typescript
395
+ @Component({
396
+ changeDetection: ChangeDetectionStrategy.OnPush,
397
+ template: `
398
+ <cometchat-conversations
399
+ [onItemClick]="handleConvClick"
400
+ ></cometchat-conversations>
401
+ `,
402
+ })
403
+ export class ChatComponent {
404
+ constructor(private cdr: ChangeDetectorRef) {}
405
+
406
+ handleConvClick = (conversation: CometChat.Conversation): void => {
407
+ // Update component state
408
+ this.selectedConversation = conversation;
409
+ // Trigger change detection manually when using OnPush
410
+ this.cdr.markForCheck();
411
+ };
412
+ }
413
+ ```
414
+
415
+ CometChat components themselves use default change detection internally — `OnPush` on the parent component is fine as long as you call `markForCheck()` after updating state from CometChat callbacks.
416
+
417
+ ---
418
+
419
+ ## 9. Anti-patterns
420
+
421
+ 1. **Do NOT call `CometChatUIKit.init()` inside a lazy-loaded module.** Init must complete before any `<cometchat-*>` component renders. Use `APP_INITIALIZER` at the root level.
422
+
423
+ 2. **Do NOT use `ChangeDetectionStrategy.OnPush` without calling `markForCheck()` after CometChat callbacks.** CometChat callbacks run outside Angular's zone — without `markForCheck()`, the view won't update.
424
+
425
+ 3. **Do NOT import CometChat components in `AppModule` if they're only used in a lazy-loaded feature module.** Import them in the feature module to keep the initial bundle small.
426
+
427
+ 4. **Do NOT skip `isPlatformBrowser()` guard in SSR apps.** CometChat uses browser APIs that crash in Node.js.
428
+
429
+ 5. **Do NOT use `window.location.reload()` after login.** This is a common pattern in CometChat examples but it's an anti-pattern in Angular — use Angular Router navigation instead.
430
+
431
+ 6. **Do NOT forget `CUSTOM_ELEMENTS_SCHEMA` in every module/component that uses `<cometchat-*>` tags.** Each standalone component and each NgModule needs it independently.
432
+
433
+ ---
434
+
435
+ ## Skill routing reference
436
+
437
+ | Skill | When to route |
438
+ |---|---|
439
+ | `cometchat-angular-core` | Init, login, module setup — always first |
440
+ | `cometchat-angular-components` | Component prop reference |
441
+ | `cometchat-angular-placement` | Where to put chat (route / sidebar / modal / tab) |
442
+ | `cometchat-angular-patterns` | This skill — Angular-specific wiring (guards, lazy loading, SSR) |
443
+ | `cometchat-angular-theming` | CometChatThemeService + palette |
444
+ | `cometchat-angular-features` | Calls, extensions, AI |
445
+ | `cometchat-angular-customization` | Custom slot views, formatters, event bus |
446
+ | `cometchat-angular-production` | Server-minted auth tokens |
447
+ | `cometchat-angular-troubleshooting` | Build errors, runtime failures, SSR crashes |