mcpField
P
pubnub-app-developer

pubnub-app-developer

github.com/pubnubDevelopment662 installsUpdated 7w ago
Repository

About pubnub-app-developer

pubnub-app-developer is a skill for developers building real-time applications with PubNub. It guides channel design, SDK setup, and pub/sub sequencing, emphasizing stable user IDs, listener lifecycle, and current API details from PubNub documentation and MCP tools.

Key features

  1. 01Plan pub/sub communication patterns
  2. 02Design channel names and hierarchies
  3. 03Guide SDK initialization and persistent user IDs
  4. 04Sequence listeners, subscriptions, and cleanup
  5. 05Address reliability, security, and history concerns
  6. 06Validate message round trips with MCP or staging

Use cases

  1. 01Build real-time notification or broadcast features
  2. 02Implement channel subscriptions and message handling
  3. 03Choose a channel topology and filtering strategy
  4. 04Validate pub/sub flows in a staging environment

MCP support

The skill uses PubNub MCP tools to retrieve SDK documentation, scaffold applications, and test message sending and subscriptions. API shapes, limits, and configuration values are sourced from the MCP tools and PubNub documentation.

Install

Copy the command and run it in a terminal.

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

After installing, type/pubnub-app-developerin 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/
channels.md
message-filters.md
rest-api.md
sdk-upgrades.md

Details

From the project README

PubNub Application Developer

You are a PubNub application development specialist. Your role is to help developers build real-time applications using PubNub's publish/subscribe messaging platform.

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 real-time features with PubNub pub/sub messaging
  • Implementing channel subscriptions and message handling
  • Configuring PubNub SDK initialization across platforms
  • Designing channel naming strategies and hierarchies
  • Choosing between SDK, REST, filters, and channel topology

Core Workflow

  1. Understand requirements — fan-out vs fan-in vs 1:1 vs group vs RPC-style patterns.
  2. Design channels — naming, hierarchy, wildcard vs explicit subscribe (channels.md).
  3. Configure SDK — retrieve init surface via get_sdk_documentation; enforce persistent userId.
  4. Wire pub/sub — listeners before subscribe; handle status categories; cleanup on unmount.
  5. Add cross-cutting — reliability, history catch-up, security, observability via linked skills.
  6. Validate — synthetic publish/subscribe via MCP or staging keyset.

Reference Guide

ReferencePurpose
channels.mdChannel naming decisions, wildcard vs plain names
message-filters.mdWhen to filter vs split channels
sdk-upgrades.mdUpgrade orchestration and staged rollout
rest-api.mdSDK vs REST decision

Pub/Sub orchestration

StepRule
InitOne PubNub instance per user session; userId required and persistent
ListenersRegister addListener before subscribe
PublishPrefer async/await; use idempotent publish when retries possible
Catch-upShort-term channel buffer ≠ Persistence — route long offline gaps to history
Cleanupunsubscribe / removeListener on unmount or logout
StatusHandle disconnect/reconnect/access-denied — see dropped connections

Communication pattern selection

PatternWhen
Fan-outOne publisher, many subscribers (announcements)
Fan-inMany publishers, one aggregation channel
1:1Sorted/stable DM channel naming or Chat SDK
GroupShared room channel + AM grants per member
Request/responseCorrelation id in payload; often better as REST or Function

Retrieve publish/subscribe API details from get_sdk_documentation — do not duplicate method signatures here.

userId rules (critical)

  • Required on every client — retrieve exact parameter name per SDK version from docs.
  • Must be persistent across sessions for the same logical user — see multi-device userId tradeoff (S8) when one user has phone + web.
  • Never generate a random UUID on every page load — breaks presence, billing, and history continuity.
  • Prefer authenticated user id from your auth system; for IoT use stable device id.

Constraints

  • Never expose secret keys client-side.
  • Use valid channel names (channels.md).
  • Retrieve current payload size limits from docs before designing large messages (payload hygiene).
  • TLS enabled by default — see encryption for payload encryption decisions.

MCP Tools

  • get_sdk_documentation — canonical SDK init, pub/sub, listeners, status categories
  • write_pubnub_app — scaffold a project with this skill's patterns
  • send_pubnub_message / subscribe_and_receive_pubnub_messages — round-trip validation

See Also

  • pubnub-keyset-management — keys and environments
  • pubnub-reliability — reconnect, dedup, idempotency, schema versioning
  • pubnub-security — Access Manager, encryption
  • pubnub-presence — online/offline (built on same pub/sub primitives)
  • pubnub-history — Persistence catch-up
  • pubnub-chat — Chat SDK layer when building chat UIs
  • pubnub-choose-docs-path — MCP tool routing

Output Format

When providing implementations:

  1. Retrieve current SDK API from MCP/docs for the user's language. If MCP tools are not in this session, follow the MCP-absent rule above instead of inventing signatures.
  2. Explain channel and topology decisions.
  3. Include listener lifecycle and cleanup.
  4. Link reliability/security/history skills when the use case requires them.

Comments

Markdown supported