sf-soql

sf-soql is a skill for Claude Code from Clientell-Ai/salesforce-skills. It costs 78 tokens per session (2,009 once invoked), scanned A, original, Apache-2.0.

Guidance for writing and improving SOQL, Salesforce’s query language for retrieving records such as accounts and contacts. It covers filters, related records, grouped results, and records that can have different object types.

In plain words
What is it for?
Writing, debugging, and optimizing SOQL queries, including relationship queries, totals and counts, polymorphic records, selective filters, and security checks.
Why use it?
It helps produce queries that are efficient and respect Salesforce’s access rules. It also avoids unsafe ways of inserting user input into queries.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Good fit Writing, debugging, and optimizing SOQL queries, including relationship queries, totals and counts, polymorphic records, selective filters, and security checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/clientell-ai/salesforce-skills/sf-soql
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Clientell-Ai/salesforce-skills --skill sf-soql
Clone the repo
git clone --depth 1 https://github.com/Clientell-Ai/salesforce-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sf-soql

README.md
[![agentmods](https://agentmods.dev/badge/skills/clientell-ai/salesforce-skills/sf-soql/github.svg)](https://agentmods.dev/skills/clientell-ai/salesforce-skills/sf-soql)
Your own site
<a href="https://agentmods.dev/skills/clientell-ai/salesforce-skills/sf-soql"><img src="https://agentmods.dev/badge/skills/clientell-ai/salesforce-skills/sf-soql/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sf-soql

Your own site · 80×15
<a href="https://agentmods.dev/skills/clientell-ai/salesforce-skills/sf-soql"><img src="https://agentmods.dev/badge/skills/clientell-ai/salesforce-skills/sf-soql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,009 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00078 $0.02009
Opus 5 $0.00039 $0.01005
Sonnet 5 $0.00016 $0.00402
Haiku 4.5 $0.00008 $0.00201

Measured 11d ago against content hash a4339dc7ce66, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

sf-soql scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/sf-soql/SKILL.md · 230 lines

How it starts

The opening of the file, as written. The whole thing — 230 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SOQL Query Builder & Optimizer

You are a Salesforce SOQL specialist. Build optimized, secure queries.

Security First

  • ALWAYS use WITH USER_MODE to enforce CRUD/FLS
  • NEVER use string concatenation for dynamic SOQL — use bind variables
  • Use Database.query() only when dynamic queries are truly needed
// GOOD
List<Account> accounts = [
    SELECT Id, Name, Industry
    FROM Account
    WHERE Industry = :industryFilter
    WITH USER_MODE
    LIMIT 200
];

// BAD — injection risk
String query = 'SELECT Id FROM Account WHERE Name = \'' + userInput + '\'';

Query Patterns

Parent-to-Child (Subquery)

SELECT Id, Name,
    (SELECT Id, FirstName, LastName FROM Contacts)
FROM Account
WHERE Industry = 'Technology'
WITH USER_MODE

Child-to-Parent (Dot Notation)

SELECT Id, FirstName, Account.Name, Account.Industry
FROM Contact
WHERE Account.Industry = 'Technology'
WITH USER_MODE

Aggregate Queries

SELECT Industry, COUNT(Id) cnt, SUM(AnnualRevenue) totalRevenue
FROM Account
WHERE Industry != null
WITH USER_MODE
GROUP BY Industry
HAVING COUNT(Id) > 5
ORDER BY COUNT(Id) DESC

Polymorphic (TYPEOF)

SELECT Id, Subject,
    TYPEOF What
        WHEN Account THEN Name, Industry
        WHEN Opportunity THEN Name, StageName, Amount
    END
FROM Task
WITH USER_MODE

Semi-Joins and Anti-Joins

-- Semi-join: Accounts WITH contacts
SELECT Id, Name FROM Account
WHERE Id IN (SELECT AccountId FROM Contact)
WITH USER_MODE

-- Anti-join: Accounts WITHOUT opportunities
SELECT Id, Name FROM Account
WHERE Id NOT IN (SELECT AccountId FROM Opportunity)
WITH USER_MODE

SOSL (Search Language)

Use SOSL for full-text search across multiple objects:

FIND {SearchTerm} IN ALL FIELDS
RETURNING Account(Id, Name WHERE Industry = 'Tech'),
          Contact(Id, FirstName, LastName)
LIMIT 20
  • Use SOSL when: searching text across objects, fuzzy matching, partial words
  • Use SOQL when: exact matches, relationship queries, aggregates, DML-related queries
  • Governor limit: 20 SOSL queries per transaction

Read the full file on GitHub · 230 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 230 lines · 78 tokens per session scan A a4339dc7ce66

Subscribe to this mod's changes

sf-soql is a skill published in the GitHub repository Clientell-Ai/salesforce-skills (15 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 78 tokens to every session and 2,009 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

bmob-database-javascript

A JavaScript guide for using Bmob, a hosted NoSQL database service, from browsers, servers, and several cross-platform app environments. It uses Bmob's newer hydrogen-js-sdk and covers data, users, files, and related records.

bmob/agent-skills · 296 tokens

bmob-database-restful

Use when interacting with Bmob backend cloud over plain HTTP / curl from ANY language that lacks a Bmob SDK — Python (requests/httpx), Go (net/http), PHP (Guzzle), C# (HttpClient), Rust (reqwest), Ruby, Java backend, Bash, Deno, server-side scripting, data migration. Also use when the user explicitly wants curl or the…

bmob/agent-skills · 274 tokens

bmob

A guide for using Bmob, a backend-as-a-service platform that provides hosted databases, users, files, cloud functions, messaging, and other server features. It routes tasks to platform-specific instructions for JavaScript, Android, iOS, Flutter, and other clients.

bmob/agent-skills · 204 tokens

mako-neighborhoods

TRIGGER when: user wants entity-wide context for a table, route, or RPC -- schema + RLS + readers + writers + downstream touches all at once. Covers tableneighborhood, routecontext, rpcneighborhood.

drhalto/agentmako · 48 tokens

bmob-mcp

Use when the user has the Bmob MCP server configured (http://mcp.bmobapp.com/mcp) and wants to perform LIVE operations against their Bmob backend cloud project from the IDE. Triggers: 'list bmob tables', 'show bmob schema', 'create bmob table', 'add a row to bmob', 'update bmob record', 'delete bmob data', '生成 bmob…

bmob/agent-skills · 310 tokens

django-patterns

Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps.

KunanonJ/ai-skills-hub · 32 tokens