/cometchat-skills:cometchat-angular-v5-patternsfrom cometchat-skills
Handles Angular project shape decisions for CometChat integration: CLI vs Nx, standalone vs NgModule, SSR/Universal, lazy routes, and RxJS/signals state patterns.
Ships in cometchat-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ground truth: this skill is Angular PROJECT-SHAPE glue — CLI vs Nx, standalone vs NgModule,
environment.ts, SSR, lazy routes. CometChat API surface belongs tocometchat-angular-v5-core; fetch any symbol viacometchat-angular-v5-core/references/docs-map.md. Where the Angular UI Kit docs genuinely do not cover a shape (SSR / Angular Universal), this file says so explicitly and marks the guidance as the pack's own — absence from the guide is never silently presented as documented.
cometchat-angular-v5-core — install, credentials, init→login→render. Assumed.cometchat-angular-v5-placement — routing a chat page.The blocker is the project shape, not CometChat: a monorepo, NgModules, SSR, or where config lives.
| Signal | Shape | Deltas |
|---|---|---|
nx.json present | Nx workspace | env files, project-level styles, path aliases |
angular.json + src/main.ts | Angular CLI | the default; core's recipe applies as-is |
app.module.ts present | NgModule app | components go in imports: of the module |
server.ts / @angular/ssr | SSR / Universal | browser-only guards, see below |
The kit's components are standalone, which means an NgModule app imports them into the module's imports array — the same array, a different file:
// app.module.ts
import { NgModule } from '@angular/core';
import { CometChatConversationsComponent, CometChatMessageListComponent } from '@cometchat/chat-uikit-angular';
import { ChatComponent } from './chat/chat.component'; // YOUR (non-standalone) component
@NgModule({
declarations: [ChatComponent],
imports: [CometChatConversationsComponent, CometChatMessageListComponent],
})
export class AppModule {}
Do not add them to declarations — they are not yours to declare, and Angular will error. Init moves from main.ts into an APP_INITIALIZER provider on the module.
Three things move:
apps/<app>/src/environments/environment.ts. fileReplacements go in that project's project.json, not a root angular.json.styles array with a workspace-root-relative path: node_modules/@cometchat/chat-uikit-angular/styles/css-variables.css.imports, or consumers get the silent no-render.Nx does not change the CometChat API at all — only where config lives.
The kit is a browser client. The SDK touches window, localStorage and WebSockets, none of which exist on the server.
import { Component, inject, PLATFORM_ID } from '@angular/core';
import { isPlatformBrowser } from '@angular/common';
import { CometChatUIKit } from '@cometchat/chat-uikit-angular';
import { environment } from '../environments/environment';
@Component({ selector: 'app-root', standalone: true, template: '<router-outlet />' })
export class AppComponent {
constructor() {
if (isPlatformBrowser(inject(PLATFORM_ID))) {
const { appId, region, authKey } = environment.cometchat;
// init only in the browser — on the server this throws "window is not defined"
CometChatUIKit.initFromSettings({
appId, region,
credentials: { authKey },
chatSDK: { presenceSubscription: { type: 'ALL_USERS' } },
});
}
}
}
Rules:
isPlatformBrowser.@defer on hydration, or an *ngIf on a browser flag). Server-rendering them produces markup that immediately mismatches.ThemeService is already SSR-safe — it writes data-theme through the DOCUMENT token rather than touching document directly.Not in the docs. The Angular UI Kit docs do not cover SSR / Angular Universal. The guards above are derived from what the SDK touches (
window,localStorage, WebSockets) and are the pack's own guidance — absence from the guide is not a signal that they are unnecessary.
{ path: 'chat', loadComponent: () => import('./chat/chat.component').then(m => m.ChatComponent) }
Lazy loading the route is fine and recommended — the kit is large. Init still happens once at bootstrap, not in the lazy chunk, or the first navigation pays for it and a second navigation re-runs it.
ChatStateService exposes both (activeUser signal, activeUser$ observable). Pick one style per component and stay in it; mixing produces two update paths for the same value.
async pipe.takeUntil(destroy$) in ngOnDestroy.Never mirror either into your own field — see placement's "two sources of truth" pitfall.
declarations → Angular error; they belong in imports.window is not defined at build or first request.ng build (and ng build --ssr where applicable) passes · chat renders in the browser · no window is not defined on the server · navigating to the lazy route once initialises once · config resolves in every configuration you build.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cometchat/cometchat-skills --plugin cometchat-skills98 skills in this plugin
/cometchatEntry point for any CometChat task on any platform. Detects the framework + UI Kit version (React, Angular, iOS, Android, React Native, Flutter), then routes to that family's skills — for a NEW integration or a change to an existing one. Triggers: 'add chat', 'add cometchat', 'add chat to my app', 'add calling', 'change something in my chat', 'my chat is already set up', 'add a feature to the chat', 'add chat to my android app', 'integrate cometchat android', 'add chat to my ios app', 'integrate cometchat ios', 'add chat to my swift app', 'migrate my app to cometchat', 'migrate from sendbird', 'migrate from getstream / stream', 'replace sendbird / stream chat with cometchat', 'build a <app> clone', 'make a chat app like <app>', 'make it look and work like <app>'./cometchat-a11yKeep a CometChat integration accessible — the UI Kit is designed targeting WCAG 2.1 AA with keyboard navigation (verify per component in its docs; full conformance still needs manual testing), and this skill makes sure the HOST app doesn't break that, covering contrast, focus, screen-reader context, reduced motion, RTL, and calls accessibility. Cross-family. Triggers: 'is cometchat accessible', 'WCAG / 508 / ADA compliance', 'screen reader support', 'keyboard navigation', 'a11y audit', 'accessible chat', 'contrast/focus issues in chat'./cometchat-analyticsSee what your chat is doing — pull usage & message metrics via REST, stream real-time events to your data/observability stack via webhooks, monitor client-side errors & the init/login path, and read push/call logs. Cross-family: metrics/webhooks are server-side; client error monitoring wires per family. Triggers: 'chat analytics', 'usage metrics', 'message volume', 'monitor cometchat', 'observability', 'send chat events to datadog/segment/bigquery', 'track delivery', 'error monitoring for chat', 'dashboards for chat'./cometchat-android-v5-calls-sdkAdd voice & video calling to any Android app FROM SCRATCH with the headless CometChat Calls SDK v5 (`com.cometchat:calls-sdk-android:5.0.4`) — no UI Kit. Kotlin: initFromSettings→login→generateToken→joinSession into a RelativeLayout, lifecycle-bound listeners, meet-style session rooms AND 1:1 ringing (Chat SDK v5 signaling + Calls SDK media), call logs, layouts, audio modes, recording, PiP, background service. Triggers: 'add calling from scratch android', 'standalone video call kotlin', 'headless calls sdk android', 'build my own call UI android', 'meeting room join by session id android', 'one-on-one ringing call without uikit android'./cometchat-android-v5-sdkBuild chat on Android with the headless CometChat Chat SDK v5 and your OWN UI — init/login ordering, the method map, request-builder pagination, listener lifecycle, and a production-ready app surface (optimistic updates, error states, sized shell). Use when the app needs custom UI instead of the drop-in UI Kit. Triggers: 'cometchat android sdk', 'chat with my own ui android', 'headless cometchat android', 'send message with chat-sdk-android', 'cometchat message listener kotlin'./cometchat-android-v6-builder-settingsThe CometChat Android v6 settings and session API reference — the assets/cometchat-settings.json file that initFromSettings reads (appId, region, credentials, uiKit toggles), the legacy UIKitSettings builder, and the CometChatUIKit session methods (login, loginWithAuthToken, logout, getLoggedInUser, createUser). Use when configuring init options or wiring auth beyond the core golden path. Triggers: 'cometchat settings json android', 'uikitsettings builder options', 'login with auth token android', 'create a cometchat user from the app', 'enable calling in settings'.Other plugins' skills for the same job