@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.
- package/LICENSE +21 -0
- package/README.md +44 -17
- package/bin/install.js +389 -43
- package/package.json +19 -9
- package/skills/cometchat/SKILL.md +1066 -265
- package/skills/cometchat-android-v5/SKILL.md +120 -0
- package/skills/cometchat-android-v5-components/SKILL.md +430 -0
- package/skills/cometchat-android-v5-core/SKILL.md +468 -0
- package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
- package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
- package/skills/cometchat-android-v5-features/SKILL.md +130 -0
- package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
- package/skills/cometchat-android-v5-production/SKILL.md +94 -0
- package/skills/cometchat-android-v5-push/SKILL.md +620 -0
- package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
- package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
- package/skills/cometchat-android-v6/SKILL.md +107 -0
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
- package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
- package/skills/cometchat-android-v6-core/SKILL.md +354 -0
- package/skills/cometchat-android-v6-events/SKILL.md +212 -0
- package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
- package/skills/cometchat-android-v6-features/SKILL.md +130 -0
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
- package/skills/cometchat-android-v6-production/SKILL.md +187 -0
- package/skills/cometchat-android-v6-push/SKILL.md +274 -0
- package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
- package/skills/cometchat-angular-components/SKILL.md +706 -0
- package/skills/cometchat-angular-core/SKILL.md +444 -0
- package/skills/cometchat-angular-customization/SKILL.md +424 -0
- package/skills/cometchat-angular-features/SKILL.md +447 -0
- package/skills/cometchat-angular-patterns/SKILL.md +447 -0
- package/skills/cometchat-angular-placement/SKILL.md +685 -0
- package/skills/cometchat-angular-production/SKILL.md +415 -0
- package/skills/cometchat-angular-theming/SKILL.md +365 -0
- package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
- package/skills/cometchat-astro-patterns/SKILL.md +3 -3
- package/skills/cometchat-components/SKILL.md +11 -0
- package/skills/cometchat-core/SKILL.md +11 -6
- package/skills/cometchat-customization/references/component-catalog.md +1 -1
- package/skills/cometchat-features/SKILL.md +176 -108
- package/skills/cometchat-flutter-v5/SKILL.md +167 -0
- package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
- package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
- package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
- package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
- package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
- package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
- package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
- package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
- package/skills/cometchat-flutter-v6/SKILL.md +445 -0
- package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
- package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
- package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
- package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
- package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
- package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
- package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
- package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
- package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
- package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
- package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
- package/skills/cometchat-ios/SKILL.md +323 -0
- package/skills/cometchat-ios-components/SKILL.md +651 -0
- package/skills/cometchat-ios-core/SKILL.md +822 -0
- package/skills/cometchat-ios-customization/SKILL.md +825 -0
- package/skills/cometchat-ios-features/SKILL.md +725 -0
- package/skills/cometchat-ios-placement/SKILL.md +750 -0
- package/skills/cometchat-ios-production/SKILL.md +730 -0
- package/skills/cometchat-ios-push/SKILL.md +582 -0
- package/skills/cometchat-ios-theming/SKILL.md +631 -0
- package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
- package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
- package/skills/cometchat-native-components/SKILL.md +594 -0
- package/skills/cometchat-native-core/SKILL.md +407 -0
- package/skills/cometchat-native-customization/SKILL.md +594 -0
- package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
- package/skills/cometchat-native-features/SKILL.md +608 -0
- package/skills/cometchat-native-placement/SKILL.md +500 -0
- package/skills/cometchat-native-production/SKILL.md +694 -0
- package/skills/cometchat-native-push/SKILL.md +593 -0
- package/skills/cometchat-native-testing/SKILL.md +583 -0
- package/skills/cometchat-native-theming/SKILL.md +656 -0
- package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
- package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
- package/skills/cometchat-production/SKILL.md +60 -0
- package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat
|
|
3
|
-
description: Entry-point for CometChat integration.
|
|
3
|
+
description: Entry-point for CometChat integration in any React, React Native, Angular, Android, Flutter, or iOS project — web (React/Next.js/React Router/Astro), React Native (Expo/bare), Angular (12-15), native Android (V5 stable, V6 beta), Flutter (V5 stable, V6 beta), and native iOS (V5 stable). Detects the framework, gathers requirements through an interactive conversation, and writes production-quality integration code.
|
|
4
4
|
license: "MIT"
|
|
5
5
|
allowed-tools: "executeBash, readFile, fileSearch, listDirectory, AskUserQuestion"
|
|
6
6
|
metadata:
|
|
7
7
|
author: "CometChat"
|
|
8
8
|
version: "3.0.0"
|
|
9
|
-
tags: "cometchat dispatcher entry react chat"
|
|
9
|
+
tags: "cometchat dispatcher entry react nextjs react-router astro expo react-native angular android flutter ios chat"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
## Use this skill when
|
|
@@ -15,10 +15,24 @@ The user wants to add CometChat to any kind of project. Trigger phrases:
|
|
|
15
15
|
|
|
16
16
|
- `/cometchat`
|
|
17
17
|
- "add cometchat", "integrate cometchat", "add chat to my app"
|
|
18
|
-
- "add messaging", "add chat ui"
|
|
18
|
+
- "add messaging", "add chat ui", "add in-app chat"
|
|
19
19
|
|
|
20
|
-
This is the **entry point**. Do
|
|
21
|
-
directly — this dispatcher
|
|
20
|
+
This is the **entry point for every framework**. Do NOT invoke
|
|
21
|
+
framework-specific skills directly — this dispatcher detects the
|
|
22
|
+
framework first and routes to the right ones.
|
|
23
|
+
|
|
24
|
+
**Supported frameworks:**
|
|
25
|
+
|
|
26
|
+
| Family | Frameworks |
|
|
27
|
+
|---|---|
|
|
28
|
+
| **Web** | React (Vite/CRA), Next.js, React Router v6/v7, Astro |
|
|
29
|
+
| **React Native** | Expo (managed + Expo Router), bare RN CLI |
|
|
30
|
+
| **Angular** | Angular 12-15 (Angular CLI / NgModule) |
|
|
31
|
+
| **Android** | V5 stable (Java + Kotlin Views) / V6 beta (Compose + Kotlin Views) |
|
|
32
|
+
| **Flutter** | V5 stable (GetX-based, `cometchat_chat_uikit:^5.2`) / V6 beta (Bloc-based, `cometchat_chat_uikit:^6.0.0-beta`) |
|
|
33
|
+
| **iOS** | V5 stable (Swift; SwiftUI + UIKit hosting; `CometChatUIKitSwift:~> 5.1`) |
|
|
34
|
+
|
|
35
|
+
The web family loads `@cometchat/chat-uikit-react` + `@cometchat/chat-sdk-javascript`. The RN family loads `@cometchat/chat-uikit-react-native` + `@cometchat/chat-sdk-react-native`. The Angular family loads `@cometchat/chat-uikit-angular` + `@cometchat/chat-sdk-javascript`. The Android family loads `com.cometchat:chat-uikit-android:5.x` (V5) or `com.cometchat:chatuikit-{compose,kotlin}-android:6.x` (V6) from Maven Central. The Flutter family loads `cometchat_chat_uikit:^5.2` (V5; pair with `cometchat_calls_uikit:^5.0` for calls) or `cometchat_chat_uikit:^6.0.0-beta` (V6; calls fold into the same package) from the Cloudsmith Dart pub-hosted registry. The dispatcher decides which set after Step 1's detection.
|
|
22
36
|
|
|
23
37
|
## How v3 works
|
|
24
38
|
|
|
@@ -27,11 +41,11 @@ the framework and dump code. You have a conversation with the developer
|
|
|
27
41
|
to understand their project, their use case, and exactly where chat
|
|
28
42
|
should go — THEN you write code that fits.
|
|
29
43
|
|
|
30
|
-
|
|
31
|
-
- `cometchat-core` —
|
|
32
|
-
- `cometchat-components` —
|
|
33
|
-
- `cometchat-placement`
|
|
34
|
-
- `cometchat-{
|
|
44
|
+
Pattern skills (loaded from your context, not via `Skill()`):
|
|
45
|
+
- `cometchat-core` (web) / `cometchat-native-core` (RN) / `cometchat-angular-core` (Angular) / `cometchat-android-{v5,v6}-core` (Android) / `cometchat-flutter-{v5,v6}-core` (Flutter) — init, login, provider chain, env vars, anti-patterns
|
|
46
|
+
- `cometchat-components` (web) / `cometchat-native-components` (RN) / `cometchat-angular-components` (Angular) / `cometchat-android-v5-components` or `cometchat-android-v6-{compose,kotlin}-components` (Android) / `cometchat-flutter-v6-components` (V6 only — V5 splits into `-conversations`/`-messages`/`-users-groups`) — component catalog, props, composition
|
|
47
|
+
- `cometchat-placement` (web) / `cometchat-native-placement` (RN) / `cometchat-angular-placement` (Angular) / `cometchat-android-v5-placement` or `cometchat-android-v6-{compose,kotlin}-placement` (Android) / `cometchat-flutter-v6-placement` (V6 only) — WHERE to put chat
|
|
48
|
+
- One per-framework skill (`cometchat-{react,nextjs,react-router,astro}-patterns`, `cometchat-native-{expo,bare}-patterns`, `cometchat-angular-patterns`, the v5/v6 Android sub-tree, or the Flutter v5/v6 sub-tree) — framework-specific details
|
|
35
49
|
|
|
36
50
|
**Key principle: ask, don't assume.** Every piece of information you need
|
|
37
51
|
from the user should be asked explicitly. Don't guess the route path,
|
|
@@ -56,24 +70,160 @@ If no config, run detection:
|
|
|
56
70
|
npx @cometchat/skills-cli detect --json
|
|
57
71
|
```
|
|
58
72
|
|
|
59
|
-
|
|
73
|
+
The JSON output includes `framework` (one of `reactjs`, `nextjs`, `react-router`, `astro`, `expo`, `react-native`, `angular`, `android`, `flutter`, `ios`, or `null`), framework-specific fields (`router`, `expo_mode`, `react_native_version`, `android_version`, `flutter_version`, `env_prefix`), and a `compatibility.supported` flag. If `supported` is `false`, stop and surface the warnings.
|
|
74
|
+
|
|
75
|
+
**Android — `android_version` is load-bearing.** When `framework === "android"`, the detect output includes `android_version: "v5" | "v6" | null`. The cohort selects which V5 or V6 pattern set to load — V5 (live, `chat-uikit-android:5.x`, Java + Kotlin Views) and V6 (beta, `chatuikit-{compose,kotlin}-android:6.x`) are different SDKs with different APIs. Treat them as separate routing targets even though both live under `--family android`.
|
|
76
|
+
|
|
77
|
+
If `android_version` is `null`, the project is greenfield (no cometchat dep yet). Ask the user via `AskUserQuestion`:
|
|
78
|
+
> "Which CometChat Android UI Kit do you want to use? V5 is the live SDK (recommended for production today). V6 is beta (Compose + Kotlin Views split, future-facing)."
|
|
79
|
+
|
|
80
|
+
Save the choice into `.cometchat/config.json` under `android_version` so subsequent `/cometchat` runs don't re-ask.
|
|
81
|
+
|
|
82
|
+
**Flutter — `flutter_version` is load-bearing too.** When `framework === "flutter"`, the detect output includes `flutter_version: "v5" | "v6" | null`. V5 is GetX-based (`cometchat_chat_uikit:^5.2`); V6 is Bloc-based (`cometchat_chat_uikit:^6.0.0-beta2`). The two cohorts have different state-management primitives, different barrel exports, and different theme APIs — never mix them. Same `--family flutter` install ships both sets; routing picks the right one.
|
|
83
|
+
|
|
84
|
+
If `flutter_version` is `null`, ask via `AskUserQuestion`:
|
|
85
|
+
> "Which CometChat Flutter UI Kit do you want to use? V5 is the live SDK (GetX-based, recommended for production today). V6 is beta (Bloc-based, future-facing)."
|
|
86
|
+
|
|
87
|
+
Save the choice into `.cometchat/config.json` under `flutter_version`.
|
|
88
|
+
|
|
89
|
+
**Then read the project yourself — this is critical.**
|
|
90
|
+
|
|
91
|
+
**For web frameworks (`reactjs`, `nextjs`, `react-router`, `astro`):**
|
|
60
92
|
- `package.json` — name, dependencies, scripts
|
|
61
93
|
- The source directory structure — list all directories under `src/` or `app/`
|
|
62
|
-
- Find the router:
|
|
63
|
-
`react-router.config.ts`, `astro.config.*`
|
|
94
|
+
- Find the router: `createBrowserRouter`, `app/` directory, `pages/`, `react-router.config.ts`, `astro.config.*`
|
|
64
95
|
- Find the layout: `App.tsx`, `layout.tsx`, `root.tsx`, `Layout.astro`
|
|
65
|
-
- Find the nav:
|
|
96
|
+
- Find the nav: components with "nav", "header", "sidebar" in name
|
|
66
97
|
- Find existing pages/routes: list them so you can reference them later
|
|
67
98
|
|
|
99
|
+
**For React Native (`expo`, `react-native`):**
|
|
100
|
+
- `package.json` — name, RN version, all dependencies, scripts
|
|
101
|
+
- Entry file — `index.js` or `App.{tsx,jsx}` or `app/_layout.tsx` (Expo Router)
|
|
102
|
+
- Navigation — look for `@react-navigation/native`, `@react-navigation/stack`, `@react-navigation/bottom-tabs`, or `expo-router`
|
|
103
|
+
- Existing screens — list all files under `screens/`, `src/screens/`, `app/`, or wherever routes live
|
|
104
|
+
- Existing nav structure — read the root navigator to see stack vs tab vs drawer layout
|
|
105
|
+
|
|
106
|
+
**For Angular (`angular`):**
|
|
107
|
+
- `package.json` — name, `@angular/core` version (12-15 supported), all `@angular/*` deps
|
|
108
|
+
- `angular.json` — workspace config; identify the project name + `sourceRoot`
|
|
109
|
+
- Root NgModule — usually `src/app/app.module.ts`; check imports + declarations + `schemas`
|
|
110
|
+
- Routing — `src/app/app-routing.module.ts` or root `RouterModule.forRoot([...])`; list all routes
|
|
111
|
+
- Layout — `src/app/app.component.{ts,html}`; identify nav, sidebar, header components
|
|
112
|
+
- Existing pages/components — list under `src/app/pages/`, `src/app/components/`, or wherever the project organizes them
|
|
113
|
+
- Environment files — `src/environments/environment.ts` (and `.prod.ts`); credentials live here, NOT in `.env`
|
|
114
|
+
|
|
115
|
+
**For Android (`android`):**
|
|
116
|
+
- `settings.gradle` (or `.kts`) — module list; usually `:app` plus optional library modules
|
|
117
|
+
- Root `build.gradle` (or `.kts`) — top-level plugins, repositories, classpath versions
|
|
118
|
+
- App `build.gradle` (or `.kts`) — dependencies (this is where the cometchat dep lives), Android plugin, `applicationId`, `minSdk`/`targetSdk`/`compileSdk`, `buildConfigField` entries
|
|
119
|
+
- `AndroidManifest.xml` — root `<application>` class, permissions, `<activity>` entries, deep links
|
|
120
|
+
- Source dirs: `app/src/main/java/<pkg>/` (Java) and/or `app/src/main/kotlin/<pkg>/` (Kotlin)
|
|
121
|
+
- For V6 stack split: presence of `androidx.compose.ui:ui` or `compose.material3` in deps signals Compose; otherwise Kotlin Views (XML layouts under `app/src/main/res/layout/`). Many V6 projects have both — ask the user which surface chat lands in.
|
|
122
|
+
- `gradle.properties` and `local.properties` — credentials live here as `cometchat.appId=...` / `cometchat.region=...` / `cometchat.authKey=...`, exposed to code as `BuildConfig` fields via `buildConfigField` in the app `build.gradle`. NOT in `.env`.
|
|
123
|
+
- `Application` class (e.g. `MyApp extends android.app.Application`) — init goes in `onCreate()`. Note the class FQN; you'll wire `CometChatUIKit.init(this, settings, callback)` here.
|
|
124
|
+
|
|
125
|
+
**For Flutter (`flutter`):**
|
|
126
|
+
- `pubspec.yaml` — package name + Dart SDK constraint + Flutter SDK constraint + `dependencies:` (this is where `cometchat_chat_uikit` lives)
|
|
127
|
+
- For V5: a typical project has BOTH `cometchat_chat_uikit:^5.2` AND `cometchat_calls_uikit:^5.0` if calls are needed. V6 folds calls into the single `cometchat_chat_uikit:^6.0.0-beta2` package (no separate calls package).
|
|
128
|
+
- `lib/` — Dart source. The app entry is `lib/main.dart` (the `void main() => runApp(...)` site); init goes in `main()` or in a top-level `Stateful`/`State.initState()`.
|
|
129
|
+
- `lib/<config>.dart` (or similar) — credentials. There is NO Flutter `.env` convention — credentials are typically defined as `const` Dart values in a config file, OR injected at compile time via `--dart-define=COMETCHAT_APP_ID=...` flags read inside Dart with `String.fromEnvironment`. NOT a `.env` file at runtime.
|
|
130
|
+
- `android/app/build.gradle` and `ios/Runner/Info.plist` — platform-specific config (FCM service registration, Push capabilities, microphone/camera Info.plist entries for calls). Flutter projects DO have these subdirs but they're configured Flutter-side; do not run the native skill flows.
|
|
131
|
+
- For V5 vs V6: V5 uses **GetX** (`get` in deps); V6 uses **flutter_bloc** + `equatable`. Their controllers, observers, and theming are different — match the integration code to the detected cohort.
|
|
132
|
+
|
|
133
|
+
**For iOS (`ios`):**
|
|
134
|
+
- `<App>.xcodeproj` and/or `<App>.xcworkspace` — Xcode project / workspace. The `.xcworkspace` is preferred when CocoaPods is in use (open it, NOT the .xcodeproj).
|
|
135
|
+
- `Podfile` (CocoaPods) — pin `pod 'CometChatUIKitSwift', '~> 5.1'` and run `pod install`. Look for `platform :ios, '13.0'` (or higher) — V5 needs iOS 13+.
|
|
136
|
+
- `Package.swift` (Swift Package Manager) — `dependencies:` block adds `https://github.com/cometchat/cometchat-uikit-ios`. Both SPM and CocoaPods are supported; check which the project uses.
|
|
137
|
+
- App entry — `<App>App.swift` (SwiftUI) or `AppDelegate.swift` + `SceneDelegate.swift` (UIKit). Init goes in `@main struct App.init()` (SwiftUI) or `application(_:didFinishLaunchingWithOptions:)` (UIKit).
|
|
138
|
+
- `Info.plist` — for calls add `NSMicrophoneUsageDescription` + `NSCameraUsageDescription`; for push add the APNs entitlement and a `BackgroundModes` entry with `remote-notification` (and `voip` for VoIP push).
|
|
139
|
+
- Credentials: NO `.env` at runtime. Use a `Secrets.swift` const enum/struct (gitignored) or an `*.xcconfig` file with `COMETCHAT_APP_ID = ...` exposed as Build Settings. The skill teaches both.
|
|
140
|
+
- **Mixed-stack apps (SwiftUI + UIKit):** the kit ships UIKit `UIViewController`s and exposes them via `UIViewControllerRepresentable` for SwiftUI hosting. Identify which surface chat lands in (SwiftUI screen vs UIKit nav stack) and follow the matching pattern.
|
|
141
|
+
|
|
68
142
|
Store this mental map — you'll use it throughout the conversation.
|
|
69
143
|
|
|
70
|
-
|
|
144
|
+
**Compatibility baselines (the CLI enforces these):**
|
|
145
|
+
- Web: react@<18 → upgrade required; nextjs@<13 → warning; astro@<4 → warning
|
|
146
|
+
- RN: react-native@<0.70 → upgrade required; expo@<49 → upgrade required
|
|
147
|
+
- Angular: @angular/core@<12 → upgrade required; @angular/core@>=16 → warning (skill is verified against v15)
|
|
148
|
+
- Android V5: minSdk@<21 → upgrade required; minSdk@<24 → warning; AGP@<7.0 → warning
|
|
149
|
+
- Android V6: minSdk@<28 → upgrade required (V6 raised the floor from API 23 to API 28); Kotlin@<1.9 → warning; for Compose stack, Compose BOM@<2024.x → warning
|
|
150
|
+
- Flutter V5: Dart SDK <2.17 → upgrade required; Flutter <2.5 → warning; Android `minSdk 24` (Flutter platform default) when V5 is in use
|
|
151
|
+
- Flutter V6: Dart SDK <2.17 → upgrade required; Flutter <2.5 → warning; Android `minSdk 26` REQUIRED (cometchat_calls_sdk in V6 raised the floor)
|
|
152
|
+
- iOS V5: iOS deployment target <13 → upgrade required; Swift <5.0 → upgrade required; Xcode 15+ requires `ENABLE_USER_SCRIPT_SANDBOXING = NO` in Build Settings (or the `post_install` Podfile hook)
|
|
153
|
+
|
|
154
|
+
#### Pattern skills not installed?
|
|
155
|
+
|
|
156
|
+
The dispatcher routes to web pattern skills (`cometchat-{core,components,placement,*-patterns}`), RN pattern skills (`cometchat-native-{core,components,placement,*-patterns}`), or Angular pattern skills (`cometchat-angular-{core,components,placement,patterns}`) based on the detected framework. If the matching set isn't loaded — i.e. the user has only the dispatcher in `.claude/skills/`, OR they installed only `@cometchat/skills` (web) but the project is RN/Angular, OR vice versa — **install the missing package yourself**. Do NOT stop and ask the user to run the npx command manually — that turns a 0-step recovery into a 2-step recovery for no benefit.
|
|
157
|
+
|
|
158
|
+
To check whether the pattern skills are loaded, attempt to read `cometchat-core/SKILL.md` (web), `cometchat-native-core/SKILL.md` (RN), or `cometchat-angular-core/SKILL.md` (Angular) from your loaded skills context. If the read fails, the package isn't installed — run the installer.
|
|
159
|
+
|
|
160
|
+
**If `framework` is `expo` or `react-native` AND `cometchat-native-core` is NOT loaded:**
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
npx @cometchat/skills-native add
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**If `framework` is `reactjs`, `nextjs`, `react-router`, or `astro` AND `cometchat-core` is NOT loaded:**
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
npx @cometchat/skills add
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**If `framework` is `angular` AND `cometchat-angular-core` is NOT loaded:**
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
npx @cometchat/skills add --family angular
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**If `framework` is `android` AND neither `cometchat-android-v5-core` nor `cometchat-android-v6-core` is loaded:**
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npx @cometchat/skills add --family android
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
This installs both V5 and V6 skill sets — the dispatcher's Step 4 routing picks the correct one based on `android_version`.
|
|
185
|
+
|
|
186
|
+
**If `framework` is `flutter` AND neither `cometchat-flutter-v5-core` nor `cometchat-flutter-v6-core` is loaded:**
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
npx @cometchat/skills add --family flutter
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Same shape as Android — installs both V5 and V6 skill sets; routing picks the right one based on `flutter_version`.
|
|
193
|
+
|
|
194
|
+
**If `framework` is `ios` AND `cometchat-ios-core` is NOT loaded:**
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npx @cometchat/skills add --family ios
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
iOS only ships V5 today (no V6 beta yet), so there's no version-detection step — the install command lands the single iOS skill set.
|
|
201
|
+
|
|
202
|
+
After the install completes, tell the user:
|
|
203
|
+
|
|
204
|
+
> "I just installed the {family} pattern skills into your workspace. Please re-run `/cometchat` to continue — your config is saved in `.cometchat/config.json` and credentials in `.env`, so the next run picks up at code generation without re-asking the questions you've already answered."
|
|
205
|
+
|
|
206
|
+
**Why re-run rather than continue in this session:** Claude Code (and most coding agents) snapshot the skill set at session start and do NOT hot-reload SKILL.md mid-session. Even though the install writes the new skill files into `.claude/skills/`, your in-context skill set is the snapshot. Continuing would mean writing code from training memory — which the skills explicitly forbid (this is the same failure mode that produced the `UIKitSettingsBuilder` and `getLoggedinUser` casing bugs at v2.2.0). The re-run is the only safe path.
|
|
207
|
+
|
|
208
|
+
**Non-default IDE — pass `--ide`.** The default installer target is `claude` (`.claude/skills/`). If the dispatcher's own SKILL.md was loaded from a different location, pass the matching flag:
|
|
209
|
+
|
|
210
|
+
| Dispatcher loaded from | Install command |
|
|
211
|
+
|---|---|
|
|
212
|
+
| `.claude/skills/cometchat/SKILL.md` (default) | `npx @cometchat/skills add` |
|
|
213
|
+
| `.agents/skills/cometchat/SKILL.md` (Replit / Cursor / Copilot / Cline / Codex) | `npx @cometchat/skills add --ide replit` |
|
|
214
|
+
| `.cursor/skills/cometchat/SKILL.md` (legacy Cursor path) | `npx @cometchat/skills add --ide cursor` |
|
|
215
|
+
| `.kiro/skills/cometchat/SKILL.md` | `npx @cometchat/skills add --ide kiro` |
|
|
216
|
+
|
|
217
|
+
You can usually infer the IDE from where the dispatcher itself was loaded. If uncertain, default to `claude`. (Same logic applies to `@cometchat/skills-native` for RN projects.)
|
|
218
|
+
|
|
219
|
+
Do NOT attempt to write web UI Kit code into an RN project (CSS imports + `<a href>` + `document.*` fail at runtime) or RN UI Kit code into a web project (`react-native-gesture-handler`, `@gorhom/bottom-sheet`, native bubble components have no browser equivalents). Likewise, never use the React UI Kit (`@cometchat/chat-uikit-react`) in an Angular project — it's a different package (`@cometchat/chat-uikit-angular`) with NgModule imports, kebab-case selectors, content-projection slots, and no React reconciler. And never mix V5 and V6 skill sets within Android or Flutter — the artifact coordinates, package names, state-management primitives (V5 GetX vs V6 Bloc on Flutter; V5 Java/Views vs V6 Compose+Kotlin on Android), and theme system differ; the skills target one cohort each.
|
|
71
220
|
|
|
72
221
|
### Step 2 — Set up credentials (onboarding)
|
|
73
222
|
|
|
74
223
|
**CRITICAL: All onboarding happens via CLI commands. NEVER send the user
|
|
75
|
-
to a browser or dashboard. The CLI handles
|
|
76
|
-
and credential writing — all from the
|
|
224
|
+
to a browser or dashboard for credential copy-pasting. The CLI handles
|
|
225
|
+
signup, login, app creation, and credential writing — all from the
|
|
226
|
+
terminal — for every framework.**
|
|
77
227
|
|
|
78
228
|
If config has `appId` set, verify credentials are in `.env` and skip to Step 3.
|
|
79
229
|
|
|
@@ -82,7 +232,7 @@ Otherwise check:
|
|
|
82
232
|
npx @cometchat/skills-cli auth status --json
|
|
83
233
|
```
|
|
84
234
|
|
|
85
|
-
If `status` is `"logged-in"`, skip to **Step
|
|
235
|
+
If `status` is `"logged-in"`, skip to **Step 2b.5** (fetch dashboard profile).
|
|
86
236
|
|
|
87
237
|
If `status` is `"logged-out"`, ask:
|
|
88
238
|
|
|
@@ -107,12 +257,10 @@ This command:
|
|
|
107
257
|
1. Generates a short-lived session via the CLI auth API.
|
|
108
258
|
2. Opens `https://app.cometchat.com/login?sessionId=<hex>` in the user's default browser.
|
|
109
259
|
3. Polls the auth API every 5 seconds for up to 15 minutes.
|
|
110
|
-
4. When the user finishes signing in
|
|
260
|
+
4. When the user finishes signing in, the dashboard marks the session authenticated. The next poll receives the bearer token and stores it in the OS keychain.
|
|
111
261
|
5. Prints `✓ Logged in as <email> (backend: keychain-macos).`
|
|
112
262
|
|
|
113
|
-
Let the CLI block — do NOT background it, do NOT race it with other
|
|
114
|
-
prompts. The user completes sign-in in the browser tab; the terminal
|
|
115
|
-
waits.
|
|
263
|
+
Let the CLI block — do NOT background it, do NOT race it with other prompts.
|
|
116
264
|
|
|
117
265
|
Terminal error handling (surface verbatim, stop, do not retry silently):
|
|
118
266
|
- `ACCESS_DENIED` — user clicked Deny in the dashboard.
|
|
@@ -120,15 +268,9 @@ Terminal error handling (surface verbatim, stop, do not retry silently):
|
|
|
120
268
|
- `TIMEOUT` — max polls exhausted before user authorized.
|
|
121
269
|
- `ABORTED` — user Ctrl-C'd the CLI.
|
|
122
270
|
- `NETWORK` — couldn't reach the auth host.
|
|
123
|
-
- `ALREADY_AUTHENTICATED` — this session was already consumed. Re-run
|
|
124
|
-
`auth login` to mint a fresh session.
|
|
271
|
+
- `ALREADY_AUTHENTICATED` — this session was already consumed. Re-run `auth login` to mint a fresh session.
|
|
125
272
|
|
|
126
|
-
After success, verify
|
|
127
|
-
```bash
|
|
128
|
-
npx @cometchat/skills-cli auth status --json
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
If `status` is `"logged-in"`, proceed to **Step 2c**.
|
|
273
|
+
After success, verify via `auth status --json` and proceed to **Step 2b.5**.
|
|
132
274
|
|
|
133
275
|
#### Step 2b — Sign up (new account, browser flow)
|
|
134
276
|
|
|
@@ -136,26 +278,115 @@ If `status` is `"logged-in"`, proceed to **Step 2c**.
|
|
|
136
278
|
npx @cometchat/skills-cli auth signup
|
|
137
279
|
```
|
|
138
280
|
|
|
139
|
-
Same polling flow as Step 2a, but the CLI opens
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
281
|
+
Same polling flow as Step 2a, but the CLI opens the signup URL. The browser handles email, name, password, verification email, role, industry. The CLI never sees any of those values.
|
|
282
|
+
|
|
283
|
+
No role / name / verification-code questions in the chat. The dashboard owns that flow now; skipping it keeps the user's password and verification code out of the transcript.
|
|
284
|
+
|
|
285
|
+
Error codes match Step 2a. After success, verify via `auth status --json` and proceed to **Step 2b.5**.
|
|
286
|
+
|
|
287
|
+
#### Step 2b.5 — Fetch the user's dashboard profile
|
|
145
288
|
|
|
146
|
-
|
|
147
|
-
owns that flow now; skipping it keeps the user's password and verification
|
|
148
|
-
code out of the transcript.
|
|
289
|
+
The dashboard's signup flow (`/auth/signup` → `/choose-role` → `/choose-intent`) collects the user's name, email, role, and product intent during browser onboarding — none of those values touch the CLI. Now that the bearer token is in the keychain, fetch them via `cometchat auth me` so the rest of this skill can:
|
|
149
290
|
|
|
150
|
-
|
|
151
|
-
|
|
291
|
+
- Greet the user by name in subsequent steps
|
|
292
|
+
- Skip the placement-intent question (Step 3a) when `meta.intent === "exploring"` (the user already told the dashboard they're just exploring)
|
|
293
|
+
- Tailor explanation depth by `meta.role` (frontend developer → UI examples; engineering manager → architecture trade-offs)
|
|
152
294
|
|
|
153
|
-
After success, verify:
|
|
154
295
|
```bash
|
|
155
|
-
npx @cometchat/skills-cli auth
|
|
296
|
+
npx @cometchat/skills-cli auth me --json
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Response shape:
|
|
300
|
+
```json
|
|
301
|
+
{
|
|
302
|
+
"status": "logged-in",
|
|
303
|
+
"email": "you@example.com",
|
|
304
|
+
"name": "Your Name",
|
|
305
|
+
"role": "frontend",
|
|
306
|
+
"other_role": null,
|
|
307
|
+
"intent": "building",
|
|
308
|
+
"last_app": {
|
|
309
|
+
"id": "27xxxxx",
|
|
310
|
+
"name": "my-marketplace-chat",
|
|
311
|
+
"region": "us",
|
|
312
|
+
"industry": "online_marketplaces",
|
|
313
|
+
"technology": "react",
|
|
314
|
+
"product": "support"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
156
317
|
```
|
|
157
318
|
|
|
158
|
-
|
|
319
|
+
Field meanings (from the dashboard's signup screens — see `/Users/swapnil/Downloads/customer-dashboard-main/src/components/auth/Welcome/`):
|
|
320
|
+
|
|
321
|
+
- `role`: `"frontend"` / `"backend"` / `"fullstack_engineer"` / `"startup_founder"` / `"product_leader/manager"` / `"engineering_leader/manager"` / `"others"` (when `others`, `other_role` carries the freeform value)
|
|
322
|
+
- `intent`: `"building"` / `"evaluating"` / `"exploring"` (this is the **dashboard's** intent — distinct from Step 3a's `placement_intent` which asks about app archetype)
|
|
323
|
+
- `last_app`: most-recently-created app on the user's account (or `null` if they have none). The dashboard's `/create-app` and `/select-product` screens write `industry`, `technology`, `product` into the app's `metadata` — we surface them here so Step 2c can pre-fill region/industry instead of asking again.
|
|
324
|
+
|
|
325
|
+
**Store the response in working memory.** Reference these fields downstream:
|
|
326
|
+
|
|
327
|
+
- **Step 2c (new app):** if `last_app` is non-null, default `--region` and `--industry` to the values from `last_app` and only ask the user to confirm — do NOT re-prompt from scratch.
|
|
328
|
+
- **Step 3a:** if `meta.intent === "exploring"`, skip the placement-intent question and route straight to the "Just exploring" branch (one route/screen with `<CometChatConversations />` and `cometchat-uid-1` pre-logged-in).
|
|
329
|
+
- **Step 5 explanations:** if `meta.role === "frontend"`, lead with concrete component composition + CSS examples; if `meta.role === "engineering_leader/manager"`, lead with placement architecture trade-offs (where state lives, what gets cached, how routing fits the project's pattern).
|
|
330
|
+
- **Greeting:** if `meta.name` is non-null, greet by name in any user-facing message during the rest of the flow ("Got it, Swapnil — let's pick an app").
|
|
331
|
+
|
|
332
|
+
**Failure modes — each is non-blocking; degrade to the original generic flow:**
|
|
333
|
+
|
|
334
|
+
- `status: "logged-out"` → bearer expired between Step 2a/b and now (rare). Re-run `auth login` and retry.
|
|
335
|
+
- `status: "auth-required"` → 401 from server. Same fix.
|
|
336
|
+
- `status: "error"` → network or unexpected. Skip silently, proceed to Step 2b.6 (will ask role + intent there).
|
|
337
|
+
- `name` is `null` → no greeting (don't ask, the dashboard will collect it on next browser visit).
|
|
338
|
+
- `role` is `null` → **ask in Step 2b.6** (this is the case for accounts that signed up via `auth signup` from the CLI — they never saw the dashboard's `/choose-role` screen).
|
|
339
|
+
- `intent` is `null` → **ask in Step 2b.6**.
|
|
340
|
+
- `last_app` is `null` → ask region/industry normally in Step 2c.
|
|
341
|
+
|
|
342
|
+
After this step, proceed to **Step 2b.6**.
|
|
343
|
+
|
|
344
|
+
#### Step 2b.6 — Backfill role + intent if missing
|
|
345
|
+
|
|
346
|
+
The dashboard's `/choose-role` and `/choose-intent` screens collect two profile fields used to tailor the rest of the integration:
|
|
347
|
+
|
|
348
|
+
- `role` shapes the depth and angle of code explanations in Step 5
|
|
349
|
+
- `intent` decides whether Step 3a's placement question is needed (`exploring` short-circuits to a single screen)
|
|
350
|
+
|
|
351
|
+
If `auth me` returned non-null values for both, **skip this step entirely** and go to Step 2c — the dashboard already collected them, do not re-ask.
|
|
352
|
+
|
|
353
|
+
If either is `null` (typical for accounts created via `cometchat auth signup` rather than the dashboard browser flow), ask the user. The options below mirror the dashboard exactly so that anyone who later visits the dashboard sees consistent terminology.
|
|
354
|
+
|
|
355
|
+
**If `role === null`** — `AskUserQuestion`:
|
|
356
|
+
- **question:** "What's your role? (We'll tailor explanations to match.)"
|
|
357
|
+
- **header:** "Role"
|
|
358
|
+
- **multiSelect:** false
|
|
359
|
+
- **options** (label → store as `role` value):
|
|
360
|
+
|
|
361
|
+
| Label | `role` value |
|
|
362
|
+
|---|---|
|
|
363
|
+
| Frontend Developer | `frontend` |
|
|
364
|
+
| Backend Developer | `backend` |
|
|
365
|
+
| Fullstack Developer | `fullstack_engineer` |
|
|
366
|
+
| Founder | `startup_founder` |
|
|
367
|
+
| Product Manager | `product_leader/manager` |
|
|
368
|
+
| Engineering Manager | `engineering_leader/manager` |
|
|
369
|
+
| Other | `others` |
|
|
370
|
+
|
|
371
|
+
If the user picks **Other**, follow up with a free-form `AskUserQuestion` for `other_role` (single short text field; store the freeform value in `other_role`).
|
|
372
|
+
|
|
373
|
+
**If `intent === null`** — `AskUserQuestion`:
|
|
374
|
+
- **question:** "What brings you to CometChat?"
|
|
375
|
+
- **header:** "Intent"
|
|
376
|
+
- **multiSelect:** false
|
|
377
|
+
- **options** (use the dashboard's exact wording):
|
|
378
|
+
|
|
379
|
+
| Label | Description shown under the label | `intent` value |
|
|
380
|
+
|---|---|---|
|
|
381
|
+
| I'm building | Integrating chat into my app now. | `building` |
|
|
382
|
+
| I'm evaluating | Comparing options for my team. | `evaluating` |
|
|
383
|
+
| I'm exploring | Just looking around for now. | `exploring` |
|
|
384
|
+
|
|
385
|
+
**Store the answers in working memory under the same keys** (`role`, `other_role`, `intent`) as if they had come from `auth me`. Downstream steps (3a + 5) treat dashboard-supplied and CLI-collected values identically.
|
|
386
|
+
|
|
387
|
+
> **Note:** These answers are not yet persisted back to the dashboard `/me` endpoint — they only live for the current session. A follow-up will add a `cometchat auth me --update` mode that PATCHes them server-side so the next session won't re-ask. Until then, the user may be asked again in a fresh session.
|
|
388
|
+
|
|
389
|
+
After this step, proceed to **Step 2c**.
|
|
159
390
|
|
|
160
391
|
#### Step 2c — Pick or create an app
|
|
161
392
|
|
|
@@ -171,28 +402,20 @@ npx @cometchat/skills-cli provision list --json
|
|
|
171
402
|
>
|
|
172
403
|
> Which one should I use, or should I create a new one?"
|
|
173
404
|
|
|
174
|
-
**For an existing app**, fetch credentials and wire everything in one call
|
|
175
|
-
(pass `--framework` from Step 1 detection — one of `reactjs`, `nextjs`,
|
|
176
|
-
`react-router`, `astro`):
|
|
405
|
+
**For an existing app**, fetch credentials and wire everything in one call. Pass `--framework` from Step 1 detection (one of `reactjs`, `nextjs`, `react-router`, `astro`, `expo`, `react-native`):
|
|
177
406
|
```bash
|
|
178
407
|
npx @cometchat/skills-cli provision setup \
|
|
179
408
|
--app-id "<selected-appId>" --framework "<framework>" --json
|
|
180
409
|
```
|
|
181
410
|
|
|
182
|
-
This creates/updates
|
|
183
|
-
`.cometchat/config.json` in one step. Output is compact:
|
|
184
|
-
`{ appId, region, framework, envFile, configPath }` — no authKey echoed
|
|
185
|
-
back, no multi-command chain. Skip ahead to "Tell the user" below.
|
|
411
|
+
This creates/updates the env file with the correct prefix AND writes `.cometchat/config.json` in one step. Output is compact: `{ appId, region, framework, envFile, configPath }` — no authKey echoed back.
|
|
186
412
|
|
|
187
413
|
**If no apps exist** (or user wants new), collect:
|
|
188
414
|
1. App name — suggest `<project-name>-chat` from package.json `name`
|
|
189
|
-
2. Region —
|
|
415
|
+
2. Region — **if Step 2b.5 returned `last_app.region`**, default to that value and ask only `"Use the same region as your <last_app.name> app (<region>)? [Y/n]"`. Otherwise `AskUserQuestion`:
|
|
190
416
|
- **question:** "Which region for your CometChat app?"
|
|
191
417
|
- **header:** "Region"
|
|
192
|
-
- **options:**
|
|
193
|
-
1. label: "US", description: "United States (recommended)"
|
|
194
|
-
2. label: "EU", description: "Europe"
|
|
195
|
-
3. label: "India", description: "India"
|
|
418
|
+
- **options:** US (recommended), EU, India
|
|
196
419
|
|
|
197
420
|
**Region key mapping** (CLI expects lowercase):
|
|
198
421
|
| Label | `--region` value |
|
|
@@ -200,18 +423,12 @@ back, no multi-command chain. Skip ahead to "Tell the user" below.
|
|
|
200
423
|
| US | `us` |
|
|
201
424
|
| EU | `eu` |
|
|
202
425
|
| India | `in` |
|
|
203
|
-
3. Industry —
|
|
204
|
-
- **
|
|
205
|
-
- **header:** "Industry"
|
|
206
|
-
- **options:**
|
|
207
|
-
1. label: "SaaS / Business", description: ""
|
|
208
|
-
2. label: "Marketplace", description: ""
|
|
209
|
-
3. label: "Social / Community", description: ""
|
|
210
|
-
4. label: "Other", description: ""
|
|
426
|
+
3. Industry — **if Step 2b.5 returned `last_app.industry`**, default to that value and ask only `"Same industry as your previous app (<industry>)? [Y/n]"`. Otherwise `AskUserQuestion`:
|
|
427
|
+
- **options:** SaaS / Business, Marketplace, Social / Community, Other (or finer-grained from the table below)
|
|
211
428
|
|
|
212
429
|
**Industry key mapping:**
|
|
213
430
|
|
|
214
|
-
| Label |
|
|
431
|
+
| Label | `--industry` value |
|
|
215
432
|
|---|---|
|
|
216
433
|
| SaaS / Business | `saas_businesses` |
|
|
217
434
|
| Marketplace | `online_marketplaces` |
|
|
@@ -225,30 +442,16 @@ back, no multi-command chain. Skip ahead to "Tell the user" below.
|
|
|
225
442
|
| On-demand Services | `on_demand_services` |
|
|
226
443
|
| Other | `other` |
|
|
227
444
|
|
|
228
|
-
**Confirm before creating:**
|
|
229
|
-
> "I'll create a CometChat app:
|
|
230
|
-
> - Name: test-cometchat-vite-chat
|
|
231
|
-
> - Region: US
|
|
232
|
-
> - Industry: SaaS / Business
|
|
233
|
-
>
|
|
234
|
-
> Go ahead?"
|
|
235
|
-
|
|
236
|
-
Then create the app AND wire `.env` AND save config in one step. Pass
|
|
237
|
-
`--framework` from Step 1 detection (one of `reactjs`, `nextjs`,
|
|
238
|
-
`react-router`, `astro`):
|
|
445
|
+
**Confirm before creating, then:**
|
|
239
446
|
```bash
|
|
240
447
|
npx @cometchat/skills-cli provision setup \
|
|
241
448
|
--name "<name>" --region "<region>" --industry "<industry_key>" \
|
|
242
449
|
--framework "<framework>" --json
|
|
243
450
|
```
|
|
244
451
|
|
|
245
|
-
|
|
246
|
-
The authKey is written to the env file but is NOT echoed to stdout, so
|
|
247
|
-
credentials don't appear multiple times in the transcript. This replaces
|
|
248
|
-
the old `provision create` → `provision use` → `config init` chain.
|
|
452
|
+
The authKey is written to the env file but is NOT echoed to stdout, so credentials don't appear multiple times in the transcript.
|
|
249
453
|
|
|
250
|
-
Tell the user: "Your CometChat account and app are ready. Credentials
|
|
251
|
-
saved to `.env`. Let's set up the integration."
|
|
454
|
+
Tell the user: "Your CometChat account and app are ready. Credentials saved to `<envFile>`. Let's set up the integration."
|
|
252
455
|
|
|
253
456
|
#### Step 2d — Paste keys manually
|
|
254
457
|
|
|
@@ -260,42 +463,160 @@ Tell the user which env vars to set based on the detected framework:
|
|
|
260
463
|
| nextjs | `.env.local` | `NEXT_PUBLIC_COMETCHAT_APP_ID`, `NEXT_PUBLIC_COMETCHAT_REGION`, `NEXT_PUBLIC_COMETCHAT_AUTH_KEY` |
|
|
261
464
|
| react-router | `.env` | `VITE_COMETCHAT_APP_ID`, `VITE_COMETCHAT_REGION`, `VITE_COMETCHAT_AUTH_KEY` |
|
|
262
465
|
| astro | `.env` | `PUBLIC_COMETCHAT_APP_ID`, `PUBLIC_COMETCHAT_REGION`, `PUBLIC_COMETCHAT_AUTH_KEY` |
|
|
466
|
+
| expo (managed + Expo Router) | `.env` | `EXPO_PUBLIC_COMETCHAT_APP_ID`, `EXPO_PUBLIC_COMETCHAT_REGION`, `EXPO_PUBLIC_COMETCHAT_AUTH_KEY` |
|
|
467
|
+
| react-native (bare CLI) | `.env` | `COMETCHAT_APP_ID`, `COMETCHAT_REGION`, `COMETCHAT_AUTH_KEY` (paired with `react-native-dotenv`) |
|
|
468
|
+
| angular | `src/environments/environment.ts` | `cometchat: { appId, region, authKey }` (TypeScript object — Angular does NOT use `.env`) |
|
|
469
|
+
| android | `local.properties` (gitignored) → `BuildConfig` | `cometchat.appId`, `cometchat.region`, `cometchat.authKey` in `local.properties`; expose to code via `buildConfigField "String", "COMETCHAT_APP_ID", "\"...\""` in `app/build.gradle`. Code reads `BuildConfig.COMETCHAT_APP_ID`. |
|
|
470
|
+
| flutter | `lib/cometchat_config.dart` (or `--dart-define` flags) | A `const` Dart class with `appId`, `region`, `authKey`. Add `lib/cometchat_config.dart` to `.gitignore` so the file isn't committed. For CI, use `--dart-define=COMETCHAT_APP_ID=...` and read via `String.fromEnvironment('COMETCHAT_APP_ID')` instead. Flutter does NOT load `.env` at runtime. |
|
|
471
|
+
| ios | `Secrets.swift` (gitignored) or `*.xcconfig` Build Settings | A const enum/struct in `Secrets.swift`: `enum Secrets { static let appId = "..."; static let region = "..."; static let authKey = "..." }`. Add `Secrets.swift` to `.gitignore`. For CI, define them in an `.xcconfig` file (`COMETCHAT_APP_ID = ...`) and read via `Bundle.main.object(forInfoDictionaryKey: "COMETCHAT_APP_ID")` after exposing them in `Info.plist`. iOS does NOT load `.env` at runtime. |
|
|
263
472
|
|
|
264
473
|
> "Grab your credentials from https://app.cometchat.com → Your App →
|
|
265
474
|
> API & Auth Keys. Create the env file above and tell me when done."
|
|
266
475
|
|
|
476
|
+
**Bare RN extra step.** Bare RN doesn't ship a public-env-prefix convention — pair the env file with `react-native-dotenv`:
|
|
477
|
+
```bash
|
|
478
|
+
npm install --save-dev react-native-dotenv
|
|
479
|
+
```
|
|
480
|
+
and add the plugin to `babel.config.js`:
|
|
481
|
+
```js
|
|
482
|
+
module.exports = {
|
|
483
|
+
presets: ["module:@react-native/babel-preset"],
|
|
484
|
+
plugins: [["module:react-native-dotenv"]],
|
|
485
|
+
};
|
|
486
|
+
```
|
|
487
|
+
Then `import { COMETCHAT_APP_ID, COMETCHAT_REGION, COMETCHAT_AUTH_KEY } from "@env";` in the provider.
|
|
488
|
+
|
|
489
|
+
**iOS — write to `Secrets.swift` or an `.xcconfig`, NOT `.env`.** iOS has no runtime `.env` lookup. The CLI's `provision setup --framework ios` writes a `.env` only as a credentials handoff. During Step 5, migrate values into one of:
|
|
490
|
+
|
|
491
|
+
1. **`Secrets.swift` const enum** (preferred for local dev):
|
|
492
|
+
```swift
|
|
493
|
+
// Secrets.swift (add to .gitignore)
|
|
494
|
+
enum Secrets {
|
|
495
|
+
static let cometchatAppID = "<APP_ID>"
|
|
496
|
+
static let cometchatRegion = "<REGION>"
|
|
497
|
+
static let cometchatAuthKey = "<AUTH_KEY>" // dev only
|
|
498
|
+
}
|
|
499
|
+
```
|
|
500
|
+
Use as: `UIKitSettings().set(appID: Secrets.cometchatAppID).set(region: Secrets.cometchatRegion).set(authKey: Secrets.cometchatAuthKey).build()`.
|
|
501
|
+
2. **`.xcconfig` Build Settings** (preferred for CI; secrets stay out of source files):
|
|
502
|
+
```
|
|
503
|
+
// Secrets.xcconfig (add to .gitignore; reference from project Build Settings)
|
|
504
|
+
COMETCHAT_APP_ID = <APP_ID>
|
|
505
|
+
COMETCHAT_REGION = <REGION>
|
|
506
|
+
COMETCHAT_AUTH_KEY = <AUTH_KEY>
|
|
507
|
+
```
|
|
508
|
+
Expose as Info.plist entries (`$(COMETCHAT_APP_ID)` etc.) and read via `Bundle.main.object(forInfoDictionaryKey: "COMETCHAT_APP_ID") as? String`.
|
|
509
|
+
|
|
510
|
+
Never read `.env` at runtime in iOS. The handoff `.env` exists only so the integration agent can find the values during initial setup.
|
|
511
|
+
|
|
512
|
+
**Flutter — write to a Dart const file, NOT `.env`.** Flutter has no runtime `.env` lookup. The CLI's `provision setup --framework flutter` writes a `.env` only as a credentials handoff. During Step 5, migrate values into one of:
|
|
513
|
+
|
|
514
|
+
1. **Dart const file** (preferred for local dev, simpler):
|
|
515
|
+
```dart
|
|
516
|
+
// lib/cometchat_config.dart (add to .gitignore)
|
|
517
|
+
class CometChatConfig {
|
|
518
|
+
static const String appId = '<APP_ID>';
|
|
519
|
+
static const String region = '<REGION>';
|
|
520
|
+
static const String authKey = '<AUTH_KEY>'; // dev only
|
|
521
|
+
}
|
|
522
|
+
```
|
|
523
|
+
Then in `main.dart`:
|
|
524
|
+
```dart
|
|
525
|
+
import 'cometchat_config.dart';
|
|
526
|
+
final settings = (UIKitSettingsBuilder()
|
|
527
|
+
..appId = CometChatConfig.appId
|
|
528
|
+
..region = CometChatConfig.region
|
|
529
|
+
..authKey = CometChatConfig.authKey
|
|
530
|
+
..subscriptionType = CometChatSubscriptionType.allUsers)
|
|
531
|
+
.build();
|
|
532
|
+
```
|
|
533
|
+
2. **`--dart-define` flags** (preferred for CI; secrets never hit the repo):
|
|
534
|
+
```dart
|
|
535
|
+
const appId = String.fromEnvironment('COMETCHAT_APP_ID');
|
|
536
|
+
const region = String.fromEnvironment('COMETCHAT_REGION');
|
|
537
|
+
const authKey = String.fromEnvironment('COMETCHAT_AUTH_KEY');
|
|
538
|
+
```
|
|
539
|
+
Run with `flutter run --dart-define=COMETCHAT_APP_ID=... --dart-define=COMETCHAT_REGION=... --dart-define=COMETCHAT_AUTH_KEY=...`.
|
|
540
|
+
|
|
541
|
+
Never read `.env` at runtime in Flutter. The handoff `.env` exists only so the integration agent can find the values during initial setup.
|
|
542
|
+
|
|
543
|
+
**Android — write to `local.properties` + expose via `BuildConfig`.** Android has no runtime `.env` lookup; credentials are injected at compile time as `BuildConfig` fields. The CLI's `provision setup --framework android` writes a `.env` as a credentials handoff — you (the agent) must during Step 5 mirror those values into:
|
|
544
|
+
|
|
545
|
+
1. `local.properties` (project root, gitignored):
|
|
546
|
+
```
|
|
547
|
+
cometchat.appId=<APP_ID>
|
|
548
|
+
cometchat.region=<REGION>
|
|
549
|
+
cometchat.authKey=<AUTH_KEY> # dev only — omit / use auth tokens in production
|
|
550
|
+
```
|
|
551
|
+
2. `app/build.gradle` (or `.kts`) — read those properties and surface them via `buildConfigField`:
|
|
552
|
+
```groovy
|
|
553
|
+
def localProps = new Properties()
|
|
554
|
+
def localPropsFile = rootProject.file('local.properties')
|
|
555
|
+
if (localPropsFile.exists()) localProps.load(new FileInputStream(localPropsFile))
|
|
556
|
+
|
|
557
|
+
android {
|
|
558
|
+
defaultConfig {
|
|
559
|
+
buildConfigField "String", "COMETCHAT_APP_ID", "\"${localProps['cometchat.appId'] ?: ''}\""
|
|
560
|
+
buildConfigField "String", "COMETCHAT_REGION", "\"${localProps['cometchat.region'] ?: ''}\""
|
|
561
|
+
buildConfigField "String", "COMETCHAT_AUTH_KEY", "\"${localProps['cometchat.authKey'] ?: ''}\""
|
|
562
|
+
}
|
|
563
|
+
buildFeatures { buildConfig true }
|
|
564
|
+
}
|
|
565
|
+
```
|
|
566
|
+
3. Application code reads `BuildConfig.COMETCHAT_APP_ID` etc. — never hardcoded strings, never read from `.env` at runtime.
|
|
567
|
+
|
|
568
|
+
**Angular — write to `src/environments/environment.ts`, NOT `.env`.** Angular bundles `environment.ts` into the build at compile time; there is no runtime `.env` lookup. Insert (or extend) the `cometchat` block:
|
|
569
|
+
```typescript
|
|
570
|
+
// src/environments/environment.ts
|
|
571
|
+
export const environment = {
|
|
572
|
+
production: false,
|
|
573
|
+
cometchat: {
|
|
574
|
+
appId: "<APP_ID>",
|
|
575
|
+
region: "<REGION>",
|
|
576
|
+
authKey: "<AUTH_KEY>", // dev only — omit from environment.prod.ts
|
|
577
|
+
},
|
|
578
|
+
};
|
|
579
|
+
```
|
|
580
|
+
Then `import { environment } from "../environments/environment";` and access `environment.cometchat.appId` in the init service. The CLI's `provision setup --framework angular` writes a `.env` as a credentials handoff — you (the agent) must migrate the values into `environment.ts` during Step 5. Never read `.env` from Angular runtime code.
|
|
581
|
+
|
|
267
582
|
After they confirm, verify:
|
|
268
583
|
```bash
|
|
269
584
|
npx @cometchat/skills-cli config init --json
|
|
270
585
|
```
|
|
271
586
|
|
|
587
|
+
#### Never log the Auth Key
|
|
588
|
+
|
|
589
|
+
After writing credentials, don't echo the Auth Key back in the transcript. Confirm as `✓ Wrote <PREFIX>COMETCHAT_AUTH_KEY (hidden)`.
|
|
590
|
+
|
|
272
591
|
### Step 3 — Interactive requirements gathering
|
|
273
592
|
|
|
274
|
-
This is the core of v3. A multi-step conversation that gathers everything
|
|
275
|
-
you need before writing a single line of code.
|
|
593
|
+
This is the core of v3. A multi-step conversation that gathers everything you need before writing a single line of code.
|
|
276
594
|
|
|
277
595
|
#### 3a. "What are you building?"
|
|
278
596
|
|
|
279
597
|
If config has `intent` set, confirm it and move on.
|
|
280
598
|
|
|
599
|
+
**If `meta.intent === "exploring"` from Step 2b.5** (the user already told the dashboard during signup that they're just exploring), skip the rest of Step 3 entirely and route to the "Just exploring" branch — scaffold the minimal integration in Step 5 (one route/screen showing `<CometChatConversations />` with `cometchat-uid-1` pre-logged-in). Do not ask the placement-intent question; the user has already said "show me the simplest thing."
|
|
600
|
+
|
|
281
601
|
Otherwise, use `AskUserQuestion`:
|
|
282
602
|
- **question:** "What kind of app are you building?"
|
|
283
603
|
- **header:** "Your app"
|
|
284
604
|
- **multiSelect:** false
|
|
285
605
|
- **options:**
|
|
286
|
-
1. label: "Messaging app", description: "Chat is the main feature — like Slack, Discord, or
|
|
287
|
-
2. label: "Marketplace or platform", description: "Buyers and sellers communicate — like Airbnb, eBay, or
|
|
288
|
-
3. label: "SaaS or
|
|
289
|
-
4. label: "Social or community", description: "User profiles with messaging — like a dating app or forum."
|
|
606
|
+
1. label: "Messaging app", description: "Chat is the main feature — like Slack, Discord, WhatsApp, or Telegram."
|
|
607
|
+
2. label: "Marketplace or platform", description: "Buyers and sellers communicate — like Airbnb, eBay, OfferUp, or Depop."
|
|
608
|
+
3. label: "SaaS or productivity", description: "Team chat or support chat inside a product — like Notion, Intercom, or Linear."
|
|
609
|
+
4. label: "Social or community", description: "User profiles with messaging — like a dating app or community forum."
|
|
290
610
|
5. label: "Support or helpdesk", description: "Customer-to-agent communication."
|
|
291
611
|
6. label: "Just exploring", description: "Quick demo — fastest path to see chat working."
|
|
292
612
|
|
|
293
|
-
**If "Just exploring":** skip the rest of Step 3
|
|
294
|
-
demo mode in Step 5.
|
|
613
|
+
**If "Just exploring":** skip the rest of Step 3 and scaffold the minimal integration in Step 5 — one route/screen showing `<CometChatConversations />` with `cometchat-uid-1` pre-logged-in.
|
|
295
614
|
|
|
296
615
|
#### 3b. Show what you recommend and why
|
|
297
616
|
|
|
298
|
-
|
|
617
|
+
The recommendation table differs by family because the placement vocabulary is different (web has routes/drawers/widgets; RN has screens/tabs/sheets):
|
|
618
|
+
|
|
619
|
+
**Web family (reactjs, nextjs, react-router, astro):**
|
|
299
620
|
|
|
300
621
|
| Intent | What you'll set up |
|
|
301
622
|
|---|---|
|
|
@@ -305,18 +626,25 @@ Based on the intent, present the recommendation:
|
|
|
305
626
|
| **Social / community** | A full messenger page with tabs: Chats, Calls, Users, Groups. |
|
|
306
627
|
| **Support** | A floating widget bubble in the bottom-right corner. |
|
|
307
628
|
|
|
308
|
-
|
|
309
|
-
("Visual reference — experience layouts") so the user can visualize it.
|
|
629
|
+
**React Native family (expo, react-native):**
|
|
310
630
|
|
|
311
|
-
|
|
312
|
-
|
|
631
|
+
| Intent | What you'll set up |
|
|
632
|
+
|---|---|
|
|
633
|
+
| **Messaging app** | A dedicated "Messages" bottom tab. Conversations list → tap a conversation → message thread. |
|
|
634
|
+
| **Marketplace** | A "Chat with seller" button on the product screen that opens a modal with the message thread. Plus an "Inbox" stack screen for all conversations. |
|
|
635
|
+
| **SaaS / productivity** | A "Chat" stack screen accessible from the nav or a header button. Optionally a bottom sheet for quick replies. |
|
|
636
|
+
| **Social / community** | A "Messages" bottom tab with conversations list + message thread. Plus a "Message" button on user profile screens that opens a modal. |
|
|
637
|
+
| **Support** | A modal triggered from a "Help" or "Support" button in the header or settings. |
|
|
638
|
+
|
|
639
|
+
When explaining, reference the ASCII diagrams from `cometchat-placement` (web) or `cometchat-native-placement` (RN) so the user can visualize.
|
|
640
|
+
|
|
641
|
+
Ask: "Does this sound right, or do you want a different approach?" Let them override.
|
|
313
642
|
|
|
314
643
|
#### 3c. Ask where things should go
|
|
315
644
|
|
|
316
|
-
**Show the user their actual project structure** — list the pages/routes
|
|
317
|
-
you found in Step 1. Then ask placement-specific questions:
|
|
645
|
+
**Show the user their actual project structure** — list the pages/routes/screens you found in Step 1. Then ask placement-specific questions appropriate to the family.
|
|
318
646
|
|
|
319
|
-
**
|
|
647
|
+
**Web — Route placement (messaging, social):**
|
|
320
648
|
> "I found these pages in your project:
|
|
321
649
|
> - / (home)
|
|
322
650
|
> - /about
|
|
@@ -325,59 +653,88 @@ you found in Step 1. Then ask placement-specific questions:
|
|
|
325
653
|
>
|
|
326
654
|
> Where should the messages page live?"
|
|
327
655
|
|
|
328
|
-
Default
|
|
656
|
+
Default: `/messages`. Let user type a custom path.
|
|
329
657
|
|
|
330
|
-
**
|
|
658
|
+
**Web — Drawer placement (marketplace):**
|
|
331
659
|
> "Which page should have the 'Chat' button that opens the drawer?
|
|
332
|
-
> I found these pages:
|
|
333
|
-
> - app/products/[id]/page.tsx
|
|
334
|
-
> - app/listings/page.tsx
|
|
335
|
-
> - app/profile/[id]/page.tsx
|
|
336
|
-
>
|
|
337
|
-
> Which one?"
|
|
660
|
+
> I found these pages: ..."
|
|
338
661
|
|
|
339
|
-
|
|
340
|
-
actions, or interactive elements. Ask:
|
|
341
|
-
> "I see a 'Contact Seller' button in ProductDetail.tsx at line 45.
|
|
342
|
-
> Should I wire the chat drawer to that button, or add a new one?"
|
|
662
|
+
Read the picked page. Look for existing buttons, actions, or interactive elements. Ask whether to wire to the existing button or add a new one.
|
|
343
663
|
|
|
344
|
-
**
|
|
664
|
+
**Web — Modal placement (SaaS):**
|
|
345
665
|
> "Where should the 'Open chat' button go? I found these components
|
|
346
|
-
> that look like navigation:
|
|
347
|
-
> - src/components/Navbar.tsx
|
|
348
|
-
> - src/components/Sidebar.tsx
|
|
349
|
-
>
|
|
350
|
-
> Which one should have the chat trigger?"
|
|
666
|
+
> that look like navigation: ..."
|
|
351
667
|
|
|
352
|
-
**
|
|
668
|
+
**Web — Widget placement (support):**
|
|
353
669
|
> "Should the widget appear on all pages, or only specific ones?"
|
|
354
670
|
|
|
355
|
-
**
|
|
356
|
-
|
|
357
|
-
|
|
671
|
+
**RN — Bottom tab placement (messaging, social):**
|
|
672
|
+
> "I found these bottom tabs in your navigator at App.tsx:
|
|
673
|
+
> - Home
|
|
674
|
+
> - Profile
|
|
675
|
+
> - Settings
|
|
676
|
+
>
|
|
677
|
+
> Where should the 'Messages' tab go? (At the end, or pick a position.)"
|
|
678
|
+
|
|
679
|
+
**RN — Stack screen placement (saas, marketplace inbox):**
|
|
680
|
+
> "I found these stack screens in your root navigator: ...
|
|
681
|
+
>
|
|
682
|
+
> What should I call the chat screen? Default: MessagesScreen."
|
|
683
|
+
|
|
684
|
+
**RN — Modal placement (marketplace, support):**
|
|
685
|
+
> "Which screen should have the 'Chat' button that opens the modal?
|
|
686
|
+
> I found these screens: ..."
|
|
687
|
+
|
|
688
|
+
Read the picked screen. Look for existing buttons. Ask whether to wire to it or add a new one.
|
|
689
|
+
|
|
690
|
+
**RN — BottomSheet placement (quick reply, support):**
|
|
691
|
+
> "Bottom sheets slide up from below. Should the sheet be:
|
|
692
|
+
> 1. Draggable (user can dismiss by swiping down) — uses @gorhom/bottom-sheet
|
|
693
|
+
> 2. Fixed overlay — uses CometChat's built-in CometChatBottomSheet
|
|
694
|
+
>
|
|
695
|
+
> Which one?"
|
|
696
|
+
|
|
697
|
+
**Combinations** (marketplace = drawer/modal + inbox): ask both questions in sequence — they're separate components wired into separate places.
|
|
698
|
+
|
|
699
|
+
**Expo Router projects** — adapt screen names to file paths:
|
|
700
|
+
- Stack screen → `app/messages.tsx` (or the path the user picks)
|
|
701
|
+
- Bottom tab → file under `app/(tabs)/messages.tsx` + update `app/(tabs)/_layout.tsx`
|
|
702
|
+
- Modal → `app/(modals)/chat.tsx` with `presentation: "modal"` in the parent `_layout.tsx`
|
|
358
703
|
|
|
359
704
|
#### 3d. Detect and ask about authentication
|
|
360
705
|
|
|
361
|
-
Read the project's `package.json` and source files. Look for auth
|
|
706
|
+
Read the project's `package.json` and source files. Look for auth.
|
|
362
707
|
|
|
708
|
+
**Web auth libraries:**
|
|
363
709
|
- `next-auth` / `@auth/core` → NextAuth
|
|
364
710
|
- `@clerk/nextjs` / `@clerk/clerk-react` → Clerk
|
|
365
711
|
- `@supabase/supabase-js` + auth usage → Supabase Auth
|
|
366
712
|
- `firebase` / `firebase/auth` → Firebase Auth
|
|
367
713
|
- `passport` → Passport.js
|
|
368
714
|
- `jsonwebtoken` / `jose` → Custom JWT
|
|
369
|
-
|
|
715
|
+
|
|
716
|
+
**RN auth libraries:**
|
|
717
|
+
- `firebase` / `@react-native-firebase/auth` → Firebase Auth
|
|
718
|
+
- `@clerk/clerk-expo` / `@clerk/clerk-react-native` → Clerk
|
|
719
|
+
- `@supabase/supabase-js` + auth usage → Supabase Auth
|
|
720
|
+
- `react-native-auth0` → Auth0
|
|
721
|
+
- `aws-amplify` + auth module → AWS Cognito
|
|
722
|
+
- `@react-native-google-signin/google-signin` → Google Sign-In (usually paired with something above)
|
|
723
|
+
- `expo-auth-session` / `expo-secure-store` → Expo Auth Session (custom)
|
|
724
|
+
|
|
725
|
+
**None detected** → no auth.
|
|
370
726
|
|
|
371
727
|
Report what you found and ask:
|
|
372
728
|
|
|
373
729
|
If auth detected:
|
|
374
|
-
> "I see you're using [NextAuth /
|
|
375
|
-
> will work with it:
|
|
730
|
+
> "I see you're using [NextAuth / Firebase Auth / etc.]. Here's how
|
|
731
|
+
> CometChat will work with it:
|
|
376
732
|
>
|
|
377
733
|
> - **Development (now):** I'll use CometChat's Auth Key for quick
|
|
378
|
-
> testing with pre-seeded users (cometchat-uid-1
|
|
379
|
-
> - **Production (later):** Your server will
|
|
380
|
-
>
|
|
734
|
+
> testing with pre-seeded users (cometchat-uid-1 through uid-5).
|
|
735
|
+
> - **Production (later):** Your server will mint per-user auth tokens
|
|
736
|
+
> via the CometChat REST API. I can set this up now or later
|
|
737
|
+
> (see `cometchat-production` / `cometchat-native-production`).
|
|
381
738
|
>
|
|
382
739
|
> Start with dev mode for now? You can upgrade to production auth
|
|
383
740
|
> anytime by choosing 'Set up production auth' from the menu."
|
|
@@ -396,148 +753,311 @@ If the user has auth AND wants to set up production mode now:
|
|
|
396
753
|
> "How should your app's users map to CometChat users?
|
|
397
754
|
>
|
|
398
755
|
> 1. Use your existing user ID as the CometChat UID (simplest)
|
|
399
|
-
> 2. Generate a separate CometChat UID and store it
|
|
400
|
-
> 3. Let me just set up dev mode for now
|
|
401
|
-
>
|
|
402
|
-
> Option 1 works if your user IDs are alphanumeric strings (no spaces,
|
|
403
|
-
> no special characters). What does a typical user ID look like in
|
|
404
|
-
> your system?"
|
|
756
|
+
> 2. Generate a separate CometChat UID and store it alongside your user record
|
|
757
|
+
> 3. Let me just set up dev mode for now"
|
|
405
758
|
|
|
406
|
-
If they share an example, validate it's CometChat-compatible
|
|
407
|
-
(alphanumeric, underscores, hyphens — no spaces or special chars).
|
|
759
|
+
If they share an example, validate it's CometChat-compatible (alphanumeric, underscores, hyphens — no spaces or special chars; max 100 chars). Firebase UIDs, Clerk user IDs, Supabase UUIDs, and Auth0 `sub` claims are all CometChat-compatible by default.
|
|
408
760
|
|
|
409
761
|
#### 3f. Confirm the plan
|
|
410
762
|
|
|
411
|
-
**This is critical. Show EXACTLY what you'll do before doing it.**
|
|
763
|
+
**This is critical. Show EXACTLY what you'll do before doing it.** The plan format differs by framework.
|
|
412
764
|
|
|
765
|
+
**Web example (Next.js, marketplace):**
|
|
413
766
|
> "Here's what I'll create:
|
|
414
767
|
>
|
|
415
768
|
> **New files:**
|
|
416
|
-
> - `app/providers/CometChatProvider.tsx`
|
|
417
|
-
> - `app/messages/page.tsx`
|
|
418
|
-
> - `app/components/ChatDrawer.tsx`
|
|
419
|
-
> - `.env.local`
|
|
769
|
+
> - `app/providers/CometChatProvider.tsx`
|
|
770
|
+
> - `app/messages/page.tsx`
|
|
771
|
+
> - `app/components/ChatDrawer.tsx`
|
|
772
|
+
> - `.env.local`
|
|
420
773
|
>
|
|
421
774
|
> **Files I'll modify:**
|
|
422
|
-
> - `app/products/[id]/page.tsx` — add ChatDrawer
|
|
423
|
-
> - `app/layout.tsx` — wrap
|
|
775
|
+
> - `app/products/[id]/page.tsx` — add ChatDrawer trigger
|
|
776
|
+
> - `app/layout.tsx` — wrap with CometChatProvider
|
|
424
777
|
> - `app/components/Navbar.tsx` — add 'Messages' link
|
|
425
778
|
>
|
|
426
|
-
> **
|
|
427
|
-
> - `app/page.tsx` (your home page)
|
|
428
|
-
> - Any other existing pages
|
|
779
|
+
> **Dependencies:** @cometchat/chat-sdk-javascript, @cometchat/chat-uikit-react
|
|
429
780
|
>
|
|
430
|
-
> **
|
|
431
|
-
>
|
|
432
|
-
|
|
781
|
+
> **Auth mode:** Development (Auth Key).
|
|
782
|
+
> Proceed? [y/n]"
|
|
783
|
+
|
|
784
|
+
**RN example (Expo Router, messaging):**
|
|
785
|
+
> "Here's what I'll create:
|
|
786
|
+
>
|
|
787
|
+
> **New files:**
|
|
788
|
+
> - `providers/CometChatProvider.tsx`
|
|
789
|
+
> - `app/(tabs)/messages.tsx`
|
|
790
|
+
> - `.env`
|
|
433
791
|
>
|
|
434
|
-
> **
|
|
435
|
-
>
|
|
792
|
+
> **Files I'll modify:**
|
|
793
|
+
> - `app/_layout.tsx` — wrap with the four-wrapper chain
|
|
794
|
+
> - `app/(tabs)/_layout.tsx` — add the Messages tab
|
|
795
|
+
> - `index.js` — `import 'react-native-gesture-handler'` at line 1 (if missing)
|
|
796
|
+
>
|
|
797
|
+
> **Dependencies (via `npx expo install`):**
|
|
798
|
+
> @cometchat/chat-uikit-react-native, @cometchat/chat-sdk-react-native,
|
|
799
|
+
> react-native-gesture-handler, react-native-reanimated,
|
|
800
|
+
> react-native-safe-area-context, react-native-screens,
|
|
801
|
+
> @react-native-async-storage/async-storage, @react-native-community/netinfo,
|
|
802
|
+
> react-native-video, react-native-image-picker, react-native-document-picker,
|
|
803
|
+
> react-native-vector-icons, react-native-fs
|
|
436
804
|
>
|
|
805
|
+
> **Auth mode:** Development (Auth Key).
|
|
437
806
|
> Proceed? [y/n]"
|
|
438
807
|
|
|
439
|
-
|
|
440
|
-
|
|
808
|
+
**Bare RN variant** — same as Expo, except `npm install` instead of `npx expo install`, plus:
|
|
809
|
+
- Run `cd ios && pod install`
|
|
810
|
+
- Patch `ios/<Name>/Info.plist`, `android/app/src/main/AndroidManifest.xml` for permissions
|
|
811
|
+
- Add `ios/<Name>/PrivacyInfo.xcprivacy` (Apple Privacy Manifest)
|
|
812
|
+
- Patch `android/build.gradle` for the async-storage Maven repo (v3+)
|
|
813
|
+
|
|
814
|
+
Wait for explicit confirmation. If the user says no or wants changes, go back to the relevant question and re-ask.
|
|
441
815
|
|
|
442
816
|
### Step 4 — Reference pattern skills
|
|
443
817
|
|
|
444
|
-
**All
|
|
445
|
-
files. Do NOT use the `Skill()` tool — that's for a different system.
|
|
446
|
-
Instead, simply read and follow the instructions in these skills:
|
|
818
|
+
**All skills are already loaded in your context** as `.claude/skills/` files. Do NOT use the `Skill()` tool. Read and follow them directly.
|
|
447
819
|
|
|
820
|
+
**For web frameworks:**
|
|
448
821
|
1. `cometchat-core` — initialization, provider, CSS, anti-patterns
|
|
449
822
|
2. `cometchat-components` — component catalog, composition patterns
|
|
450
|
-
3. Framework
|
|
823
|
+
3. Framework-specific:
|
|
451
824
|
- `reactjs` → `cometchat-react-patterns`
|
|
452
825
|
- `nextjs` → `cometchat-nextjs-patterns`
|
|
453
826
|
- `react-router` → `cometchat-react-router-patterns`
|
|
454
827
|
- `astro` → `cometchat-astro-patterns`
|
|
455
828
|
4. `cometchat-placement` — placement pattern for the chosen approach
|
|
456
829
|
|
|
457
|
-
|
|
830
|
+
**For React Native:**
|
|
831
|
+
1. `cometchat-native-core` — init, login, four-wrapper provider chain, env vars, anti-patterns
|
|
832
|
+
2. `cometchat-native-components` — component catalog
|
|
833
|
+
3. Framework-specific:
|
|
834
|
+
- `expo` (managed + Expo Router) → `cometchat-native-expo-patterns`
|
|
835
|
+
- `react-native` (bare CLI) → `cometchat-native-bare-patterns`
|
|
836
|
+
4. `cometchat-native-placement` — placement pattern (stack/tab/modal/bottom-sheet/embed)
|
|
837
|
+
|
|
838
|
+
**For Angular:**
|
|
839
|
+
1. `cometchat-angular-core` — init via `UIKitSettingsBuilder`, `APP_INITIALIZER` pattern, `CUSTOM_ELEMENTS_SCHEMA`, env config in `environment.ts`, login order, anti-patterns
|
|
840
|
+
2. `cometchat-angular-components` — component catalog (kebab-case selectors, `[input]` callbacks vs `(output)` events, content-projection slots, NgModule imports)
|
|
841
|
+
3. `angular` → `cometchat-angular-patterns` — module organization, lazy-loading the chat module, environment file editing, providers
|
|
842
|
+
4. `cometchat-angular-placement` — placement pattern (route, modal, drawer, embedded panel)
|
|
843
|
+
|
|
844
|
+
**For Android — branches by `android_version`:**
|
|
845
|
+
|
|
846
|
+
If `android_version === "v5"`:
|
|
847
|
+
1. `cometchat-android-v5-core` — Gradle deps, `UIKitSettings.UIKitSettingsBuilder`, `CometChatUIKit.init()` in `Application.onCreate()`, login, theme requirements (`CometChatTheme.DayNight` → Material 2 parent)
|
|
848
|
+
2. `cometchat-android-v5-components` — View classes (`CometChatConversations`, `CometChatMessageList`, `CometChatMessageComposer`, …), `setUser`/`setGroup`, listener setters (`setOnItemClick`, `setOnSendButtonClick`), thread-mode rule (`setParentMessage(long)` on list, `setParentMessageId(long)` on composer)
|
|
849
|
+
3. `cometchat-android-v5-placement` — Activity, Fragment, BottomSheet placement, navigation
|
|
850
|
+
4. `cometchat-android-v5-customization` — `CometChatTextFormatter`, message templates, `CometChatMessageEvents.addListener`, DataSource decorators
|
|
851
|
+
5. `cometchat-android-v5-extensions` — registrar (`PollsExtension`, `StickerExtension`, `SmartRepliesExtension` extending `ExtensionsDataSource`) vs decorator pattern; never construct decorators directly
|
|
852
|
+
|
|
853
|
+
If `android_version === "v6"`, additionally branch by UI stack (Compose vs Kotlin Views — ask the user if both are present):
|
|
854
|
+
1. `cometchat-android-v6-core` — Gradle deps for `chatuikit-{compose,kotlin}-android:6.x` + `chatuikit-core`, init, login, message sending
|
|
855
|
+
2. `cometchat-android-v6-events` — `CometChatEvents` SharedFlows + sealed event classes
|
|
856
|
+
3. **Compose stack** → `cometchat-android-v6-compose-{components,placement,theming,customization}` — Composables, `CometChatTheme { ... }`, `BubbleFactory`, slot lambdas
|
|
857
|
+
4. **Kotlin Views stack** → `cometchat-android-v6-kotlin-{components,placement,theming,customization}` — custom View classes, `setOnItemClick`, `BubbleFactory` abstract class, `setBubbleFactories`
|
|
858
|
+
5. `cometchat-android-v6-builder-settings` — `UIKitSettingsBuilder` knobs (calling, presence, etc.)
|
|
859
|
+
|
|
860
|
+
Both V5 and V6 share `cometchat-android-{v5,v6}-{features,extensions,push,production,testing,troubleshooting}` for cross-cutting concerns.
|
|
861
|
+
|
|
862
|
+
**For Flutter — branches by `flutter_version`:**
|
|
863
|
+
|
|
864
|
+
If `flutter_version === "v5"`:
|
|
865
|
+
1. `cometchat-flutter-v5-core` — pubspec deps, `UIKitSettings.UIKitSettingsBuilder`, `CometChatUIKit.init()`, login, GetX-based controller pattern, `subscriptionType` requirement, theme caching rule, listener lifecycle
|
|
866
|
+
2. `cometchat-flutter-v5-conversations` / `-messages` / `-users-groups` / `-calls` — widget-by-widget catalog (V5 splits its component catalog across these four skills)
|
|
867
|
+
3. `cometchat-flutter-v5-theming` — `CometChatThemeHelper`, `CometChatColorPalette`, `CometChatSpacing`, `CometChatTypography`, dark mode
|
|
868
|
+
4. `cometchat-flutter-v5-customization` — `DataSource`, `DataSourceDecorator`, `CometChatMessageTemplate`, `CometChatTextFormatter`, slot views
|
|
869
|
+
5. `cometchat-flutter-v5-events` — `CometChatMessageEvents.addListener`, `CometChatGroupEvents`, `CometChatUserEvents`, `CometChatCallEvents`, `CometChatUIEvents`
|
|
870
|
+
6. `cometchat-flutter-v5-push` — FCM/APNs/VoIP setup; `CometChatNotifications.registerPushToken()` is the public surface (sample-app `PNRegistry` is a wrapper users copy)
|
|
871
|
+
7. `cometchat-flutter-v5-production` — server-minted auth tokens, ProGuard, release builds
|
|
872
|
+
8. `cometchat-flutter-v5-troubleshooting` — pubspec resolution, GetX errors, runtime crashes
|
|
873
|
+
|
|
874
|
+
If `flutter_version === "v6"`:
|
|
875
|
+
1. `cometchat-flutter-v6-core` — pubspec deps (single `cometchat_chat_uikit:^6.0.0-beta2` package), `UIKitSettingsBuilder`, init, login, message sending. The `enableCalls`/`CallingConfiguration()` knobs live in `cometchat-flutter-v6-calls`.
|
|
876
|
+
2. `cometchat-flutter-v6-components` — full Bloc-driven widget catalog
|
|
877
|
+
3. `cometchat-flutter-v6-conversations` / `-messages` / `-users-groups` / `-calls` — per-widget deep dives
|
|
878
|
+
4. `cometchat-flutter-v6-features` — feature catalog
|
|
879
|
+
5. `cometchat-flutter-v6-placement` — route, modal sheet, embedded widget — where chat lives in the app
|
|
880
|
+
6. `cometchat-flutter-v6-theming` — `CometChatThemeHelper`, `CometChatColorPalette` (V6 names), `CometChatThemeMode`
|
|
881
|
+
7. `cometchat-flutter-v6-customization` — `BubbleFactory<T>`, `CometChatMessageTemplate`, text formatters, slot widgets
|
|
882
|
+
8. `cometchat-flutter-v6-events` — Bloc-based event streams, listener registration
|
|
883
|
+
9. `cometchat-flutter-v6-production` — server-minted auth tokens, ProGuard
|
|
884
|
+
10. `cometchat-flutter-v6-troubleshooting` — pubspec, Bloc, theme cache
|
|
885
|
+
|
|
886
|
+
For projects migrating from V5 to V6, ALSO load `cometchat-flutter-v6-migration` — V5→V6 breaking changes (GetX → Bloc, theme API rewrite, `BuilderSettings` removal, callMain entry-point removal).
|
|
887
|
+
|
|
888
|
+
**For iOS — single cohort (V5 only today):**
|
|
889
|
+
|
|
890
|
+
1. `cometchat-ios-core` — Installation (CocoaPods + SPM), `UIKitSettings`, `CometChatUIKit(uiKitSettings:)` constructor init, login (`.success` / `.onError` switch — NOT Swift's standard `Result.failure`), AppDelegate vs SwiftUI App-struct init sites, anti-patterns
|
|
891
|
+
2. `cometchat-ios-components` — Component catalog: `CometChatConversations`, `CometChatUsers`, `CometChatGroups`, `CometChatGroupMembers`, `CometChatMessageHeader/List/Composer`, `CometChatIncomingCall/OutgoingCall/OngoingCall/CallButtons/CallLogs`, `CometChatSearch`, `CometChatReactionList`, `CometChatThreadedMessageHeader`. Build a `MessagesVC` by composing header + list + composer (the kit does NOT ship a pre-built `CometChatMessages` UIViewController).
|
|
892
|
+
3. `cometchat-ios-placement` — Navigation controller, modal, tab bar, embedded view — where chat lives. Mixed SwiftUI + UIKit hosting via `UIViewControllerRepresentable`.
|
|
893
|
+
4. `cometchat-ios-customization` — Custom message templates, text formatters, DataSource/Decorator pattern, custom views.
|
|
894
|
+
5. `cometchat-ios-theming` — `CometChatTheme` color tokens, `CometChatTypography.setFont(name:)`, dark mode.
|
|
895
|
+
6. `cometchat-ios-features` — Feature catalog: calls, polls, reactions, AI, extensions.
|
|
896
|
+
7. `cometchat-ios-production` — Server-minted auth tokens, user management.
|
|
897
|
+
8. `cometchat-ios-push` — APNs + VoIP, CallKit integration, token lifecycle.
|
|
898
|
+
9. `cometchat-ios-troubleshooting` — SPM/CocoaPods errors, Xcode build issues, Info.plist gotchas, runtime crashes.
|
|
458
899
|
|
|
459
900
|
### Step 5 — Write the integration
|
|
460
901
|
|
|
461
|
-
Execute the confirmed plan.
|
|
902
|
+
Execute the confirmed plan. The order of operations is the same for every framework, but the file names + provider shape differ.
|
|
462
903
|
|
|
463
|
-
|
|
464
|
-
Use the correct env var prefix. Module-level `initialized` guard.
|
|
465
|
-
Mount at the level agreed in Step 3f.
|
|
904
|
+
**Web — common steps:**
|
|
466
905
|
|
|
906
|
+
1. **CometChatProvider** — follow the framework skill's provider pattern. Use the correct env var prefix. Module-level `initialized` guard. Mount at the level agreed in Step 3f.
|
|
467
907
|
2. **Chat component(s)** — follow the placement skill's pattern.
|
|
468
|
-
|
|
469
|
-
If drawer/modal: connect to the specific user/group the user specified.
|
|
470
|
-
|
|
471
|
-
3. **Wire into existing project** — READ each file before modifying:
|
|
472
|
-
- Router: add the route entry. Show the user the diff.
|
|
473
|
-
- Nav: add the link. Show the user the diff.
|
|
474
|
-
- Trigger page: add the drawer/modal import + trigger button. Show diff.
|
|
475
|
-
|
|
908
|
+
3. **Wire into existing project** — READ each file before modifying. Add the route, nav link, drawer/modal trigger.
|
|
476
909
|
4. **CSS import** — add once at the root level per framework conventions.
|
|
477
|
-
|
|
478
|
-
5. **Environment variables** — write `.env` with the correct prefix.
|
|
479
|
-
If auth key is already there from the wizard, don't duplicate.
|
|
480
|
-
|
|
910
|
+
5. **Environment variables** — write the env file with the correct prefix.
|
|
481
911
|
6. **Install dependencies:**
|
|
482
912
|
```bash
|
|
483
913
|
npm install @cometchat/chat-sdk-javascript @cometchat/chat-uikit-react
|
|
484
914
|
```
|
|
485
915
|
|
|
486
|
-
|
|
916
|
+
**React Native — common steps:**
|
|
917
|
+
|
|
918
|
+
1. **Entry file** (`index.js` / `App.tsx` / `app/_layout.tsx`) — verify `import "react-native-gesture-handler";` is **line 1**. Not line 2, not after another import. Non-negotiable.
|
|
919
|
+
2. **CometChatProvider** — follow `cometchat-native-core` § 6. Module-level `initialized` guard. Module-level `loginInFlight` promise for login concurrency.
|
|
920
|
+
3. **Four-wrapper chain** — wrap the app's root in this exact order:
|
|
921
|
+
```tsx
|
|
922
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
923
|
+
<SafeAreaProvider>
|
|
924
|
+
<CometChatThemeProvider>
|
|
925
|
+
<CometChatProvider>
|
|
926
|
+
{/* navigator / Expo Router <Stack> */}
|
|
927
|
+
</CometChatProvider>
|
|
928
|
+
</CometChatThemeProvider>
|
|
929
|
+
</SafeAreaProvider>
|
|
930
|
+
</GestureHandlerRootView>
|
|
931
|
+
```
|
|
932
|
+
4. **Chat screen(s)** — follow `cometchat-native-placement`'s pattern.
|
|
933
|
+
5. **Every `<CometChatMessageList>` MUST pass `hideReplyInThreadOption={true}`** (see hard rules).
|
|
934
|
+
6. **Wire into existing project** — READ each file before modifying.
|
|
935
|
+
7. **Environment variables** — write `.env` with the correct prefix (`EXPO_PUBLIC_` for Expo, bare for `react-native`).
|
|
936
|
+
8. **Install dependencies:**
|
|
937
|
+
|
|
938
|
+
**Expo managed:**
|
|
487
939
|
```bash
|
|
488
|
-
npx @cometchat/
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
--auth-mode "<mode>" --json
|
|
940
|
+
npx expo install @cometchat/chat-uikit-react-native @cometchat/chat-sdk-react-native \
|
|
941
|
+
react-native-gesture-handler react-native-reanimated react-native-safe-area-context \
|
|
942
|
+
react-native-screens @react-native-async-storage/async-storage \
|
|
943
|
+
@react-native-community/netinfo react-native-video react-native-image-picker \
|
|
944
|
+
react-native-document-picker react-native-vector-icons react-native-fs
|
|
494
945
|
```
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
`--experience` in the AI-written path (it only applies to CLI-
|
|
498
|
-
generated experiences 1/2/3).
|
|
499
|
-
|
|
500
|
-
8. **Record state so Phase B commands work — DO NOT SKIP.** Every
|
|
501
|
-
Phase B command (`info`, `status`, `doctor`, `verify`, `uninstall`,
|
|
502
|
-
`apply-theme`, `apply-feature`, `add-widget`, `add-user-mgmt`,
|
|
503
|
-
`production-auth`) reads `.cometchat/state.json` to know what the
|
|
504
|
-
integration looks like. Without this step, every one of them reports
|
|
505
|
-
"not integrated in this project" even though the code is there, and
|
|
506
|
-
the user can't iterate on their integration at all.
|
|
507
|
-
|
|
508
|
-
Pass every file you wrote (owned) and every existing file you patched:
|
|
946
|
+
|
|
947
|
+
**Bare RN:**
|
|
509
948
|
```bash
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
--files-patched "src/main.tsx:v3/main.tsx,src/App.tsx:v3/App.tsx,src/components/Layout.tsx:v3/Layout.tsx" \
|
|
517
|
-
--json
|
|
949
|
+
npm install @cometchat/chat-uikit-react-native @cometchat/chat-sdk-react-native \
|
|
950
|
+
react-native-gesture-handler react-native-reanimated react-native-safe-area-context \
|
|
951
|
+
react-native-screens @react-native-async-storage/async-storage \
|
|
952
|
+
@react-native-community/netinfo react-native-video react-native-image-picker \
|
|
953
|
+
react-native-document-picker react-native-vector-icons react-native-fs
|
|
954
|
+
cd ios && pod install && cd ..
|
|
518
955
|
```
|
|
519
956
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
**
|
|
957
|
+
**Reanimated plugin (both):** verify `react-native-reanimated/plugin` is the LAST entry in `babel.config.js` `plugins` array. Metro cache is sensitive to plugin order.
|
|
958
|
+
|
|
959
|
+
9. **Native config (bare RN only):**
|
|
960
|
+
- `ios/<Name>/Info.plist` — add `NSCameraUsageDescription`, `NSPhotoLibraryUsageDescription`, `NSMicrophoneUsageDescription`
|
|
961
|
+
- `android/app/src/main/AndroidManifest.xml` — add `CAMERA`, `RECORD_AUDIO`, `READ_MEDIA_IMAGES`, `READ_EXTERNAL_STORAGE` permissions
|
|
962
|
+
- `ios/<Name>/PrivacyInfo.xcprivacy` — add the 3 required API codes (C617.1, CA92.1, 35F9.1) — matching the kit's own SampleApp manifest. Add `E174.1` (DiskSpace) only if your app does explicit free-space checks. See `cometchat-native-bare-patterns`.
|
|
963
|
+
- `android/build.gradle` — async-storage Maven repo if v3+
|
|
964
|
+
|
|
965
|
+
**Expo managed** — all of this goes in `app.json` under `plugins` and `ios.infoPlist` / `android.permissions`. See `cometchat-native-expo-patterns`.
|
|
966
|
+
|
|
967
|
+
**iOS — common steps:**
|
|
968
|
+
|
|
969
|
+
1. **Migrate credentials to `Secrets.swift` or an `.xcconfig`** — if `provision setup` wrote a `.env` (iOS handoff), do the migration documented in Step 2d above. Confirm the secrets file is in `.gitignore`.
|
|
970
|
+
2. **Add the kit dep:**
|
|
971
|
+
- **CocoaPods:** add `pod 'CometChatUIKitSwift', '~> 5.1'` to `Podfile` → `pod install`. Open the `.xcworkspace` (NOT `.xcodeproj`). For Xcode 15+, set `ENABLE_USER_SCRIPT_SANDBOXING = NO` in Build Settings (or add the `post_install` Podfile hook that does this for every pod target).
|
|
972
|
+
- **SPM:** in Xcode → File → Add Package Dependencies → `https://github.com/cometchat/cometchat-uikit-ios` (latest 5.x). Or add the package URL to your `Package.swift` if you're an SPM-only app.
|
|
973
|
+
3. **Init in your app entry point** — UIKit: in `AppDelegate.application(_:didFinishLaunchingWithOptions:)`. SwiftUI: in `@main struct App.init()`. The init takes a `UIKitSettings` and a `Result<Bool, Error>` completion: `CometChatUIKit(uiKitSettings: settings) { result in switch result { case .success: ... case .failure(let error): ... } }`. The explicit `.init(...)` form (`CometChatUIKit.init(uiKitSettings: ...) { ... }`) compiles identically in Swift and is what the kit's sample apps use — both are fine. **Note that this completion uses Swift's standard `Result.failure`, NOT the kit's `.onError` enum which only appears in login/logout callbacks (see step 4).**
|
|
974
|
+
4. **Login order** — `CometChatUIKit.login(uid:)` (dev) or `.login(authToken:)` (production). The login callback uses `.success` / `.onError` cases (NOT Swift's standard `Result.failure`).
|
|
975
|
+
5. **Place chat in your app** — for UIKit nav stacks, push your composed `MessagesVC` (header + list + composer). For SwiftUI, wrap each kit `UIViewController` in a `UIViewControllerRepresentable`. The kit does NOT ship a pre-built `CometChatMessages` or `CometChatConversationsWithMessages` — compose your own.
|
|
976
|
+
6. **Info.plist permissions** — for calls add `NSMicrophoneUsageDescription` + `NSCameraUsageDescription`. For push add the APNs entitlement + a `BackgroundModes` entry (`remote-notification`, plus `voip` for VoIP push).
|
|
977
|
+
7. **Verify** — `xcodebuild -workspace <App>.xcworkspace -scheme <App> -configuration Debug build` (CocoaPods) or `-project <App>.xcodeproj -scheme <App> ...` (SPM). Skip `xcodebuild test` and `xcodebuild run-app` — those need a simulator and longer compile time than CI usually permits.
|
|
978
|
+
|
|
979
|
+
**Flutter — common steps:**
|
|
980
|
+
|
|
981
|
+
1. **Migrate credentials to a Dart const file or `--dart-define`** — if `provision setup` wrote a `.env` (Flutter handoff), do the migration documented in Step 2d above. Confirm `lib/cometchat_config.dart` is in `.gitignore` if you go the const-file route.
|
|
982
|
+
2. **Add the cometchat dep** to `pubspec.yaml` and run `flutter pub get`:
|
|
983
|
+
- V5: `cometchat_chat_uikit: ^5.2.14` (and `cometchat_calls_uikit: ^5.0.15` if calls are needed). Both packages live on the Cloudsmith Dart pub registry, so you'll also need a `--hosted-url` flag in your CI scripts: `dart pub add cometchat_chat_uikit:^5.2.14 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/`.
|
|
984
|
+
- V6: `cometchat_chat_uikit: ^6.0.0-beta2` (single package — calls fold in).
|
|
985
|
+
3. **Imports — V5 has TWO barrels.** For chat-only V5 apps, only the chat barrel is needed: `import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';`. For V5 + calls, ADD a second import: `import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';` — the calls barrel does NOT re-export the chat barrel, so chat widgets aren't reachable through it alone. V6 has ONE barrel: `import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';`.
|
|
986
|
+
4. **Init in `main.dart`** — `CometChatUIKit.init(uiKitSettings: settings, onSuccess: ..., onError: ...)`. V5 and V6 share the same init signature (callback-style); the difference is what comes after — V5 wires GetX controllers; V6 wires `BlocProvider`s. Always set `subscriptionType: CometChatSubscriptionType.allUsers` on the builder.
|
|
987
|
+
5. **Place chat in your app** — Flutter routing is in code (`Navigator.push`/`go_router`/etc.). Wire chat screens into your app's existing navigation. V6 has a dedicated placement skill for route/modal/embed patterns; V5 covers the same ground inside its per-widget skills.
|
|
988
|
+
6. **AndroidManifest + Info.plist** — for calls, add the platform permissions (microphone, camera, modify-audio-settings on Android; `NSMicrophoneUsageDescription` + `NSCameraUsageDescription` on iOS). For push, register the FCM service / configure APNs entitlements per `cometchat-flutter-{v5,v6}-push` (V5) or the troubleshooting skill (V6).
|
|
989
|
+
7. **Verify** — `flutter analyze` first (catches Dart compile + import errors), then `flutter build apk --debug` (Android) or `flutter build ios --debug --no-codesign` (iOS). The build catches dep-resolution / native-config issues.
|
|
990
|
+
|
|
991
|
+
**Android — common steps:**
|
|
992
|
+
|
|
993
|
+
1. **Migrate credentials to `local.properties` + `BuildConfig`** — if `provision setup` wrote a `.env` (Android handoff), do the migration documented in Step 2d above. Confirm `local.properties` is in `.gitignore` (it is by default in `ng new`-style scaffolds and Android Studio templates, but verify).
|
|
994
|
+
2. **Add the cometchat dep** to `app/build.gradle` (or `.kts`):
|
|
995
|
+
- V5: `implementation 'com.cometchat:chat-uikit-android:5.+'`
|
|
996
|
+
- V6 Compose: `implementation 'com.cometchat:chatuikit-compose-android:6.+'` (plus `compose-bom` if not already present)
|
|
997
|
+
- V6 Kotlin Views: `implementation 'com.cometchat:chatuikit-kotlin-android:6.+'`
|
|
998
|
+
- Both V6 stacks: add both `chatuikit-compose-android` AND `chatuikit-kotlin-android` (plus `chatuikit-core` if the kit splits it out)
|
|
999
|
+
3. **Theme parent (V5 only)** — `Application` theme must inherit from `CometChatTheme.DayNight` (which itself parents on `Theme.MaterialComponents.DayNight.NoActionBar`). Inheriting from `Theme.AppCompat.*` or `Theme.Material3.*` causes `UnsupportedOperationException` at inflate time. V6 doesn't share this requirement — Compose has its own `CometChatTheme { }` block; Kotlin Views uses style attrs.
|
|
1000
|
+
4. **Init in `Application.onCreate()`** — `CometChatUIKit.init(this, settings, callback)`. Wire `login(uid, callback)` inside the init success callback. `Application` class must be registered in `AndroidManifest.xml` via `<application android:name=".MyApp" …>`.
|
|
1001
|
+
5. **Place chat in your app** — V5: Activity / Fragment with the View classes (`CometChatConversations` etc.). V6 Compose: Composable screens via NavHost. V6 Kotlin Views: same Activity/Fragment shape as V5 but with V6 View classes.
|
|
1002
|
+
6. **AndroidManifest permissions** — `INTERNET` is mandatory; for calls add `RECORD_AUDIO`, `CAMERA`, `MODIFY_AUDIO_SETTINGS`, `BLUETOOTH_CONNECT` (API 31+).
|
|
1003
|
+
7. **ProGuard/R8** — for release builds, add `-keep class com.cometchat.** { *; }` to `proguard-rules.pro` to prevent stripping.
|
|
1004
|
+
8. **Verify** — `./gradlew :app:assembleDebug` (or `app:assembleDebug` from project root) catches Gradle/AGP/dependency issues; the kit's compile-time annotation processors surface schema errors here.
|
|
1005
|
+
|
|
1006
|
+
**Angular — common steps:**
|
|
1007
|
+
|
|
1008
|
+
1. **Migrate credentials into `environment.ts`** — if `provision setup` wrote a `.env` (Angular fallback), extend `src/environments/environment.ts` with a `cometchat: { appId, region, authKey }` block. Mirror in `environment.prod.ts` WITHOUT the `authKey` (production uses server-minted auth tokens — see `cometchat-angular-production`).
|
|
1009
|
+
2. **Add `CUSTOM_ELEMENTS_SCHEMA`** to the NgModule that hosts CometChat templates — kit atom components (`<cometchat-avatar>`, `<cometchat-status-indicator>`, etc.) are LitElement web components, not Angular standalone modules. Without the schema, Angular throws `Can't bind to '...' since it isn't a known property of 'cometchat-...'`.
|
|
1010
|
+
3. **Init service + APP_INITIALIZER** — follow `cometchat-angular-core` § 1-3. `UIKitSettingsBuilder().setAppId().setRegion().setAuthKey().build()`, then `CometChatUIKit.init(settings)` returns a Promise — chain login. Wire as `APP_INITIALIZER` so init completes before any component renders.
|
|
1011
|
+
4. **Import the right NgModule(s)** — for the chat-hosting module, add the kit modules from `@cometchat/chat-uikit-angular` (e.g. `CometChatConversations`, `CometChatMessages`) to `imports: []`. `cometchat-angular-components` documents the module name vs. component name pairing.
|
|
1012
|
+
5. **Wire chat into existing project** — READ each file before modifying. Add the route, nav link, modal trigger.
|
|
1013
|
+
6. **Theming** — inject `CometChatThemeService` to control palette/typography. See `cometchat-angular-theming`.
|
|
1014
|
+
7. **Install dependencies:**
|
|
1015
|
+
```bash
|
|
1016
|
+
npm install @cometchat/chat-uikit-angular @cometchat/chat-sdk-javascript
|
|
1017
|
+
```
|
|
1018
|
+
|
|
1019
|
+
#### Step 5 — common to ALL frameworks
|
|
1020
|
+
|
|
1021
|
+
After the framework-specific work above, every integration ends the same way:
|
|
1022
|
+
|
|
1023
|
+
10. **Update config.json** — save all the choices in one call:
|
|
1024
|
+
```bash
|
|
1025
|
+
npx @cometchat/skills-cli config save \
|
|
1026
|
+
--intent "<intent>" \
|
|
1027
|
+
--placement "<type>" \
|
|
1028
|
+
--placement-path "<path>" \
|
|
1029
|
+
--auth-mode "<mode>" --json
|
|
1030
|
+
```
|
|
1031
|
+
Pass only the fields you have — `config save` accepts any subset.
|
|
1032
|
+
|
|
1033
|
+
11. **Record state so Phase B commands work — DO NOT SKIP.** Every Phase B command (`info`, `status`, `doctor`, `verify`, `uninstall`, `apply-theme`, `apply-feature`, `add-widget`, `add-user-mgmt`, `production-auth`) reads `.cometchat/state.json` to know what the integration looks like. Without this step, every one of them reports "not integrated in this project" even though the code is there.
|
|
1034
|
+
|
|
1035
|
+
Pass every file you wrote (owned) and every existing file you patched:
|
|
1036
|
+
```bash
|
|
1037
|
+
npx @cometchat/skills-cli state record \
|
|
1038
|
+
--framework "<framework>" \
|
|
1039
|
+
--placement "<type>" \
|
|
1040
|
+
--placement-path "<path>" \
|
|
1041
|
+
--auth-mode "<mode>" \
|
|
1042
|
+
--files-owned "<comma-list of new files>" \
|
|
1043
|
+
--files-patched "<comma-list of path:patch_id pairs>" \
|
|
1044
|
+
--json
|
|
1045
|
+
```
|
|
1046
|
+
|
|
1047
|
+
- `--files-owned` — comma-separated list of every NEW file you wrote (provider, drawer, inbox page, screen). The CLI computes SHA-256 checksums for each so it can detect drift later.
|
|
1048
|
+
- `--files-patched` — comma-separated `path:patch_id` pairs for every EXISTING file you modified. `patch_id` can be any stable label — `v3/<filename>` is a reasonable default.
|
|
1049
|
+
|
|
1050
|
+
If this call errors (CLI flag mismatch, missing `--framework`, etc.), surface the error and retry. A completed Phase A with a missing state.json is worse than a visible error — the user discovers the breakage later when they try to add a feature or run diagnostics.
|
|
1051
|
+
|
|
1052
|
+
**Exception — "Just exploring" / demo mode (web only):**
|
|
535
1053
|
```bash
|
|
536
1054
|
npx @cometchat/skills-cli apply --experience 1 --framework <detected>
|
|
537
1055
|
npx @cometchat/skills-cli verify --json
|
|
538
1056
|
npx @cometchat/skills-cli install
|
|
539
1057
|
```
|
|
540
1058
|
|
|
1059
|
+
For RN demo mode, scaffold the minimal integration directly — there's no `apply` template path for RN.
|
|
1060
|
+
|
|
541
1061
|
### Step 6 — Verify + show result
|
|
542
1062
|
|
|
543
1063
|
Run a TypeScript check to verify the code compiles:
|
|
@@ -545,27 +1065,96 @@ Run a TypeScript check to verify the code compiles:
|
|
|
545
1065
|
npx tsc --noEmit
|
|
546
1066
|
```
|
|
547
1067
|
|
|
548
|
-
**
|
|
549
|
-
|
|
550
|
-
|
|
1068
|
+
**Angular projects:** prefer `npx ng build --configuration development` (Angular's compiler validates templates, NgModule shape, and DI graph — `tsc` alone misses template type errors).
|
|
1069
|
+
|
|
1070
|
+
**Android projects:** run `./gradlew :app:assembleDebug` (or `gradlew.bat :app:assembleDebug` on Windows). The Gradle build catches dependency-resolution errors (wrong cometchat coords), Kotlin/Java compile errors (wrong method signatures), `BuildConfig` field errors (missing `buildConfigField` declarations), and AndroidManifest issues. Do NOT start an emulator or run the app — keep verification to the build step.
|
|
1071
|
+
|
|
1072
|
+
**Flutter projects:** run `flutter analyze` (catches Dart compile + null-safety + import errors), then `flutter build apk --debug` for Android-side verification (or `flutter build ios --debug --no-codesign` for iOS-side). Skip `flutter run` — it starts an emulator/device session that can't be observed from CI.
|
|
1073
|
+
|
|
1074
|
+
**iOS projects:** run `xcodebuild -workspace <App>.xcworkspace -scheme <App> -configuration Debug -destination 'generic/platform=iOS' build` (CocoaPods) or the `-project` variant (SPM). The build catches CocoaPods/SPM dep-resolution errors, Swift compile errors, missing `Info.plist` keys, and signing-config issues. Do NOT run `xcodebuild test` or boot a simulator.
|
|
1075
|
+
|
|
1076
|
+
**Do NOT run `npx @cometchat/skills-cli verify`** — it checks for CLI-generated `.cometchat/state.json` that's authored by `cometchat apply`, not by AI integration. Use `tsc` (or `ng build` / `./gradlew :app:assembleDebug` / `flutter analyze` / `xcodebuild build` for Angular / Android / Flutter / iOS) instead.
|
|
1077
|
+
|
|
1078
|
+
**RN extra: do not start Metro automatically** — let the user do that in their own terminal. Metro blocks the terminal and cannot be meaningfully observed from here.
|
|
1079
|
+
|
|
1080
|
+
Surface any common issues:
|
|
1081
|
+
|
|
1082
|
+
**Web:**
|
|
1083
|
+
- `Module not found: @cometchat/chat-uikit-react` → install didn't complete
|
|
1084
|
+
- CSS variable warnings → CSS import not at root or wrong path
|
|
1085
|
+
|
|
1086
|
+
**RN:**
|
|
1087
|
+
- `Cannot find module '@cometchat/chat-uikit-react-native'` → install didn't complete
|
|
1088
|
+
- `JSX element 'GestureHandlerRootView' has no corresponding closing tag` → wrapper chain partially applied
|
|
1089
|
+
- `Property 'hideReplyInThreadOption' does not exist on type '...'` → older UI Kit types installed; on RN make sure `@cometchat/chat-uikit-react-native@^5` is resolved (the prop exists from v5 onwards)
|
|
551
1090
|
|
|
552
|
-
|
|
1091
|
+
Then:
|
|
553
1092
|
|
|
1093
|
+
**Web result message:**
|
|
554
1094
|
> "CometChat is integrated! Here's what was set up:
|
|
555
1095
|
>
|
|
556
|
-
> -
|
|
557
|
-
> - Chat drawer on product page ✓
|
|
1096
|
+
> - <list of new + patched files> ✓
|
|
558
1097
|
> - Provider + CSS wired ✓
|
|
559
1098
|
> - Dependencies installed ✓
|
|
560
1099
|
>
|
|
561
|
-
> Run `npm run dev`
|
|
562
|
-
>
|
|
1100
|
+
> Run `npm run dev` (or `ng serve` for Angular) and open the app:
|
|
1101
|
+
> - **Vite (reactjs)**: http://localhost:5173
|
|
1102
|
+
> - **Next.js**: http://localhost:3000/chat
|
|
1103
|
+
> - **React Router v7**: http://localhost:5173/chat
|
|
1104
|
+
> - **Astro**: http://localhost:4321/chat
|
|
1105
|
+
> - **Angular**: http://localhost:4200"
|
|
1106
|
+
|
|
1107
|
+
**RN result message:**
|
|
1108
|
+
> "CometChat is integrated! Here's what was set up:
|
|
1109
|
+
>
|
|
1110
|
+
> - <list of new + patched files> ✓
|
|
1111
|
+
> - Provider + four-wrapper chain ✓
|
|
1112
|
+
> - `import 'react-native-gesture-handler'` verified at line 1 ✓
|
|
1113
|
+
> - Dependencies installed ✓
|
|
1114
|
+
> - `hideReplyInThreadOption={true}` on MessageList ✓
|
|
1115
|
+
>
|
|
1116
|
+
> Next steps:
|
|
1117
|
+
>
|
|
1118
|
+
> **Expo managed:**
|
|
1119
|
+
> 1. `npx expo start --clear`
|
|
1120
|
+
> 2. Open the app in Expo Go (if no native modules) or a dev build
|
|
1121
|
+
>
|
|
1122
|
+
> **Bare RN:**
|
|
1123
|
+
> 1. `npm start -- --reset-cache`
|
|
1124
|
+
> 2. In another terminal: `npm run ios` or `npm run android`"
|
|
1125
|
+
|
|
1126
|
+
**Common ending — what you'll see on first load (every framework):**
|
|
1127
|
+
|
|
1128
|
+
> ---
|
|
1129
|
+
>
|
|
1130
|
+
> **Pre-seeded test data — chat works immediately, no dashboard setup needed:**
|
|
1131
|
+
>
|
|
1132
|
+
> Every CometChat app ships with **5 pre-created test users**
|
|
1133
|
+
> (`cometchat-uid-1` through `cometchat-uid-5`), a **"Hello" test group**,
|
|
1134
|
+
> and **sample messages between them**. Your integration is logged in
|
|
1135
|
+
> as `cometchat-uid-1` by default, so on first load the conversation
|
|
1136
|
+
> list is already populated — you'll see existing 1:1 threads and the
|
|
1137
|
+
> test group with message history. Open any conversation and reply;
|
|
1138
|
+
> round-trip is ~50ms. Receipts, typing indicators, presence, and
|
|
1139
|
+
> reactions all work out of the box.
|
|
1140
|
+
>
|
|
1141
|
+
> **Want to see real-time delivery between two users?** Open the
|
|
1142
|
+
> integration in two browser windows (or two simulators on RN), and
|
|
1143
|
+
> temporarily change the login UID in your provider — `cometchat-uid-2`
|
|
1144
|
+
> in one window, `cometchat-uid-1` in the other. Messages from one
|
|
1145
|
+
> arrive live in the other without refresh.
|
|
1146
|
+
>
|
|
1147
|
+
> The dashboard at `https://app.cometchat.com` is useful later for
|
|
1148
|
+
> creating real users, configuring extensions, and viewing analytics
|
|
1149
|
+
> — but you don't need it to confirm the integration is working.
|
|
563
1150
|
>
|
|
564
1151
|
> What would you like to do next?"
|
|
565
1152
|
|
|
566
1153
|
### Step 7 — Iteration menu
|
|
567
1154
|
|
|
568
|
-
Use `AskUserQuestion
|
|
1155
|
+
Use `AskUserQuestion`. The option set differs by family — RN has two extra options (push notifications + testing) that don't apply to web.
|
|
1156
|
+
|
|
1157
|
+
**Web — 8 canonical options:**
|
|
569
1158
|
- **question:** "What would you like to do next?"
|
|
570
1159
|
- **header:** "Next step"
|
|
571
1160
|
- **multiSelect:** false
|
|
@@ -579,62 +1168,146 @@ Use `AskUserQuestion`:
|
|
|
579
1168
|
7. label: "Run diagnostics", description: "Check for drift, missing env vars, broken imports."
|
|
580
1169
|
8. label: "I'm done", description: "Exit."
|
|
581
1170
|
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
1171
|
+
**RN — 10 canonical options:**
|
|
1172
|
+
- **question:** "What would you like to do next?"
|
|
1173
|
+
- **header:** "Next step"
|
|
1174
|
+
- **multiSelect:** false
|
|
1175
|
+
- **options:**
|
|
1176
|
+
1. label: "Customize look and feel (themes)", description: "Colors, typography, dark mode — edit CometChatThemeProvider."
|
|
1177
|
+
2. label: "Add a feature", description: "Calls, reactions, polls, extensions, AI agent — browse the catalog."
|
|
1178
|
+
3. label: "Customize a component", description: "Custom bubbles, headers, message composer actions, empty states."
|
|
1179
|
+
4. label: "Add another placement", description: "Add a modal chat, a bottom sheet, or another tab — without touching the existing integration."
|
|
1180
|
+
5. label: "Set up push notifications", description: "APNs + FCM setup, CometChat dashboard config, client registration, tap-to-deep-link. Required for production."
|
|
1181
|
+
6. label: "Set up production auth", description: "Replace the dev Auth Key with a server-minted auth token. Read `cometchat-native-production` skill."
|
|
1182
|
+
7. label: "Set up user management", description: "Server endpoints for creating, updating, deleting CometChat users."
|
|
1183
|
+
8. label: "Set up testing", description: "Jest + React Native Testing Library setup, mocks for the UI Kit / SDK, E2E with Detox or Maestro."
|
|
1184
|
+
9. label: "Troubleshoot an issue", description: "Metro cache, pod install, iOS privacy manifest, push notifications, native module linking."
|
|
1185
|
+
10. label: "I'm done", description: "Exit."
|
|
1186
|
+
|
|
1187
|
+
For **theme customization**: read the framework-appropriate theming skill and write the customization code.
|
|
1188
|
+
|
|
1189
|
+
For **adding features**: read the framework-appropriate features skill. Features fall into six buckets:
|
|
1190
|
+
|
|
1191
|
+
- **default** — already enabled by the UI Kit, no action needed.
|
|
1192
|
+
- **extension** — pure boolean toggle. Run `cometchat apply-feature <id>` (web/RN with `state.json`) or `cometchat apply-feature <id> --app-id <X>` (native cohorts: iOS / Android / Flutter / Angular). Hits the dashboard API; no browser visit required.
|
|
1193
|
+
- **ai-feature** — `smart-replies`, `conversation-summary`, `conversation-starter`. Run `cometchat apply-feature <id> --openai-key sk-...` (add `--app-id <X>` for native). The CLI sets the OpenAI key on the app's AI settings, then flips the toggle in one call.
|
|
1194
|
+
- **dashboard-only** — third-party API keys / multi-field config (Giphy, Stipop, Tenor, Chatwoot, Intercom, Disappearing Messages, Message Shortcuts). The CLI returns `manual-action-required` and prints the dashboard path — these genuinely need the user to configure third-party credentials.
|
|
1195
|
+
- **package-install** — calls. Run `npm install @cometchat/calls-sdk-javascript` (or the framework's calls SDK).
|
|
1196
|
+
- **component-swap** — `rich-text-formatting`. Run `cometchat apply-feature rich-text-formatting`.
|
|
586
1197
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
1198
|
+
Ask which feature, look it up in `packages/registry/v6/features/catalog.json` (or run `cometchat features info <id>`) to learn its bucket, then execute the right recipe. **Never tell the user to "open the dashboard and flip a toggle" for an extension or ai-feature** — that's what `cometchat apply-feature <id>` does for them.
|
|
1199
|
+
|
|
1200
|
+
For **component customization**: read the customization + components skills, then write the customization code directly. Ask the user what they want to customize, read the relevant component's props from the catalog, propose changes.
|
|
1201
|
+
|
|
1202
|
+
For **production auth**: read the framework-appropriate production skill. It's interactive — ask the user about their auth system and generate the server-side token endpoint for their backend.
|
|
1203
|
+
|
|
1204
|
+
For **push notifications (RN only)**: read `cometchat-native-push`. Structured 12-section walkthrough.
|
|
1205
|
+
|
|
1206
|
+
For **testing (RN only)**: read `cometchat-native-testing`. Ask the user whether they want unit tests (Jest + RNTL), E2E (Detox vs Maestro), or both.
|
|
1207
|
+
|
|
1208
|
+
For **troubleshooting (RN)**: read `cometchat-native-troubleshooting` and match the symptom to a triage table. (Web: option 7 "Run diagnostics" runs `cometchat doctor` against `.cometchat/state.json`.)
|
|
590
1209
|
|
|
591
1210
|
### Re-rendering the menu after each action
|
|
592
1211
|
|
|
593
|
-
After every Phase B action completes, you **MUST** re-invoke
|
|
594
|
-
`AskUserQuestion` with the **exact same 8 options** listed above
|
|
595
|
-
(same `question`, `header`, `multiSelect: false`, same option labels
|
|
596
|
-
and descriptions — verbatim). This gives the user arrow-key selection
|
|
597
|
-
in their terminal.
|
|
1212
|
+
After every Phase B action completes, you **MUST** re-invoke `AskUserQuestion` with the **exact same option set** (web: 8 options, RN: 10) — same `question`, `header`, `multiSelect: false`, same labels and descriptions, verbatim. This gives the user arrow-key selection in their terminal.
|
|
598
1213
|
|
|
599
1214
|
**Do NOT:**
|
|
600
|
-
- Present the options as a prose bullet list
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
between iterations.
|
|
607
|
-
- Skip the menu and ask a freeform "What's next?" — always route
|
|
608
|
-
through `AskUserQuestion`.
|
|
609
|
-
- Drop options or add new ones. The user expects the same 8 choices
|
|
610
|
-
every time, even if some are redundant with what they just did
|
|
611
|
-
(they may want to do the same kind of action twice, e.g. add two
|
|
612
|
-
features).
|
|
613
|
-
|
|
614
|
-
The iteration loop is the whole point of Phase B. Re-rendering the
|
|
615
|
-
canonical menu via `AskUserQuestion` after every action is how the
|
|
616
|
-
user controls the session.
|
|
1215
|
+
- Present the options as a prose bullet list — forces typed answers, worse UX.
|
|
1216
|
+
- Invent new options based on what the user just did. The canonical set doesn't change between iterations.
|
|
1217
|
+
- Skip the menu and ask freeform "What's next?" — always route through `AskUserQuestion`.
|
|
1218
|
+
- Drop options or add new ones. The user expects the same choices every time, even if some are redundant with what they just did (they may want to do the same kind of action twice).
|
|
1219
|
+
|
|
1220
|
+
The iteration loop is the whole point of Phase B. Re-rendering the canonical menu via `AskUserQuestion` after every action is how the user controls the session.
|
|
617
1221
|
|
|
618
1222
|
## Hard rules
|
|
619
1223
|
|
|
1224
|
+
### Always (every framework)
|
|
1225
|
+
|
|
620
1226
|
- **Ask, don't assume.** Every integration decision should be confirmed.
|
|
621
|
-
- Always run `detect` first
|
|
1227
|
+
- **Always run `detect` first.** Do not assume the framework.
|
|
622
1228
|
- Always use `npx @cometchat/skills-cli` for CLI commands.
|
|
623
1229
|
- NEVER replace existing project files unless the user chose demo mode.
|
|
624
1230
|
- ALWAYS read existing files before modifying them.
|
|
625
1231
|
- ALWAYS show the plan (Step 3f) and get confirmation before writing.
|
|
626
|
-
-
|
|
627
|
-
|
|
628
|
-
-
|
|
629
|
-
-
|
|
630
|
-
|
|
631
|
-
|
|
1232
|
+
- **Every `<CometChatMessageList>` must pass `hideReplyInThreadOption={true}`** unless the user has explicitly opted into thread support and you've built the thread screen too. Without it, tapping a message shows a "Reply in Thread" action that leads to a broken (undefined) thread view.
|
|
1233
|
+
- **NEVER build a custom search UI.** The UI Kit ships `<CometChatSearch>` — full dual-scope search across conversations + messages with built-in filter chips, pagination, and result highlighting. Any request involving "search", "find messages", "search conversations" MUST use the built-in component (and `showSearchBar` / `onSearchBarClicked` on `CometChatConversations` for web; `hideSearch={false}` for RN). Do NOT create custom search bars, hand-rolled result lists, or filter UIs.
|
|
1234
|
+
- For component names and props, use the framework-appropriate `*-components` skill or docs MCP — never invent from training data.
|
|
1235
|
+
- After writing code, record state in `.cometchat/state.json` (Step 5 step 11) so the iteration menu can detect the integration in a future session.
|
|
1236
|
+
- **NEVER use the `Skill()` tool** to load CometChat skills. They're already in your context as `.claude/skills/` files. Just read and follow them directly.
|
|
1237
|
+
|
|
1238
|
+
### Web only
|
|
1239
|
+
|
|
1240
|
+
- **CSS import goes once at the root level** per framework conventions. The framework skill (cometchat-{react,nextjs,react-router,astro}-patterns) tells you exactly where.
|
|
1241
|
+
- **For drawer / widget animations, animate `right` / `left`, NEVER `transform` / `translate-*`.** A `transform` on a CometChat-containing element creates a new containing block that re-anchors absolutely-positioned overlays (emoji picker, action sheet, reactions, thread panel) to the transformed element instead of the viewport. Tailwind utilities `translate-x-*`, `-translate-x-*`, `scale-*`, `rotate-*`, `transform-*` are also banned for this reason. See `cometchat-placement` § 10.
|
|
1242
|
+
|
|
1243
|
+
### React Native only
|
|
1244
|
+
|
|
1245
|
+
- **`import "react-native-gesture-handler"` must be line 1 of the entry file.** Not line 2. Not after another import. This is non-negotiable.
|
|
1246
|
+
- **All four wrappers are required, in this order:** `GestureHandlerRootView → SafeAreaProvider → CometChatThemeProvider → CometChatProvider`. Omitting any of them breaks gestures, safe areas, theming, or login state — and it fails silently in dev.
|
|
1247
|
+
- **Login API is `CometChatUIKit.login({ uid })` or `CometChatUIKit.login({ authToken })`** — same method, different object key. There is no `loginWithAuthToken`. Passing a bare string like `login("cometchat-uid-1")` silently fails on RN.
|
|
1248
|
+
|
|
1249
|
+
### Angular only
|
|
1250
|
+
|
|
1251
|
+
- **`CUSTOM_ELEMENTS_SCHEMA` is required** in any NgModule that hosts CometChat components. Kit atom elements (`<cometchat-avatar>`, `<cometchat-status-indicator>`, `<cometchat-badge>`, etc.) are LitElement web components, not Angular standalone modules — without the schema Angular throws `Can't bind to '...'`. The schema goes in the module's `schemas: [CUSTOM_ELEMENTS_SCHEMA]` array, not in `imports`.
|
|
1252
|
+
- **Credentials live in `src/environments/environment.ts`, NOT `.env`.** Angular bundles `environment.ts` at compile time; there is no runtime `.env` lookup. The CLI's `provision setup --framework angular` writes a `.env` only as a credentials handoff — migrate the values into `environment.ts` (and `environment.prod.ts` minus the `authKey`) during integration.
|
|
1253
|
+
- **Init runs through `APP_INITIALIZER`, not a wrapper component.** Angular has no React-style provider tree — `CometChatUIKit.init(settings)` must complete before any chat component renders. Wire it as `{ provide: APP_INITIALIZER, useFactory, deps: [...], multi: true }` in the root module.
|
|
1254
|
+
- **Login API is `CometChatUIKit.login({ uid })` (object form), NOT a bare string.** Same shape as the React Native UI Kit. Calling `CometChatUIKit.login("cometchat-uid-1")` silently fails on Angular too — always pass the credentials object: `login({ uid })` for dev, `login({ authToken })` for production.
|
|
1255
|
+
- **Events are `[onX]` Input callbacks, not `(onX)` Output bindings.** The Angular UI Kit declares almost no `@Output` — events like `onSendButtonClick`, `onAccept`, `onItemClick` are `@Input()` callback functions. Writing `(onAccept)="handleAccept()"` silently no-ops or fails template type checking.
|
|
1256
|
+
- **`[messagesRequestBuilder]` is plural.** `[messageRequestBuilder]` (singular) on `<cometchat-message-list>` silently no-ops — the input doesn't exist.
|
|
1257
|
+
- **Match the kit's `auxilaryButtonView` typo** on `<cometchat-message-composer>` (missing first 'i'). The corrected spelling `auxiliaryButtonView` does not exist in the kit and silently no-ops.
|
|
1258
|
+
- **`CometChatThemeService` is the v4 theme entry point**, NOT the legacy v3 `CometChatTheme` class. Inject the service; access `themeService.theme` for palette/typography control.
|
|
1259
|
+
|
|
1260
|
+
### Android only
|
|
1261
|
+
|
|
1262
|
+
- **Never mix V5 and V6 artifacts.** `chat-uikit-android:5.x` and `chatuikit-{compose,kotlin}-android:6.x` are different SDKs with different package paths, theme systems, and APIs. The dispatcher routes by `android_version`; treat the cohort as a hard switch.
|
|
1263
|
+
- **V5 app theme must inherit from `CometChatTheme.DayNight`** — the kit itself parents on `Theme.MaterialComponents.DayNight.NoActionBar` (Material 2). Using `Theme.AppCompat.*` or `Theme.Material3.*` triggers `UnsupportedOperationException: Failed to resolve attribute` at inflate time. V6 has no equivalent rule — Compose uses `CometChatTheme { … }`, Kotlin Views uses kit-defined style attrs.
|
|
1264
|
+
- **Init in `Application.onCreate()`, not in an Activity.** `CometChatUIKit.init(context, settings, callback)` must complete before any chat View / Composable inflates. Wire `login(...)` inside the init success callback. The `<application android:name=".MyApp">` registration in `AndroidManifest.xml` is non-negotiable.
|
|
1265
|
+
- **Credentials live in `local.properties` + `BuildConfig`, NOT `.env`.** Android has no runtime `.env` lookup; surface secrets via `buildConfigField` and read `BuildConfig.COMETCHAT_APP_ID` etc. in code. The CLI's `provision setup --framework android` writes a `.env` only as a credentials handoff — migrate during integration.
|
|
1266
|
+
- **`INTERNET` permission is mandatory.** Without it, the SDK silently fails to connect — no error, no symptom except missing data.
|
|
1267
|
+
- **V5 thread-mode method asymmetry.** `CometChatMessageList` uses `setParentMessage(long)` (no `Id` suffix). `CometChatMessageComposer` uses `setParentMessageId(long)`. Different methods on different classes — the same value, two names. Never use `setParentMessageId` on the list.
|
|
1268
|
+
- **V5 extensions: registrar vs decorator.** `setExtensions(...)` accepts registrars (`PollsExtension`, `StickerExtension`, `SmartRepliesExtension` — extending `ExtensionsDataSource`). NEVER add `*ExtensionDecorator` instances directly — they extend `DataSourceDecorator` and won't compile in a `List<ExtensionsDataSource>`. The decorator chain is built by the registrar's `enable()` method internally.
|
|
1269
|
+
- **V6 Kotlin Views — `setOnItemClick`, NOT `setOnItemClickListener`.** The kit doesn't expose `*Listener`-suffixed setters; use the bare callback name. Same for other V6 setters — check the actual View class before guessing.
|
|
1270
|
+
- **V6 reaction list takes `baseMessage`, not `message`.** `CometChatReactionList(baseMessage = ...)` (Compose) or `reactionList.setBaseMessage(...)` (Kotlin Views). The bare `message` param/setter doesn't exist in V6.
|
|
1271
|
+
- **Push notifications: `CometChatNotifications.registerPushToken/unregisterPushToken` is the only public surface.** Sample-app helpers like `CometChatVoIP`, `FCMService`, `FCMMessageDTO` are NOT exported from `chatuikit-*` artifacts — they live in the master sample apps. Copy the pattern; don't import them as kit classes.
|
|
1272
|
+
- **R8/ProGuard rule for release.** Add `-keep class com.cometchat.** { *; }` to `proguard-rules.pro`. Without it, release builds strip kit classes and crash with `ClassNotFoundException`.
|
|
1273
|
+
|
|
1274
|
+
### Flutter only
|
|
1275
|
+
|
|
1276
|
+
- **Never mix V5 and V6 packages.** `cometchat_chat_uikit:^5.2` (V5, GetX-based, calls in a separate `cometchat_calls_uikit:^5.0` package) and `cometchat_chat_uikit:^6.0.0-beta2` (V6, Bloc-based, calls bundled in) are different SDKs with different state-management primitives, theme APIs, and barrel exports. The skills target one cohort each — pick V5 for production, V6 for beta evaluation, never both.
|
|
1277
|
+
- **V5 has TWO barrels; V6 has ONE.** V5 chat widgets (`CometChatConversations`, `CometChatMessageList`, `CometChatMessageComposer`) are reachable ONLY through `package:cometchat_chat_uikit/cometchat_chat_uikit.dart`. The calls package barrel re-exports `cometchat_uikit_shared` + `cometchat_sdk` + `cometchat_calls_sdk` but NOT `cometchat_chat_uikit` — using only the calls import will fail to resolve chat widgets. V6 ships a single package, so the chat barrel covers both chat AND calls.
|
|
1278
|
+
- **`subscriptionType` is required on `UIKitSettingsBuilder`.** Omitting it silently disables presence and typing-indicator events — no error is thrown, just no presence updates. Always set `..subscriptionType = CometChatSubscriptionType.allUsers` (or `..forFriends` / `..forRoles`).
|
|
1279
|
+
- **`CometChatUIKit.login(uid)` takes a String, not an object.** Both V5 and V6 use the bare-string form for dev login. For production: `CometChatUIKit.loginWithAuthToken(token, ...)`.
|
|
1280
|
+
- **Cache theme values in `didChangeDependencies()`, not `build()`.** `CometChatThemeHelper.getColorPalette(context)` allocates and resolves tokens on every call — running it in `build()` causes jank during keyboard animations and theme changes.
|
|
1281
|
+
- **Listener IDs must be unique + removed in `dispose()`.** Hardcoded listener IDs collide across screens; missing `dispose()` removal leaks listeners across navigations. Use a per-instance ID and remove it on teardown.
|
|
1282
|
+
- **Credentials live in a Dart const file or `--dart-define`, NOT `.env`.** Flutter doesn't read `.env` at runtime; the CLI's `provision setup --framework flutter` writes a `.env` only as a credentials handoff — migrate during Step 5.
|
|
1283
|
+
- **`ComponentToggles` and `CallScreenOverlay` do not exist in V6.** Per-widget feature flags (e.g. `disableReactions`, `hideReplyInThreadOption`) replace v5's `BuilderSettings`. In-call UI is `CometChatOngoingCall` widget + `CometChatDisplayIncomingCallOverlay`, not an overlay class with `.show()`.
|
|
1284
|
+
- **AI widget availability varies across V6 betas.** Some AI widgets (`CometChatAIAssistantChatHistory`, `CometChatAIConversationSummary`) are exported in `6.0.0-beta2`; others may not be. If an import errors with "undefined name", the symbol isn't in that beta. Drive AI features via dashboard-enabled extensions for the most stable path — the kit surfaces AI replies/summaries inside the existing message list and composer regardless.
|
|
1285
|
+
- **V6 conversations slot signatures are asymmetric.** `subtitleView` / `leadingView` / `titleView` take `(BuildContext, Conversation)` (two-arg). `trailingView` and `listItemView` take just `(Conversation)` (single-arg). Match the source — guessing one shape across all four breaks template type-checking. See `cometchat-flutter-v6-conversations` for the example.
|
|
1286
|
+
- **`PNRegistry` is sample-app code, not a kit API.** The kit's only public push surface is `CometChatNotifications.registerPushToken(token, providerId, platform)` and `unregisterPushToken()`. Use the kit API directly, or copy the sample-app `PNRegistry` helper into your project.
|
|
1287
|
+
|
|
1288
|
+
### iOS only
|
|
1289
|
+
|
|
1290
|
+
- **No `CometChatMessages` / `CometChatConversationsWithMessages` / `CometChatDetails` exist.** These look like "pre-built composite UIViewControllers" but the kit doesn't ship them. Build your own `MessagesVC` by composing `CometChatMessageHeader` + `CometChatMessageList` + `CometChatMessageComposer` (sample app: `SampleApp/View Controllers/CometChat Components/MessagesVC.swift`). Same for details — compose your own.
|
|
1291
|
+
- **Init completion uses Swift's standard `Result<Bool, Error>`** (`case .success` / `case .failure`), NOT the kit's `.success`/`.onError` enum that only appears in login/logout callbacks. The `CometChatUIKit(uiKitSettings:)` and `CometChatUIKit.init(uiKitSettings:)` forms are identical in Swift; both compile and the kit's sample apps use the explicit `.init` form.
|
|
1292
|
+
- **Login result switches on `.success` / `.onError`** — NOT Swift's `.failure`. The kit ships its own `Result`-shaped enum for login callbacks. Add `@unknown default: break` to silence the compiler warning.
|
|
1293
|
+
- **App theme parent is irrelevant on iOS** — but pod-side: Xcode 15+ requires `ENABLE_USER_SCRIPT_SANDBOXING = NO` in Build Settings (or the `post_install` Podfile hook). Without it, the resource-bundle build phase silently fails and assets/strings load empty at runtime.
|
|
1294
|
+
- **`pod 'CometChatUIKitSwift', '~> 5.1'`**, NOT `~> 5.0` — the binary target ships at 5.1.x (5.1.12 at last verification); the older pin would resolve to a stale subrelease.
|
|
1295
|
+
- **`CometChatLocalize.set(key:value:)` does not exist.** Public API is locale-only: `set(locale: Language)` / `set(locale: String)`. Override individual keys via your app's `Localizable.strings` instead.
|
|
1296
|
+
- **`CometChatTypography.setFont(name:)` is a class func**, not a settable `fontFamily` property. `CometChatTypography.fontFamily = "Avenir"` does not compile.
|
|
1297
|
+
- **`CometChatGroupMembers()` takes zero args**; pass the group via `set(group:)`. There is no `CometChatGroupMembers(group:)` initializer.
|
|
1298
|
+
- **`CometChatCallButtons(width:height:)` requires explicit dimensions**; there is no zero-arg initializer.
|
|
1299
|
+
- **`CometChatThreadHeader` does NOT exist** — the real class is `CometChatThreadedMessageHeader`.
|
|
1300
|
+
- **Avatar `cornerRadius` is a `CGFloat` on a `CometChatCornerStyle` struct** — there is no `.circle` enum case. For a circular avatar, set a value larger than half the dimension.
|
|
1301
|
+
- **`hideSearch` defaults to `true`** on `CometChatUsers` / `CometChatGroups` / `CometChatConversations` (inherited from `CometChatListBase`). To SHOW the built-in search bar, set `vc.hideSearch = false` — the search bar is hidden out of the box, which catches developers expecting it to render automatically.
|
|
1302
|
+
- **Open the `.xcworkspace`, not the `.xcodeproj`, when CocoaPods is in use.** Opening the bare project skips the `Pods` workspace and Build Settings will show "no such module 'CometChatUIKitSwift'" at compile time.
|
|
632
1303
|
|
|
633
1304
|
## Error handling
|
|
634
1305
|
|
|
635
|
-
If the CLI's `--json` output includes `human_message` / `suggestion` fields,
|
|
636
|
-
|
|
637
|
-
|
|
1306
|
+
If the CLI's `--json` output includes `human_message` / `suggestion` fields, show those to the user. Then show the raw `error` in parentheses for debuggability. If `retryable: false`, do NOT offer a retry.
|
|
1307
|
+
|
|
1308
|
+
For RN: if a command errors (e.g., `pod install` fails, `npx expo install` fails), surface the raw error output and consult `cometchat-native-troubleshooting` for the relevant triage table before retrying. Don't loop silently.
|
|
1309
|
+
|
|
1310
|
+
If the user's project is bare RN with `ios/` and `android/` but no `package.json` scripts for `ios`/`android` (common when React Native was added incrementally to an existing native app), flag that and pause. Writing integration code won't help if the app can't build.
|
|
638
1311
|
|
|
639
1312
|
## Optional: docs MCP
|
|
640
1313
|
|
|
@@ -647,6 +1320,8 @@ Not required for integration or Phase B CLI flows.
|
|
|
647
1320
|
|
|
648
1321
|
## Skill routing reference
|
|
649
1322
|
|
|
1323
|
+
### Web family
|
|
1324
|
+
|
|
650
1325
|
| Skill | When to load |
|
|
651
1326
|
|---|---|
|
|
652
1327
|
| `cometchat-core` | Always — before any integration code |
|
|
@@ -658,5 +1333,131 @@ Not required for integration or Phase B CLI flows.
|
|
|
658
1333
|
| `cometchat-astro-patterns` | framework = astro |
|
|
659
1334
|
| `cometchat-theming` | When customizing themes |
|
|
660
1335
|
| `cometchat-features` | When adding features |
|
|
1336
|
+
| `cometchat-customization` | When writing custom formatters, events, request-builder filters |
|
|
661
1337
|
| `cometchat-production` | When setting up production auth |
|
|
662
1338
|
| `cometchat-troubleshooting` | When diagnosing problems |
|
|
1339
|
+
|
|
1340
|
+
### React Native family
|
|
1341
|
+
|
|
1342
|
+
| Skill | When to load |
|
|
1343
|
+
|---|---|
|
|
1344
|
+
| `cometchat-native-core` | Always — before any integration code |
|
|
1345
|
+
| `cometchat-native-components` | Always — before writing component code |
|
|
1346
|
+
| `cometchat-native-placement` | When integrating — for placement patterns |
|
|
1347
|
+
| `cometchat-native-expo-patterns` | framework = expo (managed + Expo Router) |
|
|
1348
|
+
| `cometchat-native-bare-patterns` | framework = react-native (bare CLI) |
|
|
1349
|
+
| `cometchat-native-theming` | When customizing themes |
|
|
1350
|
+
| `cometchat-native-features` | When adding features |
|
|
1351
|
+
| `cometchat-native-customization` | When writing custom text formatters, events, request-builder filters, or DataSource decorators |
|
|
1352
|
+
| `cometchat-native-production` | When setting up production auth or user management |
|
|
1353
|
+
| `cometchat-native-push` | When setting up push notifications |
|
|
1354
|
+
| `cometchat-native-testing` | When adding tests |
|
|
1355
|
+
| `cometchat-native-troubleshooting` | When diagnosing problems |
|
|
1356
|
+
|
|
1357
|
+
### Angular family
|
|
1358
|
+
|
|
1359
|
+
| Skill | When to load |
|
|
1360
|
+
|---|---|
|
|
1361
|
+
| `cometchat-angular-core` | Always — before any integration code |
|
|
1362
|
+
| `cometchat-angular-components` | Always — before writing component code |
|
|
1363
|
+
| `cometchat-angular-placement` | When integrating — for placement patterns (route, modal, drawer, embed) |
|
|
1364
|
+
| `cometchat-angular-patterns` | framework = angular — module organization, lazy loading, environment files |
|
|
1365
|
+
| `cometchat-angular-theming` | When customizing themes (`CometChatThemeService`) |
|
|
1366
|
+
| `cometchat-angular-features` | When adding features (calls, polls, reactions, AI, extensions) |
|
|
1367
|
+
| `cometchat-angular-customization` | When writing custom views via content projection, `<ng-template>` slots, DataSource decorators |
|
|
1368
|
+
| `cometchat-angular-production` | When setting up production auth (server-minted auth tokens) or user management |
|
|
1369
|
+
| `cometchat-angular-troubleshooting` | When diagnosing problems (build errors, schema errors, Zone.js issues) |
|
|
1370
|
+
|
|
1371
|
+
### Android V5 family (live — `chat-uikit-android:5.x`)
|
|
1372
|
+
|
|
1373
|
+
| Skill | When to load |
|
|
1374
|
+
|---|---|
|
|
1375
|
+
| `cometchat-android-v5` | Dispatcher entry — `android_version === "v5"` |
|
|
1376
|
+
| `cometchat-android-v5-core` | Always — Gradle deps, `UIKitSettings.UIKitSettingsBuilder`, init/login, theme parent |
|
|
1377
|
+
| `cometchat-android-v5-components` | Always — View class catalog (`CometChatConversations`, `CometChatMessageList`, …) |
|
|
1378
|
+
| `cometchat-android-v5-placement` | When integrating — Activity / Fragment / BottomSheet placement |
|
|
1379
|
+
| `cometchat-android-v5-theming` | When customizing themes — colors.xml, theme attrs, dark mode |
|
|
1380
|
+
| `cometchat-android-v5-features` | When adding features — calls, reactions, polls, AI, extensions |
|
|
1381
|
+
| `cometchat-android-v5-customization` | When writing custom Views, message templates, `CometChatTextFormatter`, event listeners |
|
|
1382
|
+
| `cometchat-android-v5-extensions` | When working with extensions (`PollsExtension` / `StickerExtension` registrars + custom decorator pattern) |
|
|
1383
|
+
| `cometchat-android-v5-production` | When setting up production auth (server-minted auth tokens) or user management |
|
|
1384
|
+
| `cometchat-android-v5-push` | When setting up push notifications (FCM, token lifecycle, deep-link) |
|
|
1385
|
+
| `cometchat-android-v5-testing` | When adding tests (Espresso, Robolectric, mocking the kit/SDK) |
|
|
1386
|
+
| `cometchat-android-v5-troubleshooting` | When diagnosing problems (Gradle, manifest, ProGuard, lifecycle) |
|
|
1387
|
+
|
|
1388
|
+
### Android V6 family (beta — `chatuikit-{compose,kotlin}-android:6.x`)
|
|
1389
|
+
|
|
1390
|
+
| Skill | When to load |
|
|
1391
|
+
|---|---|
|
|
1392
|
+
| `cometchat-android-v6` | Dispatcher entry — `android_version === "v6"` |
|
|
1393
|
+
| `cometchat-android-v6-core` | Always — Gradle deps, init, login, message sending |
|
|
1394
|
+
| `cometchat-android-v6-events` | Always — `CometChatEvents` SharedFlows + sealed event classes |
|
|
1395
|
+
| `cometchat-android-v6-builder-settings` | When configuring `UIKitSettingsBuilder` (calling, presence, etc.) |
|
|
1396
|
+
| `cometchat-android-v6-features` | When adding features — calls, reactions, polls, AI agent, extensions |
|
|
1397
|
+
| `cometchat-android-v6-extensions` | When working with extensions / DataSource interfaces |
|
|
1398
|
+
| `cometchat-android-v6-production` | When setting up production auth or user management |
|
|
1399
|
+
| `cometchat-android-v6-push` | When setting up push notifications |
|
|
1400
|
+
| `cometchat-android-v6-testing` | When adding tests (Espresso, Compose UI tests, Robolectric, mocking) |
|
|
1401
|
+
| `cometchat-android-v6-troubleshooting` | When diagnosing problems (Gradle, Compose runtime, R8, BuildConfig) |
|
|
1402
|
+
| `cometchat-android-v6-compose-components` | UI stack = Compose — Composable component catalog |
|
|
1403
|
+
| `cometchat-android-v6-compose-placement` | UI stack = Compose — NavHost, modal, bottom sheet placement |
|
|
1404
|
+
| `cometchat-android-v6-compose-theming` | UI stack = Compose — `CometChatTheme { … }`, `LocalColorScheme`/`LocalTypography` |
|
|
1405
|
+
| `cometchat-android-v6-compose-customization` | UI stack = Compose — `BubbleFactory`, slot lambdas, custom Composables |
|
|
1406
|
+
| `cometchat-android-v6-kotlin-components` | UI stack = Kotlin Views — custom View class catalog |
|
|
1407
|
+
| `cometchat-android-v6-kotlin-placement` | UI stack = Kotlin Views — Activity / Fragment / BottomSheet placement |
|
|
1408
|
+
| `cometchat-android-v6-kotlin-theming` | UI stack = Kotlin Views — style attrs, colors.xml, dark mode |
|
|
1409
|
+
| `cometchat-android-v6-kotlin-customization` | UI stack = Kotlin Views — custom Views, `BubbleFactory` abstract class, `setBubbleFactories` |
|
|
1410
|
+
|
|
1411
|
+
### Flutter V5 family (live — `cometchat_chat_uikit:^5.2`)
|
|
1412
|
+
|
|
1413
|
+
| Skill | When to load |
|
|
1414
|
+
|---|---|
|
|
1415
|
+
| `cometchat-flutter-v5` | Dispatcher entry — `flutter_version === "v5"` |
|
|
1416
|
+
| `cometchat-flutter-v5-core` | Always — pubspec deps, init/login, GetX patterns, theme caching, listener lifecycle |
|
|
1417
|
+
| `cometchat-flutter-v5-conversations` | When integrating — `CometChatConversations` widget |
|
|
1418
|
+
| `cometchat-flutter-v5-messages` | When integrating — `CometChatMessages`, `CometChatMessageList`, `CometChatMessageComposer`, `CometChatMessageHeader`, threads |
|
|
1419
|
+
| `cometchat-flutter-v5-users-groups` | When integrating — `CometChatUsers`, `CometChatGroups`, `CometChatGroupMembers` |
|
|
1420
|
+
| `cometchat-flutter-v5-calls` | When adding voice/video — `CometChatCallButtons`, `CometChatIncomingCall`, `CometChatOutgoingCall`, `CometChatOngoingCall`, `CometChatCallLogs` |
|
|
1421
|
+
| `cometchat-flutter-v5-theming` | When customizing themes — `CometChatThemeHelper`, `CometChatColorPalette`, dark mode |
|
|
1422
|
+
| `cometchat-flutter-v5-customization` | When writing custom bubbles, templates, formatters, slot views, DataSource decorators |
|
|
1423
|
+
| `cometchat-flutter-v5-events` | When subscribing to SDK events (`CometChatMessageEvents`, etc.) |
|
|
1424
|
+
| `cometchat-flutter-v5-production` | When setting up production auth (server-minted tokens) and ProGuard |
|
|
1425
|
+
| `cometchat-flutter-v5-push` | When setting up FCM / APNs / VoIP push |
|
|
1426
|
+
| `cometchat-flutter-v5-troubleshooting` | When diagnosing problems (pubspec, GetX, Pod errors, runtime crashes) |
|
|
1427
|
+
|
|
1428
|
+
### Flutter V6 family (beta — `cometchat_chat_uikit:^6.0.0-beta2`)
|
|
1429
|
+
|
|
1430
|
+
| Skill | When to load |
|
|
1431
|
+
|---|---|
|
|
1432
|
+
| `cometchat-flutter-v6` | Dispatcher entry — `flutter_version === "v6"` |
|
|
1433
|
+
| `cometchat-flutter-v6-core` | Always — pubspec deps, init/login, message sending |
|
|
1434
|
+
| `cometchat-flutter-v6-components` | Always — Bloc-driven widget catalog |
|
|
1435
|
+
| `cometchat-flutter-v6-conversations` | When integrating `CometChatConversations` (Bloc, request builder, callbacks) |
|
|
1436
|
+
| `cometchat-flutter-v6-messages` | When integrating `CometChatMessages`, list/header/composer composition |
|
|
1437
|
+
| `cometchat-flutter-v6-users-groups` | When integrating `CometChatUsers`/`CometChatGroups`/`CometChatGroupMembers` |
|
|
1438
|
+
| `cometchat-flutter-v6-calls` | When adding voice/video — incoming/outgoing/ongoing screens |
|
|
1439
|
+
| `cometchat-flutter-v6-features` | When adding features — calls, polls, reactions, AI, extensions |
|
|
1440
|
+
| `cometchat-flutter-v6-placement` | When deciding placement — route, modal sheet, embedded widget |
|
|
1441
|
+
| `cometchat-flutter-v6-theming` | When customizing themes — `CometChatThemeHelper`, `CometChatColorPalette`, light/dark schemes |
|
|
1442
|
+
| `cometchat-flutter-v6-customization` | When writing bubble factories, message templates, text formatters, slot widgets |
|
|
1443
|
+
| `cometchat-flutter-v6-events` | When subscribing to Bloc-based event streams |
|
|
1444
|
+
| `cometchat-flutter-v6-production` | When setting up production auth and external-backend recipes |
|
|
1445
|
+
| `cometchat-flutter-v6-troubleshooting` | When diagnosing problems (pubspec, Bloc, theme cache, build errors) |
|
|
1446
|
+
| `cometchat-flutter-v6-migration` | When migrating from V5 — GetX → Bloc, theme API rewrite, breaking changes |
|
|
1447
|
+
|
|
1448
|
+
### iOS family (V5 stable — `CometChatUIKitSwift:~> 5.1`)
|
|
1449
|
+
|
|
1450
|
+
iOS only ships V5 today; no V6 beta yet. When V6 lands, this section will fork like Android and Flutter do.
|
|
1451
|
+
|
|
1452
|
+
| Skill | When to load |
|
|
1453
|
+
|---|---|
|
|
1454
|
+
| `cometchat-ios` | Dispatcher entry — `framework === "ios"` |
|
|
1455
|
+
| `cometchat-ios-core` | Always — Installation (CocoaPods + SPM), `UIKitSettings` builder, `CometChatUIKit(uiKitSettings:)` constructor init, login order |
|
|
1456
|
+
| `cometchat-ios-components` | Always — UIViewController + SwiftUI view catalog, custom `MessagesVC` composition pattern |
|
|
1457
|
+
| `cometchat-ios-placement` | When integrating — UINavigationController, modal, tab bar, embedded view, SwiftUI hosting |
|
|
1458
|
+
| `cometchat-ios-theming` | When customizing themes — `CometChatTheme` color tokens, `CometChatTypography.setFont(name:)`, dark mode |
|
|
1459
|
+
| `cometchat-ios-customization` | When writing custom message templates, formatters, DataSource decorators, custom views |
|
|
1460
|
+
| `cometchat-ios-features` | When adding features — calls, polls, reactions, AI, extensions |
|
|
1461
|
+
| `cometchat-ios-production` | When setting up production auth (server-minted auth tokens) and user management |
|
|
1462
|
+
| `cometchat-ios-push` | When setting up APNs + VoIP push, CallKit |
|
|
1463
|
+
| `cometchat-ios-troubleshooting` | When diagnosing problems — SPM/CocoaPods errors, Xcode build issues, Info.plist, runtime crashes |
|