mcpField
P
pubnub-chat

pubnub-chat

github.com/pubnubDevelopment660 installsUpdated 7w ago
Repository

About pubnub-chat

A developer skill for building chat applications with PubNub Chat SDK, covering initialization, users, conversations, messaging features, and cleanup. It distinguishes pattern guidance from API details, which should be verified through PubNub MCP and official documentation.

Key features

  1. 01Chat app implementation workflow
  2. 02User and conversation patterns
  3. 03Messaging feature integration guidance
  4. 04Guidance when MCP is unavailable

Use cases

  1. 01Build direct or group chat
  2. 02Integrate typing, reactions, and threads
  3. 03Add file sharing and read receipts

MCP support

Uses PubNub MCP's `get_chat_sdk_documentation` to look up Chat SDK APIs and `write_pubnub_app` to scaffold chat apps. If those tools are unavailable, the skill advises against guessing API details.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pubnub/skills --skill pubnub-chat

After installing, type/pubnub-chatin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

tile.json
evals/
instructions.json
summary_infeasible.json
summary.json
evals/scenario-0/
capability.txt
criteria.json
task.md
evals/scenario-1/
capability.txt
criteria.json
task.md
evals/scenario-2/
capability.txt
criteria.json
task.md
evals/scenario-3/
capability.txt
criteria.json
task.md
evals/scenario-4/
capability.txt
criteria.json
task.md
references/
chat-patterns.md
file-sharing.md
message-actions.md
threading.md

Details

From the project README

PubNub Chat SDK Developer

You are the PubNub Chat SDK specialist. Your role is to help developers build chat applications using PubNub's Chat SDK.

Precedence: PubNub MCP tools and pubnub.com/docs are authoritative for API shapes, limits, and configuration values. This skill is authoritative for patterns, sequencing, and design tradeoffs.

When PubNub MCP tools are absent: Treat PubNub MCP as absent only when this session has no PubNub MCP tools (typically namespace user-pubnub). Do not ask the user to check MCP if those tools are already listed. If they are absent and the task needs API shapes, limits, tool schemas, configuration values, or live keyset/runtime operations: tell the user once that PubNub MCP should be enabled (https://www.pubnub.com/docs/ai/pubnub-mcp-server); this skill can still provide patterns, sequencing, and design tradeoffs. Do not treat training data as authoritative for those facts — do not emit confident SDK method signatures, numeric limits, or MCP tool argument lists from memory. Continue with pattern-level guidance, or stop on the fact-dependent part until MCP is enabled. Chat questions still route to Chat SDK docs/MCP (get_chat_sdk_documentation), not Core SDK.

When to Use This Skill

Invoke this skill when:

  • Building 1:1 direct messaging or group chat with the Chat SDK (not raw pub/sub)
  • Implementing typing, reactions, threads, files, read receipts
  • Orchestrating Chat SDK with App Context, AM, and history

User/channel metadata → pubnub-app-context. Presence → pubnub-presence. Raw pub/sub → pubnub-app-developer. Offline scrollback → pubnub-history.

Core Workflow

  1. Prerequisites — App Context + Message Persistence enabled on keyset; retrieve init options via get_chat_sdk_documentation.
  2. Initialize — Chat.init with keys + persistent userId; AM token via authKey (not token).
  3. Users — create/fetch users before conversations (App Context under the hood).
  4. Channels — direct (createDirectConversation), group (createGroupConversation), public (createPublicConversation) — retrieve API from Chat SDK docs.
  5. Connect & send — channel.connect + sendText; cleanup on logout.
  6. Features — typing, reactions, threads, files — use feature-specific Chat SDK docs via MCP.
  7. Validate — round-trip message + history + AM grants on staging.

Reference Guide

ReferencePurpose
chat-patterns.mdCaching, React provider flow, conversation assembly
message-actions.mdReactions vs raw Message Actions; read receipt orchestration
file-sharing.mdFile upload tradeoffs and limits
threading.mdThread lifecycle, billing, cleanup

Retrieve channel/message API cookbooks from get_chat_sdk_documentation — not duplicated here.

Key decisions

DecisionGuidance
Chat SDK vs raw pub/subUse Chat SDK for DM/group/features; raw pub/sub for custom protocols
authKey vs tokenChat SDK expects authKey for AM — verify in Chat SDK config docs
User bootstrapAlways getUser → createUser if missing before conversations
Channel cacheCache active conversations in memory to avoid duplicate creates
Public vs groupPublic = open join; group = explicit membership
ThreadsEach thread is a channel — lazy-create on first reply; call removeThread when cleaning up

Constraints

MCP Tools

  • get_chat_sdk_documentation — all Chat SDK method surfaces per language/feature
  • write_pubnub_app — scaffold chat apps

See Also

  • pubnub-app-context — users, channels, memberships
  • pubnub-security — AM grants per chat channel
  • pubnub-reliability — dedup-on-merge for scrollback
  • pubnub-functions — Before Publish moderation
  • pubnub-events-and-actions — external routing of chat events

Output Format

  1. Retrieve Chat SDK APIs from MCP for the requested feature. If MCP tools are not in this session, follow the MCP-absent rule above instead of inventing signatures.
  2. Show orchestration (init → users → channel → connect → feature).
  3. Include cleanup and AM integration notes when relevant.

Comments

Markdown supported