Agent skill

Sf Soql

by Jaganpro in Jaganpro/sf-skills

SOQL query generation, optimization, and analysis with 100-point scoring.

MITAuto-check passedDatabases

Install Sf Soql

skills CLI
$ npx skills add Jaganpro/sf-skills --skill sf-soql -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Jaganpro/sf-skills sf-soql --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Jaganpro/sf-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/sf-soql .claude/skills/sf-soql && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sf-soql
GitHub stars
424
Token cost
~1.2k tokens
SKILL.md length
399 words
Files
17 (incl. references, assets)
Skills in repo
36
Repo updated
First seen
Licence
MIT

At a glance

SOQL query generation, optimization, and analysis with 100-point scoring.

  • Works in 4 steps: Generate the simplest correct query → Choose the right query shape → Optimize for selectivity and safety → …
  • Debugs SOQL/SOSL queries
  • SKILL.md covers When This Skill Owns the Task, Required Context to Gather First, Recommended Workflow and High-Signal Rules, plus 4 more sections
  • Runs Python scripts from its folder

What it does

Sf Soql is an agent skill from Jaganpro/sf-skills. SOQL query generation, optimization, and analysis with 100-point scoring. TRIGGER when: user writes, optimizes, or debugs SOQL/SOSL queries, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER when: bulk data operations (use sf-data), Apex DML logic (use sf-apex), or report/dashboard queries.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 20 other files, including reference files and assets (for example `CREDITS.md`, `README.md` and `hooks/scripts/post-tool-validate.py`).

It sits in Databases, covering Query optimization. The repository describes itself as: [ARCHIVED — migrated to forcedotcom/afv-library] Salesforce Skills for Agentic Coding Tools — Apex, Flow, LWC, SOQL, Agentforce, Data Cloud, OmniStudio. Read-only archive; active… The licence is MIT.

When your agent uses it

  • Debugs SOQL/SOSL queries
  • Touches .soql files
  • Asks about relationship queries
  • Query performance

Example prompts

  • “/sf-soql”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Generate the simplest correct query
  2. Choose the right query shape
  3. Optimize for selectivity and safety
  4. Validate execution path if needed

What it can do on your machine

Read from SKILL.md and the folder at commit 53c9956. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sf Soql loads about 1.2k tokens when it runs, and up to ~16k if it reads all its reference files. Until then it costs about 89 tokens; SKILL.md has 399 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~89
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~16k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Jaganpro/sf-skills at commit 53c9956, republished under its MIT licence (© Jaganpro). 399 words, ~1,151 tokens.

Download SKILL.mdSave it as .claude/skills/sf-soql/SKILL.md (or your agent's skills folder). This skill also uses 16 other files; get the full folder from GitHub.
name
sf-soql
description
SOQL query generation, optimization, and analysis with 100-point scoring. TRIGGER when: user writes, optimizes, or debugs SOQL/SOSL queries, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER when: bulk data operations (use sf-data), Apex DML logic (use sf-apex), or report/dashboard queries.
license
MIT
metadata.version
1.1.0
metadata.author
Jag Valaiyapathy
metadata.scoring
100 points across 5 categories

sf-soql: Salesforce SOQL Query Expert

Use this skill when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan analysis, and performance/safety improvements for Salesforce queries.

When This Skill Owns the Task

Use sf-soql when the work involves:

  • .soql files
  • query generation from natural language
  • relationship queries and aggregate queries
  • query optimization and selectivity analysis
  • SOQL/SOSL syntax and governor-aware design

Delegate elsewhere when the user is:

  • performing bulk data operations → sf-data
  • embedding query logic inside broader Apex implementation → sf-apex
  • debugging via logs rather than query shape → sf-debug

Required Context to Gather First

Ask for or infer:

  • target object(s)
  • fields needed
  • filter criteria
  • sort / limit requirements
  • whether the query is for display, automation, reporting-like analysis, or Apex usage
  • whether performance / selectivity is already a concern

1. Generate the simplest correct query

Prefer:

  • only needed fields
  • clear WHERE criteria
  • reasonable LIMIT when appropriate
  • relationship depth only as deep as necessary
2. Choose the right query shape
NeedDefault pattern
parent data from childchild-to-parent traversal
child rows from parentsubquery
counts / rollupsaggregate query
records with / without related rowssemi-join / anti-join
text search across objectsSOSL
3. Optimize for selectivity and safety

Check:

  • indexed / selective filters
  • no unnecessary fields
  • no avoidable wildcard or scan-heavy patterns
  • security enforcement expectations
4. Validate execution path if needed

If the user wants runtime verification, hand off execution to:


Show full SKILL.md (171 more words)Show less

High-Signal Rules

  • never use SELECT * style thinking; query only required fields
  • do not query inside loops in Apex contexts
  • prefer filtering in SOQL rather than post-filtering in Apex
  • use aggregates for counts and grouped summaries instead of loading unnecessary records
  • evaluate wildcard usage carefully; leading wildcards often defeat indexes
  • account for security mode / field access requirements when queries move into Apex

Output Format

When finishing, report in this order:

  1. Query purpose
  2. Final SOQL/SOSL
  3. Why this shape was chosen
  4. Optimization or security notes
  5. Execution suggestion if needed

Suggested shape:

text
Query goal: <summary>
Query: <soql or sosl>
Design: <relationship / aggregate / filter choices>
Notes: <selectivity, limits, security, governor awareness>
Next step: <run in sf-data or embed in Apex>

Cross-Skill Integration

NeedDelegate toReason
run the query against an orgsf-dataexecution and export
embed the query in services/selectorssf-apeximplementation context
analyze slow-query symptoms from logssf-debugruntime evidence
wire query-backed UIsf-lwcfrontend integration

Reference Map

Start here
Specialized guidance

Score Guide

ScoreMeaning
90+production-optimized query
80–89good query with minor improvements possible
70–79functional but performance concerns remain
< 70needs revision before production use

© Jaganpro, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 16 other files (references, assets) in skills/sf-soql of Jaganpro/sf-skills.

  • SKILL.md
  • CREDITS.md
  • README.md
  • assets/aggregate-queries.soql
  • assets/basic-queries.soql
  • assets/bulkified-query-pattern.cls
  • assets/optimization-patterns.soql
  • assets/relationship-queries.soql
  • assets/selector-class.cls
  • hooks/scripts/post-tool-validate.py
  • references/anti-patterns.md
  • references/cli-commands.md
  • references/field-coverage-rules.md
  • references/query-optimization.md
  • references/selector-patterns.md
  • references/soql-reference.md
  • references/soql-syntax-reference.md

Open the folder on GitHubat commit 53c9956

Compare with similar skills

Sf Soql next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sf Soql compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sf Soql this skillJaganpro/sf-skills424—~1.2kAutomated safety check: PassMIT
SQL Optimization Patternsynulihao/AgentSkillOS61711 repos~3.3kAutomated safety check: PassNone
Cloud Trace Queryinggoogle/skills21k—~1.7kAutomated safety check: PassApache-2.0
Query Engine Designrevfactory/claude-code-harness120—~474Automated safety check: PassNone
Query Plan Snapshot CLIeclipse-rdf4j/rdf4j420—~1.5kAutomated safety check: PassBSD-3-Clause
Wp Acf And Content Modelingjorgerosal/wordpress-skills102—~3.2kAutomated safety check: PassMIT

Similar skills

  • SQL Optimization Patterns

    ynulihao/AgentSkillOS

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.

    617 GitHub starsUsed in 11 repos~3.3k tokens
    DatabasesAuto-check passed
  • Official

    Query Cloud Trace spans, filter by latency thresholds or error status, correlate distributed traces with Cloud Logging, and diagnose latency bottlenecks across Google Cloud services.

    21k GitHub stars~1.7k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Query Engine Design

    revfactory/claude-code-harness

    SQL query engine design and implementation guide. An agent skill from revfactory/claude-code-harness.

    120 GitHub stars~474 tokensUpdated 7 mo ago
    DatabasesAuto-check passed
  • Query Plan Snapshot CLI

    eclipse-rdf4j/rdf4j

    Use QueryPlanSnapshotCli to capture and compare RDF4J query plans, then assess likely performance improvements/regressions from execution verification and semantic plan diffs.

    420 GitHub stars~1.5k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Wp Acf And Content Modeling

    jorgerosal/wordpress-skills

    WordPress ACF and content modeling review. An agent skill from jorgerosal/wordpress-skills.

    102 GitHub stars~3.2k tokensUpdated 4 mo ago
    DatabasesAuto-check passed
  • Jpa Patterns

    affaan-m/ECC

    JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.

    276k GitHub starsUsed in 5 repos~1.2k tokens
    DatabasesAuto-check passed

More from Jaganpro/sf-skills

All 36 skills in this repo
  • Agentforce session tracing extraction and analysis. An agent skill from Jaganpro/sf-skills.

    424 GitHub stars~1.8k tokensUpdated 5 mo ago
    Auto-check passed
  • Sf AI Agentscript

    Jaganpro/sf-skills

    Agent Script DSL for deterministic Agentforce agents. An agent skill from Jaganpro/sf-skills.

    424 GitHub stars~3.8k tokensUpdated 5 mo ago
    Auto-check passed
  • Sf Datacloud

    Jaganpro/sf-skills

    Salesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows.

    424 GitHub stars~2.7k tokensUpdated 5 mo ago
    Auto-check passed
  • Sf Diagram Mermaid

    Jaganpro/sf-skills

    Salesforce architecture diagrams using Mermaid with ASCII fallback.

    424 GitHub stars~1.4k tokensUpdated 5 mo ago
    Auto-check passed
  • Sf Diagram Nanobananapro

    Jaganpro/sf-skills

    AI-powered image generation for Salesforce visuals via Nano Banana Pro.

    424 GitHub stars~1.6k tokensUpdated 5 mo ago
    Auto-check passed
  • Sf Flow

    Jaganpro/sf-skills

    Creates and validates Salesforce Flows with 110-point scoring.

    424 GitHub stars~1.8k tokensUpdated 5 mo ago
    Auto-check passed

Questions about Sf Soql

What does Sf Soql do?

SOQL query generation, optimization, and analysis with 100-point scoring. Sf Soql is an agent skill from Jaganpro/sf-skills. SOQL query generation, optimization, and analysis with 100-point scoring.

When should I use Sf Soql?

Sf Soql fits situations like: debugs SOQL/SOSL queries; touches .soql files; asks about relationship queries; query performance.

How do I install Sf Soql in Claude Code?

Run `npx skills add Jaganpro/sf-skills --skill sf-soql -a claude-code`. Or copy the skill folder (skills/sf-soql in Jaganpro/sf-skills) into .claude/skills/sf-soql in your project. Claude Code loads it when a task matches its description.

How do I install Sf Soql in Codex?

Run `npx skills add Jaganpro/sf-skills --skill sf-soql -a codex`. Or copy the skill folder (skills/sf-soql in Jaganpro/sf-skills) into .agents/skills/sf-soql in your project. Codex loads it when a task matches its description.

Can I use Sf Soql in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Jaganpro/sf-skills --skill sf-soql -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sf-soql, .gemini/skills/sf-soql, .github/skills/sf-soql and .opencode/skills/sf-soql in your project.

What does Sf Soql need to run?

Going by SKILL.md and its folder, Sf Soql needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Sf Soql access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sf Soql safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sf Soql use?

Sf Soql is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sf Soql use?

About 1.2k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 15k tokens, read only when the agent opens those files.

What are the alternatives to Sf Soql?

Skills that share tags, products or a category with Sf Soql: SQL Optimization Patterns (ynulihao/AgentSkillOS, 617 stars), Cloud Trace Querying (google/skills, 21k stars), Query Engine Design (revfactory/claude-code-harness, 120 stars) and Query Plan Snapshot CLI (eclipse-rdf4j/rdf4j, 420 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sf Soql?

Jaganpro (a GitHub user) maintains it in Jaganpro/sf-skills, which has 424 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on April 27, 2026.

Source: Jaganpro/sf-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.