{"id":"62a6be7d-bdcf-41a9-b86f-5a85ec214cf7","shortId":"3Pgqj7","kind":"skill","title":"cometchat-android-v5-extensions","tagline":"Extension architecture for CometChat Android — ExtensionsDataSource, decorators, built-in extensions, and how to create custom extensions.","description":"> **Companion skills:** `cometchat-android-v5-customization` covers DataSource decorators;\n> `cometchat-android-v5-features` covers the feature catalog.\n\n## Purpose\n\nThis skill covers the CometChat extension architecture — how extensions plug into the UI Kit, the built-in extensions, and how to create custom ones.\n\n---\n\n## Use this skill when\n\n- \"How do extensions work?\"\n- \"How do I add a custom extension?\"\n- \"How do I disable an extension?\"\n- Working with `ExtensionsDataSource` or `ExtensionDecorator`\n\n## Do not use this skill when\n\n- Enabling a backend extension or AI feature → use `cometchat-android-v5-features` (which routes to `cometchat apply-feature <id> --app-id <X>`)\n- Writing custom message templates → use `cometchat-android-v5-customization`\n\n---\n\n## 1. Extension architecture\n\nExtensions are split into two class types:\n\n- **Registrar** classes (e.g. `PollsExtension`, `StickerExtension`) — extend `ExtensionsDataSource`. These are what you pass to `setExtensions(...)` to enable a built-in extension.\n- **Decorator** classes (e.g. `PollsExtensionDecorator`, `StickerExtensionDecorator`) — extend `DataSourceDecorator`. These are the runtime decorators that wrap the active `DataSource` chain. The kit creates them internally; you don't construct them directly.\n\n```\nChatConfigurator.getDataSource()\n    └── SmartRepliesExtensionDecorator   (created by SmartRepliesExtension)\n        └── PollsExtensionDecorator      (created by PollsExtension)\n            └── StickerExtensionDecorator (created by StickerExtension)\n                └── MessagesDataSource (base)\n```\n\n## 2. Built-in extensions\n\n| Extension | Package | What it adds |\n|---|---|---|\n| Polls | `com.cometchat.chatuikit.extensions.polls` | Poll creation and voting in messages |\n| Stickers | `com.cometchat.chatuikit.extensions.sticker` | Sticker keyboard and sticker bubbles |\n| Collaborative Document | `com.cometchat.chatuikit.extensions.collaborative` | Shared document editing |\n| Collaborative Whiteboard | `com.cometchat.chatuikit.extensions.collaborative` | Shared whiteboard |\n| Smart Replies | `com.cometchat.chatuikit.extensions.smartreplies` | AI-powered reply suggestions |\n| Message Translation | `com.cometchat.chatuikit.extensions.messagetranslation` | Translate messages |\n| Text Moderation | `com.cometchat.chatuikit.extensions.textmoderation` | Profanity filtering |\n| Thumbnail Generation | `com.cometchat.chatuikit.extensions.thumbnailgeneration` | Image thumbnails |\n\n## 3. Enabling/disabling extensions\n\nExtensions are enabled by default. To customize which extensions are active, pass a custom list to `UIKitSettingsBuilder`:\n\n```java\nList<ExtensionsDataSource> extensions = new ArrayList<>();\nextensions.add(new PollsExtension());            // registrar, NOT PollsExtensionDecorator\nextensions.add(new StickerExtension());         // registrar, NOT StickerExtensionDecorator\nextensions.add(new SmartRepliesExtension());\n// Omit extensions you don't want\n\nUIKitSettings settings = new UIKitSettings.UIKitSettingsBuilder()\n    .setAppId(APP_ID)\n    .setRegion(REGION)\n    .setAuthKey(AUTH_KEY)\n    .setExtensions(extensions)\n    .build();\n```\n\n> **Why not `PollsExtensionDecorator`?** `*ExtensionDecorator` extends `DataSourceDecorator`, not `ExtensionsDataSource` — so it won't compile when added to a `List<ExtensionsDataSource>`. The kit's runtime decorator chain is built by the registrar's `enable()` method internally; you don't add decorators directly.\n\n## 4. Creating a custom extension\n\nA custom extension has TWO classes:\n\n1. A **registrar** that extends `ExtensionsDataSource` (gets added to `setExtensions(...)`)\n2. A **decorator** that extends `DataSourceDecorator` (created by the registrar via `ChatConfigurator.enable(...)`)\n\n```java\n// 1. Decorator — extends DataSourceDecorator, overrides per-message behavior\npublic class MyExtensionDecorator extends DataSourceDecorator {\n    public MyExtensionDecorator(DataSource dataSource) {\n        super(dataSource);\n    }\n    // Override methods to add custom behavior\n}\n\n// 2. Registrar — extends ExtensionsDataSource, exposes getExtensionId() and enable()\npublic class MyExtension extends ExtensionsDataSource {\n    @Override\n    public String getExtensionId() {\n        return \"my-custom-extension\";\n    }\n\n    @Override\n    public void enable() {\n        ChatConfigurator.enable(dataSource -> new MyExtensionDecorator(dataSource));\n    }\n}\n\n// Then add the registrar to UIKitSettings:\nextensions.add(new MyExtension());\n```\n\n---\n\n## Hard rules\n\n- **Two classes per extension.** A registrar (`ExtensionsDataSource`, holds `getExtensionId()` + `enable()`) and a decorator (`DataSourceDecorator`, holds the per-message override). `setExtensions(...)` wants registrars; the chain builds decorators automatically.\n- **Register after init.** `ChatConfigurator.enable()` must be called after `CometChatUIKit.init()` succeeds.\n- **Backend extension toggle still applies.** Even if an extension is registered client-side, it needs to be enabled on the app's backend. Use `cometchat apply-feature <id> --app-id <X>` (the CLI hits the dashboard API). For dashboard-only extensions (Giphy / Stipop / Tenor / Chatwoot / Intercom — those needing third-party API keys), the user has to enter the third-party config in the dashboard manually.","tags":["cometchat","android","extensions","skills","agent-skills","ai-agent","chat","claude-code","cursor","messaging","nextjs","react"],"capabilities":["skill","source-cometchat","skill-cometchat-android-v5-extensions","topic-agent-skills","topic-ai-agent","topic-chat","topic-claude-code","topic-cometchat","topic-cursor","topic-messaging","topic-nextjs","topic-react","topic-react-native","topic-ui-kit"],"categories":["cometchat-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/cometchat/cometchat-skills/cometchat-android-v5-extensions","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add cometchat/cometchat-skills","source_repo":"https://github.com/cometchat/cometchat-skills","install_from":"skills.sh"}},"qualityScore":"0.463","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 27 github stars · SKILL.md body (5,299 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:04:44.914Z","embedding":null,"createdAt":"2026-05-07T13:05:03.716Z","updatedAt":"2026-05-18T19:04:44.914Z","lastSeenAt":"2026-05-18T19:04:44.914Z","tsv":"'1':133,378,401 '2':208,388,427 '3':267 '4':367 'activ':179,280 'ad':342,385 'add':79,217,364,424,459 'ai':105,248 'ai-pow':247 'android':3,10,27,35,110,130 'api':544,560 'app':121,318,528,537 'app-id':120,536 'appli':118,511,534 'apply-featur':117,533 'architectur':7,49,135 'arraylist':291 'auth':323 'automat':496 'backend':102,507,530 'base':207 'behavior':409,426 'bubbl':232 'build':327,494 'built':14,59,161,210,353 'built-in':13,58,160,209 'call':503 'catalog':41 'chain':181,351,493 'chatconfigurator.enable':399,453,500 'chatconfigurator.getdatasource':193 'chatwoot':553 'class':141,144,165,377,411,436,470 'cli':540 'client':519 'client-sid':518 'collabor':233,239 'com.cometchat.chatuikit.extensions.collaborative':235,241 'com.cometchat.chatuikit.extensions.messagetranslation':254 'com.cometchat.chatuikit.extensions.polls':219 'com.cometchat.chatuikit.extensions.smartreplies':246 'com.cometchat.chatuikit.extensions.sticker':227 'com.cometchat.chatuikit.extensions.textmoderation':259 'com.cometchat.chatuikit.extensions.thumbnailgeneration':264 'cometchat':2,9,26,34,47,109,116,129,532 'cometchat-android-v5-customization':25,128 'cometchat-android-v5-extensions':1 'cometchat-android-v5-features':33,108 'cometchatuikit.init':505 'companion':23 'compil':340 'config':571 'construct':190 'cover':30,38,45 'creat':20,65,184,195,199,203,368,394 'creation':221 'custom':21,29,66,81,124,132,276,283,370,373,425,447 'dashboard':543,547,574 'dashboard-on':546 'datasourc':31,180,417,418,420,454,457 'datasourcedecor':170,333,393,404,414,482 'decor':12,32,164,175,350,365,390,402,481,495 'default':274 'direct':192,366 'disabl':86 'document':234,237 'e.g':145,166 'edit':238 'enabl':100,158,272,358,434,452,478,525 'enabling/disabling':268 'enter':566 'even':512 'expos':431 'extend':148,169,332,382,392,403,413,429,438 'extens':5,6,16,22,48,51,61,74,82,88,103,134,136,163,212,213,269,270,278,289,308,326,371,374,448,472,508,515,549 'extensiondecor':93,331 'extensions.add':292,298,304,464 'extensionsdatasourc':11,91,149,335,383,430,439,475 'featur':37,40,106,112,119,535 'filter':261 'generat':263 'get':384 'getextensionid':432,443,477 'giphi':550 'hard':467 'hit':541 'hold':476,483 'id':122,319,538 'imag':265 'init':499 'intercom':554 'intern':186,360 'java':287,400 'key':324,561 'keyboard':229 'kit':56,183,347 'list':284,288,345 'manual':575 'messag':125,225,252,256,408,487 'messagesdatasourc':206 'method':359,422 'moder':258 'must':501 'my-custom-extens':445 'myextens':437,466 'myextensiondecor':412,416,456 'need':522,556 'new':290,293,299,305,315,455,465 'omit':307 'one':67 'overrid':405,421,440,449,488 'packag':214 'parti':559,570 'pass':154,281 'per':407,471,486 'per-messag':406,485 'plug':52 'poll':218,220 'pollsextens':146,201,294 'pollsextensiondecor':167,198,297,330 'power':249 'profan':260 'public':410,415,435,441,450 'purpos':42 'region':321 'regist':497,517 'registrar':143,295,301,356,380,397,428,461,474,491 'repli':245,250 'return':444 'rout':114 'rule':468 'runtim':174,349 'set':314 'setappid':317 'setauthkey':322 'setextens':156,325,387,489 'setregion':320 'share':236,242 'side':520 'skill':24,44,70,98 'skill-cometchat-android-v5-extensions' 'smart':244 'smartrepliesextens':197,306 'smartrepliesextensiondecor':194 'source-cometchat' 'split':138 'sticker':226,228,231 'stickerextens':147,205,300 'stickerextensiondecor':168,202,303 'still':510 'stipop':551 'string':442 'succeed':506 'suggest':251 'super':419 'templat':126 'tenor':552 'text':257 'third':558,569 'third-parti':557,568 'thumbnail':262,266 'toggl':509 'topic-agent-skills' 'topic-ai-agent' 'topic-chat' 'topic-claude-code' 'topic-cometchat' 'topic-cursor' 'topic-messaging' 'topic-nextjs' 'topic-react' 'topic-react-native' 'topic-ui-kit' 'translat':253,255 'two':140,376,469 'type':142 'ui':55 'uikitset':313,463 'uikitsettings.uikitsettingsbuilder':316 'uikitsettingsbuild':286 'use':68,96,107,127,531 'user':563 'v5':4,28,36,111,131 'via':398 'void':451 'vote':223 'want':312,490 'whiteboard':240,243 'won':338 'work':75,89 'wrap':177 'write':123","prices":[{"id":"91bdf31d-8540-4cc6-a23d-dc2211687ad7","listingId":"62a6be7d-bdcf-41a9-b86f-5a85ec214cf7","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"cometchat","category":"cometchat-skills","install_from":"skills.sh"},"createdAt":"2026-05-07T13:05:03.716Z"}],"sources":[{"listingId":"62a6be7d-bdcf-41a9-b86f-5a85ec214cf7","source":"github","sourceId":"cometchat/cometchat-skills/cometchat-android-v5-extensions","sourceUrl":"https://github.com/cometchat/cometchat-skills/tree/main/skills/cometchat-android-v5-extensions","isPrimary":false,"firstSeenAt":"2026-05-07T13:05:03.716Z","lastSeenAt":"2026-05-18T19:04:44.914Z"}],"details":{"listingId":"62a6be7d-bdcf-41a9-b86f-5a85ec214cf7","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"cometchat","slug":"cometchat-android-v5-extensions","github":{"repo":"cometchat/cometchat-skills","stars":27,"topics":["agent-skills","ai-agent","chat","claude-code","cometchat","cursor","messaging","nextjs","react","react-native","ui-kit"],"license":null,"html_url":"https://github.com/cometchat/cometchat-skills","pushed_at":"2026-05-18T05:04:24Z","description":"Add CometChat chat to any React, Next.js, React Native, Angular, Android, iOS, or Flutter project through your AI coding agent. Works with Claude Code, Cursor, Codex, VS Code Copilot, Windsurf, Cline, Kiro, and 50+ more agents.","skill_md_sha":"30d22120c8d3d4fdaa20e7ada5fa8a72d5ae6d55","skill_md_path":"skills/cometchat-android-v5-extensions/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/cometchat/cometchat-skills/tree/main/skills/cometchat-android-v5-extensions"},"layout":"multi","source":"github","category":"cometchat-skills","frontmatter":{"name":"cometchat-android-v5-extensions","license":"MIT","description":"Extension architecture for CometChat Android — ExtensionsDataSource, decorators, built-in extensions, and how to create custom extensions.","compatibility":"Android 7.0+; Java 8+; Kotlin 1.8+; com.cometchat:chat-uikit-android:5.x"},"skills_sh_url":"https://skills.sh/cometchat/cometchat-skills/cometchat-android-v5-extensions"},"updatedAt":"2026-05-18T19:04:44.914Z"}}