
Salesforce Apex Quality
This enforces the Apex quality gates that keep code out of deployment hell: no SOQL or DML in loops, explicit sharing declarations on every class, CRUD/FLS checks before queries, SOQL injection prevention, and the PNB test pattern (Positive, Negative, Bulk with 200+ records). It's built for code review moments when you need to catch governor limit traps and security gaps before they hit production. The idiom upgrades are nice (safe navigation, nullish coalescing, modern Assert syntax), but the real value is having the bulk-safety and sharing model rules applied consistently. If you're writing trigger handlers, batch jobs, or reviewing PRs on a Salesforce team, this catches the expensive mistakes that only surface under load.
- skills.sh installs
- 885
- GitHub stars
- 41K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add github/awesome-copilot --skill salesforce-apex-quality --agent claude-codeInstalls into .claude/skills of the current project.
Files
Salesforce Apex Quality Guardrails
Apply these checks to every Apex class, trigger, and test file you write or review.
Step 1 — Governor Limit Safety Check
Scan for these patterns before declaring any Apex file acceptable:
SOQL and DML in Loops — Automatic Fail
// ❌ NEVER — causes LimitException at scale
for (Account a : accounts) {
List<Contact> contacts = [SELECT Id FROM Contact WHERE AccountId = :a.Id]; // SOQL in loop
update a; // DML in loop
}
// ✅ ALWAYS — collect, then query/update once
Set<Id> accountIds = new Map<Id, Account>(accounts).keySet();
Map<Id, List<Contact>> contactsByAccount = new Map<Id, List<Contact>>();
for (Contact c : [SELECT Id, AccountId FROM Contact WHERE AccountId IN :accountIds]) {
if (!contactsByAccount.containsKey(c.AccountId)) {
contactsByAccount.put(c.AccountId, new List<Contact>());
}
contactsByAccount.get(c.AccountId).add(c);
}
update accounts; // DML once, outside the loop
Rule: if you see [SELECT or Database.query, insert, update, delete, upsert, merge inside a for loop body — stop and refactor before proceeding.
Step 2 — Sharing Model Verification
Sponsors
Details
- Repository
- github.com/github/awesome-copilot
- Categories
- Testing & QA, Security, Git & Pull Requests, Code Review & Quality, AI & Agent Building, Automation & Workflows, Sales & Marketing
- First seen
- May 16, 2026
More from github/awesome-copilot
All 318- React Audit Grep Patterns884
- Salesforce Flow Design839
- Github Release790
- Flowstudio Power Automate Monitoring787
- Flowstudio Power Automate Governance779
- Salesforce Component Standards770
- React18 Dep Compatibility766
- React18 Batching Patterns756
- React18 Legacy Context747
- From The Other Side Vega746
- React18 Lifecycle Patterns745
- React18 String Refs743
- React18 Enzyme To Rtl742
- Code Tour739
- Linkedin Post Formatter361
- Ui Screenshots212
- Data Breach Blast Radius110
- Sql Server Table Reconciliation104
- Aws Cloudwatch Investigation
- Aws Cost Optimize
- Aws Resource Health Diagnose
- Aws Well Architected Review
- Azure Well Architected Review
- Bug Reproduction Brief