@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,485 @@
1
+ ---
2
+ name: cometchat-native-expo-patterns
3
+ description: "Integration patterns for Expo managed workflow — app.json config, permissions, gesture handler setup, env vars, Expo Router file-based routing subsection."
4
+ license: "MIT"
5
+ compatibility: "Node.js >=18; Expo SDK >=50; @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 expo managed expo-router"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Teaches Claude how to integrate CometChat into an Expo managed workflow project. Covers:
16
+
17
+ - Installing the full peer-dependency set (not just the UI Kit)
18
+ - Configuring `app.json` permissions for iOS + Android
19
+ - Wiring the provider chain in `App.tsx` with all four wrappers
20
+ - Optional calling SDK setup
21
+ - Env vars via `expo-constants` or `.env`
22
+ - **Expo Router subsection** (file-based routing)
23
+ - Prebuild + run cadence
24
+
25
+ **Read `cometchat-native-core` first** (init/login/wrapper chain + anti-patterns), then `cometchat-native-components` (prop reference), then `cometchat-native-placement` (where chat goes).
26
+
27
+ Ground truth: `docs/ui-kit/react-native/expo-integration.mdx`, `expo-conversation.mdx`, `expo-one-to-one-chat.mdx`, `expo-tab-based-chat.mdx`, and `examples/SampleAppExpo/`.
28
+
29
+ ---
30
+
31
+ ## Use this skill when
32
+
33
+ - Project has `expo` in `package.json` dependencies
34
+ - `app.json` / `app.config.js` exists at the root
35
+ - `package.json` `main` field references `expo` (e.g. `"main": "index.js"` with an Expo-style entry)
36
+ - The user says "Expo", "Expo Router", "managed workflow", or "EAS"
37
+
38
+ **Do NOT use this skill when:**
39
+ - The project has an `ios/` + `android/` folder at the root (that's bare RN → use `cometchat-native-bare-patterns`)
40
+ - The user says "bare React Native", "React Native CLI", or "ejected"
41
+
42
+ ---
43
+
44
+ ## Hard prerequisite — Expo Go is NOT supported
45
+
46
+ The CometChat UI Kit depends on native modules that can't be shimmed. This means:
47
+
48
+ - **Expo Go won't load your app** — you'll see "Main module field cannot be resolved" or similar
49
+ - You must build a **development client** (`eas build --profile development` or `expo run:ios` / `expo run:android`)
50
+ - Or install in a plain Expo simulator via prebuild
51
+
52
+ The first build can take 5-15 minutes. Subsequent runs are fast via the dev client.
53
+
54
+ Before integrating, confirm the user has either:
55
+ - `eas-cli` installed and an EAS account, OR
56
+ - Xcode + Android Studio for local prebuilds
57
+
58
+ If neither, stop and ask them to set one up. Don't waste their time installing packages that won't run.
59
+
60
+ ---
61
+
62
+ ## Step 1 — Install dependencies
63
+
64
+ The UI Kit has a long peer-dep tail. Install them all in one shot so Expo's resolver doesn't miss a native module during prebuild:
65
+
66
+ ```bash
67
+ # Core SDK + UI Kit
68
+ npm install @cometchat/chat-sdk-react-native
69
+ npm install @cometchat/chat-uikit-react-native
70
+
71
+ # Required peer deps (all natively-linked)
72
+ npx expo install \
73
+ @react-native-async-storage/async-storage \
74
+ @react-native-clipboard/clipboard \
75
+ @react-native-community/datetimepicker \
76
+ react-native-gesture-handler \
77
+ react-native-localize \
78
+ react-native-safe-area-context \
79
+ react-native-svg \
80
+ react-native-video
81
+
82
+ # dayjs + punycode — no native code but required by the kit
83
+ npm install dayjs punycode
84
+ ```
85
+
86
+ **Why `npx expo install` for the natively-linked deps?** `expo install` picks versions compatible with the project's Expo SDK. Using `npm install` directly can land incompatible versions that break prebuild.
87
+
88
+ ### Optional — calling SDK
89
+
90
+ If the user's flow includes voice / video calls (the `cometchat-native-features` skill's § Calls gates this):
91
+
92
+ ```bash
93
+ npm install @cometchat/calls-sdk-react-native
94
+ npx expo install \
95
+ @react-native-community/netinfo \
96
+ react-native-background-timer \
97
+ react-native-callstats \
98
+ react-native-webrtc
99
+ ```
100
+
101
+ Skip these until the user actually wants calls. Adding WebRTC to an Expo project bloats the prebuild and requires extra permissions — don't speculatively enable it.
102
+
103
+ ---
104
+
105
+ ## Step 2 — Configure app.json
106
+
107
+ Add iOS + Android permissions so the kit's attachments, camera, mic, and media features work. Merge into existing `expo.ios.infoPlist` / `expo.android.permissions` — do not replace anything the user already has.
108
+
109
+ ```json
110
+ {
111
+ "expo": {
112
+ "ios": {
113
+ "infoPlist": {
114
+ "NSCameraUsageDescription": "Allow camera access to send photos and make video calls",
115
+ "NSMicrophoneUsageDescription": "Allow microphone access to send voice messages and make calls",
116
+ "NSPhotoLibraryUsageDescription": "Allow photo library access to send photos",
117
+ "NSPhotoLibraryAddUsageDescription": "Allow saving photos from chat to your library"
118
+ }
119
+ },
120
+ "android": {
121
+ "permissions": [
122
+ "android.permission.INTERNET",
123
+ "android.permission.ACCESS_NETWORK_STATE",
124
+ "android.permission.CAMERA",
125
+ "android.permission.RECORD_AUDIO",
126
+ "android.permission.MODIFY_AUDIO_SETTINGS",
127
+ "android.permission.READ_EXTERNAL_STORAGE",
128
+ "android.permission.WRITE_EXTERNAL_STORAGE",
129
+ "android.permission.VIBRATE",
130
+ "android.permission.READ_MEDIA_IMAGES",
131
+ "android.permission.READ_MEDIA_VIDEO",
132
+ "android.permission.READ_MEDIA_AUDIO"
133
+ ]
134
+ }
135
+ }
136
+ }
137
+ ```
138
+
139
+ **Permission-string best practice**: the iOS `Usage` strings show in the system prompt when iOS asks the user for permission — write them as user-facing copy, not developer notes. `"Camera access for video calls"` is fine; `"for media upload"` isn't a real reason a user would accept.
140
+
141
+ ### If the project uses `app.config.js` or `app.config.ts`
142
+
143
+ Merge the same fields into the exported config. Don't switch the project from JS to JSON unless the user asks — respect their setup.
144
+
145
+ ---
146
+
147
+ ## Step 3 — Wire the provider chain in App.tsx
148
+
149
+ Expo projects use the same four-wrapper chain as bare RN (see `cometchat-native-core` § 3). The difference is the entry file — Expo uses `App.tsx` (or `index.ts` + `registerRootComponent`) rather than bare's `index.js` + `AppRegistry`.
150
+
151
+ ```tsx
152
+ // App.tsx
153
+ import "react-native-gesture-handler"; // MUST be the first import
154
+ import React from "react";
155
+ import { GestureHandlerRootView } from "react-native-gesture-handler";
156
+ import { SafeAreaProvider } from "react-native-safe-area-context";
157
+ import { CometChatThemeProvider } from "@cometchat/chat-uikit-react-native";
158
+ import { CometChatProvider } from "./src/providers/CometChatProvider";
159
+ import { AppNavigator } from "./src/navigation/AppNavigator";
160
+ import Constants from "expo-constants";
161
+
162
+ const extra = Constants.expoConfig?.extra ?? {};
163
+
164
+ export default function App() {
165
+ return (
166
+ <GestureHandlerRootView style={{ flex: 1 }}>
167
+ <SafeAreaProvider>
168
+ <CometChatThemeProvider>
169
+ <CometChatProvider
170
+ appId={extra.COMETCHAT_APP_ID}
171
+ region={extra.COMETCHAT_REGION}
172
+ authKey={extra.COMETCHAT_AUTH_KEY}
173
+ uid="cometchat-uid-1" // dev mode only
174
+ >
175
+ <AppNavigator />
176
+ </CometChatProvider>
177
+ </CometChatThemeProvider>
178
+ </SafeAreaProvider>
179
+ </GestureHandlerRootView>
180
+ );
181
+ }
182
+ ```
183
+
184
+ The `CometChatProvider` itself is defined per `cometchat-native-core` § 6 — reuse that implementation; don't invent another one.
185
+
186
+ ### `import "react-native-gesture-handler"` must be first
187
+
188
+ Even before React. Expo's entry-file hot reload otherwise loses the gesture handler patch and the composer / bottom-sheet gestures silently disable.
189
+
190
+ ```ts
191
+ // At the top of App.tsx:
192
+ import "react-native-gesture-handler";
193
+ // THEN everything else
194
+ import React from "react";
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Step 4 — Env vars
200
+
201
+ Two options; pick one based on what the project already uses.
202
+
203
+ ### Option A — `app.json extra` + `expo-constants` (simple, recommended)
204
+
205
+ ```json
206
+ {
207
+ "expo": {
208
+ "extra": {
209
+ "COMETCHAT_APP_ID": "YOUR_APP_ID",
210
+ "COMETCHAT_REGION": "us",
211
+ "COMETCHAT_AUTH_KEY": "YOUR_AUTH_KEY"
212
+ }
213
+ }
214
+ }
215
+ ```
216
+
217
+ Read via `expo-constants`:
218
+
219
+ ```tsx
220
+ import Constants from "expo-constants";
221
+ const { COMETCHAT_APP_ID, COMETCHAT_REGION, COMETCHAT_AUTH_KEY } = Constants.expoConfig?.extra ?? {};
222
+ ```
223
+
224
+ **Warning**: these values end up in the client bundle. Never put `REST_API_KEY` or any server-side secret in `expo.extra` — use a backend (see `cometchat-native-production`).
225
+
226
+ ### Option B — `.env` + `expo-dotenv` / SDK-native `.env` support
227
+
228
+ Expo SDK 50+ supports `.env` out of the box via `EXPO_PUBLIC_*` prefix:
229
+
230
+ ```
231
+ # .env
232
+ EXPO_PUBLIC_COMETCHAT_APP_ID=your_app_id
233
+ EXPO_PUBLIC_COMETCHAT_REGION=us
234
+ EXPO_PUBLIC_COMETCHAT_AUTH_KEY=your_auth_key
235
+ ```
236
+
237
+ Read directly via `process.env.EXPO_PUBLIC_COMETCHAT_APP_ID` anywhere in your app. Any variable WITHOUT the `EXPO_PUBLIC_` prefix is ONLY available in `app.config.js` / server scripts, not bundled — useful for REST API keys in backend-only code.
238
+
239
+ ### Which to choose
240
+
241
+ - If the project already has `.env` — **Option B**.
242
+ - If the project hasn't set up env vars at all — **Option A** (one file, no prefix rules).
243
+ - Never mix both for the same variable — pick one place.
244
+
245
+ ---
246
+
247
+ ## Step 5 — Expo Router subsection
248
+
249
+ Expo Router is a file-based alternative to `@react-navigation/*`. If the project has `app/` instead of (or alongside) `src/screens/`, they're using Expo Router.
250
+
251
+ Detect Expo Router by checking `package.json` for `expo-router` in dependencies, and `app.json` for the `"expo-router"` plugin.
252
+
253
+ ### 5a — Router entry (`app/_layout.tsx`)
254
+
255
+ In Expo Router, the `app/_layout.tsx` file is the root layout — wrap the provider chain here instead of in `App.tsx`.
256
+
257
+ ```tsx
258
+ // app/_layout.tsx
259
+ import "react-native-gesture-handler";
260
+ import { GestureHandlerRootView } from "react-native-gesture-handler";
261
+ import { SafeAreaProvider } from "react-native-safe-area-context";
262
+ import { CometChatThemeProvider } from "@cometchat/chat-uikit-react-native";
263
+ import { CometChatProvider } from "../src/providers/CometChatProvider";
264
+ import { Slot } from "expo-router";
265
+ import Constants from "expo-constants";
266
+
267
+ const extra = Constants.expoConfig?.extra ?? {};
268
+
269
+ export default function RootLayout() {
270
+ return (
271
+ <GestureHandlerRootView style={{ flex: 1 }}>
272
+ <SafeAreaProvider>
273
+ <CometChatThemeProvider>
274
+ <CometChatProvider
275
+ appId={extra.COMETCHAT_APP_ID}
276
+ region={extra.COMETCHAT_REGION}
277
+ authKey={extra.COMETCHAT_AUTH_KEY}
278
+ uid="cometchat-uid-1"
279
+ >
280
+ <Slot /> {/* Expo Router renders child routes here */}
281
+ </CometChatProvider>
282
+ </CometChatThemeProvider>
283
+ </SafeAreaProvider>
284
+ </GestureHandlerRootView>
285
+ );
286
+ }
287
+ ```
288
+
289
+ ### 5b — Conversations + message route
290
+
291
+ ```
292
+ app/
293
+ _layout.tsx ← provider chain (above)
294
+ index.tsx ← home (could be the conversations list)
295
+ messages/
296
+ [uid].tsx ← dynamic route, one chat per uid
297
+ ```
298
+
299
+ ```tsx
300
+ // app/index.tsx
301
+ import { CometChatConversations, CometChatUiKitConstants } from "@cometchat/chat-uikit-react-native";
302
+ import { router } from "expo-router";
303
+
304
+ export default function Home() {
305
+ return (
306
+ <CometChatConversations
307
+ onItemPress={(conversation) => {
308
+ const entity = conversation.getConversationWith();
309
+ const type = conversation.getConversationType();
310
+ if (type === CometChatUiKitConstants.ConversationTypeConstants.user) {
311
+ router.push(`/messages/${(entity as any).getUid()}`);
312
+ } else {
313
+ router.push(`/messages/group-${(entity as any).getGuid()}`);
314
+ }
315
+ }}
316
+ />
317
+ );
318
+ }
319
+ ```
320
+
321
+ ```tsx
322
+ // app/messages/[uid].tsx
323
+ import { useLocalSearchParams, router } from "expo-router";
324
+ import { useEffect, useState } from "react";
325
+ import { View } from "react-native";
326
+ import { CometChat } from "@cometchat/chat-sdk-react-native";
327
+ import {
328
+ CometChatMessageHeader,
329
+ CometChatMessageList,
330
+ CometChatMessageComposer,
331
+ } from "@cometchat/chat-uikit-react-native";
332
+
333
+ export default function ChatScreen() {
334
+ const { uid } = useLocalSearchParams<{ uid: string }>();
335
+ const [user, setUser] = useState<CometChat.User | null>(null);
336
+
337
+ useEffect(() => {
338
+ if (!uid) return;
339
+ // Simple UID routing; group routing encodes differently in the index example above
340
+ CometChat.getUser(uid).then(setUser).catch(() => setUser(null));
341
+ }, [uid]);
342
+
343
+ if (!user) return null;
344
+
345
+ return (
346
+ <View style={{ flex: 1 }}>
347
+ <CometChatMessageHeader user={user} onBack={() => router.back()} showBackButton />
348
+ <CometChatMessageList user={user} hideReplyInThreadOption />
349
+ <CometChatMessageComposer user={user} />
350
+ </View>
351
+ );
352
+ }
353
+ ```
354
+
355
+ ### 5c — Tabs in Expo Router (if the project uses them)
356
+
357
+ ```
358
+ app/
359
+ _layout.tsx
360
+ (tabs)/
361
+ _layout.tsx ← Tabs layout
362
+ chats.tsx
363
+ users.tsx
364
+ groups.tsx
365
+ calls.tsx
366
+ messages/
367
+ [uid].tsx
368
+ ```
369
+
370
+ ```tsx
371
+ // app/(tabs)/_layout.tsx
372
+ import { Tabs } from "expo-router";
373
+
374
+ export default function TabsLayout() {
375
+ return (
376
+ <Tabs screenOptions={{ headerShown: false }}>
377
+ <Tabs.Screen name="chats" options={{ title: "Chats" }} />
378
+ <Tabs.Screen name="users" options={{ title: "Users" }} />
379
+ <Tabs.Screen name="groups" options={{ title: "Groups" }} />
380
+ <Tabs.Screen name="calls" options={{ title: "Calls" }} />
381
+ </Tabs>
382
+ );
383
+ }
384
+ ```
385
+
386
+ Each tab file renders a single list component (`CometChatConversations`, `CometChatUsers`, etc. — see `cometchat-native-placement` § 2 Bottom tab for the component choices) and pushes to `/messages/[uid]` on press.
387
+
388
+ ### Expo Router gotchas
389
+
390
+ - **`unstable_settings`** in `_layout.tsx` can break deep linking if set incorrectly. Leave it alone unless you know you need it.
391
+ - **Navigation between stack + tabs**: `router.push("/messages/abc")` works from a tab. `router.back()` returns to the tab. No extra configuration needed.
392
+ - **Search params**: use `useLocalSearchParams()` (not `useSearchParams()` — that's web-only).
393
+
394
+ ---
395
+
396
+ ## Step 6 — Prebuild + run
397
+
398
+ Before the first run, Expo needs to generate native projects:
399
+
400
+ ```bash
401
+ npx expo prebuild
402
+ ```
403
+
404
+ Then run on the platform:
405
+
406
+ ```bash
407
+ # iOS (requires Xcode)
408
+ npx expo run:ios
409
+
410
+ # Android (requires Android Studio)
411
+ npx expo run:android
412
+
413
+ # Or EAS for cloud builds
414
+ eas build --profile development --platform ios
415
+ ```
416
+
417
+ Subsequent runs use `npx expo start` with the dev client — no rebuild needed unless native deps change.
418
+
419
+ **When to rebuild vs. reload:**
420
+ - Changed JS / JSX / TSX → no rebuild, just `r` to reload or save in Fast Refresh
421
+ - Added / removed a native dependency → `npx expo prebuild --clean && npx expo run:ios`
422
+ - Changed `app.json` permissions or plugins → `npx expo prebuild --clean`
423
+
424
+ ---
425
+
426
+ ## Step 7 — Verify integration
427
+
428
+ ```bash
429
+ npx tsc --noEmit # TypeScript check
430
+ ```
431
+
432
+ Then in the running app:
433
+
434
+ 1. Open the chat screen you wired
435
+ 2. Check that the keyboard opens when you tap the composer (gesture handler working)
436
+ 3. Tap the "+" attachment button — the action sheet should slide up (bottom sheet working)
437
+ 4. Send a message — it should appear immediately
438
+
439
+ If any of these don't work, see `cometchat-native-troubleshooting`.
440
+
441
+ ---
442
+
443
+ ## Hard rules
444
+
445
+ 1. **No Expo Go.** The user's project must use development builds. Detect early and tell the user if they're on Expo Go.
446
+ 2. **`import "react-native-gesture-handler"` is the first line of the entry file** (`App.tsx` or `app/_layout.tsx` for Expo Router). Not second. Not after any React import.
447
+ 3. **Install all peer deps via `npx expo install`**, not `npm install`, for native modules. Expo's resolver picks SDK-compatible versions.
448
+ 4. **Never commit `REST_API_KEY`** (or any server-side secret) to `app.json extra` — it ends up in the client bundle. Use a server endpoint (see `cometchat-native-production`).
449
+ 5. **Merge permissions into `app.json`, don't replace.** The user may already have permissions for other libraries; wipe them out and their other features break.
450
+ 6. **`npx expo prebuild --clean` after changing `app.json` permissions or adding native deps.** Without it, iOS + Android see the old config.
451
+ 7. **Every `<CometChatMessageList>` must include `hideReplyInThreadOption`** unless you're also wiring a full thread panel (see `cometchat-native-placement` § Hard rule 5).
452
+ 8. **The four-wrapper chain goes at the app root**, not per-screen (see `cometchat-native-core` § 3). For Expo Router, that's `app/_layout.tsx`. For plain Expo, that's `App.tsx`.
453
+
454
+ ---
455
+
456
+ ## Common questions
457
+
458
+ **Q: Can I use `npx create-expo-app --template tabs`?**
459
+ Yes — the tabs template already has Expo Router set up. Just add the provider chain in `app/_layout.tsx` per § 5a and replace a tab's content with a CometChat component.
460
+
461
+ **Q: Can I use SDK ≤49?**
462
+ Expo SDK 49 may work but the CometChat peer deps target 50+ conventions. If the user is stuck on an older SDK, ask them to upgrade — or fall back to bare RN via `npx expo prebuild` + `cometchat-native-bare-patterns`.
463
+
464
+ **Q: I'm seeing "Main module field cannot be resolved" when opening Expo Go.**
465
+ That's the "Expo Go doesn't support native modules" error. Build a dev client: `eas build --profile development` or `npx expo run:ios`.
466
+
467
+ **Q: My app crashes on first push-notification receive.**
468
+ Push notifications need additional setup (APNs + FCM + maybe `expo-notifications`). Out of scope for this skill — see `cometchat-native-troubleshooting` § Push notifications.
469
+
470
+ ---
471
+
472
+ ## Skill routing reference
473
+
474
+ | Skill | When to route |
475
+ |---|---|
476
+ | `cometchat-native-core` | Init / login / wrapper chain / anti-patterns |
477
+ | `cometchat-native-components` | Component prop reference |
478
+ | `cometchat-native-placement` | Where chat goes (stack / tabs / modal / bottom sheet / embedded) |
479
+ | `cometchat-native-expo-patterns` | This skill — Expo managed workflow specifics |
480
+ | `cometchat-native-bare-patterns` | Bare RN (pod install, native modules, privacy manifest) |
481
+ | `cometchat-native-features` | Calls, extensions, AI |
482
+ | `cometchat-native-theming` | Theme customization |
483
+ | `cometchat-native-customization` | Text formatters, events, custom views |
484
+ | `cometchat-native-production` | Server-side auth tokens + user management |
485
+ | `cometchat-native-troubleshooting` | Prebuild failures, Expo Go errors, keyboard issues, blank chat |