rt-personalization
БесплатноБез исполняемых скриптовНе проверенCreate RT 2.0 Personalization services AND entities that return real-time personalized API responses. Creates both the service configuration (via tdx ps pz)…
от treasure-data★ 23 звезды на GitHubОб этом скилле
RT 2.0 Personalization - Service and Entity Creation
Creates complete RT personalization: service configuration + Personalization entity with payload deployed to Console.
Prerequisites
- RT configuration complete (
rt-configskill orrt-setup-personalizationorchestrator) - RT status: "ok"
- Key events created
- RT attributes configured
- Parent segment folder exists
- TD_API_KEY environment variable set
Two-Step Creation Process
Step 1: Create Personalization Service (YAML workflow)
- Defines sections, criteria, attributes
- Pushed via
tdx ps push - Creates service configuration
Step 2: Create Personalization Entity (API workflow)
- Creates actual Personalization in Console
- Defines entry criteria (key event)
- Defines payload (response attributes)
- Visible in TD Console UI
Both steps required for complete personalization setup.
Migration from Previous Version
If you previously created a personalization service (before this update):
The old skill only created the service configuration (Step 1). The entity (Step 2) was missing, making personalization invisible in Console.
Check if Entity Exists
# Detect region
REGION=$(tdx config get endpoint 2>/dev/null | grep -o '[a-z][a-z][0-9][0-9]' | head -1)
REGION="${REGION:-us01}"
# List existing personalizations
RESPONSE=$(curl -s -w "\n%{http_code}" \
"https://api-cdp.treasuredata.com/entities/parent_segments/<ps_id>/realtime_personalizations" \
-H "Authorization: TD1 ${TD_API_KEY}")
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
BODY=$(echo "$RESPONSE" | sed '$d')
if [ "$HTTP_CODE" = "200" ]; then
echo "$BODY" | jq '.data[] | {id, name}'
else
echo "❌ Failed to list personalizations (HTTP $HTTP_CODE)"
echo "$BODY" | jq '.errors[]? | .detail' 2>/dev/null || echo "$BODY"
fi
If Entity is Missing
Option 1: Run Step 2 Only (Recommended)
- Skip Step 1 (service already exists)
- Follow Step 2 (sections 2a-2e) to create entity
Option 2: Recreate Everything
- Delete old service:
tdx ps pz delete <ps_id> <service_name> - Run complete skill (Step 1 + Step 2)
Verify Migration
After creating entity, test API endpoint:
curl -X GET \
"https://${REGION}.p13n.in.treasuredata.com/audiences/<ps_id>/personalizations/<pz_id>?td_client_id=test_user" \
-H "Authorization: TD1 ${TD_API_KEY}"
Should return personalized attributes (not 404).
Verify Prerequisites
# Detect region from tdx config
REGION=$(tdx config get endpoint 2>/dev/null | grep -o '[a-z][a-z][0-9][0-9]' | head -1)
REGION="${REGION:-us01}"
echo "Using region: $REGION"
# Check RT status
RT_STATUS=$(tdx ps rt list --json | jq -r --arg ps "<ps_id_or_name>" '.[] | select(.id==$ps or .name==$ps) | .status')
[ "$RT_STATUS" = "ok" ] || { echo "❌ RT status: $RT_STATUS (expected: ok)"; exit 1; }
# List key events
tdx api "/audiences/<ps_id>/realtime_key_events" --type cdp | jq '.data[] | {id, name}'
# List RT attributes
tdx api "/audiences/<ps_id>/realtime_attributes?page[size]=100" --type cdp | \
jq '.data[] | {id, name, type}'
Step 1: Create Personalization Service
Gather Requirements
Ask user:
"What's your personalization use case?"
- Product recommendations
- Cart recovery
- User profile API
- Content personalization
"Which key event should trigger personalization?"
- List available key events from RT config
"Which attributes should be returned?"
- Multi-select from RT attributes + batch attributes
"Do you need audience-based sections?"
- Yes: Different responses for VIP vs. regular users
- No: Same response for all users
Generate Service YAML
For simple use case (single section):
parent_segment_id: '<ps_id>'
parent_segment_name: '<ps_name>'
personalization_service:
name: 'product_recommendations'
description: 'Product recommendation service'
trigger_event: 'page_view'
sections:
- name: 'Default'
criteria: '' # Matches all users
attributes:
- last_product_viewed
- browsed_products_list
- page_views_24h
batch_segments: []
For multi-section use case:
parent_segment_id: '<ps_id>'
parent_segment_name: '<ps_name>'
personalization_service:
name: 'vip_personalization'
description: 'VIP-aware personalization service'
trigger_event: 'page_view'
sections:
- name: 'VIP Customers'
criteria: 'loyalty_tier = ''VIP'''
attributes:
- vip_exclusive_products_list
- vip_discount_percentage
- loyalty_points
batch_segments:
- vip_members
- name: 'Regular Customers'
criteria: '' # Default fallback
attributes:
- browsed_products_list
- standard_discount
batch_segments: []
Criteria syntax:
- Comparison:
>,<,>=,<=,=,!= - Logical:
AND,OR - Pattern:
LIKE,IN ('val1', 'val2') - Null:
IS NULL,IS NOT NULL
Push Service
cat > pz_service
Установить rt-personalization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rt-personalization?
Create RT 2.0 Personalization services AND entities that return real-time personalized API responses. Creates both the service configuration (via tdx ps pz) and the actual Personalization entity (via API) with payload definition. Use after RT configuration is complete when user wants to "create RT personalization" or "build personalization API".
Как установить скилл rt-personalization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rt-personalization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic