@cometchat/skills 3.1.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +75 -17
  2. package/bin/install.js +523 -43
  3. package/package.json +17 -8
  4. package/skills/cometchat/SKILL.md +850 -109
  5. package/skills/cometchat-android-v5/SKILL.md +120 -0
  6. package/skills/cometchat-android-v5-components/SKILL.md +430 -0
  7. package/skills/cometchat-android-v5-core/SKILL.md +468 -0
  8. package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
  9. package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
  10. package/skills/cometchat-android-v5-features/SKILL.md +130 -0
  11. package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
  12. package/skills/cometchat-android-v5-production/SKILL.md +94 -0
  13. package/skills/cometchat-android-v5-push/SKILL.md +620 -0
  14. package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
  15. package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
  16. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
  17. package/skills/cometchat-android-v6/SKILL.md +107 -0
  18. package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
  19. package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
  20. package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
  21. package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
  22. package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
  23. package/skills/cometchat-android-v6-core/SKILL.md +354 -0
  24. package/skills/cometchat-android-v6-events/SKILL.md +212 -0
  25. package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
  26. package/skills/cometchat-android-v6-features/SKILL.md +130 -0
  27. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
  28. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
  29. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
  30. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
  31. package/skills/cometchat-android-v6-production/SKILL.md +187 -0
  32. package/skills/cometchat-android-v6-push/SKILL.md +274 -0
  33. package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
  34. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
  35. package/skills/cometchat-angular-components/SKILL.md +706 -0
  36. package/skills/cometchat-angular-core/SKILL.md +444 -0
  37. package/skills/cometchat-angular-customization/SKILL.md +424 -0
  38. package/skills/cometchat-angular-features/SKILL.md +447 -0
  39. package/skills/cometchat-angular-patterns/SKILL.md +447 -0
  40. package/skills/cometchat-angular-placement/SKILL.md +685 -0
  41. package/skills/cometchat-angular-production/SKILL.md +415 -0
  42. package/skills/cometchat-angular-theming/SKILL.md +365 -0
  43. package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
  44. package/skills/cometchat-astro-patterns/SKILL.md +3 -3
  45. package/skills/cometchat-components/SKILL.md +2 -0
  46. package/skills/cometchat-core/SKILL.md +11 -6
  47. package/skills/cometchat-customization/references/component-catalog.md +1 -1
  48. package/skills/cometchat-features/SKILL.md +176 -108
  49. package/skills/cometchat-flutter-v5/SKILL.md +167 -0
  50. package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
  51. package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
  52. package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
  53. package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
  54. package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
  55. package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
  56. package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
  57. package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
  58. package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
  59. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
  60. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
  61. package/skills/cometchat-flutter-v6/SKILL.md +445 -0
  62. package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
  63. package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
  64. package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
  65. package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
  66. package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
  67. package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
  68. package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
  69. package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
  70. package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
  71. package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
  72. package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
  73. package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
  74. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
  75. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
  76. package/skills/cometchat-ios/SKILL.md +323 -0
  77. package/skills/cometchat-ios-components/SKILL.md +651 -0
  78. package/skills/cometchat-ios-core/SKILL.md +822 -0
  79. package/skills/cometchat-ios-customization/SKILL.md +825 -0
  80. package/skills/cometchat-ios-features/SKILL.md +725 -0
  81. package/skills/cometchat-ios-placement/SKILL.md +750 -0
  82. package/skills/cometchat-ios-production/SKILL.md +730 -0
  83. package/skills/cometchat-ios-push/SKILL.md +582 -0
  84. package/skills/cometchat-ios-theming/SKILL.md +631 -0
  85. package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
  86. package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
  87. package/skills/cometchat-native-components/SKILL.md +594 -0
  88. package/skills/cometchat-native-core/SKILL.md +407 -0
  89. package/skills/cometchat-native-customization/SKILL.md +594 -0
  90. package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
  91. package/skills/cometchat-native-features/SKILL.md +608 -0
  92. package/skills/cometchat-native-placement/SKILL.md +500 -0
  93. package/skills/cometchat-native-production/SKILL.md +694 -0
  94. package/skills/cometchat-native-push/SKILL.md +593 -0
  95. package/skills/cometchat-native-testing/SKILL.md +583 -0
  96. package/skills/cometchat-native-theming/SKILL.md +656 -0
  97. package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
  98. package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
  99. package/skills/cometchat-placement/SKILL.md +28 -0
  100. package/skills/cometchat-react-patterns/SKILL.md +55 -7
  101. 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 in any React project — web (React/Next.js/React Router/Astro) and React Native (Expo/bare). Detects the framework, gathers requirements through an interactive conversation, and writes production-quality integration code.
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 nextjs react-router astro expo react-native 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
@@ -27,8 +27,12 @@ framework first and routes to the right ones.
27
27
  |---|---|
28
28
  | **Web** | React (Vite/CRA), Next.js, React Router v6/v7, Astro |
29
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`) |
30
34
 
31
- 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 dispatcher decides which set after Step 1's detection.
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.
32
36
 
33
37
  ## How v3 works
34
38
 
@@ -38,10 +42,10 @@ to understand their project, their use case, and exactly where chat
38
42
  should go — THEN you write code that fits.
39
43
 
40
44
  Pattern skills (loaded from your context, not via `Skill()`):
41
- - `cometchat-core` (web) / `cometchat-native-core` (RN) — init, login, provider chain, env vars, anti-patterns
42
- - `cometchat-components` (web) / `cometchat-native-components` (RN) — component catalog, props, composition
43
- - `cometchat-placement` (web) / `cometchat-native-placement` (RN) — WHERE to put chat
44
- - One per-framework skill (`cometchat-{react,nextjs,react-router,astro}-patterns` or `cometchat-native-{expo,bare}-patterns`) — framework-specific details
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
45
49
 
46
50
  **Key principle: ask, don't assume.** Every piece of information you need
47
51
  from the user should be asked explicitly. Don't guess the route path,
@@ -66,7 +70,21 @@ If no config, run detection:
66
70
  npx @cometchat/skills-cli detect --json
67
71
  ```
68
72
 
69
- The JSON output includes `framework` (one of `reactjs`, `nextjs`, `react-router`, `astro`, `expo`, `react-native`, or `null`), framework-specific fields (`router`, `expo_mode`, `react_native_version`, `env_prefix`), and a `compatibility.supported` flag. If `supported` is `false`, stop and surface the warnings.
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`.
70
88
 
71
89
  **Then read the project yourself — this is critical.**
72
90
 
@@ -85,35 +103,169 @@ The JSON output includes `framework` (one of `reactjs`, `nextjs`, `react-router`
85
103
  - Existing screens — list all files under `screens/`, `src/screens/`, `app/`, or wherever routes live
86
104
  - Existing nav structure — read the root navigator to see stack vs tab vs drawer layout
87
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
+
88
142
  Store this mental map — you'll use it throughout the conversation.
89
143
 
144
+ #### Then show the user what you found — Step 1.5 (the "I see you" moment)
145
+
146
+ This is the most important moment of the whole flow. After running detection + reading the project, narrate what you found in **3–5 specific, observation-grounded bullets** BEFORE asking any question. The user should feel that you understand their project before deciding whether to trust you with it.
147
+
148
+ The shape (use it verbatim — the structure earns trust):
149
+
150
+ > Taking a look at your project...
151
+ >
152
+ > - **{Framework} + {Build tool} {version}** {with TypeScript / JavaScript / etc., as detected}
153
+ > - **{Router or nav state}** — {one observation about how routing is set up, or "no router yet" for greenfield}
154
+ > - **{Auth system status}** — {"NextAuth detected → I'll wire token-based login", or "no auth detected → I'll start with dev mode + a test user; you can upgrade later"}
155
+ > - **{Existing CometChat state}** — {"existing `cometchat/` folder with X — I'll patch around it", or "fresh start — no prior CometChat code"}
156
+ > - **{One personal observation}** — {something specific you noticed: "Tailwind classes throughout", "shadcn/ui components", "monorepo with apps/* and packages/*"}
157
+ >
158
+ > Ready to set this up? I'll walk you through account setup, then ask where chat should live.
159
+
160
+ **The rules for this moment:**
161
+
162
+ 1. **Be specific, not generic.** "Vite + React 19 + TypeScript" beats "a React project." Read the actual versions from `package.json`.
163
+ 2. **Five bullets max.** Beyond five, it stops feeling observational and starts feeling like a recital. Cut to what's *interesting* about the project.
164
+ 3. **Lead with what's load-bearing.** Framework + version, router, auth, existing CometChat, then one personal touch. The personal touch is what makes it land — show you actually looked.
165
+ 4. **Skip the bullet if there's nothing to say.** No router on greenfield → say "no router yet"; don't invent one. No auth → say "no auth detected"; don't list every package you didn't find.
166
+ 5. **End with a single confident question.** Not five questions. The flow continues into Step 2 (credentials) or Step 3 (placement) — let the next step ask.
167
+
168
+ **Examples of good vs bad bullets:**
169
+
170
+ | ✓ Good (specific, observational) | ✗ Bad (generic, unfounded) |
171
+ |---|---|
172
+ | "Vite + React 19 + TypeScript, Tailwind for styling" | "A React project with TypeScript" |
173
+ | "React Router v7 detected (`routes.ts` + `react-router.config.ts`)" | "Some routing is configured" |
174
+ | "NextAuth in `auth.config.ts` — I'll mint CometChat tokens server-side via your existing session cookie" | "Authentication is set up" |
175
+ | "shadcn/ui detected (`components/ui/*`) — I'll use your existing Button + Dialog primitives in the chat trigger" | "Some UI components are present" |
176
+ | "Monorepo: `apps/web` is your dashboard, `apps/marketing` is the public site — I'll integrate into apps/web" | "This is a monorepo" |
177
+
178
+ **For greenfield projects (the test case):**
179
+
180
+ > Taking a look at your project...
181
+ >
182
+ > - **Vite + React 19 + TypeScript** — fresh `cometchat-test-app` scaffold
183
+ > - **No router yet** — for the demo, chat will mount in `src/App.tsx` directly; we can move it to a route later
184
+ > - **No auth system detected** — I'll set you up in dev mode with a pre-seeded test user (`cometchat-uid-1`); production auth is a one-flag upgrade later
185
+ > - **Fresh start** — no existing CometChat code to patch around
186
+ >
187
+ > Ready to set this up? I'll get you a CometChat account first, then ask where chat should live.
188
+
189
+ This moment costs ~5 seconds of conversation but anchors the rest. Skip it and the user feels like they're talking to a script. Run it well and the rest of the flow feels effortless.
190
+
191
+ ---
192
+
90
193
  **Compatibility baselines (the CLI enforces these):**
91
194
  - Web: react@<18 → upgrade required; nextjs@<13 → warning; astro@<4 → warning
92
195
  - RN: react-native@<0.70 → upgrade required; expo@<49 → upgrade required
196
+ - Angular: @angular/core@<12 → upgrade required; @angular/core@>=16 → warning (skill is verified against v15)
197
+ - Android V5: minSdk@<21 → upgrade required; minSdk@<24 → warning; AGP@<7.0 → warning
198
+ - 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
199
+ - Flutter V5: Dart SDK <2.17 → upgrade required; Flutter <2.5 → warning; Android `minSdk 24` (Flutter platform default) when V5 is in use
200
+ - Flutter V6: Dart SDK <2.17 → upgrade required; Flutter <2.5 → warning; Android `minSdk 26` REQUIRED (cometchat_calls_sdk in V6 raised the floor)
201
+ - 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)
93
202
 
94
203
  #### Pattern skills not installed?
95
204
 
96
- The dispatcher routes to either web pattern skills (`cometchat-{core,components,placement,*-patterns}`) or RN pattern skills (`cometchat-native-{core,components,placement,*-patterns}`) based on the detected framework. If the matching set isn't loaded in your context — i.e. the user installed only one of `@cometchat/skills` (web) or `@cometchat/skills-native` (RN) and the framework doesn't match — stop and tell them which package to install:
205
+ 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.
206
+
207
+ 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.
97
208
 
98
209
  **If `framework` is `expo` or `react-native` AND `cometchat-native-core` is NOT loaded:**
99
- > "This is a React Native / Expo project, but the React Native pattern
100
- > skills aren't installed in this workspace. Install them with:
101
- > ```
102
- > npx @cometchat/skills-native add
103
- > ```
104
- > then run `/cometchat` again."
210
+
211
+ ```bash
212
+ npx @cometchat/skills-native add
213
+ ```
105
214
 
106
215
  **If `framework` is `reactjs`, `nextjs`, `react-router`, or `astro` AND `cometchat-core` is NOT loaded:**
107
- > "This is a {framework} project, but the web pattern skills aren't
108
- > installed in this workspace. Install them with:
109
- > ```
110
- > npx @cometchat/skills add
111
- > ```
112
- > then run `/cometchat` again."
113
216
 
114
- To check, attempt to read `cometchat-core/SKILL.md` (web) or `cometchat-native-core/SKILL.md` (RN) from your loaded skills context. If the read fails, the package isn't installed.
217
+ ```bash
218
+ npx @cometchat/skills add
219
+ ```
220
+
221
+ **If `framework` is `angular` AND `cometchat-angular-core` is NOT loaded:**
222
+
223
+ ```bash
224
+ npx @cometchat/skills add --family angular
225
+ ```
226
+
227
+ **If `framework` is `android` AND neither `cometchat-android-v5-core` nor `cometchat-android-v6-core` is loaded:**
228
+
229
+ ```bash
230
+ npx @cometchat/skills add --family android
231
+ ```
232
+
233
+ This installs both V5 and V6 skill sets — the dispatcher's Step 4 routing picks the correct one based on `android_version`.
234
+
235
+ **If `framework` is `flutter` AND neither `cometchat-flutter-v5-core` nor `cometchat-flutter-v6-core` is loaded:**
236
+
237
+ ```bash
238
+ npx @cometchat/skills add --family flutter
239
+ ```
240
+
241
+ Same shape as Android — installs both V5 and V6 skill sets; routing picks the right one based on `flutter_version`.
115
242
 
116
- Do NOT attempt to write web UI Kit code into an RN project (CSS imports + `<a href>` + `document.*` will 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).
243
+ **If `framework` is `ios` AND `cometchat-ios-core` is NOT loaded:**
244
+
245
+ ```bash
246
+ npx @cometchat/skills add --family ios
247
+ ```
248
+
249
+ 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.
250
+
251
+ After the install completes, tell the user:
252
+
253
+ > "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."
254
+
255
+ **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.
256
+
257
+ **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:
258
+
259
+ | Dispatcher loaded from | Install command |
260
+ |---|---|
261
+ | `.claude/skills/cometchat/SKILL.md` (default) | `npx @cometchat/skills add` |
262
+ | `.agents/skills/cometchat/SKILL.md` (Replit / Cursor / Copilot / Cline / Codex) | `npx @cometchat/skills add --ide replit` |
263
+ | `.cursor/skills/cometchat/SKILL.md` (legacy Cursor path) | `npx @cometchat/skills add --ide cursor` |
264
+ | `.kiro/skills/cometchat/SKILL.md` | `npx @cometchat/skills add --ide kiro` |
265
+
266
+ 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.)
267
+
268
+ 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.
117
269
 
118
270
  ### Step 2 — Set up credentials (onboarding)
119
271
 
@@ -129,7 +281,7 @@ Otherwise check:
129
281
  npx @cometchat/skills-cli auth status --json
130
282
  ```
131
283
 
132
- If `status` is `"logged-in"`, skip to **Step 2c** (app selection).
284
+ If `status` is `"logged-in"`, skip to **Step 2b.5** (fetch dashboard profile).
133
285
 
134
286
  If `status` is `"logged-out"`, ask:
135
287
 
@@ -167,7 +319,7 @@ Terminal error handling (surface verbatim, stop, do not retry silently):
167
319
  - `NETWORK` — couldn't reach the auth host.
168
320
  - `ALREADY_AUTHENTICATED` — this session was already consumed. Re-run `auth login` to mint a fresh session.
169
321
 
170
- After success, verify via `auth status --json` and proceed to **Step 2c**.
322
+ After success, verify via `auth status --json` and proceed to **Step 2b.5**.
171
323
 
172
324
  #### Step 2b — Sign up (new account, browser flow)
173
325
 
@@ -179,7 +331,111 @@ Same polling flow as Step 2a, but the CLI opens the signup URL. The browser hand
179
331
 
180
332
  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.
181
333
 
182
- Error codes match Step 2a. After success, verify via `auth status --json` and proceed to **Step 2c**.
334
+ Error codes match Step 2a. After success, verify via `auth status --json` and proceed to **Step 2b.5**.
335
+
336
+ #### Step 2b.5 — Fetch the user's dashboard profile
337
+
338
+ 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:
339
+
340
+ - Greet the user by name in subsequent steps
341
+ - Skip the placement-intent question (Step 3a) when `meta.intent === "exploring"` (the user already told the dashboard they're just exploring)
342
+ - Tailor explanation depth by `meta.role` (frontend developer → UI examples; engineering manager → architecture trade-offs)
343
+
344
+ ```bash
345
+ npx @cometchat/skills-cli auth me --json
346
+ ```
347
+
348
+ Response shape:
349
+ ```json
350
+ {
351
+ "status": "logged-in",
352
+ "email": "you@example.com",
353
+ "name": "Your Name",
354
+ "role": "frontend",
355
+ "other_role": null,
356
+ "intent": "building",
357
+ "last_app": {
358
+ "id": "27xxxxx",
359
+ "name": "my-marketplace-chat",
360
+ "region": "us",
361
+ "industry": "online_marketplaces",
362
+ "technology": "react",
363
+ "product": "support"
364
+ }
365
+ }
366
+ ```
367
+
368
+ Field meanings (from the dashboard's signup screens — see `/Users/swapnil/Downloads/customer-dashboard-main/src/components/auth/Welcome/`):
369
+
370
+ - `role`: `"frontend"` / `"backend"` / `"fullstack_engineer"` / `"startup_founder"` / `"product_leader/manager"` / `"engineering_leader/manager"` / `"others"` (when `others`, `other_role` carries the freeform value)
371
+ - `intent`: `"building"` / `"evaluating"` / `"exploring"` (this is the **dashboard's** intent — distinct from Step 3a's `placement_intent` which asks about app archetype)
372
+ - `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.
373
+
374
+ **Store the response in working memory.** Reference these fields downstream:
375
+
376
+ - **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.
377
+ - **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).
378
+ - **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).
379
+ - **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").
380
+
381
+ **Failure modes — each is non-blocking; degrade to the original generic flow:**
382
+
383
+ - `status: "logged-out"` → bearer expired between Step 2a/b and now (rare). Re-run `auth login` and retry.
384
+ - `status: "auth-required"` → 401 from server. Same fix.
385
+ - `status: "error"` → network or unexpected. Skip silently, proceed to Step 2b.6 (will ask role + intent there).
386
+ - `name` is `null` → no greeting (don't ask, the dashboard will collect it on next browser visit).
387
+ - `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).
388
+ - `intent` is `null` → **ask in Step 2b.6**.
389
+ - `last_app` is `null` → ask region/industry normally in Step 2c.
390
+
391
+ After this step, proceed to **Step 2b.6**.
392
+
393
+ #### Step 2b.6 — Backfill role + intent if missing
394
+
395
+ The dashboard's `/choose-role` and `/choose-intent` screens collect two profile fields used to tailor the rest of the integration:
396
+
397
+ - `role` shapes the depth and angle of code explanations in Step 5
398
+ - `intent` decides whether Step 3a's placement question is needed (`exploring` short-circuits to a single screen)
399
+
400
+ 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.
401
+
402
+ 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.
403
+
404
+ **If `role === null`** — `AskUserQuestion`:
405
+ - **question:** "What's your role? (We'll tailor explanations to match.)"
406
+ - **header:** "Role"
407
+ - **multiSelect:** false
408
+ - **options** (label → store as `role` value):
409
+
410
+ | Label | `role` value |
411
+ |---|---|
412
+ | Frontend Developer | `frontend` |
413
+ | Backend Developer | `backend` |
414
+ | Fullstack Developer | `fullstack_engineer` |
415
+ | Founder | `startup_founder` |
416
+ | Product Manager | `product_leader/manager` |
417
+ | Engineering Manager | `engineering_leader/manager` |
418
+ | Other | `others` |
419
+
420
+ 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`).
421
+
422
+ **If `intent === null`** — `AskUserQuestion`:
423
+ - **question:** "What brings you to CometChat?"
424
+ - **header:** "Intent"
425
+ - **multiSelect:** false
426
+ - **options** (use the dashboard's exact wording):
427
+
428
+ | Label | Description shown under the label | `intent` value |
429
+ |---|---|---|
430
+ | I'm building | Integrating chat into my app now. | `building` |
431
+ | I'm evaluating | Comparing options for my team. | `evaluating` |
432
+ | I'm exploring | Just looking around for now. | `exploring` |
433
+
434
+ **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.
435
+
436
+ > **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.
437
+
438
+ After this step, proceed to **Step 2c**.
183
439
 
184
440
  #### Step 2c — Pick or create an app
185
441
 
@@ -205,7 +461,7 @@ This creates/updates the env file with the correct prefix AND writes `.cometchat
205
461
 
206
462
  **If no apps exist** (or user wants new), collect:
207
463
  1. App name — suggest `<project-name>-chat` from package.json `name`
208
- 2. Region — `AskUserQuestion`:
464
+ 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`:
209
465
  - **question:** "Which region for your CometChat app?"
210
466
  - **header:** "Region"
211
467
  - **options:** US (recommended), EU, India
@@ -216,7 +472,7 @@ This creates/updates the env file with the correct prefix AND writes `.cometchat
216
472
  | US | `us` |
217
473
  | EU | `eu` |
218
474
  | India | `in` |
219
- 3. Industry — `AskUserQuestion`:
475
+ 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`:
220
476
  - **options:** SaaS / Business, Marketplace, Social / Community, Other (or finer-grained from the table below)
221
477
 
222
478
  **Industry key mapping:**
@@ -258,6 +514,10 @@ Tell the user which env vars to set based on the detected framework:
258
514
  | astro | `.env` | `PUBLIC_COMETCHAT_APP_ID`, `PUBLIC_COMETCHAT_REGION`, `PUBLIC_COMETCHAT_AUTH_KEY` |
259
515
  | expo (managed + Expo Router) | `.env` | `EXPO_PUBLIC_COMETCHAT_APP_ID`, `EXPO_PUBLIC_COMETCHAT_REGION`, `EXPO_PUBLIC_COMETCHAT_AUTH_KEY` |
260
516
  | react-native (bare CLI) | `.env` | `COMETCHAT_APP_ID`, `COMETCHAT_REGION`, `COMETCHAT_AUTH_KEY` (paired with `react-native-dotenv`) |
517
+ | angular | `src/environments/environment.ts` | `cometchat: { appId, region, authKey }` (TypeScript object — Angular does NOT use `.env`) |
518
+ | 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`. |
519
+ | 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. |
520
+ | 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. |
261
521
 
262
522
  > "Grab your credentials from https://app.cometchat.com → Your App →
263
523
  > API & Auth Keys. Create the env file above and tell me when done."
@@ -275,6 +535,99 @@ module.exports = {
275
535
  ```
276
536
  Then `import { COMETCHAT_APP_ID, COMETCHAT_REGION, COMETCHAT_AUTH_KEY } from "@env";` in the provider.
277
537
 
538
+ **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:
539
+
540
+ 1. **`Secrets.swift` const enum** (preferred for local dev):
541
+ ```swift
542
+ // Secrets.swift (add to .gitignore)
543
+ enum Secrets {
544
+ static let cometchatAppID = "<APP_ID>"
545
+ static let cometchatRegion = "<REGION>"
546
+ static let cometchatAuthKey = "<AUTH_KEY>" // dev only
547
+ }
548
+ ```
549
+ Use as: `UIKitSettings().set(appID: Secrets.cometchatAppID).set(region: Secrets.cometchatRegion).set(authKey: Secrets.cometchatAuthKey).build()`.
550
+ 2. **`.xcconfig` Build Settings** (preferred for CI; secrets stay out of source files):
551
+ ```
552
+ // Secrets.xcconfig (add to .gitignore; reference from project Build Settings)
553
+ COMETCHAT_APP_ID = <APP_ID>
554
+ COMETCHAT_REGION = <REGION>
555
+ COMETCHAT_AUTH_KEY = <AUTH_KEY>
556
+ ```
557
+ Expose as Info.plist entries (`$(COMETCHAT_APP_ID)` etc.) and read via `Bundle.main.object(forInfoDictionaryKey: "COMETCHAT_APP_ID") as? String`.
558
+
559
+ Never read `.env` at runtime in iOS. The handoff `.env` exists only so the integration agent can find the values during initial setup.
560
+
561
+ **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:
562
+
563
+ 1. **Dart const file** (preferred for local dev, simpler):
564
+ ```dart
565
+ // lib/cometchat_config.dart (add to .gitignore)
566
+ class CometChatConfig {
567
+ static const String appId = '<APP_ID>';
568
+ static const String region = '<REGION>';
569
+ static const String authKey = '<AUTH_KEY>'; // dev only
570
+ }
571
+ ```
572
+ Then in `main.dart`:
573
+ ```dart
574
+ import 'cometchat_config.dart';
575
+ final settings = (UIKitSettingsBuilder()
576
+ ..appId = CometChatConfig.appId
577
+ ..region = CometChatConfig.region
578
+ ..authKey = CometChatConfig.authKey
579
+ ..subscriptionType = CometChatSubscriptionType.allUsers)
580
+ .build();
581
+ ```
582
+ 2. **`--dart-define` flags** (preferred for CI; secrets never hit the repo):
583
+ ```dart
584
+ const appId = String.fromEnvironment('COMETCHAT_APP_ID');
585
+ const region = String.fromEnvironment('COMETCHAT_REGION');
586
+ const authKey = String.fromEnvironment('COMETCHAT_AUTH_KEY');
587
+ ```
588
+ Run with `flutter run --dart-define=COMETCHAT_APP_ID=... --dart-define=COMETCHAT_REGION=... --dart-define=COMETCHAT_AUTH_KEY=...`.
589
+
590
+ Never read `.env` at runtime in Flutter. The handoff `.env` exists only so the integration agent can find the values during initial setup.
591
+
592
+ **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:
593
+
594
+ 1. `local.properties` (project root, gitignored):
595
+ ```
596
+ cometchat.appId=<APP_ID>
597
+ cometchat.region=<REGION>
598
+ cometchat.authKey=<AUTH_KEY> # dev only — omit / use auth tokens in production
599
+ ```
600
+ 2. `app/build.gradle` (or `.kts`) — read those properties and surface them via `buildConfigField`:
601
+ ```groovy
602
+ def localProps = new Properties()
603
+ def localPropsFile = rootProject.file('local.properties')
604
+ if (localPropsFile.exists()) localProps.load(new FileInputStream(localPropsFile))
605
+
606
+ android {
607
+ defaultConfig {
608
+ buildConfigField "String", "COMETCHAT_APP_ID", "\"${localProps['cometchat.appId'] ?: ''}\""
609
+ buildConfigField "String", "COMETCHAT_REGION", "\"${localProps['cometchat.region'] ?: ''}\""
610
+ buildConfigField "String", "COMETCHAT_AUTH_KEY", "\"${localProps['cometchat.authKey'] ?: ''}\""
611
+ }
612
+ buildFeatures { buildConfig true }
613
+ }
614
+ ```
615
+ 3. Application code reads `BuildConfig.COMETCHAT_APP_ID` etc. — never hardcoded strings, never read from `.env` at runtime.
616
+
617
+ **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:
618
+ ```typescript
619
+ // src/environments/environment.ts
620
+ export const environment = {
621
+ production: false,
622
+ cometchat: {
623
+ appId: "<APP_ID>",
624
+ region: "<REGION>",
625
+ authKey: "<AUTH_KEY>", // dev only — omit from environment.prod.ts
626
+ },
627
+ };
628
+ ```
629
+ 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.
630
+
278
631
  After they confirm, verify:
279
632
  ```bash
280
633
  npx @cometchat/skills-cli config init --json
@@ -292,6 +645,8 @@ This is the core of v3. A multi-step conversation that gathers everything you ne
292
645
 
293
646
  If config has `intent` set, confirm it and move on.
294
647
 
648
+ **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."
649
+
295
650
  Otherwise, use `AskUserQuestion`:
296
651
  - **question:** "What kind of app are you building?"
297
652
  - **header:** "Your app"
@@ -308,29 +663,46 @@ Otherwise, use `AskUserQuestion`:
308
663
 
309
664
  #### 3b. Show what you recommend and why
310
665
 
311
- The recommendation table differs by family because the placement vocabulary is different (web has routes/drawers/widgets; RN has screens/tabs/sheets):
666
+ This is the second wow moment after the detection summary. Don't just list a placement **tell the user why**. Two sentences of reasoning earn confidence; a table alone reads like a lookup.
667
+
668
+ The recommendation has two layers:
669
+
670
+ 1. **The placement** — what you'll set up (route / drawer / modal / tab / widget)
671
+ 2. **The reason** — why this fits the user's archetype (one or two sentences grounded in how their kind of app actually works)
672
+
673
+ When you write your response, lead with the reason, then the concrete placement, then offer to override:
674
+
675
+ > **For a marketplace app, I'd put a "Chat with seller" drawer on your product page + an inbox at `/messages`.**
676
+ >
677
+ > The drawer keeps buyers in the buying flow — they can ask a question without losing the listing. The inbox is for going back to past conversations. Two surfaces, one integration.
678
+ >
679
+ > Sound right, or want to try a different shape?
680
+
681
+ That's the shape. The recommendation tables below are the *what*; the reasoning column is the *why* you should narrate.
312
682
 
313
683
  **Web family (reactjs, nextjs, react-router, astro):**
314
684
 
315
- | Intent | What you'll set up |
316
- |---|---|
317
- | **Messaging app** | A dedicated messages page at a route you choose. Two-pane: conversation list + active chat. |
318
- | **Marketplace** | A "Chat with seller" drawer on your product page + an inbox page at /messages. |
319
- | **SaaS / dashboard** | A chat modal triggered from your navbar + a full messages page. |
320
- | **Social / community** | A full messenger page with tabs: Chats, Calls, Users, Groups. |
321
- | **Support** | A floating widget bubble in the bottom-right corner. |
685
+ | Intent | Placement | Why |
686
+ |---|---|---|
687
+ | **Messaging app** | Dedicated messages page (route you pick), two-pane: conversation list + active chat | Chat IS the product. Users land directly on it; the route is the home of your app. |
688
+ | **Marketplace** | "Chat with seller" drawer on the product page + inbox at `/messages` | Drawer keeps buyers in the buying flow; the inbox handles "go back to a past conversation." |
689
+ | **SaaS / dashboard** | Modal triggered from your navbar + full messages page | Modal feels lightweight (chat without leaving your work); the page is for serious conversations. |
690
+ | **Social / community** | Full messenger page with tabs: Chats, Calls, Users, Groups | Discovery matters as much as messaging — users want to find people, not just their existing threads. |
691
+ | **Support** | Floating widget bubble in the bottom-right | One-way customer-to-team — minimal cognitive load on the customer; your team triages from the dashboard. |
322
692
 
323
693
  **React Native family (expo, react-native):**
324
694
 
325
- | Intent | What you'll set up |
326
- |---|---|
327
- | **Messaging app** | A dedicated "Messages" bottom tab. Conversations listtap a conversation message thread. |
328
- | **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. |
329
- | **SaaS / productivity** | A "Chat" stack screen accessible from the nav or a header button. Optionally a bottom sheet for quick replies. |
330
- | **Social / community** | A "Messages" bottom tab with conversations list + message thread. Plus a "Message" button on user profile screens that opens a modal. |
331
- | **Support** | A modal triggered from a "Help" or "Support" button in the header or settings. |
695
+ | Intent | Placement | Why |
696
+ |---|---|---|
697
+ | **Messaging app** | Dedicated "Messages" bottom tab conversationsthread | Mobile users expect chat as a first-class destination; a tab puts it one tap away. |
698
+ | **Marketplace** | "Chat with seller" button on the product screen modal thread + Inbox stack screen | Modal preserves the buying context; the Inbox is the "back to a conversation" entry point. |
699
+ | **SaaS / productivity** | "Chat" stack screen accessible from nav, optionally bottom sheet for quick replies | Stack screen for focused conversations; bottom sheet for fast back-and-forth without leaving your current work. |
700
+ | **Social / community** | "Messages" bottom tab + "Message" button on profile screens → modal thread | Tab handles discovery; per-profile button is the "I want to talk to THIS person" path. |
701
+ | **Support** | Modal triggered from a "Help" or "Support" button in header/settings | Lightweight, doesn't compete with your product's primary tabs. |
332
702
 
333
- When explaining, reference the ASCII diagrams from `cometchat-placement` (web) or `cometchat-native-placement` (RN) so the user can visualize.
703
+ When explaining, reference the ASCII diagrams from `cometchat-placement` (web) or `cometchat-native-placement` (RN) so the user can visualize the shape.
704
+
705
+ **One sentence to hand them control:** end the recommendation with "Sound right, or want to try a different shape?" — never "Which would you like?" The first phrasing implies you've thought it through and they can override; the second implies you're just collecting answers.
334
706
 
335
707
  Ask: "Does this sound right, or do you want a different approach?" Let them override.
336
708
 
@@ -452,60 +824,132 @@ If the user has auth AND wants to set up production mode now:
452
824
 
453
825
  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.
454
826
 
455
- #### 3f. Confirm the plan
827
+ #### 3f. Confirm the plan — the third wow moment
828
+
829
+ **This is the trust contract. Show EXACTLY what you'll do BEFORE doing it.** Three sections, in this order:
830
+
831
+ 1. **Files I'll create** — new files, with a one-line purpose for each
832
+ 2. **Files I'll modify** — existing files, with the specific edit (not "wrap with provider" alone — say "wrap the children of `<Layout>` with `<CometChatProvider>` at line ~14")
833
+ 3. **Files I won't touch** — call out the load-bearing files that stay untouched (auth config, route definitions outside the chat surface, your existing components). This is the reassurance.
834
+
835
+ Then dependencies + auth mode + an approval line that hands the user control.
836
+
837
+ The shape (use it verbatim — three sections + reassurance):
838
+
839
+ > Here's the plan:
840
+ >
841
+ > **Files I'll create**
842
+ > - `cometchat/CometChatProvider.tsx` — wraps the kit's auth + theme providers, gates render on login
843
+ > - `cometchat/init.ts` — module-level CometChat.init + login, called from the provider
844
+ > - `app/messages/page.tsx` — full-page messages route (your inbox)
845
+ > - `app/components/ChatDrawer.tsx` — the "chat with seller" drawer for product pages
846
+ > - `.env.local` — your CometChat App ID + Region + Auth Key (gitignored)
847
+ >
848
+ > **Files I'll modify**
849
+ > - `app/layout.tsx` — wrap `{children}` with `<CometChatProvider>` (one line, around line 14)
850
+ > - `app/products/[id]/page.tsx` — add the `<ChatDrawer />` trigger button next to the seller info (your existing layout stays)
851
+ > - `app/components/Navbar.tsx` — add a `<Link href="/messages">Messages</Link>` next to your existing nav items
852
+ >
853
+ > **Files I won't touch**
854
+ > - `auth.config.ts` — your NextAuth setup stays as-is; we'll wire CometChat to it in production-auth mode later
855
+ > - `tailwind.config.ts`, `globals.css` — no styling changes outside `cometchat/`
856
+ > - Anything under `app/products/`, `app/cart/`, etc. — your existing routes are untouched
857
+ >
858
+ > **Dependencies**
859
+ > `@cometchat/chat-sdk-javascript`, `@cometchat/chat-uikit-react`
860
+ >
861
+ > **Auth mode** Development (Auth Key for now; production auth is a one-flag upgrade later)
862
+ >
863
+ > **Estimated time** ~30 seconds to write the code, ~1 minute for `npm install` to finish.
864
+ >
865
+ > If anything looks off, just tell me what to change. Otherwise, say "go" and I'll write it.
866
+
867
+ **The rules for this moment:**
456
868
 
457
- **This is critical. Show EXACTLY what you'll do before doing it.** The plan format differs by framework.
869
+ 1. **Be specific in the modify section.** "Wrap with provider" is vague. "Wrap `{children}` with `<CometChatProvider>` at line ~14" tells the user exactly what to expect when they git-diff later.
870
+ 2. **List the don't-touch files explicitly.** Users worry about agents stomping their auth config, their tailwind, their routes. Naming what stays untouched defuses that worry up front.
871
+ 3. **Estimated time matters.** Two short numbers — a few seconds to write code, a couple minutes for `npm install`. Sets expectations; reduces "is it stuck?" mid-flow.
872
+ 4. **End with a hand-off, not a yes/no.** "Say 'go' and I'll write it. Or tell me what to change." Beats "Proceed? [y/n]" — it implies the user can adjust without throwing the whole plan away.
873
+ 5. **Never abbreviate the plan in subsequent runs.** Every integration deserves a fresh, full plan. If the user has been through this before, they can skim — but don't pre-skim for them.
458
874
 
459
- **Web example (Next.js, marketplace):**
460
- > "Here's what I'll create:
875
+ **Web example (Next.js + NextAuth, marketplace):** see the shape above.
876
+
877
+ **Web example (Vite + React, greenfield messaging app):**
878
+
879
+ > Here's the plan:
880
+ >
881
+ > **Files I'll create**
882
+ > - `src/cometchat/CometChatProvider.tsx` — wraps the kit's providers, gates render on login
883
+ > - `src/cometchat/init.ts` — `CometChat.init` + `CometChat.login` (with `cometchat-uid-1` for dev)
884
+ > - `src/components/ChatScreen.tsx` — your full-page chat surface (conversations + messages)
885
+ > - `.env` — your CometChat App ID + Region + Auth Key (gitignored)
886
+ >
887
+ > **Files I'll modify**
888
+ > - `src/main.tsx` — wrap `<App />` with `<CometChatProvider>` (line ~10)
889
+ > - `src/App.tsx` — render `<ChatScreen />` instead of the Vite default (you can move it to a route later)
890
+ >
891
+ > **Files I won't touch**
892
+ > - `vite.config.ts`, `tsconfig.*` — no build config changes
893
+ > - `src/index.css`, `src/App.css` — kit ships its own CSS; your styles stay
461
894
  >
462
- > **New files:**
463
- > - `app/providers/CometChatProvider.tsx`
464
- > - `app/messages/page.tsx`
465
- > - `app/components/ChatDrawer.tsx`
466
- > - `.env.local`
895
+ > **Dependencies** `@cometchat/chat-sdk-javascript`, `@cometchat/chat-uikit-react`
467
896
  >
468
- > **Files I'll modify:**
469
- > - `app/products/[id]/page.tsx` — add ChatDrawer trigger
470
- > - `app/layout.tsx` — wrap with CometChatProvider
471
- > - `app/components/Navbar.tsx` — add 'Messages' link
897
+ > **Auth mode** Development (Auth Key + `cometchat-uid-1`; you can log in as `cometchat-uid-1`–`uid-5` to chat with yourself across browser windows)
472
898
  >
473
- > **Dependencies:** @cometchat/chat-sdk-javascript, @cometchat/chat-uikit-react
899
+ > **Estimated time** ~30 seconds to write, ~1 minute for `npm install`.
474
900
  >
475
- > **Auth mode:** Development (Auth Key).
476
- > Proceed? [y/n]"
901
+ > Say "go" or tell me what to change.
477
902
 
478
903
  **RN example (Expo Router, messaging):**
479
- > "Here's what I'll create:
480
- >
481
- > **New files:**
482
- > - `providers/CometChatProvider.tsx`
483
- > - `app/(tabs)/messages.tsx`
484
- > - `.env`
485
- >
486
- > **Files I'll modify:**
487
- > - `app/_layout.tsx` — wrap with the four-wrapper chain
488
- > - `app/(tabs)/_layout.tsx` — add the Messages tab
489
- > - `index.js` — `import 'react-native-gesture-handler'` at line 1 (if missing)
490
- >
491
- > **Dependencies (via `npx expo install`):**
492
- > @cometchat/chat-uikit-react-native, @cometchat/chat-sdk-react-native,
493
- > react-native-gesture-handler, react-native-reanimated,
494
- > react-native-safe-area-context, react-native-screens,
495
- > @react-native-async-storage/async-storage, @react-native-community/netinfo,
496
- > react-native-video, react-native-image-picker, react-native-document-picker,
497
- > react-native-vector-icons, react-native-fs
498
- >
499
- > **Auth mode:** Development (Auth Key).
500
- > Proceed? [y/n]"
501
-
502
- **Bare RN variant** same as Expo, except `npm install` instead of `npx expo install`, plus:
503
- - Run `cd ios && pod install`
504
- - Patch `ios/<Name>/Info.plist`, `android/app/src/main/AndroidManifest.xml` for permissions
904
+
905
+ > Here's the plan:
906
+ >
907
+ > **Files I'll create**
908
+ > - `cometchat/CometChatProvider.tsx` — four-wrapper chain (gesture handler → safe area → theme → CometChat)
909
+ > - `cometchat/init.ts` — init + login, module-level guard
910
+ > - `app/(tabs)/messages.tsx` — your Messages tab
911
+ > - `.env` — `EXPO_PUBLIC_COMETCHAT_APP_ID` + region + auth key
912
+ >
913
+ > **Files I'll modify**
914
+ > - `app/_layout.tsx` — wrap with the four-wrapper chain (line ~10)
915
+ > - `app/(tabs)/_layout.tsx` — add the Messages tab as the third entry, after Home and Profile
916
+ > - `index.js` `import 'react-native-gesture-handler'` at line 1 (mandatory; without it release builds break silently)
917
+ >
918
+ > **Files I won't touch**
919
+ > - `app.json` — no Expo config changes for dev mode (production push needs them, but that's later)
920
+ > - Your existing `app/(tabs)/index.tsx`, `profile.tsx` — stay as-is
921
+ >
922
+ > **Dependencies (via `npx expo install`)**
923
+ > `@cometchat/chat-uikit-react-native`, `@cometchat/chat-sdk-react-native`, `react-native-gesture-handler`, `react-native-reanimated`, `react-native-safe-area-context`, `react-native-screens`, `@react-native-async-storage/async-storage`, `@react-native-community/netinfo`, `react-native-video`, `react-native-image-picker`, `react-native-document-picker`, `react-native-vector-icons`, `react-native-fs`
924
+ >
925
+ > **Auth mode** Development (Auth Key).
926
+ >
927
+ > **Estimated time** ~30 seconds to write, ~3 minutes for `expo install` (RN deps are heavier).
928
+ >
929
+ > Say "go" or tell me what to change.
930
+
931
+ **Bare RN variant** — same as Expo, except:
932
+ - `npm install` instead of `npx expo install`
933
+ - Run `cd ios && pod install` (~1-2 min extra)
934
+ - Patch `ios/<Name>/Info.plist`, `android/app/src/main/AndroidManifest.xml` for camera/mic permissions
505
935
  - Add `ios/<Name>/PrivacyInfo.xcprivacy` (Apple Privacy Manifest)
506
936
  - Patch `android/build.gradle` for the async-storage Maven repo (v3+)
507
937
 
508
- Wait for explicit confirmation. If the user says no or wants changes, go back to the relevant question and re-ask.
938
+ Surface these in the "Files I'll modify" section so the user knows they're coming.
939
+
940
+ **After approval — the writing moment:**
941
+
942
+ When the user says "go", narrate progress as you work. Don't be silent for 30 seconds while you write 5 files. Brief structured updates, one per beat:
943
+
944
+ > ✓ Created `cometchat/CometChatProvider.tsx`
945
+ > ✓ Created `cometchat/init.ts`
946
+ > ✓ Modified `src/main.tsx` (wrapped App with provider)
947
+ > ✓ Wrote `.env` (Auth Key hidden)
948
+ > Installing dependencies (this takes ~1 minute)...
949
+
950
+ The structured beats make the writing feel like a contract being executed, not a black box churning.
951
+
952
+ **If the user says no or wants changes:** go back to the relevant question and re-ask. Don't try to negotiate the plan in-line — the plan is atomic. Adjust the source decision, then regenerate the plan.
509
953
 
510
954
  ### Step 4 — Reference pattern skills
511
955
 
@@ -529,6 +973,68 @@ Wait for explicit confirmation. If the user says no or wants changes, go back to
529
973
  - `react-native` (bare CLI) → `cometchat-native-bare-patterns`
530
974
  4. `cometchat-native-placement` — placement pattern (stack/tab/modal/bottom-sheet/embed)
531
975
 
976
+ **For Angular:**
977
+ 1. `cometchat-angular-core` — init via `UIKitSettingsBuilder`, `APP_INITIALIZER` pattern, `CUSTOM_ELEMENTS_SCHEMA`, env config in `environment.ts`, login order, anti-patterns
978
+ 2. `cometchat-angular-components` — component catalog (kebab-case selectors, `[input]` callbacks vs `(output)` events, content-projection slots, NgModule imports)
979
+ 3. `angular` → `cometchat-angular-patterns` — module organization, lazy-loading the chat module, environment file editing, providers
980
+ 4. `cometchat-angular-placement` — placement pattern (route, modal, drawer, embedded panel)
981
+
982
+ **For Android — branches by `android_version`:**
983
+
984
+ If `android_version === "v5"`:
985
+ 1. `cometchat-android-v5-core` — Gradle deps, `UIKitSettings.UIKitSettingsBuilder`, `CometChatUIKit.init()` in `Application.onCreate()`, login, theme requirements (`CometChatTheme.DayNight` → Material 2 parent)
986
+ 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)
987
+ 3. `cometchat-android-v5-placement` — Activity, Fragment, BottomSheet placement, navigation
988
+ 4. `cometchat-android-v5-customization` — `CometChatTextFormatter`, message templates, `CometChatMessageEvents.addListener`, DataSource decorators
989
+ 5. `cometchat-android-v5-extensions` — registrar (`PollsExtension`, `StickerExtension`, `SmartRepliesExtension` extending `ExtensionsDataSource`) vs decorator pattern; never construct decorators directly
990
+
991
+ If `android_version === "v6"`, additionally branch by UI stack (Compose vs Kotlin Views — ask the user if both are present):
992
+ 1. `cometchat-android-v6-core` — Gradle deps for `chatuikit-{compose,kotlin}-android:6.x` + `chatuikit-core`, init, login, message sending
993
+ 2. `cometchat-android-v6-events` — `CometChatEvents` SharedFlows + sealed event classes
994
+ 3. **Compose stack** → `cometchat-android-v6-compose-{components,placement,theming,customization}` — Composables, `CometChatTheme { ... }`, `BubbleFactory`, slot lambdas
995
+ 4. **Kotlin Views stack** → `cometchat-android-v6-kotlin-{components,placement,theming,customization}` — custom View classes, `setOnItemClick`, `BubbleFactory` abstract class, `setBubbleFactories`
996
+ 5. `cometchat-android-v6-builder-settings` — `UIKitSettingsBuilder` knobs (calling, presence, etc.)
997
+
998
+ Both V5 and V6 share `cometchat-android-{v5,v6}-{features,extensions,push,production,testing,troubleshooting}` for cross-cutting concerns.
999
+
1000
+ **For Flutter — branches by `flutter_version`:**
1001
+
1002
+ If `flutter_version === "v5"`:
1003
+ 1. `cometchat-flutter-v5-core` — pubspec deps, `UIKitSettings.UIKitSettingsBuilder`, `CometChatUIKit.init()`, login, GetX-based controller pattern, `subscriptionType` requirement, theme caching rule, listener lifecycle
1004
+ 2. `cometchat-flutter-v5-conversations` / `-messages` / `-users-groups` / `-calls` — widget-by-widget catalog (V5 splits its component catalog across these four skills)
1005
+ 3. `cometchat-flutter-v5-theming` — `CometChatThemeHelper`, `CometChatColorPalette`, `CometChatSpacing`, `CometChatTypography`, dark mode
1006
+ 4. `cometchat-flutter-v5-customization` — `DataSource`, `DataSourceDecorator`, `CometChatMessageTemplate`, `CometChatTextFormatter`, slot views
1007
+ 5. `cometchat-flutter-v5-events` — `CometChatMessageEvents.addListener`, `CometChatGroupEvents`, `CometChatUserEvents`, `CometChatCallEvents`, `CometChatUIEvents`
1008
+ 6. `cometchat-flutter-v5-push` — FCM/APNs/VoIP setup; `CometChatNotifications.registerPushToken()` is the public surface (sample-app `PNRegistry` is a wrapper users copy)
1009
+ 7. `cometchat-flutter-v5-production` — server-minted auth tokens, ProGuard, release builds
1010
+ 8. `cometchat-flutter-v5-troubleshooting` — pubspec resolution, GetX errors, runtime crashes
1011
+
1012
+ If `flutter_version === "v6"`:
1013
+ 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`.
1014
+ 2. `cometchat-flutter-v6-components` — full Bloc-driven widget catalog
1015
+ 3. `cometchat-flutter-v6-conversations` / `-messages` / `-users-groups` / `-calls` — per-widget deep dives
1016
+ 4. `cometchat-flutter-v6-features` — feature catalog
1017
+ 5. `cometchat-flutter-v6-placement` — route, modal sheet, embedded widget — where chat lives in the app
1018
+ 6. `cometchat-flutter-v6-theming` — `CometChatThemeHelper`, `CometChatColorPalette` (V6 names), `CometChatThemeMode`
1019
+ 7. `cometchat-flutter-v6-customization` — `BubbleFactory<T>`, `CometChatMessageTemplate`, text formatters, slot widgets
1020
+ 8. `cometchat-flutter-v6-events` — Bloc-based event streams, listener registration
1021
+ 9. `cometchat-flutter-v6-production` — server-minted auth tokens, ProGuard
1022
+ 10. `cometchat-flutter-v6-troubleshooting` — pubspec, Bloc, theme cache
1023
+
1024
+ 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).
1025
+
1026
+ **For iOS — single cohort (V5 only today):**
1027
+
1028
+ 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
1029
+ 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).
1030
+ 3. `cometchat-ios-placement` — Navigation controller, modal, tab bar, embedded view — where chat lives. Mixed SwiftUI + UIKit hosting via `UIViewControllerRepresentable`.
1031
+ 4. `cometchat-ios-customization` — Custom message templates, text formatters, DataSource/Decorator pattern, custom views.
1032
+ 5. `cometchat-ios-theming` — `CometChatTheme` color tokens, `CometChatTypography.setFont(name:)`, dark mode.
1033
+ 6. `cometchat-ios-features` — Feature catalog: calls, polls, reactions, AI, extensions.
1034
+ 7. `cometchat-ios-production` — Server-minted auth tokens, user management.
1035
+ 8. `cometchat-ios-push` — APNs + VoIP, CallKit integration, token lifecycle.
1036
+ 9. `cometchat-ios-troubleshooting` — SPM/CocoaPods errors, Xcode build issues, Info.plist gotchas, runtime crashes.
1037
+
532
1038
  ### Step 5 — Write the integration
533
1039
 
534
1040
  Execute the confirmed plan. The order of operations is the same for every framework, but the file names + provider shape differ.
@@ -591,11 +1097,63 @@ Execute the confirmed plan. The order of operations is the same for every framew
591
1097
  9. **Native config (bare RN only):**
592
1098
  - `ios/<Name>/Info.plist` — add `NSCameraUsageDescription`, `NSPhotoLibraryUsageDescription`, `NSMicrophoneUsageDescription`
593
1099
  - `android/app/src/main/AndroidManifest.xml` — add `CAMERA`, `RECORD_AUDIO`, `READ_MEDIA_IMAGES`, `READ_EXTERNAL_STORAGE` permissions
594
- - `ios/<Name>/PrivacyInfo.xcprivacy` — add the 4 required API codes (C617.1, CA92.1, 35F9.1, E174.1). See `cometchat-native-bare-patterns`.
1100
+ - `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`.
595
1101
  - `android/build.gradle` — async-storage Maven repo if v3+
596
1102
 
597
1103
  **Expo managed** — all of this goes in `app.json` under `plugins` and `ios.infoPlist` / `android.permissions`. See `cometchat-native-expo-patterns`.
598
1104
 
1105
+ **iOS — common steps:**
1106
+
1107
+ 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`.
1108
+ 2. **Add the kit dep:**
1109
+ - **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).
1110
+ - **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.
1111
+ 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).**
1112
+ 4. **Login order** — `CometChatUIKit.login(uid:)` (dev) or `.login(authToken:)` (production). The login callback uses `.success` / `.onError` cases (NOT Swift's standard `Result.failure`).
1113
+ 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.
1114
+ 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).
1115
+ 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.
1116
+
1117
+ **Flutter — common steps:**
1118
+
1119
+ 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.
1120
+ 2. **Add the cometchat dep** to `pubspec.yaml` and run `flutter pub get`:
1121
+ - 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/`.
1122
+ - V6: `cometchat_chat_uikit: ^6.0.0-beta2` (single package — calls fold in).
1123
+ 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';`.
1124
+ 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.
1125
+ 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.
1126
+ 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).
1127
+ 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.
1128
+
1129
+ **Android — common steps:**
1130
+
1131
+ 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).
1132
+ 2. **Add the cometchat dep** to `app/build.gradle` (or `.kts`):
1133
+ - V5: `implementation 'com.cometchat:chat-uikit-android:5.+'`
1134
+ - V6 Compose: `implementation 'com.cometchat:chatuikit-compose-android:6.+'` (plus `compose-bom` if not already present)
1135
+ - V6 Kotlin Views: `implementation 'com.cometchat:chatuikit-kotlin-android:6.+'`
1136
+ - Both V6 stacks: add both `chatuikit-compose-android` AND `chatuikit-kotlin-android` (plus `chatuikit-core` if the kit splits it out)
1137
+ 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.
1138
+ 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" …>`.
1139
+ 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.
1140
+ 6. **AndroidManifest permissions** — `INTERNET` is mandatory; for calls add `RECORD_AUDIO`, `CAMERA`, `MODIFY_AUDIO_SETTINGS`, `BLUETOOTH_CONNECT` (API 31+).
1141
+ 7. **ProGuard/R8** — for release builds, add `-keep class com.cometchat.** { *; }` to `proguard-rules.pro` to prevent stripping.
1142
+ 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.
1143
+
1144
+ **Angular — common steps:**
1145
+
1146
+ 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`).
1147
+ 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-...'`.
1148
+ 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.
1149
+ 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.
1150
+ 5. **Wire chat into existing project** — READ each file before modifying. Add the route, nav link, modal trigger.
1151
+ 6. **Theming** — inject `CometChatThemeService` to control palette/typography. See `cometchat-angular-theming`.
1152
+ 7. **Install dependencies:**
1153
+ ```bash
1154
+ npm install @cometchat/chat-uikit-angular @cometchat/chat-sdk-javascript
1155
+ ```
1156
+
599
1157
  #### Step 5 — common to ALL frameworks
600
1158
 
601
1159
  After the framework-specific work above, every integration ends the same way:
@@ -645,7 +1203,15 @@ Run a TypeScript check to verify the code compiles:
645
1203
  npx tsc --noEmit
646
1204
  ```
647
1205
 
648
- **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` instead.
1206
+ **Angular projects:** prefer `npx ng build --configuration development` (Angular's compiler validates templates, NgModule shape, and DI graph `tsc` alone misses template type errors).
1207
+
1208
+ **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.
1209
+
1210
+ **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.
1211
+
1212
+ **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.
1213
+
1214
+ **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.
649
1215
 
650
1216
  **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.
651
1217
 
@@ -658,7 +1224,7 @@ Surface any common issues:
658
1224
  **RN:**
659
1225
  - `Cannot find module '@cometchat/chat-uikit-react-native'` → install didn't complete
660
1226
  - `JSX element 'GestureHandlerRootView' has no corresponding closing tag` → wrapper chain partially applied
661
- - `Property 'hideReplyInThreadOption' does not exist on type '...'` → v3 types installed; user needs v5 (`^5.0.0`)
1227
+ - `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)
662
1228
 
663
1229
  Then:
664
1230
 
@@ -669,11 +1235,12 @@ Then:
669
1235
  > - Provider + CSS wired ✓
670
1236
  > - Dependencies installed ✓
671
1237
  >
672
- > Run `npm run dev` and open the app:
1238
+ > Run `npm run dev` (or `ng serve` for Angular) and open the app:
673
1239
  > - **Vite (reactjs)**: http://localhost:5173
674
1240
  > - **Next.js**: http://localhost:3000/chat
675
1241
  > - **React Router v7**: http://localhost:5173/chat
676
- > - **Astro**: http://localhost:4321/chat"
1242
+ > - **Astro**: http://localhost:4321/chat
1243
+ > - **Angular**: http://localhost:4200"
677
1244
 
678
1245
  **RN result message:**
679
1246
  > "CometChat is integrated! Here's what was set up:
@@ -694,28 +1261,30 @@ Then:
694
1261
  > 1. `npm start -- --reset-cache`
695
1262
  > 2. In another terminal: `npm run ios` or `npm run android`"
696
1263
 
697
- **Common ending — empty conversation list explanation (every framework):**
1264
+ **Common ending — what you'll see on first load (every framework):**
698
1265
 
699
1266
  > ---
700
1267
  >
701
- > **About the empty conversation list you'll see:**
1268
+ > **Pre-seeded test data chat works immediately, no dashboard setup needed:**
702
1269
  >
703
- > Every CometChat app ships with **5 pre-created test users**:
704
- > `cometchat-uid-1` through `cometchat-uid-5`. Your integration is
705
- > logged in as `cometchat-uid-1` by default, and a brand-new app has
706
- > no messages yet so the conversation list will be empty when you
707
- > first load the page. **This is normal, not a bug.**
1270
+ > Every CometChat app ships with **5 pre-created test users**
1271
+ > (`cometchat-uid-1` through `cometchat-uid-5`), a **"Hello" test group**,
1272
+ > and **sample messages between them**. Your integration is logged in
1273
+ > as `cometchat-uid-1` by default, so on first load the conversation
1274
+ > list is already populated you'll see existing 1:1 threads and the
1275
+ > test group with message history. Open any conversation and reply;
1276
+ > round-trip is ~50ms. Receipts, typing indicators, presence, and
1277
+ > reactions all work out of the box.
708
1278
  >
709
- > **To see chat actually working** (60 seconds, no code changes):
710
- > 1. Open `https://app.cometchat.com` your app **Users** tab
711
- > 2. Click `cometchat-uid-2` → **Send Message** button
712
- > 3. Pick `cometchat-uid-1` as the recipient, type "hello", send
713
- > 4. Refresh the dev URL (web) or reload the app (RN: shake → Reload, or press `r` in Metro)
714
- > 5. A conversation will appear — open it to see the message and reply
1279
+ > **Want to see real-time delivery between two users?** Open the
1280
+ > integration in two browser windows (or two simulators on RN), and
1281
+ > temporarily change the login UID in your provider — `cometchat-uid-2`
1282
+ > in one window, `cometchat-uid-1` in the other. Messages from one
1283
+ > arrive live in the other without refresh.
715
1284
  >
716
- > The 5 test users (`cometchat-uid-1` through `uid-5`) can also chat
717
- > with each other from the dashboard, so you can seed multiple
718
- > conversations the same way.
1285
+ > The dashboard at `https://app.cometchat.com` is useful later for
1286
+ > creating real users, configuring extensions, and viewing analytics
1287
+ > but you don't need it to confirm the integration is working.
719
1288
  >
720
1289
  > What would you like to do next?"
721
1290
 
@@ -755,7 +1324,16 @@ Use `AskUserQuestion`. The option set differs by family — RN has two extra opt
755
1324
 
756
1325
  For **theme customization**: read the framework-appropriate theming skill and write the customization code.
757
1326
 
758
- For **adding features**: read the framework-appropriate features skill. Features fall into buckets (Default, Dashboard-toggle, Package-install, Component-swap). Ask which feature, then follow the right bucket's recipe.
1327
+ For **adding features**: read the framework-appropriate features skill. Features fall into six buckets:
1328
+
1329
+ - **default** — already enabled by the UI Kit, no action needed.
1330
+ - **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.
1331
+ - **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.
1332
+ - **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.
1333
+ - **package-install** — calls. Run `npm install @cometchat/calls-sdk-javascript` (or the framework's calls SDK).
1334
+ - **component-swap** — `rich-text-formatting`. Run `cometchat apply-feature rich-text-formatting`.
1335
+
1336
+ 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.
759
1337
 
760
1338
  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.
761
1339
 
@@ -806,6 +1384,61 @@ The iteration loop is the whole point of Phase B. Re-rendering the canonical men
806
1384
  - **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.
807
1385
  - **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.
808
1386
 
1387
+ ### Angular only
1388
+
1389
+ - **`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`.
1390
+ - **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.
1391
+ - **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.
1392
+ - **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.
1393
+ - **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.
1394
+ - **`[messagesRequestBuilder]` is plural.** `[messageRequestBuilder]` (singular) on `<cometchat-message-list>` silently no-ops — the input doesn't exist.
1395
+ - **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.
1396
+ - **`CometChatThemeService` is the v4 theme entry point**, NOT the legacy v3 `CometChatTheme` class. Inject the service; access `themeService.theme` for palette/typography control.
1397
+
1398
+ ### Android only
1399
+
1400
+ - **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.
1401
+ - **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.
1402
+ - **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.
1403
+ - **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.
1404
+ - **`INTERNET` permission is mandatory.** Without it, the SDK silently fails to connect — no error, no symptom except missing data.
1405
+ - **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.
1406
+ - **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.
1407
+ - **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.
1408
+ - **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.
1409
+ - **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.
1410
+ - **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`.
1411
+
1412
+ ### Flutter only
1413
+
1414
+ - **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.
1415
+ - **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.
1416
+ - **`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`).
1417
+ - **`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, ...)`.
1418
+ - **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.
1419
+ - **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.
1420
+ - **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.
1421
+ - **`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()`.
1422
+ - **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.
1423
+ - **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.
1424
+ - **`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.
1425
+
1426
+ ### iOS only
1427
+
1428
+ - **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.
1429
+ - **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.
1430
+ - **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.
1431
+ - **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.
1432
+ - **`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.
1433
+ - **`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.
1434
+ - **`CometChatTypography.setFont(name:)` is a class func**, not a settable `fontFamily` property. `CometChatTypography.fontFamily = "Avenir"` does not compile.
1435
+ - **`CometChatGroupMembers()` takes zero args**; pass the group via `set(group:)`. There is no `CometChatGroupMembers(group:)` initializer.
1436
+ - **`CometChatCallButtons(width:height:)` requires explicit dimensions**; there is no zero-arg initializer.
1437
+ - **`CometChatThreadHeader` does NOT exist** — the real class is `CometChatThreadedMessageHeader`.
1438
+ - **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.
1439
+ - **`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.
1440
+ - **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.
1441
+
809
1442
  ## Error handling
810
1443
 
811
1444
  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.
@@ -858,3 +1491,111 @@ Not required for integration or Phase B CLI flows.
858
1491
  | `cometchat-native-push` | When setting up push notifications |
859
1492
  | `cometchat-native-testing` | When adding tests |
860
1493
  | `cometchat-native-troubleshooting` | When diagnosing problems |
1494
+
1495
+ ### Angular family
1496
+
1497
+ | Skill | When to load |
1498
+ |---|---|
1499
+ | `cometchat-angular-core` | Always — before any integration code |
1500
+ | `cometchat-angular-components` | Always — before writing component code |
1501
+ | `cometchat-angular-placement` | When integrating — for placement patterns (route, modal, drawer, embed) |
1502
+ | `cometchat-angular-patterns` | framework = angular — module organization, lazy loading, environment files |
1503
+ | `cometchat-angular-theming` | When customizing themes (`CometChatThemeService`) |
1504
+ | `cometchat-angular-features` | When adding features (calls, polls, reactions, AI, extensions) |
1505
+ | `cometchat-angular-customization` | When writing custom views via content projection, `<ng-template>` slots, DataSource decorators |
1506
+ | `cometchat-angular-production` | When setting up production auth (server-minted auth tokens) or user management |
1507
+ | `cometchat-angular-troubleshooting` | When diagnosing problems (build errors, schema errors, Zone.js issues) |
1508
+
1509
+ ### Android V5 family (live — `chat-uikit-android:5.x`)
1510
+
1511
+ | Skill | When to load |
1512
+ |---|---|
1513
+ | `cometchat-android-v5` | Dispatcher entry — `android_version === "v5"` |
1514
+ | `cometchat-android-v5-core` | Always — Gradle deps, `UIKitSettings.UIKitSettingsBuilder`, init/login, theme parent |
1515
+ | `cometchat-android-v5-components` | Always — View class catalog (`CometChatConversations`, `CometChatMessageList`, …) |
1516
+ | `cometchat-android-v5-placement` | When integrating — Activity / Fragment / BottomSheet placement |
1517
+ | `cometchat-android-v5-theming` | When customizing themes — colors.xml, theme attrs, dark mode |
1518
+ | `cometchat-android-v5-features` | When adding features — calls, reactions, polls, AI, extensions |
1519
+ | `cometchat-android-v5-customization` | When writing custom Views, message templates, `CometChatTextFormatter`, event listeners |
1520
+ | `cometchat-android-v5-extensions` | When working with extensions (`PollsExtension` / `StickerExtension` registrars + custom decorator pattern) |
1521
+ | `cometchat-android-v5-production` | When setting up production auth (server-minted auth tokens) or user management |
1522
+ | `cometchat-android-v5-push` | When setting up push notifications (FCM, token lifecycle, deep-link) |
1523
+ | `cometchat-android-v5-testing` | When adding tests (Espresso, Robolectric, mocking the kit/SDK) |
1524
+ | `cometchat-android-v5-troubleshooting` | When diagnosing problems (Gradle, manifest, ProGuard, lifecycle) |
1525
+
1526
+ ### Android V6 family (beta — `chatuikit-{compose,kotlin}-android:6.x`)
1527
+
1528
+ | Skill | When to load |
1529
+ |---|---|
1530
+ | `cometchat-android-v6` | Dispatcher entry — `android_version === "v6"` |
1531
+ | `cometchat-android-v6-core` | Always — Gradle deps, init, login, message sending |
1532
+ | `cometchat-android-v6-events` | Always — `CometChatEvents` SharedFlows + sealed event classes |
1533
+ | `cometchat-android-v6-builder-settings` | When configuring `UIKitSettingsBuilder` (calling, presence, etc.) |
1534
+ | `cometchat-android-v6-features` | When adding features — calls, reactions, polls, AI agent, extensions |
1535
+ | `cometchat-android-v6-extensions` | When working with extensions / DataSource interfaces |
1536
+ | `cometchat-android-v6-production` | When setting up production auth or user management |
1537
+ | `cometchat-android-v6-push` | When setting up push notifications |
1538
+ | `cometchat-android-v6-testing` | When adding tests (Espresso, Compose UI tests, Robolectric, mocking) |
1539
+ | `cometchat-android-v6-troubleshooting` | When diagnosing problems (Gradle, Compose runtime, R8, BuildConfig) |
1540
+ | `cometchat-android-v6-compose-components` | UI stack = Compose — Composable component catalog |
1541
+ | `cometchat-android-v6-compose-placement` | UI stack = Compose — NavHost, modal, bottom sheet placement |
1542
+ | `cometchat-android-v6-compose-theming` | UI stack = Compose — `CometChatTheme { … }`, `LocalColorScheme`/`LocalTypography` |
1543
+ | `cometchat-android-v6-compose-customization` | UI stack = Compose — `BubbleFactory`, slot lambdas, custom Composables |
1544
+ | `cometchat-android-v6-kotlin-components` | UI stack = Kotlin Views — custom View class catalog |
1545
+ | `cometchat-android-v6-kotlin-placement` | UI stack = Kotlin Views — Activity / Fragment / BottomSheet placement |
1546
+ | `cometchat-android-v6-kotlin-theming` | UI stack = Kotlin Views — style attrs, colors.xml, dark mode |
1547
+ | `cometchat-android-v6-kotlin-customization` | UI stack = Kotlin Views — custom Views, `BubbleFactory` abstract class, `setBubbleFactories` |
1548
+
1549
+ ### Flutter V5 family (live — `cometchat_chat_uikit:^5.2`)
1550
+
1551
+ | Skill | When to load |
1552
+ |---|---|
1553
+ | `cometchat-flutter-v5` | Dispatcher entry — `flutter_version === "v5"` |
1554
+ | `cometchat-flutter-v5-core` | Always — pubspec deps, init/login, GetX patterns, theme caching, listener lifecycle |
1555
+ | `cometchat-flutter-v5-conversations` | When integrating — `CometChatConversations` widget |
1556
+ | `cometchat-flutter-v5-messages` | When integrating — `CometChatMessages`, `CometChatMessageList`, `CometChatMessageComposer`, `CometChatMessageHeader`, threads |
1557
+ | `cometchat-flutter-v5-users-groups` | When integrating — `CometChatUsers`, `CometChatGroups`, `CometChatGroupMembers` |
1558
+ | `cometchat-flutter-v5-calls` | When adding voice/video — `CometChatCallButtons`, `CometChatIncomingCall`, `CometChatOutgoingCall`, `CometChatOngoingCall`, `CometChatCallLogs` |
1559
+ | `cometchat-flutter-v5-theming` | When customizing themes — `CometChatThemeHelper`, `CometChatColorPalette`, dark mode |
1560
+ | `cometchat-flutter-v5-customization` | When writing custom bubbles, templates, formatters, slot views, DataSource decorators |
1561
+ | `cometchat-flutter-v5-events` | When subscribing to SDK events (`CometChatMessageEvents`, etc.) |
1562
+ | `cometchat-flutter-v5-production` | When setting up production auth (server-minted tokens) and ProGuard |
1563
+ | `cometchat-flutter-v5-push` | When setting up FCM / APNs / VoIP push |
1564
+ | `cometchat-flutter-v5-troubleshooting` | When diagnosing problems (pubspec, GetX, Pod errors, runtime crashes) |
1565
+
1566
+ ### Flutter V6 family (beta — `cometchat_chat_uikit:^6.0.0-beta2`)
1567
+
1568
+ | Skill | When to load |
1569
+ |---|---|
1570
+ | `cometchat-flutter-v6` | Dispatcher entry — `flutter_version === "v6"` |
1571
+ | `cometchat-flutter-v6-core` | Always — pubspec deps, init/login, message sending |
1572
+ | `cometchat-flutter-v6-components` | Always — Bloc-driven widget catalog |
1573
+ | `cometchat-flutter-v6-conversations` | When integrating `CometChatConversations` (Bloc, request builder, callbacks) |
1574
+ | `cometchat-flutter-v6-messages` | When integrating `CometChatMessages`, list/header/composer composition |
1575
+ | `cometchat-flutter-v6-users-groups` | When integrating `CometChatUsers`/`CometChatGroups`/`CometChatGroupMembers` |
1576
+ | `cometchat-flutter-v6-calls` | When adding voice/video — incoming/outgoing/ongoing screens |
1577
+ | `cometchat-flutter-v6-features` | When adding features — calls, polls, reactions, AI, extensions |
1578
+ | `cometchat-flutter-v6-placement` | When deciding placement — route, modal sheet, embedded widget |
1579
+ | `cometchat-flutter-v6-theming` | When customizing themes — `CometChatThemeHelper`, `CometChatColorPalette`, light/dark schemes |
1580
+ | `cometchat-flutter-v6-customization` | When writing bubble factories, message templates, text formatters, slot widgets |
1581
+ | `cometchat-flutter-v6-events` | When subscribing to Bloc-based event streams |
1582
+ | `cometchat-flutter-v6-production` | When setting up production auth and external-backend recipes |
1583
+ | `cometchat-flutter-v6-troubleshooting` | When diagnosing problems (pubspec, Bloc, theme cache, build errors) |
1584
+ | `cometchat-flutter-v6-migration` | When migrating from V5 — GetX → Bloc, theme API rewrite, breaking changes |
1585
+
1586
+ ### iOS family (V5 stable — `CometChatUIKitSwift:~> 5.1`)
1587
+
1588
+ iOS only ships V5 today; no V6 beta yet. When V6 lands, this section will fork like Android and Flutter do.
1589
+
1590
+ | Skill | When to load |
1591
+ |---|---|
1592
+ | `cometchat-ios` | Dispatcher entry — `framework === "ios"` |
1593
+ | `cometchat-ios-core` | Always — Installation (CocoaPods + SPM), `UIKitSettings` builder, `CometChatUIKit(uiKitSettings:)` constructor init, login order |
1594
+ | `cometchat-ios-components` | Always — UIViewController + SwiftUI view catalog, custom `MessagesVC` composition pattern |
1595
+ | `cometchat-ios-placement` | When integrating — UINavigationController, modal, tab bar, embedded view, SwiftUI hosting |
1596
+ | `cometchat-ios-theming` | When customizing themes — `CometChatTheme` color tokens, `CometChatTypography.setFont(name:)`, dark mode |
1597
+ | `cometchat-ios-customization` | When writing custom message templates, formatters, DataSource decorators, custom views |
1598
+ | `cometchat-ios-features` | When adding features — calls, polls, reactions, AI, extensions |
1599
+ | `cometchat-ios-production` | When setting up production auth (server-minted auth tokens) and user management |
1600
+ | `cometchat-ios-push` | When setting up APNs + VoIP push, CallKit |
1601
+ | `cometchat-ios-troubleshooting` | When diagnosing problems — SPM/CocoaPods errors, Xcode build issues, Info.plist, runtime crashes |