cometchat/cometchat-uikit-flutter/cometchat-flutter-core
Claude Code and agent skill by cometchat/cometchat-uikit-flutter
- community
Checking that the SKILL.md file is still in the repository.
Use when writing any code that uses cometchat_chat_uikit. Contains hard rules that prevent silent failures, crashes, and subtle bugs. Covers CometChatUIKit.init, login, logout, UIKitSettings, UIKitSettingsBuilder, listener lifecycle, theme caching, subscriptionType, region, muid preservation, and the Clean Architecture + BLoC component pattern. Also use when seeing errors like "Authentication null", "APP ID null", ERR_ALREADY_LOGGED_IN, or StateError from uninitialized ServiceLocator. Make sure…
Install
npx vskill@latest install cometchat/cometchat-uikit-flutter/cometchat-flutter-coreSKILL.md
The same SKILL.md was published earlier as cometchat/cometchat-uikit-flutter/cometchat-flutter-core.
CometChat Flutter UIKit — Core Rules
Non-negotiable constraints for all CometChat UIKit code. Violating these causes silent failures or crashes.
Rule: INIT_FIRST
CometChatUIKit.init() must complete before any login, component usage, or SDK call.
With ..enableCalls = true, init (and login/loginWithAuthToken) call onSuccess, and complete their futures, only once the Calls SDK is set up too: within about 22 s, and a Calls failure never becomes onError. Await init behind a splash screen, not before runApp.
Rule: AUTH_CHECK_AFTER_INIT
After CometChatUIKit.init() completes (in its onSuccess), the static field CometChatUIKit.loggedInUser is already populated if a cached session exists. Use this synchronous check — do NOT call CometChat.getLoggedInUser() separately.
The init() method internally calls getLoggedInUser() and sets CometChatUIKit.loggedInUser before firing onSuccess. Calling it again is redundant and the callback-based version can silently fail when no session exists (the SDK logs "Please log in to CometChat before calling this method" and neither callback fires consistently).
This also applies to login() and loginWithAuthToken() — all three populate CometChatUIKit.loggedInUser before calling onSuccess.
Rule: LISTENER_LIFECYCLE
SDK listeners MUST be registered with a unique ID in initState() and removed with the same ID in dispose(). Forgetting removal causes duplicate events and memory leaks.
Rule: THEME_CACHE
Cache theme values in didChangeDependencies() with a _themeInitialized flag. Never call CometChatThemeHelper.getColorPalette(context) in build() — during keyboard animation, MediaQuery changes trigger rebuilds, and each lookup does expensive InheritedWidget traversal (44-95ms instead of <16ms).
Rule: SUBSCRIPTION_TYPE_REQUIRED
Omitting subscriptionType in UIKitSettingsBuilder silently disables all presence events (online/offline, typing indicators). No error is thrown.
Rule: REGION_LOWERCASE
Region must be a lowercase string. The SDK validates against ['us', 'eu', 'in'].
Rule: SERVICE_LOCATOR_INIT
Each component's ServiceLocator.instance.setup() must be called before creating its BLoC. The UIKit widgets do this automatically, but if you create BLoCs manually:
Rule: MUID_PRESERVATION
When sending messages, the SDK may return an empty muid in the success callback. The UIKit preserves the original muid for pending→sent deduplication. If you handle ccMessageSent events, compare by muid first, then id.
Pattern: Callback → Async Bridge
The CometChat SDK uses callback-based APIs (onSuccess/onError). Wrap them with Completer for async/await:
This pattern is used internally by the UIKit's repository layer. Use it when calling SDK methods directly outside UIKit components.
Component Architecture Pattern
Every component follows this structure:
Naming Conventions
| Type | Pattern | Example | |
|---|---|---|---|
| Widget | CometChat{Name} | CometChatConversations | |
| BLoC | {Name}Bloc | ConversationsBloc | |
| Event | {Verb}{Name} | LoadConversations, MessageReceived | |
| State | {Name}State | ConversationsLoaded, MessageListState | |
| Repository | {Name}Repository / {Name}RepositoryImpl | ConversationsRepository | |
| Use Case | {Verb}{Name}UseCase | GetConversationsUseCase | |
| Service Locator | {Name}ServiceLocator | ConversationsServiceLocator | |
| Style | CometChat{Name}Style | CometChatConversationsStyle |
Checklist — Every CometChat Screen
- [ ]
CometChatUIKit.init()called before any usage - [ ] Auth check uses
CometChatUIKit.loggedInUserafter init, notCometChat.getLoggedInUser() - [ ]
subscriptionTypeset in UIKitSettingsBuilder - [ ]
regionis lowercase - [ ] Theme cached in
didChangeDependencies(), notbuild() - [ ] SDK listeners registered with unique ID, removed in
dispose() - [ ] Colors from
CometChatThemeHelper, never hardcoded - [ ] Strings from
Translations.of(context), never hardcoded
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cometchat-flutter-core/SKILL.md
Popularity
- Repository stars
- 591
- Repository forks
- 42
- 7-day trend score
- 31
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cometchat/cometchat-uikit-flutter/cometchat-flutter-core)