PluginBench
Skill
Pass
Audit score 90

data360-segment

forcedotcom/sf-skills

Create, publish, and troubleshoot Salesforce Data Cloud segments and calculated insights.

What is data360-segment?

This skill handles audience segmentation work in Salesforce Data Cloud, including segment creation, publishing, calculated insight management, and SQL troubleshooting. Use it when working with segments, calculated insights, member counts, or audience SQL—not for data modeling, activation, or queries.

  • Create and publish segments using JSON definitions
  • Manage calculated insights and run insight execution
  • Inspect segment member counts and membership details
  • Troubleshoot Data Cloud segment SQL and audience logic
  • Verify segment state and publish workflows
  • Classify org readiness for segment operations

How to install data360-segment

npx skills add https://github.com/forcedotcom/sf-skills --skill data360-segment
Prerequisites
  • Node.js >=18.0.0
  • Salesforce CLI (sf) >=2.0.0
  • Access to a Salesforce org with Data Cloud configured
  • Unified Data Model Objects (DMOs) already created in the org
Claude Code
Cursor
Windsurf
Cline

How to use data360-segment

  1. 1.Run the readiness classifier: node ../data360-orchestrate/scripts/diagnose-org.mjs -o <org> --phase segment --json
  2. 2.List current segments and calculated insights: sf data360 segment list -o <org> and sf data360 calculated-insight list -o <org>
  3. 3.Create a segment or calculated insight using a JSON definition file: sf data360 segment create -o <org> -f segment.json --api-version 64.0
  4. 4.Publish the segment or run the calculated insight: sf data360 segment publish -o <org> --name <segment-name> or sf data360 calculated-insight run -o <org> --name <insight-name>
  5. 5.Verify success with member counts or SQL queries: sf data360 segment count -o <org> --name <segment-name>

Use cases

Good for
  • Building a customer segment based on unified data model objects and publishing it for downstream activation
  • Creating a calculated insight to compute lifetime value or aggregate metrics across segment members
  • Troubleshooting why a segment SQL query returns unexpected results or member counts
  • Inspecting current segments and calculated insights in an org to understand existing audience assets
  • Verifying segment publish status and member counts after creation
Who it's for
  • Data Cloud administrators managing audience segmentation
  • Analytics engineers building segments and calculated insights
  • Salesforce developers troubleshooting segment SQL and audience logic
  • Data teams verifying segment membership and counts

data360-segment FAQ

When should I use data360-segment vs. data360-harmonize?

Use data360-segment for audience work (segments, calculated insights, member counts). Use data360-harmonize for data modeling, mappings, and identity resolution.

What is the difference between segment SQL and SOQL?

Data Cloud segment SQL is distinct from Salesforce SOQL. Segment SQL operates on unified data model objects and has different syntax and limitations.

Why does segment creation sometimes require --api-version 64.0?

Segment creation behavior can be unstable on newer API versions, so 64.0 is recommended for reliability.

How do I get human-readable member details from a segment?

Use SQL joins rather than the segment members command, which returns only opaque IDs.

Does the publish command complete synchronously?

No; publish and run steps may kick off asynchronous work even when the command returns quickly. Always verify with counts or queries.

Full instructions (SKILL.md)

Source of truth, from forcedotcom/sf-skills.


name: data360-segment description: "Salesforce Data Cloud Segment phase. Use this skill when the user creates or publishes segments, manages calculated insights, or troubleshoots audience SQL in Data Cloud. TRIGGER when: user creates or publishes segments, manages calculated insights, inspects segment counts or membership, or troubleshoots audience SQL in Data Cloud. DO NOT TRIGGER when: the task is DMO/mapping/identity-resolution work (use data360-harmonize), activation work (use data360-activate), query/search-index work (use data360-query), or Standard Data Model (STDM)/session tracing (use agentforce-observe)." metadata: cliTools: - tool: ["node"] semver: ">=18.0.0" - tool: ["sf"] semver: ">=2.0.0" relatedSkills: - "agentforce-observe" - "data360-activate" - "data360-harmonize" - "data360-orchestrate" - "data360-query" version: "1.0" domains: ["Data 360"]

data360-segment: Data Cloud Segment Phase

Use this skill when the user needs audience and insight work: segments, calculated insights, publish workflows, member counts, or troubleshooting Data Cloud segment SQL.

When This Skill Owns the Task

Use data360-segment when the work involves:

  • sf data360 segment *
  • sf data360 calculated-insight *
  • segment publish workflows
  • member counts and segment troubleshooting
  • calculated insight execution and verification

Delegate elsewhere when the user is:

  • still building Data Model Objects (DMOs), mappings, or identity resolution → data360-harmonize
  • activating a segment downstream → data360-activate
  • writing read-only SQL or search-index queries → data360-query

Required Context to Gather First

Ask for or infer:

  • target org alias
  • unified DMO (Data Model Object) or base entity name
  • whether the user wants create, publish, inspect, or troubleshoot
  • whether the asset is a segment or calculated insight
  • expected success metric: member count, aggregate value, or publish status

Core Operating Rules

  • Treat Data Cloud segment SQL as distinct from CRM SOQL.
  • Run the shared readiness classifier from the data360-orchestrate skill before mutating audience assets: node ../data360-orchestrate/scripts/diagnose-org.mjs -o <org> --phase segment --json.
  • Prefer reusable JSON definitions for repeatable segment and CI creation.
  • Use --api-version 64.0 when segment creation behavior is unstable on newer defaults.
  • Verify with counts or SQL after publish/run steps instead of assuming success.
  • Use SQL joins rather than segment members when readable member details are needed.

Recommended Workflow

1. Classify readiness for segment work

node ../data360-orchestrate/scripts/diagnose-org.mjs -o <org> --phase segment --json

2. Inspect current state

sf data360 segment list -o <org> 2>/dev/null
sf data360 calculated-insight list -o <org> 2>/dev/null

3. Create with reusable JSON definitions

sf data360 segment create -o <org> -f segment.json --api-version 64.0 2>/dev/null
sf data360 calculated-insight create -o <org> -f ci.json 2>/dev/null

4. Publish or run explicitly

sf data360 segment publish -o <org> --name My_Segment 2>/dev/null
sf data360 calculated-insight run -o <org> --name Lifetime_Value 2>/dev/null

5. Verify with counts or SQL

sf data360 segment count -o <org> --name My_Segment 2>/dev/null
sf data360 query sql -o <org> --sql 'SELECT COUNT(*) FROM "UnifiedssotIndividualMain__dlm"' 2>/dev/null

High-Signal Gotchas

  • Segment creation can require --api-version 64.0.
  • segment members returns opaque IDs; use SQL joins when human-readable member details are needed.
  • Segment SQL is not SOQL.
  • Calculated insight assets and segment SQL have different limitations.
  • Publish/run steps may kick off asynchronous work even when the command returns quickly.
  • An empty segment or calculated-insight list usually means the module is reachable but unconfigured, not unavailable.

Output Format

Segment task: <segment / calculated-insight>
Action: <create / publish / inspect / troubleshoot>
Target org: <alias>
Artifacts: <definition files / commands>
Verification: <member count / query result / publish state>
Next step: <act / retrieve / follow-up>

References

  • ../data360-orchestrate/assets/definitions/calculated-insight.template.json
  • ../data360-orchestrate/assets/definitions/segment.template.json
  • ../data360-orchestrate/references/feature-readiness.md