New to Claude Skills? Learn how to install them →

forcedotcom on GitHub

Data Cloud Query

OfficialFree

Efficiently query and introspect Salesforce Data Cloud objects.

by forcedotcom808 stars on forcedotcom/sf-skills
2 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Data Cloud Query does

The Data Cloud Query skill is designed to streamline the process of querying and retrieving data from Salesforce's Data Cloud. This skill is particularly useful for developers and data engineers who need to perform complex queries, search operations, and metadata introspection on Data Cloud objects. It supports various query types, including synchronous SQL, asynchronous queries, and search-index workflows, making it a versatile tool for data retrieval tasks.

When using this skill, you will be able to execute commands such as sf data360 query, sf data360 search-index, and sf data360 metadata. This allows for detailed inspections of data structures and results, ensuring that you can effectively manage and analyze your data. The skill emphasizes the importance of understanding the unique Data Cloud SQL syntax, which differs from standard SOQL, and provides guidance on how to navigate this environment efficiently.

The Data Cloud Query skill is ideal for users who are involved in data analysis, reporting, or any task that requires deep interaction with Salesforce Data Cloud. It is particularly beneficial for those who need to handle large datasets or perform complex search operations, as it includes features for hybrid and vector searches, provided the index lifecycle is healthy. By leveraging this skill, users can enhance their productivity and accuracy when working with Salesforce data.

However, it is essential to note that this skill is not suitable for standard CRM SOQL queries or tasks related to segment creation and telemetry analysis. Users should be aware of the specific contexts in which this skill excels and when to utilize other skills for different types of tasks.

When to use it

Use this skill when you need to execute Data Cloud SQL queries, manage search indexes, or inspect metadata for Data Cloud objects.

When not to use it

Avoid this skill for standard CRM SOQL queries or tasks related to segment design and telemetry analysis.

What you can build with it

Running Asynchronous Queries

Use this skill to execute asynchronous queries on large datasets, improving performance and response times.

Metadata Inspection

Quickly inspect the metadata of Data Cloud objects to understand their structure and available fields.

Executing Hybrid Searches

Leverage hybrid search capabilities to retrieve relevant data based on indexed queries while applying filters.

How to install Data Cloud Query

View source

1. Install with the skills CLI

npx skills add forcedotcom/sf-skills/data360-query --agent claude-code

2. 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 forcedotcom

data360-query: Data Cloud Retrieve Phase

Use this skill when the user needs query, search, and metadata introspection for Data Cloud: sync SQL, paginated SQL, async query workflows, table describe, vector search, hybrid search, or search index operations.

When This Skill Owns the Task

Use data360-query when the work involves:

  • sf data360 query *
  • sf data360 search-index *
  • sf data360 metadata *
  • sf data360 profile * or sf data360 insight * inspection
  • understanding Data Cloud SQL results or query shape

Delegate elsewhere when the user is:


Required Context to Gather First

Ask for or infer:

  • target org alias
  • whether the user needs quick count, medium result set, large export, schema inspection, or semantic search
  • table/index name if known
  • whether the task is read-only SQL or search-index lifecycle management

Core Operating Rules

  • Treat Data Cloud SQL as its own query language, not SOQL.
  • Run the shared readiness classifier before relying on query/search surfaces: node ../data360-orchestrate/scripts/diagnose-org.mjs -o <org> --phase retrieve --json.
  • Use describe before guessing columns.
  • Prefer sqlv2 or async query flows for larger result sets.
  • Use vector search or hybrid search only when the search index lifecycle is healthy.
  • Keep STDM/parquet/session-tracing workflows out of this skill family.

Recommended Workflow

1. Classify readiness for retrieve work

node ../data360-orchestrate/scripts/diagnose-org.mjs -o <org> --phase retrieve --json
# optional query-plane probe, only with a real table name
node ../data360-orchestrate/scripts/diagnose-org.mjs -o <org> --phase retrieve --describe-table MyDMO__dlm --json

2. Choose the smallest correct query shape

sf data360 query sql -o <org> --sql 'SELECT COUNT(*) FROM "ssot__Individual__dlm"' 2>/dev/null
sf data360 query sqlv2 -o <org> --sql 'SELECT * FROM "ssot__Individual__dlm"' 2>/dev/null
sf data360 query async-create -o <org> --sql 'SELECT * FROM "ssot__Individual__dlm"' 2>/dev/null

3. Use describe before guessing fields

sf data360 query describe -o <org> --table ssot__Individual__dlm 2>/dev/null

4. Use vector or hybrid search only when an index exists

sf data360 search-index list -o <org> 2>/dev/null
sf data360 query vector -o <org> --index Knowledge_Index --query "reset password" --limit 5 2>/dev/null
sf data360 query hybrid -o <org> --index Knowledge_Index --query "reset password" --limit 5 2>/dev/null
sf data360 query hybrid -o <org> --index Insurance_Index --query "weather damage coverage" --prefilter "Type_of_Insurance__c='Home'" --limit 10 2>/dev/null

5. Reuse curated search-index examples when creating indexes

Use the phase-owned examples instead of inventing JSON from scratch:

  • examples/search-indexes/vector-knowledge.json
  • examples/search-indexes/hybrid-structured.json

High-Signal Gotchas

  • Data Cloud SQL is not SOQL.
  • Table names should be double-quoted in SQL.
  • sqlv2 is better than ad hoc OFFSET paging for medium result sets.
  • async query is preferable for large results.
  • search-index operations and vector/hybrid queries depend on the index lifecycle being healthy.
  • Hybrid search can use --prefilter, but only on fields configured as prefilter-capable when the search index was created.
  • HNSW index parameters are typically read-only on create; leave userValues: [] unless the platform explicitly documents otherwise.
  • query describe is not a universal tenant probe; only run it with a known DMO or DLO table after broader readiness has been confirmed.

Output Format

Retrieve task: <sql / sqlv2 / async / describe / vector / search-index>
Target org: <alias>
Target object: <table or index>
Commands: <key commands run>
Verification: <query rows / schema / status>
Next step: <segment / harmonize / follow-up>

References

Frequently asked questions about Data Cloud Query

Similar skills