segment
БесплатноБез исполняемых скриптовНе проверенManages CDP child segments using `tdx sg` commands with YAML rule configs. Covers Value/Behavior condition types, all operators (Equal, In, Between…
Об этом скилле
tdx Segment - CDP Child Segment Management
Segment Creation Workflow
Process one segment at a time. For each segment:
- Create the YAML file
- Validate with
tdx sg validate <file> - Count check — run
tdx sg sql --path <file> | tdx query -and verify count > 0- If count is 0, the rule is too restrictive — revise before proceeding
- Preview with
preview_segmenttool — get user approval before proceeding - Push with
tdx sg push -y "<file>"— always specify the file path explicitly
Never batch multiple segments in validate or push operations.
After push succeeds, display the Console link:
https://console.treasuredata.com/app/audiences/<parent_id>/segments/<segment_id>
Editing segments safely — read this first
All segment edits go through the typed tdx sg commands. Never edit a segment with raw tdx api HTTP calls.
- Never
tdx apiPUT/PATCH a segment. Raw writes skip validation and can erase a segment's rule. Use the typed command for the change you want:tdx sg moveto change folder,tdx sg pushto change rules/activations. - Never read-modify-write a segment. Do not GET a segment and write the object back — rule fields can come back empty from list/
entitiesreads, so writing it back erases the rule. Always use the dedicated command for the specific change. - To change only the folder, use
tdx sg move(below). It changes the folder and nothing else.
If a typed command seems not to exist for what you need, ask the user — do not fall back to raw tdx api.
Core Commands
tdx sg use "Customer 360" # Set parent segment context
tdx sg pull "Customer 360" # Pull to YAML (creates segments/customer-360/*.yml)
tdx sg validate <file> # Validate specific file locally
tdx sg push --dry-run "<file>" # Server-side validation (quote paths with special chars)
tdx sg push -y "<file>" # Push specific file (-y for non-interactive)
tdx sg list # List segments
tdx sg list -r # Recursive tree view
tdx sg fields # List available fields
tdx sg show "Segment Name" # Preview segment data
tdx sg sql "Segment Name" | tdx query - # Pipe segment SQL to query
tdx sg sql --path <file> # Get SQL from local YAML (requires tdx.json)
tdx sg move <segment...> --folder <folder> # Safely move segment(s) by ID or name to a folder (preserves rules)
Note: --path requires a project directory created by tdx sg pull. The file must be inside a folder with tdx.json.
Moving segments between folders
To move one or more segments to a different folder, use tdx sg move. It changes only the folder — the segment's rule and activations are left untouched (it re-reads and verifies the rule survived).
tdx sg move 12345 --folder 67890 # by ID
tdx sg move 12345 12346 --folder 67890 # several at once
tdx sg move 12345 --folder 67890 --dry-run # preview, makes no changes
# By name — needs a parent segment context:
tdx sg use "Customer 360"
tdx sg move "VIP Customers" --folder "Archive" # by name
tdx sg move "Marketing/VIP Customers" --folder "Marketing/Archive" # nested path
- Segments and the target folder can be given by numeric ID or by name/path (names resolve within the current parent segment context).
- Find a segment or folder by name with
tdx sg list '<pattern>' -r— it searches the whole tree for names matching<pattern>(case-insensitive; a plain string matches as a substring, so'VIP (US)'matches that name as-is;*and?are wildcards) and prints each match with its full folder path + id, ready to pass totdx sg move. On several matches it lists them all — pass the intended path/id, and if more than one matches, ask the user which; never assume the first. If it returns too many matches, narrow the pattern. (tdx sg list -ralone dumps the full tree.) Do not use the ids returned bytdx sg create. - If you skip the search and run
tdx sg move '<name>'with a name that matches several segments, the move refuses and lists them — pick the intended full path/id (or ask the user); it will not guess. - In
tdx sg move, name matching is case-insensitive; an ambiguous name errors and lists the matches with their IDs so you can pass the ID instead. - Names are relative to the parent segment — do not prefix the parent segment name.
- A bare name in
sg moveonly resolves a segment at the parent's top level. If the name is nested,sg movewon't move the wrong thing: it tells you the segment is nested and prints its full path (or, if the name matches several, lists them all and refuses). Either way, take the full folder path it shows — or find it up front withtdx sg list '<name>' -r— and move by that path (Folder/Sub/Segment Name). - Footgun: the same
Установить segment в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл segment?
Manages CDP child segments using `tdx sg` commands with YAML rule configs. Covers Value/Behavior condition types, all operators (Equal, In, Between, TimeWithinPast, etc.), behavior aggregations with filters, and nested condition group support/caveats. Use when creating audience segments with filtering rules, configuring behavior-based conditions, managing segment hierarchies, or exploring available fields with `tdx sg fields`.
Как установить скилл segment?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл segment запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic