@cometchat/skills 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -17
  3. package/bin/install.js +389 -43
  4. package/package.json +19 -9
  5. package/skills/cometchat/SKILL.md +1066 -265
  6. package/skills/cometchat-android-v5/SKILL.md +120 -0
  7. package/skills/cometchat-android-v5-components/SKILL.md +430 -0
  8. package/skills/cometchat-android-v5-core/SKILL.md +468 -0
  9. package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
  10. package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
  11. package/skills/cometchat-android-v5-features/SKILL.md +130 -0
  12. package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
  13. package/skills/cometchat-android-v5-production/SKILL.md +94 -0
  14. package/skills/cometchat-android-v5-push/SKILL.md +620 -0
  15. package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
  16. package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
  17. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
  18. package/skills/cometchat-android-v6/SKILL.md +107 -0
  19. package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
  20. package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
  21. package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
  22. package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
  23. package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
  24. package/skills/cometchat-android-v6-core/SKILL.md +354 -0
  25. package/skills/cometchat-android-v6-events/SKILL.md +212 -0
  26. package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
  27. package/skills/cometchat-android-v6-features/SKILL.md +130 -0
  28. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
  29. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
  30. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
  31. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
  32. package/skills/cometchat-android-v6-production/SKILL.md +187 -0
  33. package/skills/cometchat-android-v6-push/SKILL.md +274 -0
  34. package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
  35. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
  36. package/skills/cometchat-angular-components/SKILL.md +706 -0
  37. package/skills/cometchat-angular-core/SKILL.md +444 -0
  38. package/skills/cometchat-angular-customization/SKILL.md +424 -0
  39. package/skills/cometchat-angular-features/SKILL.md +447 -0
  40. package/skills/cometchat-angular-patterns/SKILL.md +447 -0
  41. package/skills/cometchat-angular-placement/SKILL.md +685 -0
  42. package/skills/cometchat-angular-production/SKILL.md +415 -0
  43. package/skills/cometchat-angular-theming/SKILL.md +365 -0
  44. package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
  45. package/skills/cometchat-astro-patterns/SKILL.md +3 -3
  46. package/skills/cometchat-components/SKILL.md +11 -0
  47. package/skills/cometchat-core/SKILL.md +11 -6
  48. package/skills/cometchat-customization/references/component-catalog.md +1 -1
  49. package/skills/cometchat-features/SKILL.md +176 -108
  50. package/skills/cometchat-flutter-v5/SKILL.md +167 -0
  51. package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
  52. package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
  53. package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
  54. package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
  55. package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
  56. package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
  57. package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
  58. package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
  59. package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
  60. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
  61. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
  62. package/skills/cometchat-flutter-v6/SKILL.md +445 -0
  63. package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
  64. package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
  65. package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
  66. package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
  67. package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
  68. package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
  69. package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
  70. package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
  71. package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
  72. package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
  73. package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
  74. package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
  75. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
  76. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
  77. package/skills/cometchat-ios/SKILL.md +323 -0
  78. package/skills/cometchat-ios-components/SKILL.md +651 -0
  79. package/skills/cometchat-ios-core/SKILL.md +822 -0
  80. package/skills/cometchat-ios-customization/SKILL.md +825 -0
  81. package/skills/cometchat-ios-features/SKILL.md +725 -0
  82. package/skills/cometchat-ios-placement/SKILL.md +750 -0
  83. package/skills/cometchat-ios-production/SKILL.md +730 -0
  84. package/skills/cometchat-ios-push/SKILL.md +582 -0
  85. package/skills/cometchat-ios-theming/SKILL.md +631 -0
  86. package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
  87. package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
  88. package/skills/cometchat-native-components/SKILL.md +594 -0
  89. package/skills/cometchat-native-core/SKILL.md +407 -0
  90. package/skills/cometchat-native-customization/SKILL.md +594 -0
  91. package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
  92. package/skills/cometchat-native-features/SKILL.md +608 -0
  93. package/skills/cometchat-native-placement/SKILL.md +500 -0
  94. package/skills/cometchat-native-production/SKILL.md +694 -0
  95. package/skills/cometchat-native-push/SKILL.md +593 -0
  96. package/skills/cometchat-native-testing/SKILL.md +583 -0
  97. package/skills/cometchat-native-theming/SKILL.md +656 -0
  98. package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
  99. package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
  100. package/skills/cometchat-production/SKILL.md +60 -0
  101. package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
@@ -270,8 +270,8 @@ function ChatContent() {
270
270
  <>
271
271
  {selectedUser && <CometChatMessageHeader user={selectedUser} />}
272
272
  {selectedGroup && <CometChatMessageHeader group={selectedGroup} />}
273
- {selectedUser && <CometChatMessageList user={selectedUser} />}
274
- {selectedGroup && <CometChatMessageList group={selectedGroup} />}
273
+ {selectedUser && <CometChatMessageList user={selectedUser} hideReplyInThreadOption={true} />}
274
+ {selectedGroup && <CometChatMessageList group={selectedGroup} hideReplyInThreadOption={true} />}
275
275
  {selectedUser && <CometChatMessageComposer user={selectedUser} />}
276
276
  {selectedGroup && <CometChatMessageComposer group={selectedGroup} />}
277
277
  </>
@@ -352,7 +352,7 @@ function DrawerContent({ targetUserId }: { targetUserId: string }) {
352
352
  <>
353
353
  <CometChatMessageHeader user={user} />
354
354
  <div style={{ flex: 1, overflow: "hidden" }}>
355
- <CometChatMessageList user={user} />
355
+ <CometChatMessageList user={user} hideReplyInThreadOption={true} />
356
356
  </div>
357
357
  <CometChatMessageComposer user={user} />
358
358
  </>
@@ -124,6 +124,8 @@ A text input with send button, attachment options, and emoji support. Sends mess
124
124
 
125
125
  A rich-text variant of the message composer with formatting toolbar (bold, italic, code, etc.). Same props as CometChatMessageComposer.
126
126
 
127
+ **Prefer this for new integrations.** The v6 sample app uses `CometChatCompactMessageComposer` everywhere — rich-text formatting is the modern default. Both work; reach for `CometChatMessageComposer` (the basic variant) only if you have a specific reason to skip the formatting toolbar (e.g., a stripped-down marketplace ping where plain text is the entire UX).
128
+
127
129
  **Key props:**
128
130
  | Prop | Type | Description |
129
131
  |---|---|---|
@@ -192,6 +194,15 @@ Full-featured dual-scope search: searches across conversations AND messages with
192
194
 
193
195
  **Works with:** CometChatConversations (replaces the list when search is active)
194
196
 
197
+ > **Hard rule — never roll your own search.** Any request involving
198
+ > "search", "find messages", "search conversations", or "search across
199
+ > conversations" MUST use `<CometChatSearch>` (or `showSearchBar={true}`
200
+ > + `onSearchBarClicked` on `CometChatConversations` to swap into
201
+ > `<CometChatSearch>` on click). Do NOT build custom `<input type="search">`
202
+ > bars, hand-rolled result lists, or filter UIs — they bypass the SDK's
203
+ > pagination, highlighting, and dual-scope (conversations + messages)
204
+ > matching that ship with the built-in component.
205
+
195
206
  ---
196
207
 
197
208
  ### CometChatThreadHeader
@@ -140,19 +140,24 @@ Call `ensureLoggedIn()` from the provider / effect instead of `CometChatUIKit.lo
140
140
 
141
141
  When your integration code needs the current user's UID (for example, to decide which conversation to target, or to filter by sender), **always fetch it from the SDK — never hardcode a UID like `"cometchat-uid-1"`**.
142
142
 
143
- Two getters, for different contexts:
143
+ Two getters, for different contexts. **Default to the sync version** — it matches the v6 sample app and works for almost all app code, because by the time UI components render, the kit's init + login flow is already complete:
144
144
 
145
145
  ```typescript
146
- // Asyncpreferred for app logic, guaranteed correct after init completes
147
- const me = await CometChatUIKit.getLoggedinUser();
148
- const myUid = me?.getUid();
149
-
150
- // Sync — use inside render paths where you already know init is done
146
+ // Preferred sync, returns User | null directly. Use this in app code.
151
147
  import { CometChatUIKitLoginListener } from "@cometchat/chat-uikit-react";
152
148
  const me = CometChatUIKitLoginListener.getLoggedInUser(); // note capital `I` in `InUser`
153
149
  const myUid = me?.getUid();
150
+
151
+ // Fallback — async, for the bootstrap path where init may not be complete
152
+ // (e.g., inside the provider's init effect, or before the first login resolves).
153
+ const me = await CometChatUIKit.getLoggedinUser();
154
+ const myUid = me?.getUid();
154
155
  ```
155
156
 
157
+ The sync `CometChatUIKitLoginListener.getLoggedInUser()` is the right call from any component that mounts AFTER login completes — which is virtually all of them, since the dispatcher's recipes put login on a dedicated route or in the provider's init effect that gates rendering. Reach for the async `CometChatUIKit.getLoggedinUser()` only when you're inside that init effect itself.
158
+
159
+ **Casing matters.** Note `getLogged**In**User` (capital `I`) on the LoginListener vs `getLogged**in**User` (lowercase `i`) on `CometChatUIKit` — both casings exist in the kit, they're different methods.
160
+
156
161
  Hardcoding `"cometchat-uid-1"` only works in the dev mode login call (`CometChatUIKit.login("cometchat-uid-1")`) because you're *choosing* who to log in as. Once logged in, the getters are the source of truth — useful when the logged-in user comes from production auth (a real user ID, not a test UID), or when the user logs out and logs in as someone else.
157
162
 
158
163
  ### Production mode
@@ -226,7 +226,7 @@ docs MCP, just use the component listed here.
226
226
  | "click handler on item / message" | `onItemClick` / `onMessageClick` / `onBack` / `onSearchBarClicked` (prop) | |
227
227
  | "hide / disable a feature" | `disable*` boolean props on the relevant component (prop) | e.g. `disableReactions`, `disableTyping`, `disableMentions` |
228
228
  | "mentions in composer" | `CometChatMentionsFormatter` (A) | Already wired into `CometChatMessageComposer` by default |
229
- | "AI smart replies" / "AI assistant" | `CometChatAIAssistantChat` (A) | Requires dashboard toggle + extension |
229
+ | "AI smart replies" / "AI assistant" | `CometChatAIAssistantChat` (A) | Requires `cometchat apply-feature smart-replies --openai-key sk-...` (one-shot via API) |
230
230
  | "top-level layout" / "home screen" | `CometChatHome/CometChatHome.tsx` (B) | The canonical three-column layout |
231
231
  | "login screen" | `CometChatLogin/` (B) | Sample app pattern |
232
232
  | "avatar" | `CometChatAvatar` (A) | Used inside many components; also usable standalone |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cometchat-features
3
- description: Add features (calls, reactions, polls, file sharing, presence, etc.) to an already-integrated CometChat project. Routes to the right sub-flow based on feature type — default features (already enabled), dashboard-toggle features (extensions + AI), package-install features (calls), or component-swap features (rich text).
3
+ description: Add features (calls, reactions, polls, file sharing, presence, etc.) to an already-integrated CometChat project. Routes to the right sub-flow based on feature type — default (already enabled), extension (API toggle), ai-feature (API toggle + OpenAI key), dashboard-only (third-party config), package-install (calls), or component-swap (rich text).
4
4
  license: "MIT"
5
5
  compatibility: "Node.js >=18; @cometchat/chat-uikit-react ^6; integration must already be applied"
6
6
  allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
@@ -19,9 +19,10 @@ metadata:
19
19
 
20
20
  This skill teaches Claude how CometChat features are structured and
21
21
  what work is actually required to enable each one. Most features require
22
- **zero code** — they are either already built into the UI Kit, enabled
23
- via a dashboard toggle, or activated by a single npm install.
24
- Understanding which type a feature is prevents unnecessary work.
22
+ **zero code** — they are either already built into the UI Kit, toggled
23
+ via the `cometchat apply-feature` CLI (which hits the dashboard API),
24
+ or activated by a single npm install. Understanding which type a feature
25
+ is prevents unnecessary work.
25
26
 
26
27
  ---
27
28
 
@@ -53,35 +54,48 @@ first to create the integration.
53
54
 
54
55
  ## 3. Why features fall into each type
55
56
 
56
- CometChat features split into 4 types based on their architecture:
57
-
58
- - **Type 1 — Default (compiled-in):** These are shipped inside the UI
59
- Kit component bundle unconditionally. CometChat builds reactions,
60
- typing indicators, mentions, etc. into `CometChatMessageList` and
61
- `CometChatMessageComposer` at compile time. The feature is always
62
- present; the only question is whether the prop that surfaces it is
63
- enabled. No code or dashboard changes needed.
64
-
65
- - **Type 2 Dashboard-toggle (backend extensions):** These are
66
- backend services hosted by CometChat's infrastructure. The UI Kit
67
- polls which extensions are enabled via the app's init response. When
68
- you flip the dashboard toggle, the backend returns a different
69
- feature flag, and the UI Kit renders the corresponding UI
70
- automatically. No client code change is needed — the rendering logic
71
- is already in the UI Kit, just gated on the flag.
72
-
73
- - **Type 3 Package-install (separate SDK):** Voice/video calling
74
- requires a separate WebRTC SDK (`@cometchat/calls-sdk-javascript`)
75
- because it links against browser media APIs that would bloat every
76
- integration if bundled unconditionally. Once installed, the UI Kit
77
- detects it via dynamic import and enables the call UI.
78
-
79
- - **Type 4 — Component-swap (variant component):** Some features
80
- require a different component variant because the base component has
81
- a hard-coded behavior that can't be toggled via props. The CLI does
82
- a safe word-boundary replace of the component name in your owned
83
- files. If CometChat adds new variant components in future SDK
84
- releases, they will follow this same pattern.
57
+ CometChat features split into six types based on what work is actually
58
+ needed to enable each one:
59
+
60
+ - **default (compiled-in):** Shipped inside the UI Kit component bundle
61
+ unconditionally. CometChat builds reactions, typing indicators,
62
+ mentions, etc. into `CometChatMessageList` and `CometChatMessageComposer`
63
+ at compile time. The feature is always present; the only question is
64
+ whether the prop that surfaces it is enabled. No action needed.
65
+
66
+ - **extension (backend boolean toggle):** Pure on/off backend extension.
67
+ The CLI's `apply-feature` command flips the toggle via the same REST
68
+ API the dashboard UI uses (`POST /apps/{id}/extensions`), so no
69
+ browser visit required. Once enabled, the UI Kit renders the matching
70
+ UI automatically. Examples: polls, link-preview, voice-transcription,
71
+ message-translation, stickers.
72
+
73
+ - **ai-feature (backend AI toggle + OpenAI key):** Same API path as
74
+ extensions but split out because the AI feature requires an OpenAI
75
+ API key on the app's AI settings (`PUT /apps/{id}/ai/settings`)
76
+ before the toggle (`POST /apps/{id}/features/ai.{key}/enabled`)
77
+ succeeds. The CLI handles both calls in one invocation when given
78
+ `--openai-key sk-…`. Examples: smart-replies, conversation-summary,
79
+ conversation-starter.
80
+
81
+ - **dashboard-only (third-party config):** Requires entering config
82
+ the user has to fetch themselves third-party API keys (Giphy,
83
+ Stipop, Tenor), webhooks (Chatwoot), or multi-field choices
84
+ (disappearing-messages interval, message-shortcuts list). The CLI
85
+ cannot automate these; the skill prints the dashboard path and
86
+ stops.
87
+
88
+ - **package-install (separate SDK):** Voice/video calling requires
89
+ `@cometchat/calls-sdk-javascript` because it links against browser
90
+ media APIs that would bloat every integration if bundled unconditionally.
91
+ Once installed, the UI Kit detects it via dynamic import.
92
+
93
+ - **component-swap (variant component):** Replaces one UI Kit component
94
+ with a drop-in variant whose default behavior differs (e.g.
95
+ `CometChatCompactMessageComposer` enables rich text by default).
96
+ The CLI does a safe word-boundary replace in `state.files_owned`.
97
+ Requires `cometchat apply` to have run (i.e. web/RN integrations
98
+ only — native cohorts can't use this path).
85
99
 
86
100
  ---
87
101
 
@@ -110,15 +124,23 @@ component:
110
124
  For these: query the docs MCP for the feature's component/usage docs, show
111
125
  the user where it is in their integration. **No code changes needed.**
112
126
 
113
- ### Type 2Dashboard-toggle features (~40+, no code needed)
127
+ ### Type 2aExtensions (pure boolean, CLI-toggleable)
114
128
 
115
- These require flipping a toggle in the [CometChat Dashboard](https://app.cometchat.com).
116
- Once enabled, the UI Kit auto-integrates them. **No code changes needed.**
129
+ These are backend extensions enabled by a single API call (`POST /apps/{id}/extensions`).
130
+ Use the CLI no browser visit required:
131
+
132
+ ```bash
133
+ cometchat apply-feature <id>
134
+ ```
135
+
136
+ For native cohorts (iOS / Android / Flutter / Angular) where there's no
137
+ `.cometchat/state.json`, pass `--app-id` explicitly:
117
138
 
118
- > **Note:** The dashboard features page also shows the Type 1 features
119
- > (Instant Messaging, Reactions, Mentions, etc.) as always-on toggles
120
- > at the top. Those are already enabled — no action needed. The
121
- > features below are the ones that actually require toggling on.
139
+ ```bash
140
+ cometchat apply-feature <id> --app-id <your-app-id>
141
+ ```
142
+
143
+ Once enabled, the UI Kit auto-integrates them. **No code changes needed.**
122
144
 
123
145
  > **Note:** Conversation and Advanced Search has its own toggle on the
124
146
  > Features page. It is on by default but can be disabled. If a user
@@ -150,30 +172,55 @@ Email Notification, Push Notification, SMS Notification
150
172
  **Extensions — Customer Support:**
151
173
  Chatwoot, Intercom
152
174
 
153
- **Smart Chat Features (AI):**
154
- Conversation Starter, Smart Replies, Conversation Summary
155
- (AI features are fetched dynamically from the API — the exact list
156
- depends on your plan and backend configuration.)
157
-
158
- **Exact dashboard path (give this to the user verbatim):**
159
-
160
- > **For most features (User Experience, User Engagement, Collaboration, Security, AI):**
161
- > 1. Open https://app.cometchat.com
162
- > 2. Select your app
163
- > 3. In the left sidebar: **Chat & Messaging** → **Features**
164
- > 4. Find the feature and flip its **Status** toggle to ON
165
- > 5. Some extensions have a settings icon click it if the feature
166
- > needs configuration (e.g. API keys for Giphy)
167
- > 6. Changes take effect immediately — refresh the chat in the browser
168
- >
169
- > **For Moderation and Notification extensions:**
170
- > These are NOT on the Features page. Navigate to:
171
- > **Left sidebar → Extensions** (the separate Extensions page)
172
- > Find the extension and enable it there.
173
-
174
- After enabling, run `cometchat verify` to ensure the existing
175
- integration still passes. No code changes are needed — the UI Kit
176
- picks up enabled features automatically.
175
+ ### Type 2b — AI features (CLI-toggleable, OpenAI key required)
176
+
177
+ `smart-replies`, `conversation-summary`, `conversation-starter`. These
178
+ need an OpenAI API key on the app's AI settings before the toggle
179
+ succeeds. The CLI does both calls in one invocation:
180
+
181
+ ```bash
182
+ cometchat apply-feature smart-replies --openai-key sk-...
183
+ # native:
184
+ cometchat apply-feature smart-replies --app-id <id> --openai-key sk-...
185
+ ```
186
+
187
+ After the first AI feature is enabled the key is stored on the app, so
188
+ subsequent ai-feature applies don't need `--openai-key` repeated.
189
+
190
+ Get an OpenAI key: https://platform.openai.com/api-keys
191
+
192
+ ### Type 2c Dashboard-only (third-party config required)
193
+
194
+ These extensions require config the user has to provide themselves
195
+ (third-party API keys / webhooks / multi-field setup) — `apply-feature`
196
+ returns `manual-action-required` and prints the dashboard path. The
197
+ CLI cannot automate these:
198
+
199
+ - **Third-party API keys:** Giphy, Stipop, Tenor, Intercom
200
+ - **Webhooks:** Chatwoot
201
+ - **Multi-field config:** Message Shortcuts (shortcut list), Disappearing Messages (interval)
202
+
203
+ Manual flow for these:
204
+ 1. https://app.cometchat.com → select your app
205
+ 2. Sidebar → Extensions (or Chat & Messaging → Features for
206
+ Disappearing Messages)
207
+ 3. Find the extension, enter the third-party config, toggle ON
208
+
209
+ ### Moderation and Notification extensions
210
+
211
+ Live on a separate Extensions page (not Features). Both currently
212
+ require dashboard navigation (Phase 1 didn't cover moderation rules):
213
+
214
+ - **Moderation:** Data Masking, Image Moderation, Profanity Filter,
215
+ Sentiment Analysis, XSS Filter, Human Moderation, Report User,
216
+ Slow Mode, Virus/Malware Scanner
217
+ - **Notifications:** Email, Push, SMS
218
+
219
+ > Sidebar → **Extensions** → find extension → configure + enable.
220
+
221
+ After enabling any feature, run `cometchat verify` to ensure the
222
+ existing integration still passes. No code changes are needed — the
223
+ UI Kit picks up enabled features automatically.
177
224
 
178
225
  ### Type 3 — Package-install features (4, calls)
179
226
 
@@ -275,7 +322,14 @@ export function CustomCallUI({ targetUser }: { targetUser: CometChat.User }) {
275
322
 
276
323
  ### AI smart replies
277
324
 
278
- Smart replies is a dashboard-toggle feature (Type 2). After enabling it in the dashboard (Extensions Smart Replies Toggle on), **no code changes are required** — the `CometChatMessageComposer` automatically renders suggested replies as chips above the input when there's a recent incoming message.
325
+ Smart replies is an `ai-feature`. Enable with one CLI call (the first time also sets the OpenAI key on the app):
326
+
327
+ ```bash
328
+ cometchat apply-feature smart-replies --openai-key sk-...
329
+ # native cohorts: add --app-id <your-app-id>
330
+ ```
331
+
332
+ **No code changes are required** — the `CometChatMessageComposer` automatically renders suggested replies as chips above the input when there's a recent incoming message.
279
333
 
280
334
  For a custom UI — e.g. showing smart replies inline instead of above the composer, or only for certain conversation types — you read the extension data from the incoming message and render your own chips:
281
335
 
@@ -366,9 +420,10 @@ this skill. It's the canonical source for:
366
420
  "I need the CometChat docs MCP to walk you through this feature.
367
421
  Install it with `claude mcp add --transport http cometchat-docs
368
422
  https://www.cometchat.com/docs/mcp` and re-run."
369
- 3. **Use the dashboard path from this skill** (Chat & Messaging →
370
- Features) for all toggle features. Query the docs MCP for
371
- per-feature configuration details beyond the basic toggle.
423
+ 3. **Use `cometchat apply-feature <id>` for extension and ai-feature
424
+ types.** The CLI is the canonical path. Only fall back to the
425
+ dashboard URL when the CLI returns `manual-action-required`,
426
+ `auth-required`, or `error`.
372
427
  4. **Canonical reference URLs** (use as starting points if the agent
373
428
  doesn't have an MCP query handy):
374
429
  - Extensions: https://www.cometchat.com/docs/ui-kit/react/extensions
@@ -437,45 +492,54 @@ the type, query the docs MCP first.
437
492
  No new components, no custom CSS, no new files.
438
493
  4. Only if no prop matches, route to the `cometchat-customization`
439
494
  skill for the full four-tier discovery.
440
- - **Dashboard-toggle:** prefer the CLI it flips the toggle via the
441
- same API the dashboard UI uses, so the user doesn't leave the
442
- terminal:
495
+ - **Extension / AI feature:** run `cometchat apply-feature <id>`. The
496
+ CLI hits the dashboard API directly using the bearer token from
497
+ `cometchat auth login` (stored in the OS keychain). For native
498
+ cohorts (iOS / Android / Flutter / Angular), pass `--app-id <id>`
499
+ explicitly because there's no `.cometchat/state.json`. AI features
500
+ also take `--openai-key sk-…` the first time:
501
+
443
502
  ```bash
444
- npx @cometchat/skills-cli features enable <id> --json
445
- # to turn it off:
446
- npx @cometchat/skills-cli features disable <id> --json
503
+ # Web/RN (state.json present):
504
+ cometchat apply-feature polls
505
+ cometchat apply-feature smart-replies --openai-key sk-...
506
+
507
+ # Native (stateless):
508
+ cometchat apply-feature polls --app-id A1B2C3
509
+ cometchat apply-feature smart-replies --app-id A1B2C3 --openai-key sk-...
447
510
  ```
448
- The CLI reads the app id from `.cometchat/config.json` and the
449
- bearer token from the OS keychain (requires a prior
450
- `cometchat auth login`). Response shape:
451
- - `"status": "enabled"` / `"disabled"` done. Tell the user to
452
- hard-refresh (Cmd+Shift+R) the browser tab running their dev
453
- server.
454
- - `"status": "no-op"` → already in the desired state.
455
- - `"status": "not-logged-in"` → run `cometchat auth login` first.
456
- - `"status": "no-app"` → run `/cometchat` or
457
- `cometchat provision setup` first so `.cometchat/config.json`
458
- has the app id.
459
- - `"status": "error"` surface `next_steps` verbatim. Includes
460
- the dashboard URL as a manual fallback.
461
-
462
- **Only fall back to the dashboard walkthrough** (app.cometchat.com
463
- → Chat & Messaging → Features → flip Status toggle) if the CLI
464
- returns `error` or isn't available. Run
465
- `cometchat features info <id>` for per-feature configuration
466
- details (Giphy API keys, translation languages, etc.) beyond the
467
- basic toggle.
511
+
512
+ Response shapes (`--json`):
513
+ - `"status": "applied"` → done. Tell the user to hard-refresh
514
+ (Cmd+Shift+R) the browser tab running their dev server.
515
+ - `"status": "already-applied"` → the feature is already enabled
516
+ in this integration's `state.applied_features`.
517
+ - `"status": "auth-required"` → run `cometchat auth login` first.
518
+ - `"status": "openai-key-required"` (ai-feature only) re-run
519
+ with `--openai-key sk-…`.
520
+ - `"status": "error"` surface `next_steps` verbatim.
521
+
522
+ **Only fall back to the dashboard** when the CLI returns `error` or
523
+ isn't available. Manual flow for extensions: app.cometchat.com →
524
+ *Chat & Messaging → Features → flip Status toggle*.
468
525
 
469
526
  **Note:** if the feature has `auto_wired_in_uikit: false` in the
470
527
  catalog (most non-default extensions), the toggle alone isn't
471
528
  enough — you also need to register the extension via
472
- `UIKitSettingsBuilder.setExtensions([...])` before `init`. The
473
- CLI's success output flags this; query the docs MCP for the exact
474
- builder syntax.
529
+ `UIKitSettingsBuilder.setExtensions([...])` before `init`. Query
530
+ the docs MCP for the exact builder syntax.
531
+
532
+ - **Dashboard-only:** the CLI returns `manual-action-required` and
533
+ prints the dashboard path. These need third-party config (Giphy
534
+ API key, Chatwoot webhook, etc.) that only the user can supply.
535
+ Walk them through the dashboard.
536
+
475
537
  - **Package-install (calls):** run `npm install @cometchat/calls-sdk-javascript`
476
538
  directly. The user opted in, that IS consent.
477
- - **Component-swap:** run `npx @cometchat/skills-cli apply-feature <id>`.
478
- The CLI handles the swap deterministically. Do NOT hand-edit.
539
+
540
+ - **Component-swap:** run `cometchat apply-feature <id>` (web/RN
541
+ only — needs `state.json`). The CLI handles the swap
542
+ deterministically. Do NOT hand-edit.
479
543
 
480
544
  ### Step 5 — Verify
481
545
 
@@ -493,17 +557,21 @@ skill for deeper triage.
493
557
 
494
558
  - Never modify a project without an existing CometChat integration.
495
559
  - Always query the docs MCP for SDK reference (do not invent function names).
496
- - For component-swap features, always use `cometchat apply-feature <id>`
497
- the CLI is the source of truth, never hand-edit.
560
+ - For component-swap, extension, and ai-feature types, always use
561
+ `cometchat apply-feature <id>` — the CLI is the source of truth,
562
+ never hand-edit and never tell the user to navigate the dashboard
563
+ unless the CLI itself returns `manual-action-required`.
564
+ - For ai-feature types, the OpenAI key prerequisite is the only
565
+ manual input — pass it as `--openai-key sk-…` the first time per
566
+ app.
567
+ - For native cohorts (iOS / Android / Flutter / Angular), always
568
+ pass `--app-id <id>` because their projects don't write
569
+ `.cometchat/state.json`.
498
570
  - For package-install features (calls), the user opting in IS consent —
499
571
  run `npm install <package>` directly.
500
- - For dashboard-toggle features, walk the user through the dashboard
501
- activation steps from `cometchat features info <id>`the dashboard
502
- flip is something only the human can do.
503
- - For dashboard-toggle features, always give the canonical path:
504
- **app.cometchat.com → select app → Chat & Messaging → Features →
505
- toggle ON.** Query the docs MCP for per-feature config details
506
- (e.g. Giphy API key, Translation language settings).
572
+ - For dashboard-only features (third-party API keys, webhooks,
573
+ multi-field config), walk the user through the dashboard these
574
+ cannot be automated.
507
575
  - Always use `npx @cometchat/skills-cli`.
508
576
 
509
577
  ## Sources
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: cometchat-flutter-v5
3
+ description: "Use when building chat with CometChat Flutter UIKit v5 (cometchat_chat_uikit v5.2.14, cometchat_calls_uikit v5.0.15). Orchestrator skill that routes to feature-specific skills."
4
+ license: "MIT"
5
+ compatibility: "cometchat_chat_uikit ^5.2.14; cometchat_calls_uikit ^5.0.15; cometchat_uikit_shared ^5.2.3; cometchat_sdk ^4.1.2; get ^4.6.5"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat flutter v5 chat uikit messaging conversations getx"
11
+ ---
12
+
13
+ # CometChat Flutter UIKit v5 — Orchestrator
14
+
15
+ Entry point skill for the CometChat UIKit v5 packages. Routes to feature skills based on context.
16
+
17
+ ## Project Detection
18
+
19
+ Confirm the project uses CometChat UIKit v5 by checking `pubspec.yaml` for:
20
+
21
+ ```yaml
22
+ dependencies:
23
+ cometchat_chat_uikit: ^5.2.14
24
+ cometchat_calls_uikit: ^5.0.15 # Optional, for calling features
25
+ ```
26
+
27
+ The v5 uses **separate packages** (unlike v6 which bundles everything):
28
+ - `cometchat_chat_uikit` — Chat UI components
29
+ - `cometchat_calls_uikit` — Call UI components (re-exports `cometchat_uikit_shared` + `cometchat_sdk` + `cometchat_calls_sdk`; does NOT re-export `cometchat_chat_uikit`)
30
+ - `cometchat_uikit_shared` — Shared utilities
31
+
32
+ **Imports — two barrels, not one.** For chat-only apps, the chat barrel is sufficient. If you also need voice/video calls, add a SECOND import — the calls barrel does NOT re-export the chat barrel.
33
+
34
+ ```dart
35
+ // Always:
36
+ import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
37
+
38
+ // Add this only if your app uses calls:
39
+ import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';
40
+ ```
41
+
42
+ ## Key v5 vs v6 Differences
43
+
44
+ | Aspect | v5 | v6 |
45
+ |--------|----|----|
46
+ | State management | GetX (GetBuilder, GetxController) | BLoC (Bloc, Equatable) |
47
+ | Packages | Separate (chat_uikit + calls_uikit) | Single (cometchat_chat_uikit) |
48
+ | Controllers | `Get.put()` internally | ServiceLocator pattern |
49
+ | SDK | `cometchat_sdk ^4.1.2` | `cometchat_sdk ^5.0.0` |
50
+
51
+ ## Skill Routing
52
+
53
+ | User mentions | Route to skill |
54
+ |---------------|---------------|
55
+ | init, login, logout, UIKitSettings, setup, GetX, GetBuilder | `cometchat-flutter-v5-core` |
56
+ | theme, colors, dark mode, styling, CometChatColorPalette, merge() | `cometchat-flutter-v5-theming` |
57
+ | conversations, conversation list, recent chats | `cometchat-flutter-v5-conversations` |
58
+ | messages, message list, composer, compact composer, header, keyboard, threads | `cometchat-flutter-v5-messages` |
59
+ | users, groups, group members, contacts, CometChatChangeScope | `cometchat-flutter-v5-users-groups` |
60
+ | calls, voice call, video call, CometChatCallButtons, incoming call, call logs | `cometchat-flutter-v5-calls` |
61
+ | events, listeners, real-time, typing indicator, online status, receipts | `cometchat-flutter-v5-events` |
62
+ | custom bubbles, templates, DataSource, decorator, formatters, slot views, extensions | `cometchat-flutter-v5-customization` |
63
+ | push notifications, FCM, APNs, VoIP, token, firebase messaging, callkit | `cometchat-flutter-v5-push` |
64
+ | auth tokens, ProGuard, release build, security, environment, production | `cometchat-flutter-v5-production` |
65
+ | error, debug, not working, crash, fix, troubleshoot, verify | `cometchat-flutter-v5-troubleshooting` |
66
+
67
+ ## Architecture Overview
68
+
69
+ The UIKit v5 follows a **GetX controller pattern**:
70
+
71
+ ```
72
+ {component}/
73
+ ├── cometchat_{component}.dart # StatefulWidget
74
+ ├── cometchat_{component}_controller.dart # extends GetxController
75
+ ├── cometchat_{component}_style.dart # ThemeExtension with merge()
76
+ └── {component}_builder_protocol.dart # Request builder protocol
77
+ ```
78
+
79
+ ## Golden Path — Minimal Chat App (v5)
80
+
81
+ ```dart
82
+ import 'package:flutter/material.dart';
83
+ import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
84
+ // Add the calls import only if your app uses voice/video calls:
85
+ // import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';
86
+
87
+ const String appId = 'YOUR_APP_ID';
88
+ const String region = 'us';
89
+ const String authKey = 'YOUR_AUTH_KEY';
90
+
91
+ void main() => runApp(const MyApp());
92
+
93
+ class MyApp extends StatefulWidget {
94
+ const MyApp({super.key});
95
+ @override
96
+ State<MyApp> createState() => _MyAppState();
97
+ }
98
+
99
+ class _MyAppState extends State<MyApp> {
100
+ bool _initializing = true;
101
+ bool _loggedIn = false;
102
+
103
+ @override
104
+ void initState() {
105
+ super.initState();
106
+ _initCometChat();
107
+ }
108
+
109
+ void _initCometChat() {
110
+ final settings = (UIKitSettingsBuilder()
111
+ ..appId = appId
112
+ ..region = region
113
+ ..authKey = authKey
114
+ ..subscriptionType = CometChatSubscriptionType.allUsers
115
+ ..callingExtension = CometChatCallingExtension())
116
+ .build();
117
+
118
+ CometChatUIKit.init(
119
+ uiKitSettings: settings,
120
+ onSuccess: (_) {
121
+ setState(() {
122
+ _loggedIn = CometChatUIKit.loggedInUser != null;
123
+ _initializing = false;
124
+ });
125
+ },
126
+ onError: (e) {
127
+ debugPrint('Init failed: ${e.message}');
128
+ setState(() => _initializing = false);
129
+ },
130
+ );
131
+ }
132
+
133
+ @override
134
+ Widget build(BuildContext context) {
135
+ return MaterialApp(
136
+ navigatorKey: CallNavigationContext.navigatorKey,
137
+ home: _initializing
138
+ ? const Scaffold(body: Center(child: CircularProgressIndicator()))
139
+ : _loggedIn
140
+ ? HomeScreen()
141
+ : LoginScreen(),
142
+ );
143
+ }
144
+ }
145
+ ```
146
+
147
+ Key points:
148
+ - Always import `package:cometchat_chat_uikit/cometchat_chat_uikit.dart` for chat widgets; add `package:cometchat_calls_uikit/cometchat_calls_uikit.dart` as a second import only when using calls
149
+ - `CometChatUIKit.login(uid)` takes a String directly
150
+ - `CallNavigationContext.navigatorKey` set on MaterialApp
151
+ - `CometChatCallingExtension()` set on UIKitSettingsBuilder
152
+ - `subscriptionType` always set
153
+
154
+ ## Autonomous Mode
155
+
156
+ - If `pubspec.yaml` has `cometchat_chat_uikit` v5.x or `cometchat_calls_uikit` v5.x → proceed without asking
157
+ - If credentials exist in code → reuse them
158
+ - If user says "messages screen" → generate Scaffold + Header + List + Composer
159
+ - Always add `subscriptionType` to UIKitSettingsBuilder
160
+ - Always use `CometChatThemeHelper` for colors, never hardcode
161
+ - Always import from `cometchat_chat_uikit` barrel for chat widgets. Add `cometchat_calls_uikit` as a SECOND import for calls — never as a replacement (the calls barrel does not re-export chat).
162
+
163
+ ## Android Build Requirements
164
+
165
+ - `android.useAndroidX=true` and `android.enableJetifier=true` in `gradle.properties`
166
+ - `minSdk 26` in `android/app/build.gradle`
167
+ - ProGuard: `-keep class com.cometchat.** { *; }`