Agent skill

Soql Lib Selector

by beyond-the-cloud-dev in beyond-the-cloud-dev/soql-lib

Creates Salesforce Apex selector classes using the SOQL Lib selector pattern.

MITAuto-check passedSales & Support

Install Soql Lib Selector

skills CLI
$ npx skills add beyond-the-cloud-dev/soql-lib --skill soql-lib-selector -a claude-code

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

GitHub CLI
$ gh skill install beyond-the-cloud-dev/soql-lib soql-lib-selector --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/beyond-the-cloud-dev/soql-lib.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/soql-lib-selector .claude/skills/soql-lib-selector && 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
soql-lib-selector
GitHub stars
154
Token cost
~2k tokens
SKILL.md length
138 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Creates Salesforce Apex selector classes using the SOQL Lib selector pattern.

  • Creating a new selector class
  • SKILL.md covers When to Use, Instructions and Examples
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Adding filter methods to an existing selector

What it does

Soql Lib Selector is an agent skill from beyond-the-cloud-dev/soql-lib. Creates Salesforce Apex selector classes using the SOQL Lib selector pattern. Covers class declaration (extends SOQL, implements SOQL.Selector), constructor defaults, static query() factory, domain-specific filter methods, naming conventions (SOQL<ObjectName), and call-site patterns. Use when creating a new selector class, adding filter methods to an existing selector, or when asked how to encapsulate SOQL queries in a reusable class.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Sales & Support, covering CRM management. It works with Salesforce. The repository describes itself as: The SOQL Lib provides functional constructs for SOQL queries in Apex. The licence is MIT.

When your agent uses it

  • Creating a new selector class
  • Adding filter methods to an existing selector
  • Asked how to encapsulate SOQL queries in a reusable class

Example prompts

  • “Use the soql-lib-selector skill to create Salesforce Apex selector classes using the SOQL Lib selector pattern”
  • “/soql-lib-selector”

What it can do on your machine

Read from SKILL.md and the folder at commit cc06784. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are apex).

    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

Soql Lib Selector loads about 2k tokens when it runs. Until then it costs about 115 tokens; SKILL.md has 138 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~115
When it runs · the whole SKILL.md, loaded when a task matches
~2k

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 beyond-the-cloud-dev/soql-lib at commit cc06784, republished under its MIT licence (© beyond-the-cloud-dev). 138 words, ~2,028 tokens.

Download SKILL.mdSave it as .claude/skills/soql-lib-selector/SKILL.md (or your agent's skills folder).
name
soql-lib-selector
description
Creates Salesforce Apex selector classes using the SOQL Lib selector pattern. Covers class declaration (extends SOQL, implements SOQL.Selector), constructor defaults, static query() factory, domain-specific filter methods, naming conventions (SOQL_<ObjectName>), and call-site patterns. Use when creating a new selector class, adding filter methods to an existing selector, or when asked how to encapsulate SOQL queries in a reusable class.

SOQL Lib — Selector Pattern

A selector is a dedicated Apex class that encapsulates all queries for one SObject. It extends SOQL, implements SOQL.Selector, and exposes domain-specific filter methods.

When to Use

  • Use this skill when creating a new selector class for any SObject
  • Use this skill when adding or refactoring filter methods on an existing selector
  • Use this skill when asked how to structure or call a SOQL Lib query class

Instructions

Class structure rules
RuleValue
Class nameSOQL_<ObjectApiName>
Sharing keywordinherited sharing
ExtendsSOQL
ImplementsSOQL.Selector
Constructor visibilityprivate
Mock ID constant@TestVisible private static final String MOCK_ID = 'SOQL_<ClassName>'
Filter method return typeThe selector class (e.g. SOQL_Account), not Queryable
Default security.systemMode().withoutSharing() in constructor
Constructor checklist
apex
private SOQL_Account() {
    super(Account.SObjectType);      // 1. required
    with(Account.Id, Account.Name);  // 2. default SELECT fields
    systemMode();                    // 3. ignore FLS in selector layer
    withoutSharing();                // 4. sharing enforced at service layer
    mockId(MOCK_ID);                 // 5. enable unit test mocking
}
Filter method patterns
apex
// Equality
public SOQL_Account byType(String type) {
    whereAre(Filter.with(Account.Type).equal(type));
    return this;
}

// Null-safe — filter skipped when value is null
public SOQL_Account byIndustry(String industry) {
    whereAre(Filter.with(Account.Industry).equal(industry).ignoreWhen(industry == null));
    return this;
}

// IN
public SOQL_Account byOwnerIds(Set<Id> ownerIds) {
    whereAre(Filter.with(Account.OwnerId).isIn(ownerIds));
    return this;
}

// Boolean
public SOQL_Account activeOnly() {
    whereAre(Filter.with(Account.IsActive__c).isTrue());
    return this;
}

// Date literal
public SOQL_Opportunity closingThisMonth() {
    whereAre(Filter.with(Opportunity.CloseDate).equal('THIS_MONTH').asDateLiteral());
    return this;
}

// Range
public SOQL_Opportunity aboveAmount(Decimal minAmount) {
    whereAre(Filter.with(Opportunity.Amount).greaterOrEqual(minAmount));
    return this;
}

### Calling the selector

Selector filter methods always should be called first, then SOQL Lib overrides.

```apex
// Basic
List<Account> accounts = SOQL_Account.query().toList();

// Chained filters
List<Account> accounts = SOQL_Account.query()
    .byType('Customer')
    .byIndustry('Technology')
    .with(Account.Phone)
    .toList();

// Add extra fields beyond constructor defaults
List<Account> accounts = SOQL_Account.query()
    .with(Account.BillingCity, Account.Phone)
    .toList();

// Override security ad-hoc (e.g. from a controller)
List<Account> accounts = SOQL_Account.query()
    .userMode()
    .toList();

// Top-level OR logic between selector filters
List<Account> accounts = SOQL_Account.query()
    .byIndustry('IT')
    .byRecordType('Partner')
    .anyConditionMatching()
    .toList();

// Map result
Map<Id, Account> accountMap = (Map<Id, Account>) SOQL_Account.query()
    .byIds(accountIds)
    .toMap();

// Single record (null-safe)
Account acc = (Account) SOQL_Account.query()
    .byId(accountId)
    .toObject();

// Extract single field value
String industry = (String) SOQL_Account.query()
    .byId(accountId)
    .toValueOf(Account.Industry);

// Extract IDs of a related field
Set<Id> ownerIds = SOQL_Account.query().toIdsOf(Account.OwnerId);

Examples

Minimal selector
apex
public inherited sharing class SOQL_Account extends SOQL implements SOQL.Selector {
    @TestVisible
    private static final String MOCK_ID = 'SOQL_Account';

    public static SOQL_Account query() {
        return new SOQL_Account();
    }

    private SOQL_Account() {
        super(Account.SObjectType);
        with(Account.Id, Account.Name);
        systemMode();
        withoutSharing();
        mockId(MOCK_ID);
    }

    public SOQL_Account byType(String type) {
        whereAre(Filter.with(Account.Type).equal(type));
        return this;
    }

    public SOQL_Account byOwnerId(Id ownerId) {
        whereAre(Filter.with(Account.OwnerId).equal(ownerId));
        return this;
    }
}
Complete selector
apex
public inherited sharing class SOQL_Opportunity extends SOQL implements SOQL.Selector {
    @TestVisible
    private static final String MOCK_ID = 'SOQL_Opportunity';

    public static SOQL_Opportunity query() {
        return new SOQL_Opportunity();
    }

    private SOQL_Opportunity() {
        super(Opportunity.SObjectType);
        with(Opportunity.Id, Opportunity.Name, Opportunity.StageName, Opportunity.CloseDate, Opportunity.Amount);
        systemMode();
        withoutSharing();
        mockId(MOCK_ID);
    }

    public SOQL_Opportunity byStageName(String stageName) {
        whereAre(Filter.with(Opportunity.StageName).equal(stageName));
        return this;
    }

    public SOQL_Opportunity byAccountId(Id accountId) {
        whereAre(Filter.with(Opportunity.AccountId).equal(accountId).ignoreWhen(accountId == null));
        return this;
    }

    public SOQL_Opportunity byAccountIds(Set<Id> accountIds) {
        whereAre(Filter.with(Opportunity.AccountId).isIn(accountIds));
        return this;
    }

    public SOQL_Opportunity closingThisMonth() {
        whereAre(Filter.with(Opportunity.CloseDate).equal('THIS_MONTH').asDateLiteral());
        return this;
    }

    public SOQL_Opportunity isOpen() {
        whereAre(Filter.with(Opportunity.IsClosed).isFalse());
        return this;
    }

    public SOQL_Opportunity aboveAmount(Decimal minAmount) {
        whereAre(Filter.with(Opportunity.Amount).greaterOrEqual(minAmount));
        return this;
    }
}
Selector with parent fields
apex
public inherited sharing class SOQL_Contact extends SOQL implements SOQL.Selector {
    @TestVisible
    private static final String MOCK_ID = 'SOQL_Contact';

    public static SOQL_Contact query() {
        return new SOQL_Contact();
    }

    private SOQL_Contact() {
        super(Contact.SObjectType);
        with(Contact.Id, Contact.FirstName, Contact.LastName, Contact.Email);
        with('Account', Account.Name, Account.Industry);
        systemMode();
        withoutSharing();
        mockId(MOCK_ID);
    }

    public SOQL_Contact byAccountId(Id accountId) {
        whereAre(Filter.with(Contact.AccountId).equal(accountId));
        return this;
    }

    public SOQL_Contact byRecordTypeName(String devName) {
        byRecordType(devName);
        return this;
    }
}
Usage in a controller (with sharing, userMode)
apex
public with sharing class ExampleController {
    @AuraEnabled
    public static List<Contact> getContactsByRecordType(String recordType) {
        return SOQL_Contact.query()
            .byRecordType(recordType)
            .with(Contact.Email, Contact.Title)
            .toList();
    }

    @AuraEnabled
    public static List<Account> getAccountsByRecordTypeOrIndustry(String recordType) {
        return SOQL_Account.query()
            .byIndustry('IT')
            .byRecordType(recordType)
            .anyConditionMatching()
            .with(Account.Industry, Account.AccountSource)
            .toList();
    }

    @AuraEnabled
    public static String getAccountIndustry(Id accountId) {
        return (String) SOQL_Account.query()
            .byId(accountId)
            .toValueOf(Account.Industry);
    }
}

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

Files

Just SKILL.md in .cursor/skills/soql-lib-selector of beyond-the-cloud-dev/soql-lib.

Open the folder on GitHubat commit cc06784

Compare with similar skills

Soql Lib Selector 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.

Soql Lib Selector compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Soql Lib Selector this skillbeyond-the-cloud-dev/soql-lib154—~2kAutomated safety check: PassMIT
Sf DatacloudJaganpro/sf-skills424—~2.7kAutomated safety check: PassMIT
Dev SetupPortwood-Global-Solutions/Portwood125—~1.1kAutomated safety check: PassApache-2.0
Sf FlowJaganpro/sf-skills424—~1.8kAutomated safety check: PassMIT
Automation Sandbox Post Copy Configureforcedotcom/sf-skills1.1k—~5.3kAutomated safety check: NotesApache-2.0
Automation Sandbox Post Copy Configureforcedotcom/sf-skills1.1k—~5.4kAutomated safety check: NotesApache-2.0

Similar skills

  • 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
    Sales & SupportAuto-check passed
  • Dev Setup

    Portwood-Global-Solutions/Portwood

    Get from a fresh clone of Portwood to a working, fully-tested Salesforce org.

    125 GitHub stars~1.1k tokensUpdated 2 days ago
    Sales & SupportAuto-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
    Sales & SupportAuto-check passed
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.3k tokensUpdated 4 days ago
    Sales & SupportAuto-check: notes
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.4k tokensUpdated 4 days ago
    Sales & SupportAuto-check: notes
  • Google Maps Export

    gmapsscraper/google-maps-agent-skills

    Export Google Maps business data to CSV, JSON, or CRM format (HubSpot, Pipedrive, Salesforce).

    131 GitHub stars~1.2k tokensUpdated 4 mo ago
    Sales & SupportAuto-check passed

More from beyond-the-cloud-dev/soql-lib

  • Soql Lib Query Builder

    beyond-the-cloud-dev/soql-lib

    Builds Salesforce SOQL queries using the SOQL Lib fluent builder API (SOQL.cls).

    154 GitHub stars~4.3k tokensUpdated 4 days ago
    Auto-check passed
  • Soql Lib Testing

    beyond-the-cloud-dev/soql-lib

    Writes unit tests for Salesforce Apex code that uses SOQL Lib (SOQL.cls).

    154 GitHub stars~2.1k tokensUpdated 4 days ago
    Auto-check passed

Works with

Categories

Questions about Soql Lib Selector

What does Soql Lib Selector do?

Creates Salesforce Apex selector classes using the SOQL Lib selector pattern. Soql Lib Selector is an agent skill from beyond-the-cloud-dev/soql-lib. Creates Salesforce Apex selector classes using the SOQL Lib selector pattern.

When should I use Soql Lib Selector?

Soql Lib Selector fits situations like: creating a new selector class; adding filter methods to an existing selector; asked how to encapsulate SOQL queries in a reusable class.

How do I install Soql Lib Selector in Claude Code?

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

How do I install Soql Lib Selector in Codex?

Run `npx skills add beyond-the-cloud-dev/soql-lib --skill soql-lib-selector -a codex`. Or copy the skill folder (.cursor/skills/soql-lib-selector in beyond-the-cloud-dev/soql-lib) into .agents/skills/soql-lib-selector in your project. Codex loads it when a task matches its description.

Can I use Soql Lib Selector 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 beyond-the-cloud-dev/soql-lib --skill soql-lib-selector -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/soql-lib-selector, .gemini/skills/soql-lib-selector, .github/skills/soql-lib-selector and .opencode/skills/soql-lib-selector in your project.

What does Soql Lib Selector need to run?

SKILL.md names no scripts, command-line tools or credentials: Soql Lib Selector is instructions for the agent only.

Does Soql Lib Selector 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 Soql Lib Selector 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 Soql Lib Selector use?

Soql Lib Selector is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Soql Lib Selector use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Soql Lib Selector?

Skills that share tags, products or a category with Soql Lib Selector: Sf Datacloud (Jaganpro/sf-skills, 424 stars), Dev Setup (Portwood-Global-Solutions/Portwood, 125 stars), Sf Flow (Jaganpro/sf-skills, 424 stars) and Automation Sandbox Post Copy Configure (forcedotcom/sf-skills, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Soql Lib Selector?

beyond-the-cloud-dev (a GitHub organization) maintains it in beyond-the-cloud-dev/soql-lib, which has 154 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 3, 2026.

Source: beyond-the-cloud-dev/soql-lib on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.