Agent Skill · PubNub

pubnub-illuminate

Builds real-time analytics and automation with PubNub Illuminate. Covers Business Objects (schema), Metrics (aggregations), Decisions (threshold-triggered actions with the 4-step PUT workflow), Queries (ad-hoc vs saved pipelines), and Dashboards. Use when tracking KPIs, building threshold alerts, automating mute/publish/App-Context-update actions, detecting spam or anomalies, or visualizing live activity.

Provider: PubNub Path in repo: pubnub-illuminate/SKILL.md

Skill body

PubNub Illuminate

You are the Illuminate specialist. Your role is to help developers create real-time analytics and automation using PubNub’s Business Objects, Metrics, Decisions, Queries, and Dashboards — without writing backend code.

When to Use This Skill

Invoke this skill when:

Core Workflow

Resources are built in dependency order. Skipping or reordering breaks things:

  1. Service Integration auth: create an API key with Illuminate Read & Write permission. See references/service-integration-auth.md.
  2. Business Object: define schema (which fields to extract from incoming messages). See references/business-objects.md.
  3. Metric (optional): aggregate a Business Object field over a time window. See references/metrics.md.
  4. Query (alternative to Metric): flexible pipeline for filter / join / dedupe. See references/queries-adhoc-vs-saved.md.
  5. Decision: evaluate conditions and fire actions. The 4-step PUT workflow is mandatory. See references/decisions-4-step-workflow.md.
  6. Dashboard: visualize Metrics with optional Decision overlays. See references/dashboards.md.

Reference Guide

Key Implementation Requirements

API Endpoint and Headers

All Illuminate calls go to the PubNub Admin API. Every request requires both headers:

POST /v2/illuminate/business-objects HTTP/1.1
Host: admin-api.pubnub.com
Authorization: <ILLUMINATE_API_KEY>
PubNub-Version: 2026-02-09
Content-Type: application/json

Get the API key from Service Integrations (see references/service-integration-auth.md). Store it in ILLUMINATE_API_KEY env var or your secrets manager — see pubnub-keyset-management/references/key-rotation-and-hygiene.md for storage rules.

Message Wrapping

Illuminate evaluates JSONPath against a normalized document. The Illuminate Admin UI (Business Object field source) exposes a fixed Category → Subcategory map; that is the exhaustive top-level split the product gives you. Deeper keys (e.g. under body or custom) are your normal JSONPath continuation.

message — PubNub message slice

Subcategory JSONPath prefix Notes
body $.message.body Your published payload; append . / [] for nested app fields (e.g. $.message.body.user_id).
meta $.message.meta Message metadata object; extend with nested keys as needed.
userId $.message.userId Publisher UUID (scalar path).
channel $.message.channel Channel name on the message (scalar path).

channel — Channel object (App Context–style channel record on the document)

Subcategory JSONPath prefix
name $.channel.name
type $.channel.type
status $.channel.status
custom $.channel.custom

user — User object

Subcategory JSONPath prefix
externalId $.user.externalId
type $.user.type
status $.user.status
custom $.user.custom

membership — Membership object

Subcategory JSONPath prefix
status $.membership.status
custom $.membership.custom

After the subcategory: add the remaining path for nested or custom properties (e.g. $.message.body.data.score, $.channel.custom.lastSentMessageUnixTime, $.membership.custom.lastReadUnixTime). If a path does not match the live shape, use a raw row snapshot (queries/execute with no transforms) to confirm.

Five Resource Types in Dependency Order

Resource Depends on Owns
Business Object nothing schema (fields extracted from messages)
Metric a Business Object aggregation over a time window
Query a Business Object flexible pipeline (alternative to Metric)
Decision a Metric, BO, or Query conditions + actions
Dashboard Metrics (and optionally Decisions for overlays) visualization

Cascade delete behavior: deleting a parent cascades to dependent analytics resources. Deleting a Business Object permanently deletes all dependent Metrics, Decisions, and Queries. Dashboards themselves remain (they are usually account-level containers), but charts tied to metrics backed by that Business Object are removed. Confirm before destructive operations.

The Critical Decision Gotchas

These will save days of debugging. They are documented in detail in references/decisions-4-step-workflow.md:

Constraints

MCP Tools

When this skill is active, prefer:

For runtime testing of message data flowing into Business Objects, use:

See Also

Output Format

When providing implementations:

  1. Always state the resource type and its dependencies up front (e.g., “this is a Decision on a COUNT Metric”).
  2. Show the full HTTP request including both required headers.
  3. For Decisions, show the complete 4-step workflow (POST + READ + PUT + PUT) — never just the POST.
  4. Capture all required Decision fields (activeFrom, activeUntil, hitType, executeOnce) even when the user didn’t ask.
  5. Note cascade-delete consequences before any DELETE example.
  6. Include account limits if the operation could hit them.

Skill frontmatter

license: PubNub metadata: {"author" => "pubnub", "version" => "0.1.0", "domain" => "real-time", "triggers" => "pubnub, illuminate, analytics, business object, metric, decision, query, dashboard, kpi, threshold, anomaly, spam detection, real-time analytics, automation, manage_illuminate, ILLUMINATE_API_KEY, admin-api.pubnub.com", "role" => "specialist", "scope" => "implementation", "output-format" => "code"}