cas
Installation
SKILL.md
tdx CAS - Composable Audience Studio Management
Composable audiences never copy data into Treasure Data — they query the customer's own Snowflake/Databricks/BigQuery directly. This is the main reason CAS YAML differs from standard tdx ps/tdx sg YAML: every table reference needs a connection, and child segment rules use a different condition shape.
Pushing composable audiences safely — read this first
All CAS writes go through the typed tdx cas commands. Never create or update a composable audience/segment/activation with raw tdx api HTTP calls — the request shapes below have real footguns that the typed command handles for you.
- Audience updates are a full replace of
attributes/behaviors, not a merge. If you push a YAML that's missing an attribute/behavior the server currently has,tdx cas pushrefuses before writing anything and names exactly what would be removed. This is intentional — it is not a bug to work around. Either update the local YAML to include the missing field (pull first if it might be stale:tdx cas pull), or, if removing it is genuinely intended, re-run with--delete. Never assume--deleteis safe to add reflexively just to make the refusal go away — confirm with the user first if you didn't write the YAML yourself. - Renaming an attribute/behavior (same source
schema/table/column, newname) does NOT need--delete.tdx cas pushdetects this as a rename, not a removal, and applies it directly. Under the hood the backend recreates the attribute/behavior with a new server-side id every time (it can't rename in place) — push output reports this explicitly, e.g.Renamed attribute: "email" → "email_updated" (server id changed 10095 → 10096). If anything else is keyed on that id (an activation, an external system), it needs to be updated separately;tdx cas pushhas no way to know about or update such references. - Repeat pushes are idempotent by name. Pushing the same audience/segment/activation name again updates the existing one — it does not create a duplicate. There's no need to check existence yourself before pushing.
- No confirmation prompt on drift or errors. Both the drift refusal above and any other push failure exit non-zero with a specific message (never a generic "push failed"). Read the message — it names the exact field/attribute/behavior involved.
- If a typed command seems not to exist for what you need, ask the user — do not fall back to raw
tdx api.