@cometchat/skills 4.1.0 → 4.2.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 (257) hide show
  1. package/bin/install.js +298 -41
  2. package/package.json +1 -1
  3. package/skills/cometchat/SKILL.md +146 -27
  4. package/skills/cometchat-a11y/SKILL.md +476 -0
  5. package/skills/cometchat-android-v5/SKILL.md +1 -1
  6. package/skills/cometchat-android-v5-calls/SKILL.md +413 -0
  7. package/skills/cometchat-android-v5-calls/references/README.md +53 -0
  8. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +195 -0
  9. package/skills/cometchat-android-v5-calls/references/audio-controls.md +91 -0
  10. package/skills/cometchat-android-v5-calls/references/background-handling.md +168 -0
  11. package/skills/cometchat-android-v5-calls/references/call-layouts.md +123 -0
  12. package/skills/cometchat-android-v5-calls/references/call-logs.md +113 -0
  13. package/skills/cometchat-android-v5-calls/references/call-session.md +274 -0
  14. package/skills/cometchat-android-v5-calls/references/custom-ui.md +150 -0
  15. package/skills/cometchat-android-v5-calls/references/event-listeners.md +123 -0
  16. package/skills/cometchat-android-v5-calls/references/group-calls.md +205 -0
  17. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +111 -0
  18. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +134 -0
  19. package/skills/cometchat-android-v5-calls/references/join-session.md +120 -0
  20. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +206 -0
  21. package/skills/cometchat-android-v5-calls/references/participant-management.md +110 -0
  22. package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +106 -0
  23. package/skills/cometchat-android-v5-calls/references/raise-hand.md +242 -0
  24. package/skills/cometchat-android-v5-calls/references/recording.md +101 -0
  25. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +152 -0
  26. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +82 -0
  27. package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +215 -0
  28. package/skills/cometchat-android-v5-calls/references/session-settings.md +121 -0
  29. package/skills/cometchat-android-v5-calls/references/setup.md +137 -0
  30. package/skills/cometchat-android-v5-calls/references/share-invite.md +151 -0
  31. package/skills/cometchat-android-v5-calls/references/video-controls.md +87 -0
  32. package/skills/cometchat-android-v5-calls/references/voip-calling.md +526 -0
  33. package/skills/cometchat-android-v5-components/SKILL.md +1 -1
  34. package/skills/cometchat-android-v5-core/SKILL.md +1 -1
  35. package/skills/cometchat-android-v5-customization/SKILL.md +1 -1
  36. package/skills/cometchat-android-v5-extensions/SKILL.md +1 -1
  37. package/skills/cometchat-android-v5-features/SKILL.md +1 -1
  38. package/skills/cometchat-android-v5-placement/SKILL.md +1 -1
  39. package/skills/cometchat-android-v5-production/SKILL.md +1 -1
  40. package/skills/cometchat-android-v5-push/SKILL.md +1 -1
  41. package/skills/cometchat-android-v5-testing/SKILL.md +1 -1
  42. package/skills/cometchat-android-v5-theming/SKILL.md +1 -1
  43. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +1 -1
  44. package/skills/cometchat-android-v6/SKILL.md +1 -1
  45. package/skills/cometchat-android-v6-builder-settings/SKILL.md +1 -1
  46. package/skills/cometchat-android-v6-calls/SKILL.md +375 -0
  47. package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +97 -0
  48. package/skills/cometchat-android-v6-calls/references/call-layouts.md +91 -0
  49. package/skills/cometchat-android-v6-calls/references/call-session.md +163 -0
  50. package/skills/cometchat-android-v6-calls/references/device-management.md +171 -0
  51. package/skills/cometchat-android-v6-calls/references/group-calls.md +191 -0
  52. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +107 -0
  53. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +136 -0
  54. package/skills/cometchat-android-v6-calls/references/raise-hand.md +186 -0
  55. package/skills/cometchat-android-v6-calls/references/ringing-integration.md +176 -0
  56. package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +127 -0
  57. package/skills/cometchat-android-v6-calls/references/share-invite.md +105 -0
  58. package/skills/cometchat-android-v6-compose-components/SKILL.md +2 -2
  59. package/skills/cometchat-android-v6-compose-customization/SKILL.md +1 -1
  60. package/skills/cometchat-android-v6-compose-placement/SKILL.md +1 -1
  61. package/skills/cometchat-android-v6-compose-theming/SKILL.md +1 -1
  62. package/skills/cometchat-android-v6-core/SKILL.md +1 -1
  63. package/skills/cometchat-android-v6-events/SKILL.md +1 -1
  64. package/skills/cometchat-android-v6-extensions/SKILL.md +1 -1
  65. package/skills/cometchat-android-v6-features/SKILL.md +1 -1
  66. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +1 -1
  67. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +1 -1
  68. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +1 -1
  69. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +1 -1
  70. package/skills/cometchat-android-v6-migration/SKILL.md +398 -0
  71. package/skills/cometchat-android-v6-production/SKILL.md +1 -1
  72. package/skills/cometchat-android-v6-push/SKILL.md +1 -1
  73. package/skills/cometchat-android-v6-testing/SKILL.md +1 -1
  74. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +1 -1
  75. package/skills/cometchat-angular-calls/SKILL.md +511 -0
  76. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +95 -0
  77. package/skills/cometchat-angular-calls/references/call-layouts.md +106 -0
  78. package/skills/cometchat-angular-calls/references/call-session.md +167 -0
  79. package/skills/cometchat-angular-calls/references/custom-ui.md +231 -0
  80. package/skills/cometchat-angular-calls/references/device-management.md +135 -0
  81. package/skills/cometchat-angular-calls/references/group-calls.md +412 -0
  82. package/skills/cometchat-angular-calls/references/idle-timeout.md +145 -0
  83. package/skills/cometchat-angular-calls/references/in-call-chat.md +148 -0
  84. package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +205 -0
  85. package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +53 -0
  86. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +183 -0
  87. package/skills/cometchat-angular-calls/references/picture-in-picture.md +285 -0
  88. package/skills/cometchat-angular-calls/references/raise-hand.md +167 -0
  89. package/skills/cometchat-angular-calls/references/recording-screen-share.md +267 -0
  90. package/skills/cometchat-angular-calls/references/ringing-integration.md +131 -0
  91. package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +100 -0
  92. package/skills/cometchat-angular-calls/references/share-invite.md +116 -0
  93. package/skills/cometchat-angular-components/SKILL.md +1 -1
  94. package/skills/cometchat-angular-core/SKILL.md +1 -1
  95. package/skills/cometchat-angular-customization/SKILL.md +1 -1
  96. package/skills/cometchat-angular-features/SKILL.md +1 -1
  97. package/skills/cometchat-angular-patterns/SKILL.md +1 -1
  98. package/skills/cometchat-angular-placement/SKILL.md +1 -1
  99. package/skills/cometchat-angular-production/SKILL.md +1 -1
  100. package/skills/cometchat-angular-push/SKILL.md +403 -0
  101. package/skills/cometchat-angular-testing/SKILL.md +333 -0
  102. package/skills/cometchat-angular-theming/SKILL.md +1 -1
  103. package/skills/cometchat-angular-troubleshooting/SKILL.md +1 -1
  104. package/skills/cometchat-astro-patterns/SKILL.md +1 -1
  105. package/skills/cometchat-calls/SKILL.md +358 -0
  106. package/skills/cometchat-calls/references/use-case-broadcast.md +194 -0
  107. package/skills/cometchat-calls/references/use-case-marketplace.md +158 -0
  108. package/skills/cometchat-calls/references/use-case-support.md +190 -0
  109. package/skills/cometchat-calls/references/use-case-team.md +169 -0
  110. package/skills/cometchat-calls/references/use-case-telehealth.md +154 -0
  111. package/skills/cometchat-components/SKILL.md +1 -1
  112. package/skills/cometchat-core/SKILL.md +1 -1
  113. package/skills/cometchat-customization/SKILL.md +2 -2
  114. package/skills/cometchat-features/SKILL.md +2 -2
  115. package/skills/cometchat-flutter-v5/SKILL.md +1 -1
  116. package/skills/cometchat-flutter-v5-calls/SKILL.md +325 -94
  117. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +169 -0
  118. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +98 -0
  119. package/skills/cometchat-flutter-v5-calls/references/call-session.md +330 -0
  120. package/skills/cometchat-flutter-v5-calls/references/device-management.md +120 -0
  121. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +187 -0
  122. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +97 -0
  123. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +132 -0
  124. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +160 -0
  125. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +244 -0
  126. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +193 -0
  127. package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +101 -0
  128. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +142 -0
  129. package/skills/cometchat-flutter-v5-conversations/SKILL.md +1 -1
  130. package/skills/cometchat-flutter-v5-core/SKILL.md +1 -1
  131. package/skills/cometchat-flutter-v5-customization/SKILL.md +1 -1
  132. package/skills/cometchat-flutter-v5-events/SKILL.md +1 -1
  133. package/skills/cometchat-flutter-v5-messages/SKILL.md +1 -1
  134. package/skills/cometchat-flutter-v5-production/SKILL.md +1 -1
  135. package/skills/cometchat-flutter-v5-push/SKILL.md +1 -1
  136. package/skills/cometchat-flutter-v5-testing/SKILL.md +390 -0
  137. package/skills/cometchat-flutter-v5-theming/SKILL.md +1 -1
  138. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +1 -1
  139. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +1 -1
  140. package/skills/cometchat-flutter-v6/SKILL.md +1 -1
  141. package/skills/cometchat-flutter-v6-calls/SKILL.md +308 -243
  142. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +134 -0
  143. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +102 -0
  144. package/skills/cometchat-flutter-v6-calls/references/call-session.md +229 -0
  145. package/skills/cometchat-flutter-v6-calls/references/device-management.md +99 -0
  146. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +190 -0
  147. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +80 -0
  148. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +122 -0
  149. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +268 -0
  150. package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +171 -0
  151. package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +93 -0
  152. package/skills/cometchat-flutter-v6-calls/references/share-invite.md +102 -0
  153. package/skills/cometchat-flutter-v6-components/SKILL.md +1 -1
  154. package/skills/cometchat-flutter-v6-conversations/SKILL.md +1 -1
  155. package/skills/cometchat-flutter-v6-core/SKILL.md +1 -1
  156. package/skills/cometchat-flutter-v6-customization/SKILL.md +1 -1
  157. package/skills/cometchat-flutter-v6-events/SKILL.md +1 -1
  158. package/skills/cometchat-flutter-v6-features/SKILL.md +1 -1
  159. package/skills/cometchat-flutter-v6-messages/SKILL.md +1 -1
  160. package/skills/cometchat-flutter-v6-migration/SKILL.md +1 -1
  161. package/skills/cometchat-flutter-v6-placement/SKILL.md +1 -1
  162. package/skills/cometchat-flutter-v6-production/SKILL.md +1 -1
  163. package/skills/cometchat-flutter-v6-push/SKILL.md +452 -0
  164. package/skills/cometchat-flutter-v6-testing/SKILL.md +319 -0
  165. package/skills/cometchat-flutter-v6-theming/SKILL.md +1 -1
  166. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +1 -1
  167. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +1 -1
  168. package/skills/cometchat-i18n/SKILL.md +358 -0
  169. package/skills/cometchat-ios/SKILL.md +5 -5
  170. package/skills/cometchat-ios-calls/SKILL.md +409 -0
  171. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +172 -0
  172. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +189 -0
  173. package/skills/cometchat-ios-calls/references/call-layouts.md +136 -0
  174. package/skills/cometchat-ios-calls/references/call-session.md +221 -0
  175. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +353 -0
  176. package/skills/cometchat-ios-calls/references/custom-ui.md +322 -0
  177. package/skills/cometchat-ios-calls/references/device-management.md +171 -0
  178. package/skills/cometchat-ios-calls/references/group-calls.md +396 -0
  179. package/skills/cometchat-ios-calls/references/idle-timeout.md +185 -0
  180. package/skills/cometchat-ios-calls/references/in-call-chat.md +183 -0
  181. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +138 -0
  182. package/skills/cometchat-ios-calls/references/picture-in-picture.md +246 -0
  183. package/skills/cometchat-ios-calls/references/raise-hand.md +239 -0
  184. package/skills/cometchat-ios-calls/references/recording-screen-share.md +339 -0
  185. package/skills/cometchat-ios-calls/references/ringing-integration.md +142 -0
  186. package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +267 -0
  187. package/skills/cometchat-ios-calls/references/share-invite.md +152 -0
  188. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +246 -0
  189. package/skills/cometchat-ios-calls/references/voip-cert-setup.md +166 -0
  190. package/skills/cometchat-ios-components/SKILL.md +1 -1
  191. package/skills/cometchat-ios-core/SKILL.md +1 -1
  192. package/skills/cometchat-ios-customization/SKILL.md +1 -1
  193. package/skills/cometchat-ios-features/SKILL.md +1 -1
  194. package/skills/cometchat-ios-placement/SKILL.md +1 -1
  195. package/skills/cometchat-ios-production/SKILL.md +1 -1
  196. package/skills/cometchat-ios-push/SKILL.md +1 -1
  197. package/skills/cometchat-ios-testing/SKILL.md +371 -0
  198. package/skills/cometchat-ios-theming/SKILL.md +1 -1
  199. package/skills/cometchat-ios-troubleshooting/SKILL.md +1 -1
  200. package/skills/cometchat-native-bare-patterns/SKILL.md +45 -3
  201. package/skills/cometchat-native-calls/SKILL.md +599 -0
  202. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +203 -0
  203. package/skills/cometchat-native-calls/references/call-layouts.md +124 -0
  204. package/skills/cometchat-native-calls/references/call-session.md +182 -0
  205. package/skills/cometchat-native-calls/references/custom-ui.md +250 -0
  206. package/skills/cometchat-native-calls/references/device-management.md +135 -0
  207. package/skills/cometchat-native-calls/references/expo-vs-bare.md +179 -0
  208. package/skills/cometchat-native-calls/references/group-calls.md +291 -0
  209. package/skills/cometchat-native-calls/references/idle-timeout.md +128 -0
  210. package/skills/cometchat-native-calls/references/in-call-chat.md +143 -0
  211. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +72 -0
  212. package/skills/cometchat-native-calls/references/picture-in-picture.md +276 -0
  213. package/skills/cometchat-native-calls/references/raise-hand.md +203 -0
  214. package/skills/cometchat-native-calls/references/recording-screen-share.md +290 -0
  215. package/skills/cometchat-native-calls/references/ringing-integration.md +118 -0
  216. package/skills/cometchat-native-calls/references/server-push-bridge.md +135 -0
  217. package/skills/cometchat-native-calls/references/server-push-payloads.md +193 -0
  218. package/skills/cometchat-native-calls/references/share-invite.md +144 -0
  219. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +317 -0
  220. package/skills/cometchat-native-components/SKILL.md +1 -1
  221. package/skills/cometchat-native-core/SKILL.md +1 -1
  222. package/skills/cometchat-native-customization/SKILL.md +1 -1
  223. package/skills/cometchat-native-expo-patterns/SKILL.md +18 -1
  224. package/skills/cometchat-native-features/SKILL.md +1 -1
  225. package/skills/cometchat-native-placement/SKILL.md +1 -1
  226. package/skills/cometchat-native-production/SKILL.md +1 -1
  227. package/skills/cometchat-native-push/SKILL.md +1 -1
  228. package/skills/cometchat-native-testing/SKILL.md +1 -1
  229. package/skills/cometchat-native-theming/SKILL.md +1 -1
  230. package/skills/cometchat-native-troubleshooting/SKILL.md +1 -1
  231. package/skills/cometchat-nextjs-patterns/SKILL.md +1 -1
  232. package/skills/cometchat-placement/SKILL.md +1 -1
  233. package/skills/cometchat-production/SKILL.md +1 -1
  234. package/skills/cometchat-react-calls/SKILL.md +539 -0
  235. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +145 -0
  236. package/skills/cometchat-react-calls/references/call-layouts.md +161 -0
  237. package/skills/cometchat-react-calls/references/call-session.md +235 -0
  238. package/skills/cometchat-react-calls/references/custom-ui.md +201 -0
  239. package/skills/cometchat-react-calls/references/device-management.md +206 -0
  240. package/skills/cometchat-react-calls/references/group-calls.md +262 -0
  241. package/skills/cometchat-react-calls/references/idle-timeout.md +175 -0
  242. package/skills/cometchat-react-calls/references/in-call-chat.md +212 -0
  243. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +172 -0
  244. package/skills/cometchat-react-calls/references/picture-in-picture.md +245 -0
  245. package/skills/cometchat-react-calls/references/raise-hand.md +238 -0
  246. package/skills/cometchat-react-calls/references/recording-screen-share.md +143 -0
  247. package/skills/cometchat-react-calls/references/ringing-integration.md +255 -0
  248. package/skills/cometchat-react-calls/references/server-web-push-vapid.md +241 -0
  249. package/skills/cometchat-react-calls/references/share-invite.md +176 -0
  250. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +198 -0
  251. package/skills/cometchat-react-calls/references/voip-and-web-push.md +165 -0
  252. package/skills/cometchat-react-patterns/SKILL.md +1 -1
  253. package/skills/cometchat-react-push/SKILL.md +448 -0
  254. package/skills/cometchat-react-router-patterns/SKILL.md +1 -1
  255. package/skills/cometchat-react-testing/SKILL.md +404 -0
  256. package/skills/cometchat-theming/SKILL.md +3 -3
  257. package/skills/cometchat-troubleshooting/SKILL.md +2 -2
@@ -0,0 +1,476 @@
1
+ ---
2
+ name: cometchat-a11y
3
+ description: Accessibility (a11y) for CometChat UI Kit integrations across all families — React, React Native, Angular, Android (V5/V6), iOS, Flutter. Covers WCAG 2.1 AA targets, keyboard navigation in chat, screen reader announcements (live regions for new messages), color contrast, focus management on call screens, motion-reduction support, and the cross-family checks that catch the common production a11y bugs. Cross-family — applies wherever the agent is checking accessibility.
4
+ license: "MIT"
5
+ compatibility: "All CometChat UI Kit families v4.x / v5.x / v6.x"
6
+ allowed-tools: "shell, file-read, file-search, file-list, ask-user"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "4.0.0"
10
+ tags: "cometchat a11y accessibility wcag aa keyboard screen-reader voiceover talkback aria live-region focus-management contrast prefers-reduced-motion cross-family"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Accessibility for CometChat integrations. Out-of-the-box, the UI Kit components are mostly accessible — the kit's own buttons, inputs, and lists ship with semantic markup. Production gaps appear in the wiring **around** the kit: custom call surfaces, navigation, focus management on screen transitions, and contrast in custom themes.
16
+
17
+ Target: **WCAG 2.1 AA**. The skill writes code that meets this baseline.
18
+
19
+ ---
20
+
21
+ ## The five gaps that trip integrations (any family)
22
+
23
+ 1. **Color contrast in custom themes.** A brand color picked for "looks nice in the brand book" may be 3.2:1 against the text — fails AA's 4.5:1 minimum.
24
+ 2. **Focus management on chat screen entry.** Tab/screen reader user lands on the chat screen but focus stays on the previous trigger button. They have to manually navigate into the message list every time.
25
+ 3. **No live region announcement for new messages.** Screen reader users don't know a new message arrived unless they navigate the message list and hear the new item.
26
+ 4. **Keyboard-only users can't navigate the conversation list.** Click handlers bound to `<div>` instead of `<button>` skip keyboard events.
27
+ 5. **Reduced-motion users see decorative animations.** Typing-indicator dots, message bubble entrance animations, transition effects — should respect `prefers-reduced-motion`.
28
+
29
+ This skill addresses each one across families.
30
+
31
+ ---
32
+
33
+ ## 1. Color contrast — the theme audit
34
+
35
+ CometChat themes are CSS variables (web/RN) or color tokens (native/Flutter). Override a single color and you might fail AA.
36
+
37
+ ### Web / Angular — CSS variable contrast check
38
+
39
+ ```ts
40
+ // scripts/check-contrast.ts (run in CI or as a one-shot)
41
+ function contrastRatio(hex1: string, hex2: string): number {
42
+ const luminance = (hex: string) => {
43
+ const rgb = hex.match(/\w\w/g)!.map(c => parseInt(c, 16) / 255).map(c =>
44
+ c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4
45
+ );
46
+ return 0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2];
47
+ };
48
+ const l1 = luminance(hex1);
49
+ const l2 = luminance(hex2);
50
+ return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
51
+ }
52
+
53
+ // Pull the values from your CSS variables
54
+ const fg = getComputedStyle(document.documentElement).getPropertyValue("--cometchat-text-color").trim();
55
+ const bg = getComputedStyle(document.documentElement).getPropertyValue("--cometchat-background-color").trim();
56
+ const ratio = contrastRatio(fg, bg);
57
+ if (ratio < 4.5) {
58
+ console.warn(`Text/background contrast ${ratio.toFixed(2)}:1 fails WCAG AA (need ≥4.5:1)`);
59
+ }
60
+ ```
61
+
62
+ In CI, add this to your test suite. The skill writes a starter version into `tests/a11y/contrast.test.ts`.
63
+
64
+ ### React Native / native / Flutter — manual audit at theme-design time
65
+
66
+ Use a contrast-checker tool (browser extensions, https://webaim.org/resources/contrastchecker/) on the theme tokens before shipping. There's no runtime DOM to audit on native.
67
+
68
+ The kit's default theme tokens pass AA. Custom palettes need the audit.
69
+
70
+ **Common fail:** brand purple #6750A4 against white background = 6.6:1 (passes). Same purple against `#F0F0F0` light gray = 5.7:1 (passes). Same purple against `#999999` muted gray = 2.8:1 (FAILS). Watch for muted backgrounds in dark-mode toggles, secondary buttons, and "subtle" surfaces.
71
+
72
+ ---
73
+
74
+ ## 2. Focus management on chat screen entry
75
+
76
+ When the user navigates to a chat screen (clicked a conversation, opened the chat tab, accepted a deep link), focus should land on a meaningful control — usually the message composer or the latest message.
77
+
78
+ ### React (web)
79
+
80
+ ```tsx
81
+ import { useEffect, useRef } from "react";
82
+
83
+ export function ChatScreen() {
84
+ const composerRef = useRef<HTMLElement>(null);
85
+
86
+ useEffect(() => {
87
+ // After mount + animations, focus the composer
88
+ const timer = setTimeout(() => {
89
+ composerRef.current?.focus();
90
+ }, 100);
91
+ return () => clearTimeout(timer);
92
+ }, []);
93
+
94
+ return (
95
+ <div>
96
+ <CometChatMessageHeader />
97
+ <CometChatMessageList />
98
+ <CometChatMessageComposer ref={composerRef} />
99
+ </div>
100
+ );
101
+ }
102
+ ```
103
+
104
+ The kit's `CometChatMessageComposer` accepts a forwarded ref in v6; if not, query for the input via `composerRef.current?.querySelector("input, [contenteditable]")?.focus()`.
105
+
106
+ ### React Native
107
+
108
+ ```tsx
109
+ import { useRef, useEffect } from "react";
110
+ import { findNodeHandle, AccessibilityInfo } from "react-native";
111
+
112
+ export function ChatScreen() {
113
+ const composerRef = useRef(null);
114
+
115
+ useEffect(() => {
116
+ const handle = findNodeHandle(composerRef.current);
117
+ if (handle) {
118
+ AccessibilityInfo.setAccessibilityFocus(handle);
119
+ }
120
+ }, []);
121
+
122
+ return (
123
+ <View>
124
+ <CometChatMessageHeader />
125
+ <CometChatMessageList />
126
+ <CometChatMessageComposer ref={composerRef} />
127
+ </View>
128
+ );
129
+ }
130
+ ```
131
+
132
+ ### Angular
133
+
134
+ ```ts
135
+ @Component({...})
136
+ export class ChatComponent implements AfterViewInit {
137
+ @ViewChild("composer") composer!: ElementRef;
138
+
139
+ ngAfterViewInit() {
140
+ setTimeout(() => this.composer.nativeElement.focus(), 100);
141
+ }
142
+ }
143
+ ```
144
+
145
+ ### Native Android (Kotlin)
146
+
147
+ ```kotlin
148
+ override fun onResume() {
149
+ super.onResume()
150
+ composerView.requestFocus()
151
+ composerView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED)
152
+ }
153
+ ```
154
+
155
+ ### Native iOS (Swift)
156
+
157
+ ```swift
158
+ override func viewDidAppear(_ animated: Bool) {
159
+ super.viewDidAppear(animated)
160
+ UIAccessibility.post(notification: .screenChanged, argument: composerView)
161
+ }
162
+ ```
163
+
164
+ ### Flutter
165
+
166
+ ```dart
167
+ final FocusNode _composerFocus = FocusNode();
168
+
169
+ @override
170
+ void initState() {
171
+ super.initState();
172
+ WidgetsBinding.instance.addPostFrameCallback((_) {
173
+ _composerFocus.requestFocus();
174
+ });
175
+ }
176
+
177
+ // Then on the composer widget: focusNode: _composerFocus
178
+ ```
179
+
180
+ ---
181
+
182
+ ## 3. Live region for new messages
183
+
184
+ Screen reader users need an audible announcement when a new message arrives — otherwise they have to navigate to the message list and re-read it.
185
+
186
+ ### Web / Angular — ARIA live region
187
+
188
+ ```html
189
+ <!-- A visually-hidden region that screen readers announce -->
190
+ <div
191
+ aria-live="polite"
192
+ aria-atomic="true"
193
+ style="position: absolute; left: -9999px; height: 1px; width: 1px; overflow: hidden;"
194
+ id="message-announcer"></div>
195
+ ```
196
+
197
+ ```ts
198
+ // Listen for new messages and announce
199
+ import { CometChat } from "@cometchat/chat-sdk-javascript";
200
+
201
+ const listenerId = "a11y-message-announcer";
202
+ CometChat.addMessageListener(listenerId, new CometChat.MessageListener({
203
+ onTextMessageReceived: (msg: CometChat.TextMessage) => {
204
+ const senderName = msg.getSender().getName();
205
+ const text = msg.getText();
206
+ const region = document.getElementById("message-announcer");
207
+ if (region) {
208
+ // Clearing first ensures the same text re-announces
209
+ region.textContent = "";
210
+ setTimeout(() => {
211
+ region.textContent = `New message from ${senderName}: ${text}`;
212
+ }, 100);
213
+ }
214
+ },
215
+ }));
216
+ ```
217
+
218
+ `aria-live="polite"` waits for the user to finish speaking before announcing. Use `aria-live="assertive"` only for urgent messages (like incoming calls) — too aggressive for chat.
219
+
220
+ ### React Native
221
+
222
+ ```ts
223
+ import { AccessibilityInfo } from "react-native";
224
+
225
+ CometChat.addMessageListener(listenerId, new CometChat.MessageListener({
226
+ onTextMessageReceived: (msg) => {
227
+ const text = `New message from ${msg.getSender().getName()}: ${msg.getText()}`;
228
+ AccessibilityInfo.announceForAccessibility(text);
229
+ },
230
+ }));
231
+ ```
232
+
233
+ ### Native Android / iOS / Flutter
234
+
235
+ Each platform has an equivalent — Android `View.announceForAccessibility(text)`, iOS `UIAccessibility.post(notification: .announcement, argument: text)`, Flutter `SemanticsService.announce(text, TextDirection.ltr)`. Same shape; the SDK callback is the trigger.
236
+
237
+ ---
238
+
239
+ ## 4. Keyboard navigation
240
+
241
+ The kit's components are keyboard-accessible by default. Custom wrapping is what breaks it.
242
+
243
+ ### Anti-pattern — `<div onClick>` for clickable items
244
+
245
+ ```tsx
246
+ // ✗ WRONG — keyboard users can't activate
247
+ <div onClick={() => openConversation(c)}>{c.name}</div>
248
+
249
+ // ✓ RIGHT — `<button>` is keyboard + screen-reader native
250
+ <button onClick={() => openConversation(c)}>{c.name}</button>
251
+
252
+ // ✓ ALSO RIGHT — div with explicit ARIA + keyboard handlers
253
+ <div
254
+ role="button"
255
+ tabIndex={0}
256
+ onClick={() => openConversation(c)}
257
+ onKeyDown={(e) => {
258
+ if (e.key === "Enter" || e.key === " ") {
259
+ e.preventDefault();
260
+ openConversation(c);
261
+ }
262
+ }}
263
+ >
264
+ {c.name}
265
+ </div>
266
+ ```
267
+
268
+ ### Skip links
269
+
270
+ For long conversation lists, add a skip-to-message-composer link:
271
+
272
+ ```html
273
+ <a href="#message-composer" class="skip-link">Skip to message composer</a>
274
+ ```
275
+
276
+ ```css
277
+ .skip-link {
278
+ position: absolute;
279
+ left: -9999px;
280
+ z-index: 999;
281
+ }
282
+ .skip-link:focus {
283
+ left: 0;
284
+ top: 0;
285
+ background: white;
286
+ padding: 8px;
287
+ }
288
+ ```
289
+
290
+ The kit's components already include skip links where applicable; custom wrapping should preserve them.
291
+
292
+ ### Keyboard shortcuts
293
+
294
+ For productivity apps:
295
+
296
+ ```ts
297
+ useEffect(() => {
298
+ const handler = (e: KeyboardEvent) => {
299
+ // Cmd/Ctrl + K → focus search
300
+ if ((e.metaKey || e.ctrlKey) && e.key === "k") {
301
+ e.preventDefault();
302
+ searchRef.current?.focus();
303
+ }
304
+ // Escape → close any open thread / modal
305
+ if (e.key === "Escape") {
306
+ closeOpenThread();
307
+ }
308
+ };
309
+ window.addEventListener("keydown", handler);
310
+ return () => window.removeEventListener("keydown", handler);
311
+ }, []);
312
+ ```
313
+
314
+ Document the shortcuts in your in-app help — discoverability matters.
315
+
316
+ ---
317
+
318
+ ## 5. Reduced motion
319
+
320
+ Animations help most users; they cause physical discomfort or distraction for users with vestibular disorders, ADHD, or who simply prefer less movement. WCAG 2.1 AA requires honoring the OS preference.
321
+
322
+ ### Web / Angular — CSS
323
+
324
+ ```css
325
+ @media (prefers-reduced-motion: reduce) {
326
+ /* Disable kit animations + your custom ones */
327
+ * {
328
+ animation-duration: 0.01ms !important;
329
+ animation-iteration-count: 1 !important;
330
+ transition-duration: 0.01ms !important;
331
+ }
332
+ }
333
+ ```
334
+
335
+ ### React Native
336
+
337
+ ```ts
338
+ import { AccessibilityInfo } from "react-native";
339
+
340
+ const [reduceMotion, setReduceMotion] = useState(false);
341
+
342
+ useEffect(() => {
343
+ AccessibilityInfo.isReduceMotionEnabled().then(setReduceMotion);
344
+ const sub = AccessibilityInfo.addEventListener("reduceMotionChanged", setReduceMotion);
345
+ return () => sub.remove();
346
+ }, []);
347
+
348
+ // In animations
349
+ <Animated.View
350
+ style={{
351
+ transform: [{ scale: reduceMotion ? 1 : animatedValue }],
352
+ }}
353
+ />
354
+ ```
355
+
356
+ ### Native iOS
357
+
358
+ ```swift
359
+ let reduceMotion = UIAccessibility.isReduceMotionEnabled
360
+ if !reduceMotion {
361
+ UIView.animate(withDuration: 0.3) { ... }
362
+ } else {
363
+ // Apply final state without animation
364
+ }
365
+ ```
366
+
367
+ ### Native Android
368
+
369
+ ```kotlin
370
+ val reduceMotion = Settings.Global.getFloat(
371
+ contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE, 1.0f
372
+ ) == 0.0f
373
+ ```
374
+
375
+ ### Flutter
376
+
377
+ ```dart
378
+ final reduceMotion = MediaQuery.of(context).disableAnimations;
379
+ ```
380
+
381
+ The skill defaults to wrapping the typing indicator + message-bubble entrance animations in reduce-motion guards. Other kit animations need similar treatment if you've customized them.
382
+
383
+ ---
384
+
385
+ ## Calls a11y
386
+
387
+ Calls have specific a11y considerations beyond chat:
388
+
389
+ 1. **Focus on call screen entry → end-call button.** Avoids accidental hangup but ensures the user can quickly exit.
390
+ 2. **Announce incoming calls.** Live region (web/RN) or `UIAccessibility.post(.announcement)` (iOS) — "Incoming call from Alice."
391
+ 3. **Mute/end button labels.** "Mute microphone" not just "Mute" — clarify what's being toggled.
392
+ 4. **No flashing — recording indicator uses dot, not strobe.** WCAG 2.3 forbids more than 3 flashes/sec to prevent seizures.
393
+ 5. **Caption support if recording.** Production calling apps with live captioning hook in via the platform's speech-recognition API and overlay text on the call screen.
394
+
395
+ ---
396
+
397
+ ## Testing — automated + manual
398
+
399
+ ### Web automated
400
+
401
+ ```bash
402
+ npm install --save-dev @axe-core/playwright
403
+ ```
404
+
405
+ ```ts
406
+ import { test, expect } from "@playwright/test";
407
+ import AxeBuilder from "@axe-core/playwright";
408
+
409
+ test("chat screen passes axe AA", async ({ page }) => {
410
+ await page.goto("/messages");
411
+ const results = await new AxeBuilder({ page }).withTags(["wcag2a", "wcag2aa"]).analyze();
412
+ expect(results.violations).toEqual([]);
413
+ });
414
+ ```
415
+
416
+ ### Native automated
417
+
418
+ iOS: Xcode → Accessibility Inspector → Audit. Android: Accessibility Scanner app on a real device.
419
+
420
+ ### Manual
421
+
422
+ - **Keyboard-only navigation** — unplug your mouse, complete a full chat flow. Tab through every control.
423
+ - **VoiceOver (iOS) / TalkBack (Android) / NVDA (Windows) / VoiceOver (macOS)** — listen to the kit; verify announcements make sense.
424
+ - **Browser zoom 200%** — kit should remain usable at 200% zoom on a 1280×720 viewport (WCAG 1.4.10 reflow).
425
+
426
+ ---
427
+
428
+ ## Anti-patterns
429
+
430
+ 1. **Custom themes without a contrast audit.** Brand colors silently fail AA.
431
+ 2. **`<div onClick>` for clickable items.** Keyboard users can't activate.
432
+ 3. **No live region for new messages.** Screen reader users miss messages.
433
+ 4. **Auto-playing video on call screen.** Some users browse with autoplay disabled — kit handles this; custom UI must too.
434
+ 5. **Focus stays on the trigger button after opening chat.** User has to manually re-navigate.
435
+ 6. **Ignoring `prefers-reduced-motion`.** Vestibular-disorder users get disoriented.
436
+ 7. **`aria-live="assertive"` for chat messages.** Interrupts the user mid-sentence; reserve for genuinely urgent (incoming call).
437
+ 8. **Skipping label specificity.** "Mute" alone is ambiguous; "Mute microphone" / "Unmute microphone" is clear.
438
+ 9. **Color-only signals.** "Read" status as just a checkmark color — add a visible text label for color-blind users.
439
+ 10. **No test coverage for a11y.** Regressions slip in. Automate the easy checks (axe-core); manual-test the rest per release.
440
+
441
+ ---
442
+
443
+ ## Verification checklist
444
+
445
+ **Cross-family:**
446
+ - [ ] Custom theme passes AA contrast (4.5:1 text, 3:1 large text + UI components)
447
+ - [ ] Focus lands on a meaningful control on chat screen entry
448
+ - [ ] Live region / accessibility announcement on new message receive
449
+ - [ ] No `<div onClick>` patterns — buttons are buttons
450
+ - [ ] `prefers-reduced-motion` / `isReduceMotionEnabled` honored for animations
451
+ - [ ] Mute/end/camera labels are specific (not just "Mute")
452
+ - [ ] Incoming-call announcement (`assertive` live region OR platform announcement API)
453
+ - [ ] No flashing > 3 Hz (recording dot uses fade, not strobe)
454
+
455
+ **Web/Angular:**
456
+ - [ ] axe-core / Playwright a11y test in CI; passes WCAG AA tags
457
+ - [ ] `<html lang="...">` set to current locale (consumes `cometchat-i18n` skill output)
458
+ - [ ] Skip-to-composer link present
459
+ - [ ] Browser zoom 200% smoke test
460
+
461
+ **Native (Android/iOS/Flutter):**
462
+ - [ ] TalkBack / VoiceOver smoke test on a real device
463
+ - [ ] Reduced motion preference observed (`UIAccessibility.isReduceMotionEnabled`, etc.)
464
+ - [ ] Focus restored on screen pop (not just push)
465
+ - [ ] Touch targets ≥ 44×44 pt (iOS) / 48×48 dp (Android) — kit defaults pass; custom UI must too
466
+
467
+ ---
468
+
469
+ ## Pointers
470
+
471
+ - `cometchat-i18n` — sister skill; `<html lang>` and screen-reader pronunciation of translated strings depend on locale set correctly
472
+ - `cometchat-{family}-customization` — when customizing kit components, preserve their built-in a11y attributes
473
+ - `cometchat-{family}-troubleshooting` — when a11y tools report issues that look kit-internal
474
+ - WCAG 2.1 AA reference — https://www.w3.org/WAI/WCAG21/quickref/?levels=aa
475
+ - Material Design accessibility — https://m3.material.io/foundations/accessible-design
476
+ - Apple HIG accessibility — https://developer.apple.com/design/human-interface-guidelines/accessibility
@@ -3,7 +3,7 @@ name: cometchat-android-v5
3
3
  description: "Entry-point dispatcher for CometChat Android UI Kit v5. Detects project setup, understands what the dev is building, and routes to the right sub-skills."
4
4
  license: "MIT"
5
5
  compatibility: "Android 7.0+; Java 8+; Kotlin 1.8+; com.cometchat:chat-uikit-android:5.x"
6
- allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
6
+ allowed-tools: "shell, file-read, file-search, file-list"
7
7
  metadata:
8
8
  author: "CometChat"
9
9
  version: "3.0.0"