OpenParable
Skip to content
← Back to skills

Validate Segment

Testing & Quality
validate-segment

Validate Segment is an Agent Skill for testing & quality published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

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.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/data/validate-segment/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/validate-segment, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

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: days → day, months → month

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

Related Skills

  • segment - Full segment management