@cometchat/skills 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -17
  3. package/bin/install.js +389 -43
  4. package/package.json +19 -9
  5. package/skills/cometchat/SKILL.md +1066 -265
  6. package/skills/cometchat-android-v5/SKILL.md +120 -0
  7. package/skills/cometchat-android-v5-components/SKILL.md +430 -0
  8. package/skills/cometchat-android-v5-core/SKILL.md +468 -0
  9. package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
  10. package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
  11. package/skills/cometchat-android-v5-features/SKILL.md +130 -0
  12. package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
  13. package/skills/cometchat-android-v5-production/SKILL.md +94 -0
  14. package/skills/cometchat-android-v5-push/SKILL.md +620 -0
  15. package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
  16. package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
  17. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
  18. package/skills/cometchat-android-v6/SKILL.md +107 -0
  19. package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
  20. package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
  21. package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
  22. package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
  23. package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
  24. package/skills/cometchat-android-v6-core/SKILL.md +354 -0
  25. package/skills/cometchat-android-v6-events/SKILL.md +212 -0
  26. package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
  27. package/skills/cometchat-android-v6-features/SKILL.md +130 -0
  28. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
  29. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
  30. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
  31. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
  32. package/skills/cometchat-android-v6-production/SKILL.md +187 -0
  33. package/skills/cometchat-android-v6-push/SKILL.md +274 -0
  34. package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
  35. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
  36. package/skills/cometchat-angular-components/SKILL.md +706 -0
  37. package/skills/cometchat-angular-core/SKILL.md +444 -0
  38. package/skills/cometchat-angular-customization/SKILL.md +424 -0
  39. package/skills/cometchat-angular-features/SKILL.md +447 -0
  40. package/skills/cometchat-angular-patterns/SKILL.md +447 -0
  41. package/skills/cometchat-angular-placement/SKILL.md +685 -0
  42. package/skills/cometchat-angular-production/SKILL.md +415 -0
  43. package/skills/cometchat-angular-theming/SKILL.md +365 -0
  44. package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
  45. package/skills/cometchat-astro-patterns/SKILL.md +3 -3
  46. package/skills/cometchat-components/SKILL.md +11 -0
  47. package/skills/cometchat-core/SKILL.md +11 -6
  48. package/skills/cometchat-customization/references/component-catalog.md +1 -1
  49. package/skills/cometchat-features/SKILL.md +176 -108
  50. package/skills/cometchat-flutter-v5/SKILL.md +167 -0
  51. package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
  52. package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
  53. package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
  54. package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
  55. package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
  56. package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
  57. package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
  58. package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
  59. package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
  60. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
  61. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
  62. package/skills/cometchat-flutter-v6/SKILL.md +445 -0
  63. package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
  64. package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
  65. package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
  66. package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
  67. package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
  68. package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
  69. package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
  70. package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
  71. package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
  72. package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
  73. package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
  74. package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
  75. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
  76. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
  77. package/skills/cometchat-ios/SKILL.md +323 -0
  78. package/skills/cometchat-ios-components/SKILL.md +651 -0
  79. package/skills/cometchat-ios-core/SKILL.md +822 -0
  80. package/skills/cometchat-ios-customization/SKILL.md +825 -0
  81. package/skills/cometchat-ios-features/SKILL.md +725 -0
  82. package/skills/cometchat-ios-placement/SKILL.md +750 -0
  83. package/skills/cometchat-ios-production/SKILL.md +730 -0
  84. package/skills/cometchat-ios-push/SKILL.md +582 -0
  85. package/skills/cometchat-ios-theming/SKILL.md +631 -0
  86. package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
  87. package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
  88. package/skills/cometchat-native-components/SKILL.md +594 -0
  89. package/skills/cometchat-native-core/SKILL.md +407 -0
  90. package/skills/cometchat-native-customization/SKILL.md +594 -0
  91. package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
  92. package/skills/cometchat-native-features/SKILL.md +608 -0
  93. package/skills/cometchat-native-placement/SKILL.md +500 -0
  94. package/skills/cometchat-native-production/SKILL.md +694 -0
  95. package/skills/cometchat-native-push/SKILL.md +593 -0
  96. package/skills/cometchat-native-testing/SKILL.md +583 -0
  97. package/skills/cometchat-native-theming/SKILL.md +656 -0
  98. package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
  99. package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
  100. package/skills/cometchat-production/SKILL.md +60 -0
  101. package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
@@ -0,0 +1,500 @@
1
+ ---
2
+ name: cometchat-native-placement
3
+ description: "Where to put chat in a React Native app — Stack screen, BottomTab, Modal, BottomSheet, Embedded. Maps each to CometChat component composition with ASCII layout references."
4
+ license: "MIT"
5
+ compatibility: "Node.js >=18; React Native >=0.70; @cometchat/chat-uikit-react-native ^5"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory, AskUserQuestion"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat react-native placement stack tabs modal bottomsheet embedded"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Teaches Claude the five canonical placement patterns for putting chat inside a React Native app. Each pattern specifies:
16
+
17
+ 1. Which CometChat components to compose
18
+ 2. How to wire the placement into `@react-navigation/*` (or Expo Router)
19
+ 3. Platform gotchas (safe-area, keyboard avoiding, gesture handling)
20
+ 4. When to choose this placement over the alternatives
21
+
22
+ Ground truth: `docs/ui-kit/react-native/react-native-conversation.mdx`, `react-native-one-to-one-chat.mdx`, `react-native-tab-based-chat.mdx`, their `expo-*.mdx` equivalents, and the `examples/SampleApp/` + `examples/SampleAppExpo/` sample apps.
23
+
24
+ **Read `cometchat-native-core` and `cometchat-native-components` before this skill** — the provider wrapper chain and component catalog are prerequisites.
25
+
26
+ ---
27
+
28
+ ## "What are you building?" — placement recommendation
29
+
30
+ Use this table to pick a placement. If the user says "add chat to my app" without specifying where, ask them what they're building.
31
+
32
+ | User intent | Recommended placement | Experience |
33
+ |---|---|---|
34
+ | Messaging app (WhatsApp / Telegram / Signal style) | **Conversations stack** — list → tap → full-page messages screen | Two-pane-equivalent on mobile |
35
+ | SaaS / marketplace / e-commerce with chat as a feature | **Stack screen** — dedicated `/chat` or `/messages` route | Full-page chat inside the app |
36
+ | Support app or focused 1-to-1 | **Stack screen (single thread)** — no conversation list, go straight into one chat | Single thread |
37
+ | Full messaging hub with calls / users / groups | **Bottom tabs** — Chats / Users / Groups / Calls tabs + stack screen for message view | Tab-based messenger |
38
+ | Occasional chat overlay from a non-chat screen | **Modal** — present from anywhere, dismiss to return | Modal |
39
+ | Inline comments / contextual chat | **BottomSheet** — swipe up from a screen section | Sheet |
40
+ | Chat embedded inside an existing screen (e.g. a support tab next to product details) | **Embedded** — CometChat components inside a parent layout | Embedded |
41
+
42
+ ---
43
+
44
+ ## Visual reference — five RN placement patterns
45
+
46
+ ### 1. Stack screen (full page)
47
+
48
+ ```
49
+ ┌───────────────────────────────────┐
50
+ │ ← Hiking Group ⋮ │ ← CometChatMessageHeader
51
+ ├───────────────────────────────────┤
52
+ │ │
53
+ │ ╭──────────╮ │
54
+ │ │ Message │ │
55
+ │ ╰──────────╯ │ ← CometChatMessageList
56
+ │ │
57
+ │ ╭──────────╮ │
58
+ │ │ Reply │ │
59
+ │ ╰──────────╯ │
60
+ │ │
61
+ ├───────────────────────────────────┤
62
+ │ + Type a message... ▶ │ ← CometChatMessageComposer
63
+ └───────────────────────────────────┘
64
+ ```
65
+
66
+ ### 2. Bottom tab
67
+
68
+ ```
69
+ ┌───────────────────────────────────┐
70
+ │ ← Hiking Group ⋮ │ ← header
71
+ ├───────────────────────────────────┤
72
+ │ │
73
+ │ (messages) │
74
+ │ │
75
+ ├───────────────────────────────────┤
76
+ │ Chats Users Groups Calls │ ← bottom tab bar
77
+ └───────────────────────────────────┘
78
+ ```
79
+
80
+ ### 3. Modal (slide-up over current screen)
81
+
82
+ ```
83
+ ┌─────────────────┐
84
+ │ ═══ Chat ✕ │ ← drag handle + close
85
+ ├─────────────────┤
86
+ │ │
87
+ │ (messages) │
88
+ │ │
89
+ ├─────────────────┤
90
+ │ Type message ▶ │
91
+ └─────────────────┘
92
+ (parent screen dimmed behind)
93
+ ```
94
+
95
+ ### 4. BottomSheet (swipe-up partial)
96
+
97
+ ```
98
+ parent screen visible at top ─────
99
+ ┌─────────────────┐
100
+ │ ═══ (handle) │
101
+ │ Hiking Group │
102
+ ├─────────────────┤
103
+ │ (messages) │
104
+ ├─────────────────┤
105
+ │ Type message ▶ │
106
+ └─────────────────┘
107
+ ```
108
+
109
+ ### 5. Embedded (inside an existing screen)
110
+
111
+ ```
112
+ ┌───────────────────────────────────┐
113
+ │ Product details │
114
+ │ [product image + specs] │
115
+ ├───────────────────────────────────┤
116
+ │ Contact seller │ ← section heading
117
+ │ ┌────────────────────────────┐ │
118
+ │ │ (CometChatMessageHeader) │ │
119
+ │ │ (CometChatMessageList) │ │ ← embedded chat
120
+ │ │ (CometChatMessageComposer) │ │
121
+ │ └────────────────────────────┘ │
122
+ └───────────────────────────────────┘
123
+ ```
124
+
125
+ ---
126
+
127
+ ## 1. Stack screen
128
+
129
+ The most common pattern — chat lives in its own screen, pushed via `@react-navigation/native-stack`.
130
+
131
+ ### Pattern A — Conversations list → Messages
132
+
133
+ Two screens: list + messages.
134
+
135
+ ```tsx
136
+ // ConversationsScreen.tsx
137
+ import { CometChatConversations, CometChatUiKitConstants } from "@cometchat/chat-uikit-react-native";
138
+ import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
139
+
140
+ export function ConversationsScreen({ navigation }: { navigation: NativeStackNavigationProp<any> }) {
141
+ return (
142
+ <CometChatConversations
143
+ onItemPress={(conversation) => {
144
+ const type = conversation.getConversationType();
145
+ if (type === CometChatUiKitConstants.ConversationTypeConstants.user) {
146
+ navigation.navigate("Messages", { user: conversation.getConversationWith() });
147
+ } else {
148
+ navigation.navigate("Messages", { group: conversation.getConversationWith() });
149
+ }
150
+ }}
151
+ />
152
+ );
153
+ }
154
+ ```
155
+
156
+ ```tsx
157
+ // MessagesScreen.tsx
158
+ import { View } from "react-native";
159
+ import {
160
+ CometChatMessageHeader,
161
+ CometChatMessageList,
162
+ CometChatMessageComposer,
163
+ } from "@cometchat/chat-uikit-react-native";
164
+
165
+ export function MessagesScreen({ route, navigation }: any) {
166
+ const { user, group } = route.params ?? {};
167
+ return (
168
+ <View style={{ flex: 1 }}>
169
+ <CometChatMessageHeader user={user} group={group} onBack={() => navigation.goBack()} showBackButton />
170
+ <CometChatMessageList user={user} group={group} hideReplyInThreadOption />
171
+ <CometChatMessageComposer user={user} group={group} />
172
+ </View>
173
+ );
174
+ }
175
+ ```
176
+
177
+ ```tsx
178
+ // AppNavigator.tsx
179
+ import { createNativeStackNavigator } from "@react-navigation/native-stack";
180
+ const Stack = createNativeStackNavigator();
181
+
182
+ <Stack.Navigator screenOptions={{ headerShown: false }}>
183
+ <Stack.Screen name="Conversations" component={ConversationsScreen} />
184
+ <Stack.Screen name="Messages" component={MessagesScreen} />
185
+ </Stack.Navigator>
186
+ ```
187
+
188
+ ### Pattern B — Single thread (no conversation list)
189
+
190
+ For support chat, marketplace "Contact seller", or any focused 1-to-1 where the target user/group is known in advance.
191
+
192
+ ```tsx
193
+ export function SupportChatScreen() {
194
+ const [agent, setAgent] = useState<CometChat.User | null>(null);
195
+ const [loading, setLoading] = useState(true);
196
+
197
+ useEffect(() => {
198
+ CometChat.getUser("support-agent-uid")
199
+ .then((user) => {
200
+ setAgent(user);
201
+ setLoading(false);
202
+ })
203
+ .catch(() => setLoading(false));
204
+ }, []);
205
+
206
+ if (loading) return <ActivityIndicator style={{ flex: 1 }} />;
207
+ if (!agent) return <Text style={{ padding: 16 }}>Support unavailable. Try again shortly.</Text>;
208
+
209
+ return (
210
+ <View style={{ flex: 1 }}>
211
+ <CometChatMessageHeader user={agent} />
212
+ <CometChatMessageList user={agent} hideReplyInThreadOption />
213
+ <CometChatMessageComposer user={agent} />
214
+ </View>
215
+ );
216
+ }
217
+ ```
218
+
219
+ ### Navigation wiring notes
220
+
221
+ - The screen is wrapped in a `<View style={{ flex: 1 }}>` so the composer sits at the bottom and the list fills the middle.
222
+ - `CometChatMessageHeader`'s `onBack` should call `navigation.goBack()`. Set `showBackButton` explicitly so the header knows to render it.
223
+ - **Keyboard avoiding**: when the composer is visible, RN needs `KeyboardAvoidingView` on iOS or `android:windowSoftInputMode="adjustResize"` on Android. The framework patterns (`cometchat-native-expo-patterns`, `cometchat-native-bare-patterns`) cover the platform-specific wiring.
224
+
225
+ ---
226
+
227
+ ## 2. Bottom tab
228
+
229
+ For full-featured messengers with distinct entry points per content type.
230
+
231
+ ```tsx
232
+ // TabsNavigator.tsx
233
+ import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
234
+ import { createNativeStackNavigator } from "@react-navigation/native-stack";
235
+
236
+ const Tab = createBottomTabNavigator();
237
+ const Stack = createNativeStackNavigator();
238
+
239
+ function MainTabs() {
240
+ return (
241
+ <Tab.Navigator screenOptions={{ headerShown: false }}>
242
+ <Tab.Screen name="Chats" component={ConversationsScreen} />
243
+ <Tab.Screen name="Users" component={UsersScreen} />
244
+ <Tab.Screen name="Groups" component={GroupsScreen} />
245
+ <Tab.Screen name="Calls" component={CallLogsScreen} />
246
+ </Tab.Navigator>
247
+ );
248
+ }
249
+
250
+ export function AppNavigator() {
251
+ return (
252
+ <Stack.Navigator screenOptions={{ headerShown: false }}>
253
+ <Stack.Screen name="Main" component={MainTabs} />
254
+ <Stack.Screen name="Messages" component={MessagesScreen} />
255
+ </Stack.Navigator>
256
+ );
257
+ }
258
+ ```
259
+
260
+ Each tab screen pushes to a shared `Messages` stack screen with the selected entity:
261
+
262
+ ```tsx
263
+ export function UsersScreen({ navigation }: any) {
264
+ return (
265
+ <CometChatUsers onItemPress={(user) => navigation.navigate("Messages", { user })} />
266
+ );
267
+ }
268
+ export function GroupsScreen({ navigation }: any) {
269
+ return (
270
+ <CometChatGroups onItemPress={(group) => navigation.navigate("Messages", { group })} />
271
+ );
272
+ }
273
+ export function CallLogsScreen() {
274
+ return <CometChatCallLogs />;
275
+ }
276
+ ```
277
+
278
+ ### Wiring notes
279
+
280
+ - Tabs use `@react-navigation/bottom-tabs`. The `Messages` screen is OUTSIDE the tab navigator (at the stack level) so it presents full-screen without the tab bar.
281
+ - For the **Calls** tab, `CometChatCallLogs` only works when `@cometchat/calls-sdk-react-native` is installed. Omit the Calls tab if the project doesn't use calling.
282
+
283
+ ---
284
+
285
+ ## 3. Modal
286
+
287
+ For occasional chat that doesn't belong in the primary navigation. Two approaches — native RN `<Modal>` or react-navigation's `presentation: "modal"`.
288
+
289
+ ### Pattern A — React Navigation modal (recommended)
290
+
291
+ Cleaner — the modal is a regular stack screen with a modal presentation option.
292
+
293
+ ```tsx
294
+ <Stack.Navigator screenOptions={{ headerShown: false }}>
295
+ <Stack.Screen name="Home" component={HomeScreen} />
296
+ <Stack.Screen
297
+ name="ChatModal"
298
+ component={ChatModalScreen}
299
+ options={{ presentation: "modal" }}
300
+ />
301
+ </Stack.Navigator>
302
+ ```
303
+
304
+ ```tsx
305
+ function ChatModalScreen({ navigation }: any) {
306
+ const [agent, setAgent] = useState<CometChat.User | null>(null);
307
+ useEffect(() => { CometChat.getUser("support-agent").then(setAgent); }, []);
308
+ if (!agent) return null;
309
+ return (
310
+ <View style={{ flex: 1 }}>
311
+ <CometChatMessageHeader user={agent} onBack={() => navigation.goBack()} showBackButton />
312
+ <CometChatMessageList user={agent} hideReplyInThreadOption />
313
+ <CometChatMessageComposer user={agent} />
314
+ </View>
315
+ );
316
+ }
317
+
318
+ // Trigger from anywhere:
319
+ <Button title="Contact support" onPress={() => navigation.navigate("ChatModal")} />
320
+ ```
321
+
322
+ iOS gets the native modal slide-up. Android shows a fade-in full-screen by default — if you need a swipe-to-dismiss feel, use the BottomSheet pattern instead.
323
+
324
+ ### Pattern B — RN `<Modal>` component
325
+
326
+ For lightweight one-off modals that don't need a separate route.
327
+
328
+ ```tsx
329
+ import { Modal, Pressable, View } from "react-native";
330
+
331
+ const [visible, setVisible] = useState(false);
332
+
333
+ <Modal visible={visible} animationType="slide" onRequestClose={() => setVisible(false)}>
334
+ <SafeAreaView style={{ flex: 1 }}>
335
+ <View style={{ flex: 1 }}>
336
+ <CometChatMessageHeader user={agent} onBack={() => setVisible(false)} showBackButton />
337
+ <CometChatMessageList user={agent} hideReplyInThreadOption />
338
+ <CometChatMessageComposer user={agent} />
339
+ </View>
340
+ </SafeAreaView>
341
+ </Modal>
342
+ ```
343
+
344
+ Works fine but bypasses navigation state — deep links and back-button handling need extra work.
345
+
346
+ ---
347
+
348
+ ## 4. BottomSheet
349
+
350
+ Native-feel swipe-up chat overlaid on a parent screen. Two library options; pick one based on the project's existing navigation:
351
+
352
+ | Library | When to use |
353
+ |---|---|
354
+ | `@gorhom/bottom-sheet` | Most flexible + most common. Good for partial-height sheets with snap points. |
355
+ | `@cometchat/chat-uikit-react-native`'s `CometChatBottomSheet` | Lightweight. Good if the project doesn't already depend on `@gorhom/bottom-sheet`. |
356
+
357
+ ### Pattern A — @gorhom/bottom-sheet
358
+
359
+ ```tsx
360
+ import BottomSheet, { BottomSheetView } from "@gorhom/bottom-sheet";
361
+ import { useRef, useMemo } from "react";
362
+
363
+ function ProductScreen({ product }: any) {
364
+ const sheetRef = useRef<BottomSheet>(null);
365
+ const snapPoints = useMemo(() => ["25%", "90%"], []);
366
+ const [agent, setAgent] = useState<CometChat.User | null>(null);
367
+
368
+ useEffect(() => {
369
+ CometChat.getUser(product.sellerUid).then(setAgent);
370
+ }, [product.sellerUid]);
371
+
372
+ return (
373
+ <View style={{ flex: 1 }}>
374
+ <ProductDetails product={product} />
375
+ <Button title="Contact seller" onPress={() => sheetRef.current?.expand()} />
376
+
377
+ <BottomSheet ref={sheetRef} snapPoints={snapPoints} index={-1} enablePanDownToClose>
378
+ <BottomSheetView style={{ flex: 1 }}>
379
+ {agent && (
380
+ <>
381
+ <CometChatMessageHeader user={agent} />
382
+ <CometChatMessageList user={agent} hideReplyInThreadOption />
383
+ <CometChatMessageComposer user={agent} />
384
+ </>
385
+ )}
386
+ </BottomSheetView>
387
+ </BottomSheet>
388
+ </View>
389
+ );
390
+ }
391
+ ```
392
+
393
+ ### Pattern B — CometChatBottomSheet
394
+
395
+ ```tsx
396
+ import { CometChatBottomSheet } from "@cometchat/chat-uikit-react-native";
397
+
398
+ const sheetRef = useRef<any>(null);
399
+
400
+ <CometChatBottomSheet ref={sheetRef}>
401
+ <View style={{ flex: 1, height: "100%" }}>
402
+ <CometChatMessageHeader user={agent} />
403
+ <CometChatMessageList user={agent} hideReplyInThreadOption />
404
+ <CometChatMessageComposer user={agent} />
405
+ </View>
406
+ </CometChatBottomSheet>
407
+
408
+ <Button title="Chat" onPress={() => sheetRef.current?.show()} />
409
+ ```
410
+
411
+ ### BottomSheet gotchas
412
+
413
+ - **Snap points must be memoized**: Always wrap `snapPoints` in `useMemo(() => [...], [])` (see Pattern A above). An inline array creates a new reference on every parent render, which forces `@gorhom/bottom-sheet` to re-measure layout and tears the open/close gesture animation. The example above does this correctly — do NOT "simplify" by inlining the array.
414
+ - **Keyboard behavior**: `@gorhom/bottom-sheet` has `keyboardBehavior` + `keyboardBlurBehavior` props. Without them the composer gets covered by the keyboard on iOS. Use `keyboardBehavior="interactive"` + `keyboardBlurBehavior="restore"`.
415
+ - **Gesture handler wrap**: BottomSheet requires `<GestureHandlerRootView style={{ flex: 1 }}>` at the root (already required by the UI Kit — see `cometchat-native-core` § 3).
416
+ - **Height**: Pass `flex: 1` + `height: "100%"` on the inner View so the message list expands to fill the sheet.
417
+
418
+ ---
419
+
420
+ ## 5. Embedded
421
+
422
+ Chat inside an existing screen, not its own route.
423
+
424
+ ```tsx
425
+ export function ProductDetailScreen({ product }: any) {
426
+ const [agent, setAgent] = useState<CometChat.User | null>(null);
427
+ useEffect(() => { CometChat.getUser(product.sellerUid).then(setAgent); }, [product.sellerUid]);
428
+
429
+ return (
430
+ <ScrollView style={{ flex: 1 }} keyboardShouldPersistTaps="handled">
431
+ <ProductImages images={product.images} />
432
+ <ProductSpecs product={product} />
433
+
434
+ <View style={{ marginTop: 24 }}>
435
+ <Text style={{ fontSize: 18, fontWeight: "600", padding: 16 }}>Chat with seller</Text>
436
+ <View style={{ height: 480 }}>
437
+ {agent && (
438
+ <>
439
+ <CometChatMessageHeader user={agent} />
440
+ <CometChatMessageList user={agent} hideReplyInThreadOption />
441
+ <CometChatMessageComposer user={agent} />
442
+ </>
443
+ )}
444
+ </View>
445
+ </View>
446
+ </ScrollView>
447
+ );
448
+ }
449
+ ```
450
+
451
+ ### Embedded gotchas
452
+
453
+ - **Fixed height required.** CometChat components fill 100% of their parent. If you put them inside a `ScrollView` without a bounded height, the list collapses to zero height. Wrap in a `<View style={{ height: NNN }}>` or flex container with an explicit height.
454
+ - **Scroll conflict.** If the parent is a `ScrollView`, the message list's internal scroll competes with the parent's scroll. Consider the single-thread-as-stack-screen pattern instead if the chat is a primary UX.
455
+ - **Composer focus.** When the user taps the composer, the keyboard rises and can push the embedded chat off-screen on iOS. `keyboardShouldPersistTaps="handled"` on the parent ScrollView + `KeyboardAvoidingView` at the root help.
456
+
457
+ Usually the embedded pattern is the wrong default — prefer a Modal or BottomSheet trigger from a button on the screen, which gives users a dedicated surface for chatting.
458
+
459
+ ---
460
+
461
+ ## Hard rules
462
+
463
+ These apply to ALL placement patterns. Violating any of them causes integration bugs or destroys the existing navigation.
464
+
465
+ 1. **NEVER modify the project's existing navigator without reading it first.** Understand what's there before adding screens or tabs. Don't replace a user's navigation structure unless they explicitly chose "demo mode."
466
+
467
+ 2. **ALWAYS use a separate screen / stack entry for chat**, not inline replacement of an existing screen. The one exception is embedded placement (§ 5) where chat is explicitly part of a bigger screen.
468
+
469
+ 3. **The four-wrapper chain is required at the app root**, not per-screen (see `cometchat-native-core` § 3). Re-wrapping per screen causes duplicate init + login, dropped WebSockets, and a 2–3-second flicker on first mount.
470
+
471
+ 4. **`import "react-native-gesture-handler"`** must be at the very top of `index.js` (or Expo entry). Missing this import silently disables swipe gestures in the composer, bottom sheet, and attachment drawer.
472
+
473
+ 5. **Every `<CometChatMessageList>` MUST include `hideReplyInThreadOption`** unless the integration also wires a full thread panel (`CometChatThreadHeader` + scoped list + scoped composer with `parentMessageId`). Drawer / modal / bottom sheet / embedded / stack-screen placements without a thread panel **must include the flag** — otherwise "Reply in Thread" shows in the message menu and silently does nothing.
474
+
475
+ 6. **Resolve user / group before rendering.** The component props `user` and `group` expect `CometChat.User` and `CometChat.Group` instances — not bare UID strings. Fetch via `CometChat.getUser(uid)` / `CometChat.getGroup(guid)` in a `useEffect` and gate the render on the resolved object.
476
+
477
+ 7. **Pass either `user` or `group`, never both.** Passing both causes runtime errors. Branch in render based on which one is set.
478
+
479
+ 8. **Every CometChat container must have explicit flex height.** Components fill 100% of parent. If parent has no bounded height (`flex: 1`, `height: N`, or inside a flex layout with `flex: N`), components collapse to zero height and render empty. This is THE most common "why is my chat blank" bug.
480
+
481
+ 9. **For modals and bottom sheets, set `keyboardShouldPersistTaps="handled"`** on any ScrollView / FlatList parent and configure keyboard behavior explicitly. Otherwise the composer gets hidden by the keyboard on iOS.
482
+
483
+ 10. **Never animate a CometChat-containing container with `transform`** (including Tailwind's `translate-x-*` / `translate-y-*` / `scale-*` / `rotate-*` utilities if using NativeWind). `transform` creates a new containing block for `position: "absolute"` descendants, which reparents CometChat's absolute-positioned overlays (emoji picker, action sheet, reactions popover) and makes them misalign. In RN this is less common than web (RN has no `position: fixed`) but the same rule applies to any `position: absolute` pickers. Animate `right` / `left` / `top` / `bottom` offsets instead.
484
+
485
+ ---
486
+
487
+ ## Skill routing reference
488
+
489
+ | Skill | When to route |
490
+ |---|---|
491
+ | `cometchat-native-core` | Always first — init, login, provider wrapper chain |
492
+ | `cometchat-native-components` | For component prop details — always |
493
+ | `cometchat-native-placement` | This skill — picking + wiring a placement |
494
+ | `cometchat-native-expo-patterns` | Expo-specific integration (app.json, permissions, Expo Router) |
495
+ | `cometchat-native-bare-patterns` | Bare RN (pod install, native modules, privacy manifest) |
496
+ | `cometchat-native-theming` | Customize colors / typography / dark mode |
497
+ | `cometchat-native-features` | Calls, extensions, AI — the "add a feature" flow |
498
+ | `cometchat-native-customization` | Custom slot views, text formatters, events |
499
+ | `cometchat-native-production` | Server-side auth tokens |
500
+ | `cometchat-native-troubleshooting` | Blank chat / gestures not working / keyboard covering composer / pod install fails |