Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

rt-setup-personalization

FreeNo executable scriptsNot checked

Complete workflow to set up RT 2.0 personalization from scratch - validates parent segment RT status, discovers event tables and attributes, configures RT…

treasure-databy treasure-data★ 23 GitHub stars

About this skill

RT 2.0 Personalization Setup - Complete Workflow

Orchestrates the complete RT personalization setup: parent segment validation → use case discovery → data exploration → RT config → personalization service → personalization entity deployment.

Prerequisites

  • TD CLI installed: tdx
  • Authenticated: tdx auth setup
  • Parent segment created in Data Workbench
  • Master API key with full permissions: export TD_API_KEY=your_key

Workflow Overview

Complete 9-step workflow. Each step must complete successfully before proceeding.

Step 1: Validate Parent Segment ✓
Step 2: Use Case Discovery ✓
Step 3: Explore PS Attributes ✓
Step 4: Discover Event Tables ✓
Step 5: Define ID Stitching ✓
Step 6: Define RT Attributes ✓
Step 7: Configure RT Infrastructure ✓ (SHARED with rt-setup-triggers)
Step 8: Create Personalization Service ✓
Step 9: Create Personalization Entity ✓
  9a. Get Parent Segment Folder
  9b. Get Key Event and Attribute IDs
  9c. Validate Payload (REQUIRED - use rt-personalization-validation skill)
  9d. Create Entity via API
Step 10: Verify & Test ✓

Steps 1-2: Validate & Discover Use Case

See steps/01-02-validate-discovery.md for detailed implementation.

Quick Summary

Step 1: Validate parent segment exists and check RT status

# Check if PS has RT enabled
tdx ps rt list --json | jq '.[] | select(.id=="<ps_id>" or .name=="<ps_name>") | {
  id, name,
  rt_status: .status,
  event_tables: (.event_tables | length),
  key_events: (.key_events | length)
}'

Expected outputs:

  • rt_status: "ok" → RT enabled, proceed to Step 2
  • rt_status: "updating" → Wait for RT to be ready
  • Empty result → PS not RT-enabled. Show error: "RT not enabled for this parent segment. Contact CSM."

Step 2: Ask user about use case (Web Personalization, Cart Recovery, User Profile API, etc.)

Checkpoints:

  • ✓ Parent segment ID confirmed
  • ✓ RT status validated ("ok" or "not_configured")
  • ✓ Use case selected

Steps 3-6: Data Exploration

See steps/03-06-data-exploration.md for detailed implementation.

Quick Summary

Step 3: Explore parent segment batch attributes

# List all RT-enabled parent segments
tdx ps rt list --json

# Show RT-enabled parent segments with status
tdx ps rt list --json | jq '.[] | {
  id, name,
  rt_status: .status,
  event_tables: (.event_tables | length),
  key_events: (.key_events | length)
}'

Step 4: Discover streaming event tables

tdx tables "<event_db>.*" --json | jq -r '.[].name'

Step 5: Define ID stitching keys (td_client_id, email, canonical_id) — only use columns that exist in event tables (verify with tdx describe

)

Step 6: Define RT attributes based on use case (single, list, counter types)

Checkpoints:

  • ✓ Batch attributes identified
  • ✓ Event tables discovered and selected
  • ✓ ID stitching keys defined
  • ✓ RT attributes planned (types and aggregations)

Step 7: Configure RT Infrastructure

SHARED CONFIGURATION - See steps/07-rt-config.md for complete implementation.

This step is identical for both RT Personalization and RT Triggers.

Quick Summary

7a. Configure Event Tables & Key Events

# Add event tables
tdx api "/audiences/<ps_id>/realtime_setting" --type cdp -X PATCH --data '{
  "eventTables": [{"database": "<db>", "table": "<table>"}]
}'

# Create key events
tdx api "/audiences/<ps_id>/realtime_key_events" --type cdp -X POST --data '{
  "name": "<event_name>",
  "databaseName": "<db>",
  "tableName": "<table>",
  "filterRule": {"type": "And", "conditions": []}
}'

7b. Configure ID Stitching ⚠️ CRITICAL: extLookupKey must be the Profile Key column from the Parent Segment master table (e.g., guest_id, customer_id), NOT a stitching key like email. Find it with:

tdx ps desc <ps_id> --json | jq '.master'

```bash
tdx api "/audiences/<ps_id>/realtime_setting" --type cdp -X PATCH --data '{
  "keyColumns": [
    {"name": "td_client_id", "validRegexp": null, "invalidTexts": [], "internal": false}
  ],
  "extLookupKey": "<profile_key>"
}'

7c. Create RT Attributes

# Single attribute
tdx api "/audiences/<ps_id>/realtime_attributes" --type cdp -X POST --data '{
  "name": "<attr_name>",
  "type": "single",
  "realtimeKeyEventId": "<key_event_id>",
  "valueColumn": "<column>",
  "dataType": "string",
  "duration": {"value": 1, "unit": "day"}
}'

# List attribute
tdx api "/audiences/<ps_id>/realtime_attributes" --type cdp -X POST --data '{
  "name": "<list_attr>",
  "type": "list",
  "realtimeKeyEventId": "<key_event_id>",
  "idColumn": "<id_column>",
  "maxItems": 100,
  "aggregations": [{
    "name": "items",
    "identifier": "items",
    "column": "<column>",
    "aggregationType": "distinct_list"
  }],
  "duration": {"value": 60, "unit": "day"}
}'

# Counter attribute
tdx api "/audiences/<ps_i
Full SKILL.md on GitHub

Install rt-setup-personalization in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

steps/01-02-validate-discovery.mdsteps/03-06-data-exploration.mdsteps/07-rt-config.mdsteps/08-09-personalization.mdsteps/10-verification.md

FAQ

What does the rt-setup-personalization skill do?

Complete workflow to set up RT 2.0 personalization from scratch - validates parent segment RT status, discovers event tables and attributes, configures RT infrastructure (events, attributes, ID stitching), creates personalization service, and deploys the personalization entity with payload. Use when user wants to "create realtime setup and build personalization" or "set up RT personalization end-to-end". Includes automatic validation using rt-personalization-validation skill to prevent common API errors.

How do I install the rt-setup-personalization skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the rt-setup-personalization skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare rt-setup-personalization with