Back to list
treasure-data

validate-segment

by treasure-data

Treasure Data Skills for Claude Code

6🍴 4📅 Jan 23, 2026

SKILL.md


name: validate-segment description: Validates CDP segment YAML configurations against the TD CDP API specification. Use when reviewing segment rules for correctness, checking operator types and values, or troubleshooting segment configuration errors before pushing to Treasure Data.

Segment YAML Validation

tdx sg validate                           # Validate all YAML files locally
tdx sg validate path/to/segment.yml       # Validate specific file
tdx sg push --dry-run                     # Preview changes before push

Required Structure

name: string
kind: batch                    # batch | realtime | funnel_stage
rule:
  type: And                    # And | Or
  conditions:
    - type: Value
      attribute: field_name
      operator:
        type: OperatorType
        value: ...

Operators Quick Reference

TypeValueNotes
Equal, NotEqualsingle value
Greater, GreaterEqual, Less, LessEqualnumber
In, NotInarray["US", "CA"]
Contain, StartWith, EndWitharray["@gmail.com"]
Regexpstringregex pattern
IsNull(none)
TimeWithinPast, TimeWithinNextnumber + unitvalue: 30, unit: day
include, excludesegment namereuse existing segment

Time Units (Singular Form Only)

year | quarter | month | week | day | hour | minute | second

Common mistake: daysday, monthsmonth

Behavior Aggregation Structure

# Behavior condition with aggregation
- type: Value
  attribute: field_name          # Or "" for pure count
  operator:
    type: GreaterEqual
    value: 1
  aggregation:
    type: Count                  # Count | Sum | Avg | Min | Max
  source: behavior_name          # Behavior from parent segment

Required fields: aggregation.type and source must both be present

  • segment - Full segment management

Score

Total Score

45/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon