PranavNagrecha/AwesomeSalesforceSkills / .claude/skills/salesforce-apex
salesforce-apex
VerifiedRouter for the 159 SfSkills `apex` skill packages. Apex and SOQL: triggers, Apex governor limits, async processing, OUTBOUND HTTP callouts, security enforcement, and test patterns. Owns calling an external API FROM Salesforce; salesforce-integration owns inbound. Generic nightly scheduling without naming code belongs to salesforce-flow. Codebase security review belongs to salesforce-security. NOT for SOSL — use salesforce-data. Use when the request mentions Apex, trigger, SOQL, Apex governor limit, batch, queueable, @future, schedulable, test class, CPU time, heap, with sharing, StripInaccessible, callout, HTTP callout, HttpRequest, call an external API, consume a REST API from Apex, Named Credential in Apex, HttpCalloutMock, Apex REST service. Finds and opens the exact skill package to read; it does not contain the guidance itself.
Salesforce apex — SfSkills domain router
Apex and SOQL: triggers, Apex governor limits, async processing, OUTBOUND HTTP callouts, security enforcement, and test patterns. Owns calling an external API FROM Salesforce; salesforce-integration owns inbound. Generic nightly scheduling without naming code belongs to salesforce-flow. Codebase security review belongs to salesforce-security. NOT for SOSL — use salesforce-data.
159 skill packages live under
${CLAUDE_PLUGIN_ROOT}/skills/apex/<slug>/SKILL.md. They are not
loaded — reach them by path, on demand.
Generated by scripts/build_plugin.py. Do not hand-edit.
How to find the right skill
Three mechanisms, listed in order of reliability on a fresh install. Use the first one that is available; do not stop at a guess.
1. The shipped roster (always works, no setup).
Read references/skill-index.md next to this file. It lists every
apex skill package with a one-line gloss, generated from
registry/skills.json. Scan it and pick by name.
2. The MCP server (fast, needs the sfskills-mcp server connected).
Call the search_skill tool with the user's phrasing and domain: "apex". It returns
ranked skill ids. get_skill then returns the package contents.
3. The search CLI (fast, needs a locally built index).
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/search_knowledge.py" "<the user's question>" --domain apex --json
This needs vector_index/, which is not shipped — it is gitignored
and must be built once per clone:
cd "${CLAUDE_PLUGIN_ROOT}" && python3 -m pip install -r requirements.txt && python3 scripts/build_index.py
If the command errors or reports Coverage: NONE, fall back to
mechanism 1 rather than telling the user the topic is uncovered.
Then read the package. Open the exact
${CLAUDE_PLUGIN_ROOT}/skills/<domain>/<slug>/SKILL.md the lookup
returned, plus its references/gotchas.md and
references/llm-anti-patterns.md. Do not answer from this router:
it is a map, not the territory.
Featured entry points
Curated starting points when the request is broad or the lookup is
ambiguous. This is a shortlist, not the catalogue — the roster at
references/skill-index.md has all 159.
${CLAUDE_PLUGIN_ROOT}/skills/apex/trigger-framework/SKILL.md— one trigger per object, handler dispatch, and recursion control${CLAUDE_PLUGIN_ROOT}/skills/apex/governor-limits/SKILL.md— the limit table and which ones actually bite in practice${CLAUDE_PLUGIN_ROOT}/skills/apex/soql-fundamentals/SKILL.md— selectivity, relationship queries, and queries inside loops${CLAUDE_PLUGIN_ROOT}/skills/apex/apex-security-patterns/SKILL.md— CRUD/FLS enforcement, sharing keywords, and injection-safe dynamic SOQL${CLAUDE_PLUGIN_ROOT}/skills/apex/batch-apex-patterns/SKILL.md— Batchable structure, chaining, scope sizing and failure recovery${CLAUDE_PLUGIN_ROOT}/skills/apex/apex-queueable-patterns/SKILL.md— the default async choice, with chaining depth and callout rules${CLAUDE_PLUGIN_ROOT}/skills/apex/test-data-factory-patterns/SKILL.md— a reusable factory so bulk tests are not copy-pasted record builders${CLAUDE_PLUGIN_ROOT}/skills/apex/test-class-standards/SKILL.md— assertions, bulk cases, negative paths, and what coverage does not prove
Decision trees
Read the tree before activating a skill when the request could be solved more than one way, and cite the branch that decided it.
${CLAUDE_PLUGIN_ROOT}/standards/decision-trees/automation-selection.md— read before writing Apex that a Flow could do${CLAUDE_PLUGIN_ROOT}/standards/decision-trees/async-selection.md— @future vs Queueable vs Batch vs Schedulable vs Platform Events${CLAUDE_PLUGIN_ROOT}/standards/decision-trees/performance-tuning.md— read on any CPU, heap, SOQL or limit symptom
Canonical templates
Do not hand-roll an idiom that already exists. Copy from
${CLAUDE_PLUGIN_ROOT}/templates/apex/ and rename in the consuming
project; never edit the template in place.
${CLAUDE_PLUGIN_ROOT}/templates/apex/TriggerHandler.cls${CLAUDE_PLUGIN_ROOT}/templates/apex/SecurityUtils.cls${CLAUDE_PLUGIN_ROOT}/templates/apex/tests/TestDataFactory.cls${CLAUDE_PLUGIN_ROOT}/templates/apex/README.md— the full list
Run-time agents for this domain
Invoke one of these subagents when the ask is a whole workflow rather than a single question:
apex-builder— Generate an Apex scaffold for any canonical surfaceapex-refactorer— Refactor an Apex class to canonical patternsapex-test-failure-triager— Diagnose an existing Apex test run failureautomation-transaction-profiler— Automation Transaction Profilersecurity-scanner— Security audit for Apex, callouts, and sharingsoql-optimizer— Find and fix SOQL anti-patternstest-class-generator— Generate a bulk-safe Apex test classtrigger-consolidator— Consolidate N triggers on an sObject into one handler
Rules
- Answer from the opened
apexpackage, never from this router. - Cite the skill id and, where one applied, the decision-tree branch.
- Never claim a topic is uncovered without pasting lookup output.
- Never deploy to an org.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |