
Data Cloud Segment
OfficialFreeManage segments and insights in Salesforce Data Cloud.
Free · Opens the source repo
What Data Cloud Segment does
The data360-segment skill is designed for users working with audience segments and calculated insights within Salesforce Data Cloud. It facilitates the creation, publication, and troubleshooting of segments, allowing users to effectively manage their audience data. This skill is particularly useful when you need to execute segment workflows, verify member counts, or troubleshoot SQL queries related to audience segments.
When using this skill, users can leverage commands to create segments and calculated insights using reusable JSON definitions. It also provides the necessary tools to inspect the current state of segments and insights, ensuring that users can monitor their audience data effectively. Additionally, the skill includes specific commands to publish segments and run calculated insights, allowing for seamless integration into data workflows.
The skill is particularly beneficial for data analysts and Salesforce administrators who are involved in audience segmentation and insights generation. It streamlines the process of managing audience data, reducing the complexity often associated with SQL troubleshooting and segment management. By providing clear commands and workflows, data360-segment enhances productivity and ensures that users can focus on deriving insights from their audience data rather than getting bogged down in technical details.
However, it is important to note that this skill is not suitable for tasks related to data model objects, activation, or query/search-index work. For those specific tasks, users should refer to other skills such as data360-harmonize, data360-activate, or data360-query. This delineation ensures that users can select the right tool for their specific needs, optimizing their workflow in Salesforce Data Cloud.
When to use it
Use this skill when you need to create, publish, or troubleshoot audience segments and calculated insights in Salesforce Data Cloud.
When not to use it
Avoid this skill for tasks involving data model objects, activation of segments, or executing read-only SQL queries.
What you can build with it
Creating a New Segment
Use the skill to create a new audience segment by defining it in a JSON file and executing the appropriate command.
Publishing Calculated Insights
After creating calculated insights, utilize this skill to publish them and make them available for analysis.
Troubleshooting SQL Queries
If you encounter issues with segment SQL, this skill provides the tools necessary to troubleshoot and resolve those problems.
How to install Data Cloud Segment
View source1. Install with the skills CLI
npx skills add forcedotcom/sf-skills/data360-segment --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by forcedotcomdata360-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-orchestrateskill 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.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 ../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 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
Frequently asked questions about Data Cloud Segment
Similar skills
Power BI Semantic Modeling
Optimize your Power BI data models with best practices.
Data Context Extractor
Tailor data analysis skills to your company's needs.
Power BI Performance Troubleshooting
Systematic guidance for optimizing Power BI performance.
Power BI Model Design Review
Optimize your Power BI data models with expert reviews.
Power BI DAX Formula Optimizer
Optimize your DAX formulas for better performance and clarity.
Fabric Lakehouse
Optimize your data solutions with Lakehouse best practices.
