sf-soql-constraints

Enforce SOQL/SOSL safety rules and governor limit compliance for Salesforce queries.

13|2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/jiten-singh-shahi/salesforce-claude-code --skill sf-soql-constraints
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-soql-constraints
Source: https://github.com/jiten-singh-shahi/salesforce-claude-code/tree/main/.cursor/skills/sf-soql-constraints
Command: npx skills add https://github.com/jiten-singh-shahi/salesforce-claude-code --skill sf-soql-constraints

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforce SOQL/SOSL safety rules, selectivity, and governor limit compliance for Salesforce queries, helping developers prevent governor-limit breaches and security risks.

Core Features & Use Cases

  • Always bulkify database operations and use bind variables to avoid governor-limit issues.
  • Enforce safe query patterns in user-facing contexts with WITH USER_MODE and proper FLS/ CRUD guards.
  • Use Case: When writing or reviewing SOQL or SOSL queries, this skill flags anti-patterns, suggests optimizations, and ensures queries stay within limits.

Quick Start

Review a SOQL query and receive guidance on applying bulkification, binds, and selective filters.

Frequently Asked Questions about sf-soql-constraints

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent Salesforce governor limits when writing SOQL queries?

Prevent Salesforce governor limits by bulkifying database operations, using bind variables, and applying selective filters. This skill reviews SOQL queries to enforce these safety rules and ensure per-transaction budgets are respected.

What is query selectivity in SOQL and why does it matter?

Query selectivity in SOQL determines how efficiently a query retrieves records using indexed fields. This skill enforces selective filter best practices to keep Salesforce queries within governor limit compliance and avoid performance bottlenecks.

How do I enforce FLS and CRUD checks in SOQL queries?

Enforce FLS and CRUD checks in SOQL queries by applying WITH USER_MODE in user-facing contexts. This skill flags missing security guards and suggests safe query patterns to mitigate security risks.

How do I bulkify Apex database operations to avoid governor limits?

Bulkify Apex database operations by processing records in collections and avoiding queries inside loops. This skill reviews Apex database operations to ensure bulkification and proper bind variable usage.

Does this skill review SOSL searches for governor limit compliance?

Yes, this skill reviews SOSL searches for governor limit compliance. It flags anti-patterns, suggests optimizations, and ensures SOSL search operations stay within Salesforce per-transaction limits.

What are the limitations of using SOQL bind variables for query safety?

SOQL bind variables prevent governor-limit issues by safely passing Apex variables into queries. This skill enforces their usage but cannot optimize queries lacking selective filters or indexed fields, which remain subject to platform limits.