segmenting-datacloud
forcedotcom/sf-skills
Create, publish, and troubleshoot Salesforce Data Cloud segments and calculated insights.
What is segmenting-datacloud?
This skill handles the segmentation phase of Data Cloud work: creating and publishing audience segments, managing calculated insights, inspecting member counts, and troubleshooting segment SQL. Use it when building audience definitions and insights; delegate data modeling to harmonizing-datacloud, activation to activating-datacloud, and read-only queries to retrieving-datacloud.
- Create segments and calculated insights using JSON definitions
- Publish segments and run calculated insights with explicit commands
- Inspect segment member counts and verify publish status
- Troubleshoot Data Cloud segment SQL and membership issues
- Classify org readiness for segment work before mutations
How to install segmenting-datacloud
npx skills add https://github.com/forcedotcom/sf-skills --skill segmenting-datacloud- External community sf data360 CLI plugin installed
- Data Cloud-enabled Salesforce org
- Target org alias configured
How to use segmenting-datacloud
- 1.Run the readiness classifier: node ../orchestrating-datacloud/scripts/diagnose-org.mjs -o <org> --phase segment --json
- 2.List current segments and calculated insights: sf data360 segment list and sf data360 calculated-insight list
- 3.Create assets using JSON definitions: sf data360 segment create -o <org> -f segment.json --api-version 64.0
- 4.Publish segments or run calculated insights: sf data360 segment publish or sf data360 calculated-insight run
- 5.Verify with member counts or SQL queries: sf data360 segment count or sf data360 query sql
Use cases
- Build a segment targeting high-value customers and publish it to activate downstream
- Create a calculated insight to compute lifetime value across unified customer records
- Inspect member counts after segment publish to verify audience size
- Troubleshoot why a segment SQL query returns unexpected results or empty membership
- Verify segment and calculated-insight assets exist and are configured in the org
- Data Cloud administrators managing audience segments
- Marketing operations teams building customer segments
- Analytics engineers creating calculated insights
- Salesforce developers troubleshooting Data Cloud SQL
segmenting-datacloud FAQ
Use segmenting-datacloud for segment creation, publishing, and calculated insights. Use harmonizing-datacloud for Data Model Object (DMO) creation, mappings, and identity resolution work.
Segment creation behavior can be unstable on newer API versions. Using --api-version 64.0 provides more reliable behavior.
Use SQL joins rather than the segment members command, which returns only opaque IDs. Query the unified DMO directly with SQL.
It usually means the Data Cloud module is reachable but unconfigured, not that it is unavailable. Check org readiness with the diagnostic classifier.
No. Publish and run commands may kick off asynchronous work. Always verify with member counts or query results after publishing.
Full instructions (SKILL.md)
Source of truth, from forcedotcom/sf-skills.
name: segmenting-datacloud 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 harmonizing-datacloud), activation work (use activating-datacloud), query/search-index work (use retrieving-datacloud), or Standard Data Model (STDM)/session tracing (use observing-agentforce)." compatibility: "Requires an external community sf data360 CLI plugin and a Data Cloud-enabled org" metadata: version: "1.0"
segmenting-datacloud: 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 segmenting-datacloud 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 → harmonizing-datacloud
- activating a segment downstream → activating-datacloud
- writing read-only SQL or search-index queries → retrieving-datacloud
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
orchestrating-datacloudskill before mutating audience assets:node ../orchestrating-datacloud/scripts/diagnose-org.mjs -o <org> --phase segment --json. - Prefer reusable JSON definitions for repeatable segment and CI creation.
- Use
--api-version 64.0when 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 memberswhen readable member details are needed.
Recommended Workflow
1. Classify readiness for segment work
node ../orchestrating-datacloud/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 membersreturns 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
- README.md
- ../orchestrating-datacloud/assets/definitions/calculated-insight.template.json
- ../orchestrating-datacloud/assets/definitions/segment.template.json
- ../orchestrating-datacloud/references/feature-readiness.md
- ../orchestrating-datacloud/UPSTREAM.md
Related skills
More from forcedotcom/sf-skills and the wider catalog.

switching-org
Switch the active Salesforce org for CLI commands using the Salesforce CLI.

testing-agentforce
Write, run, and analyze structured test suites for Agentforce agents.

uplifting-components-to-slds2
Migrate Lightning Web Components from SLDS 1 to SLDS 2 using the SLDS linter and structured violation fixes.

using-mobile-native-capabilities
Build LWCs that access native mobile device capabilities—barcode scanning, biometrics, location, NFC, payments, and more.

using-ui-bundle-salesforce-data
Access Salesforce records in UI bundles using the Data SDK with GraphQL and REST APIs.

validating-slds
Audit Lightning Web Components for SLDS compliance and produce a scored quality report. Runs the SLDS linter, analyzes CSS for theming hook usage and pairing, checks HTML for accessibility attributes, and scores findings across categories into an overall grade. Use when asked to \"score my component\", \"SLDS scorecard\", \"quality report\", \"audit SLDS compliance\", \"how good is my SLDS\", \"check component quality\", \"rate my component\", \"evaluate my component\", \"is this component ready to ship?\", \"look at my LWC for issues\", \"audit this before I submit\", \"review my component before code review\", or any time a user wants a quality assessment or production-readiness check on an LWC or SLDS component. Not for fixing violations (use uplifting-components-to-slds2) or building new components (use applying-slds).