/cometchat-skills:cometchat-migrate-from-getstreamfrom cometchat-skills
Migrates an app from Stream (GetStream) Chat to CometChat across React, Angular, React Native, iOS, Android, and Flutter. Inventories Stream usage, swaps features, removes unsupported code, writes data-migration scripts, and produces a migration report.
Ships in cometchat-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Ground truth: the STREAM side (what to look for) is baked in
references/inventory.md+references/feature-map.md— confirm each hit by reading the user's code. The COMETCHAT side is never from memory: symbols come from the target family's skills + catalog, feature existence from that family'sfeatures.json, signatures from the docs via the family's-core/references/docs-map.md(Docs MCP first —RULES.md→ Fetch discipline). REST pages live underDOCS_BASE=https://www.cometchat.com/docs.
cometchat-<family>-core — the init → login → render the migrated app lands on. <family> is resolved in step 1; this skill ASSUMES that core and never restates its code.cometchat-<family>-components / -features / -calls / -push / -customization — pulled in only for the Stream features the inventory finds.The user asks to move an app off Stream: "migrate my app from GetStream/Stream to CometChat", "replace Stream Chat", "switch to CometChat", or "migrate my app to CometChat" when npx @cometchat/skills detect --json reports migrate_from with vendor getstream. Sendbird apps → cometchat-migrate-from-sendbird. An app with BOTH vendors: run both skills, one after the other, into one report.
Data only ("migrate only my data", "import my Stream users and messages", "don't change my code", or the app already runs on CometChat) → follow references/data-only.md INSTEAD of the workflow below: it writes and runs the data script and changes nothing else.
The migration request IS the approval (RULES.md → Competitor migration). Run every step below to the end in this one turn:
search_cometchat_docs tool? Say so in your first message, before any edit, with how to connect it (RULES.md → Canonical doc channel), then continue on web docs. Note it in the report.git switch -c cometchat-migration (carries any uncommitted work along; mention that in the report). Never commit, push, or rewrite history. No git → proceed and say so in the report.RULES.md's append-never-replace does not protect Stream code. It still protects everything else: touch non-chat code only to rewire it..cometchat/config.json or existing CometChat env values if present; otherwise write the family's env/settings file with clearly-named placeholders so the build still compiles, and make "add your CometChat credentials" action item #1. Never write a real key into a git-tracked file: check git ls-files <file> first. If the file is tracked, put real values in the untracked local variant the framework reads (Vite/Next .env.local, Android local.properties, ...) and keep placeholders in the tracked file. Adding a tracked file to .gitignore does NOT untrack it. The server's REST API key only ever goes into an untracked file or the hosting env.cometchat; (2) the app's platform has no family in this pack (Vue, Unity, .NET, ...) → deliver the inventory + feature map as the report, change nothing; (3) the build was already failing before you started → record the pre-existing errors, migrate anyway, and label them as pre-existing.Every step applies to every app, however small: a 3-file sample still has vendor users and history, so steps 4 (toCometChatId) and 8 (data script) are ALWAYS delivered. Only a step whose subject truly doesn't exist (no server → step 7) may be skipped, and it's listed under Defaults taken as skipped: <why>. A silent skip is a failed migration.
npx @cometchat/skills detect --json → framework, android_variant, existing_cometchat, migrate_from. Resolve <family> exactly like the router (peers.yaml dir_prefix; per-platform targets in references/inventory.md §Target family). Monorepo: migrate every package that uses Stream, including the server that mints tokens. existing_cometchat: true + Stream still present = a half-finished migration: resume it, don't redo it. Read .cometchat/config.json if it exists: its appId/region/authKey are THE credentials. Write them into the family's untracked env/settings file (single-prompt contract), never ask. Before editing anything, run the app's build once and record whether it passed.references/inventory.md (packages, imports, client creation, connectUser, SDK components, event subscriptions, channel queries, custom attachments, push devices, Video, Feeds, env vars, server tokens, webhooks, tests/mocks). Record every hit as file:line → what it does. Classify the app: UI SDK mode (Stream's React/Angular/RN/Flutter/iOS/Android UI components render the chat) → the family's CometChat UI Kit replaces them; client mode (own UI on the low-level client: stream-chat, stream_chat, StreamChat/ChatClient, stream-chat-android-client) → KEEP the app's UI and port its data layer to the family's CometChat Chat SDK; mixed → both.references/feature-map.md, then check the listed CometChat id in the TARGET family's features.json. Present → migrate. Absent → check BOTH levels — UI Kit (search_cometchat_docs "<feature> <platform> ui kit") AND Chat SDK/REST (... SDK); documented at either → migrate (no UI Kit drop-in is NOT unsupported), built with the SDK method in the app's own UI (RULES.md → UI Kit first, SDK fallback). Mark UNSUPPORTED only when NEITHER has it — and an empty MCP search is NOT proof: follow the verification ladder (re-query with CometChat vocabulary → live-fetch the likely docs page → cross-check the family CATALOG) in references/feature-map.md §Deciding unsupported, before any REMOVE. Never call a feature unsupported from memory or invent an API; if it truly can't be verified, KEEP it as needs-verification. Every UNSUPPORTED row needs evidence in the report — the features.json result + the exact UI Kit AND SDK queries you ran.cometchat-<family>-core (its install, initFromSettings, login gate, render order, env file). Identity: the CometChat UID is the app's existing Stream user ID passed through ONE shared toCometChatId() (references/concept-map.md §IDs). The GUID is the channel cid (type:id) through the same helper. The client login, the server token endpoint AND the data script all call the SAME toCometChatId() — put it in a shared client module (src/cometchat/ids.ts; native → §Native platforms) the login imports, and copy that body verbatim into the data script. Route the current-user id through it at login even when the Stream id already looks valid (it's a no-op then); confining toCometChatId to the data script is the #1 Stream migration miss and imports users under UIDs the app never logs in as (references/concept-map.md §IDs). Login: the app minted Stream user tokens on a server (createToken) or used a tokenProvider → migrate that endpoint (step 7) and use the auth-token login; the app used devToken() → Auth Key login (dev only) + an action item to switch to tokens before production. Keep every identity source, in the same order: whatever decides the current user today (URL params, env vars like VITE_USER_ID, the auth provider, a stored ID, a demo fallback) still decides it after the migration. Only the Stream-token-derived path becomes the CometChat auth token. Dropping one silently logs a configured deployment in as someone else. Returning users: the app already persists who is signed in (localStorage, keychain, prefs, a cookie) from the vendor era. Gate the chat on CometChat's logged-in user, NOT that cached ID. On start, a stored ID with no CometChat session → run the same login path before rendering any CometChat component; if that fails → the sign-in screen. Otherwise every user who was signed in before the upgrade lands on a broken chat. No UI Kit family for this app? A headless / vanilla-JS app that draws its own UI on the stream-chat client (no framework the pack ships a UI Kit for) has no -core to wire — do NOT stop. Install the CometChat Chat SDK for the platform (web → @cometchat/chat-sdk-javascript) and migrate the data layer straight onto it, taking every method from the SDK docs (/sdk/<platform>/*). Keep the app's own UI; there is no UI Kit to install. This is client/SDK mode with no framework core — the concept map's SDK/client-mode section still applies.references/concept-map.md: client/connectUser → CometChat init/login; ChannelList → conversations; channel (Channel/Window/MessageList/MessageInput/Thread) → message pane; member-based distinct channels → user conversations; client.on(...)/channel.on(...) → listeners (remove them on unmount); attachments/threads/reactions → the core + -features skill; theme/CSS variables/i18n → -customization; Stream Video → -calls (or the headless calls peer); push devices → -push. Remove each Stream import as you replace its last use. Both modes fetch from docs only: UI Kit component props AND SDK method signatures come from the live docs (the family core's docs-map.md), verified against the catalog — never written from memory or ported from the vendor's API shape.createToken, upsertUser on sign-up) with a CometChat auth-token endpoint (REST: create the user if missing, then create an auth token — /rest-api/auth-tokens, REST API key from server env only). Map Stream webhooks (verifyWebhook, x-signature) to CometChat webhooks (/rest-api/management-apis/webhooks/overview); before-message-send hooks, custom-command endpoints and SQS/SNS without an equivalent are REMOVED + listed. Replace other server-client calls with CometChat REST, or remove + list them.scripts/cometchat-migration/ per references/data-migration.md: export users, channels, members and messages with the Stream server client → transform with the same toCometChatId() → import through the CometChat Data Import API. When the code migration is done, tell the user the data-import script is ready and ask for the credentials it needs — the source keys (STREAM_API_KEY, STREAM_API_SECRET) and the CometChat App ID, Region and full-access REST API key. (Asking for these is the ONE question the single-prompt contract allows; everything else still takes the documented default.) As soon as the user provides them, RUN the import yourself from env vars — never write the secrets into a repo file: a --dry-run first (show the users / channels / members / messages counts), then the real import, then report what landed and what failed. Only messages within CometChat's 6-month retention window import — tell the user to reach out to CometChat to import messages older than 6 months. If the user does not share credentials, leave running the script as an action item.stream-chat-react/dist/css/..., @stream-io/stream-chat-css), i18n setup, env vars, native config, and CI secrets references. Remove Stream-only peer dependencies (offline SQLite, audio recorder, ...) only when nothing else imports them. react-native-reanimated, react-native-gesture-handler and react-native-svg are usually shared: keep those. Re-run the package manager install. On iOS/SPM the ROOT manifest counts too: a vendored-SDK repo declares the vendor in its own Package.swift/*.podspec at the repo root, not just in the app's .xcodeproj — remove the dependency there AND delete any vendored Framework/*.xcframework, or the vendor package is still declared after every call site is gone. Update the app's OWN docs (README, setup/deploy guides, .env.example): setup steps, env var names and screenshots captions that describe Stream now describe CometChat. Rename Stream-named identifiers (getstreamUserId → userId).RULES.md → Verification scope).COMETCHAT_MIGRATION.md at the repo root from references/report-template.md, then END your reply with its two lists pasted in full: Removed — not available in CometChat and Your action items. This final list is the deliverable the user asked for; never skip it, even if nothing was removed (say "none").CometChatProvider (and, on web, CometChatErrorBoundary) render wrapper elements exactly where the vendor's provider sat. If they now wrap the app's own shell/header, each wrapper needs a height in the chain, or the chat renders at 0px while the build passes. Follow the core's layout reference, and check the chain from the root element down to the conversation list.a-z 0-9 - _), max 100 characters, and lowercased. Stream cids contain :, member-based channel IDs start with !members-, and user IDs can contain @ or .. Sanitize with one deterministic function everywhere, and always feed it the full cid, so messaging:general and team:general stay distinct.!members-... ID, created from exactly two members) becomes a CometChat user conversation, not a two-person group.client.on(...)/channel.on(...)/useChatContext event path needs a CometChat listener that is also removed on unmount/dispose. Missing removals cause duplicate messages.extraData. Stream custom fields ride on users, channels and messages; move them into CometChat metadata/custom messages, or they silently disappear.RULES.md → Default-on affordances). Remove the entry point too.Native builds (Android/iOS/Flutter) have extra REQUIRED steps beyond editing code — bump the sample toolchain to the -core build floors, add the kit dep AND wire initFromSettings in the app entry, port toCometChatId to the client language, edit .pbxproj/.xcscheme as structured build graphs (never a text scrub), and RUN the platform build. A native migration is NOT done until you have followed references/native-build.md in full — open it and work through every step; it is mandatory, not optional.
flutter logs. Fix EVERY runtime error you introduced before declaring done — a Cannot read properties of undefined from a half-migrated reference, or an SDK enum/class read at module-load before the SDK is ready, is a migration bug, not the user's problem (hand off to cometchat-<family>-troubleshooting for symptom → fix). If the app genuinely can't be started here (no dev env / needs a device), SAY SO and give the user the exact run command + what to watch for — never silently skip this.grep -rIilE 'stream-chat|stream_chat|@stream-io|getstream|StreamChat|StreamVideo' . --exclude-dir=node_modules --exclude-dir=.git --exclude-dir=dist --exclude-dir=build --exclude-dir=.claude --exclude-dir=Pods --exclude-dir=.dart_tool --exclude-dir=.gradle | grep -vE 'COMETCHAT_MIGRATION.md|scripts/cometchat-migration' → must print nothing (repeated --exclude-dir= flags on purpose: a {a,b} brace list is rejected by the coding agent's command-permission parser, so the check silently never runs). The ONE allowed mention is a single provenance comment above toCometChatId(); code identifiers, README lines and env names are residue, not "expected". This includes a "migrated from " line in the README or any doc you write — a provenance note reads as helpful and is still residue; the migration report is where that belongs, and it is already exempt. Rewrite the app's own README so it describes CometChat, naming the vendor nowhere. The same goes for every other doc the repo ships — CHANGELOG.md, docs/, changelogs/, a vendored SDK's own release notes: if a file is not the migration report, it must not name the vendor. Delete the ones that document the vendor's product rather than your app.scripts/cometchat-migration/migrate.mjs + README.md exist — even for a demo/sample app with no data of its own (it is for the user's real data; step 8 is never skipped).features.json or the docs. Every UNSUPPORTED item is in the report's Removed list with its files.toCometChatId() — from a shared client module, and at login even for already-valid ids (not only inside the data script).git ls-files each file you wrote credentials to).references/concept-map.md (opens in a new tab)references/data-migration.md (opens in a new tab)references/data-only.md (opens in a new tab)references/feature-map.md (opens in a new tab)references/inventory.md (opens in a new tab)references/native-build.md (opens in a new tab)references/report-template.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cometchat, getstream, stream-chat, migration, chat-sdk, data-migration
npx claudepluginhub cometchat/cometchat-skills --plugin cometchat-skills98 skills in this plugin
/cometchatEntry point for any CometChat task on any platform. Detects the framework + UI Kit version (React, Angular, iOS, Android, React Native, Flutter), then routes to that family's skills — for a NEW integration or a change to an existing one. Triggers: 'add chat', 'add cometchat', 'add chat to my app', 'add calling', 'change something in my chat', 'my chat is already set up', 'add a feature to the chat', 'add chat to my android app', 'integrate cometchat android', 'add chat to my ios app', 'integrate cometchat ios', 'add chat to my swift app', 'migrate my app to cometchat', 'migrate from sendbird', 'migrate from getstream / stream', 'replace sendbird / stream chat with cometchat', 'build a <app> clone', 'make a chat app like <app>', 'make it look and work like <app>'./cometchat-a11yKeep a CometChat integration accessible — the UI Kit is designed targeting WCAG 2.1 AA with keyboard navigation (verify per component in its docs; full conformance still needs manual testing), and this skill makes sure the HOST app doesn't break that, covering contrast, focus, screen-reader context, reduced motion, RTL, and calls accessibility. Cross-family. Triggers: 'is cometchat accessible', 'WCAG / 508 / ADA compliance', 'screen reader support', 'keyboard navigation', 'a11y audit', 'accessible chat', 'contrast/focus issues in chat'.Other plugins' skills for the same job