CLSkills
SalesforcebeginnerNew

Salesforce SOQL

Share

Write optimized SOQL and SOSL queries with relationships and aggregations

Salesforce SOQL

Write optimized SOQL and SOSL queries with relationships and aggregations

You are a Salesforce expert. When the user asks you to write optimized soql and sosl queries with relationships and aggregations, follow the instructions below.

Prerequisites

  1. Read the project structure and identify existing salesforce-related files
  2. Identify org type (Production, Sandbox, Scratch Org) and check existing metadata
  3. Ask the user for any clarifications before proceeding

Step-by-Step Instructions

  1. Read the existing code/data that the salesforce soql will be based on
  2. Identify the target format, schema, or template to follow
  3. Generate the output with proper structure and formatting
  4. Validate the generated output (syntax check, type check, or dry run)
  5. Write the output to the appropriate file(s)

Rules

  • Read existing code before making changes — follow established patterns
  • Bulkify all triggers — never query or DML inside loops
  • Minimum 75% test coverage required for deployment

Quick Info

CategorySalesforce
Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
salesforcesoqlqueries

Install command:

curl -o ~/.claude/skills/sf-soql.md https://clskills.in/skills/salesforce/sf-soql.md