No slash command · from salesforce-claude-code
Enforces Apex governor limits, naming conventions, bulkification rules, and security requirements when writing or reviewing any Apex class, trigger, or batch job.
Ships in salesforce-claude-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill auto-activates when writing, reviewing, or modifying any Apex class, trigger, or batch job. It enforces governor limits, naming conventions, bulkification rules, and security requirements for all Apex artifacts.
Hard rules that every Apex class, trigger, and batch job must satisfy. Violations here cause governor failures, security review rejections, or production incidents. Reference files contain the full data; this skill contains only the enforcement rules.
@../_reference/GOVERNOR_LIMITS.md @../_reference/NAMING_CONVENTIONS.md @../_reference/SECURITY_PATTERNS.md @../_reference/DEPRECATIONS.md
Exception — masks programming bugs (NullPointerException, TypeException); catch specific types onlywithout sharing; always declare with sharing, without sharing, or inherited sharing explicitlywithout sharing on user-facing classes — bypasses record-level security; must be with sharingglobal access modifier — locks managed package API surface; use public unless building a package APISystem.debug in production code — fills debug logs, can expose sensitive dataDatabase.queryWithBinds()Database.SaveResult — partial-success DML silently drops failures; always inspect every resultelement.innerHTML = userInput — XSS vulnerability; use textContent or sanitized componentsList<sObject> as a parameter type — loses type information; use concrete types like List<Account>strName, lstAccounts) — use descriptive camelCase names insteadwith sharing by default — only use without sharing with a documented justificationWITH USER_MODE for SOQL, AccessLevel.USER_MODE for DML on user-facing operations{Object}TriggerHandler)Service, Selector, TriggerHandler, Batch, Job, Scheduler, Controller, Test, ExceptionTest (not prefix) — AccountServiceTest, not TestAccountServicetest{Method}_{scenario}_{expectedResult}Exception throwsLimits.getQueries(), Limits.getCpuTime(), etc.String.join() for string building — not concatenation in loops (heap + CPU cost)?. (null-safe navigation) for parent relationship fields| Anti-Pattern | Problem | Correct Pattern |
|---|---|---|
| SOQL in loop | Exceeds per-transaction SOQL limit (see @../_reference/GOVERNOR_LIMITS.md) | Query once, store in Map |
| DML in loop | Exceeds per-transaction DML limit (see @../_reference/GOVERNOR_LIMITS.md) | Collect records, single DML after loop |
| Nested loops for matching | CPU time exhaustion (O(n^2)) | Map/Set lookup (O(1)) |
| String concat in loop | Heap growth + CPU waste | List<String> + String.join() |
| SELECT * (all fields) | Heap exhaustion | SELECT only required fields |
| No sharing keyword | Silent without sharing default | Explicit with sharing declaration |
| Missing CRUD/FLS check | Security review failure | WITH USER_MODE / AccessLevel.USER_MODE |
| Dynamic SOQL via concat | SOQL injection | Bind variables / queryWithBinds() |
Catching Exception | Masks real bugs | Catch specific exception types |
| Ignoring SaveResult | Silent data loss | Inspect every Database.SaveResult |
| Hardcoded IDs | Breaks across orgs | SOQL / Custom Metadata lookup |
sf-apex-best-practices — implementation examples for the rules above (class organization, error handling, collection patterns)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jiten-singh-shahi/salesforce-claude-code --plugin salesforce-claude-code58 skills in this plugin
/asideUse when you need a quick Salesforce answer mid-task. Answer a side question about Apex, org config, or metadata without losing context, then resume work automatically./checkpointUse when saving Salesforce development progress. Create a named checkpoint via git stash before risky Apex deploys or org changes for easy recovery./configure-sccUse when setting up SCC for Salesforce Apex and LWC development. Interactive wizard to install profiles, modules, and customize the harness for your org.Other plugins' skills for the same job