github avatar

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-code

Installs 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
1jwynia avatarelectron-best-practicesjwynia/agent-skillsGuide AI agents through Electron app development with React including security patterns, type-safe IPC, React integration, packaging with code signing, and test863skills.sh installs
2manutej avatarpytest-patternsmanutej/luxor-claude-marketplacePython testing with pytest covering fixtures, parametrization, mocking, and test organization for reliable test suites858skills.sh installs
3hamelsmu avatarevaluate-raghamelsmu/evals-skillsGuides evaluation of RAG pipeline retrieval and generation quality. Use when evaluating a retrieval-augmented generation system, measuring retrieval quality, as850skills.sh installs
4dimillian avatarreview-swarmdimillian/skillsParallel read-only multi-agent review of a current git diff or explicit file scope to find behavioral regressions, security or privacy risks, performance or rel789skills.sh installs
5github avatarsalesforce-component-standardsgithub/awesome-copilotQuality standards for Salesforce Lightning Web Components (LWC), Aura components, and Visualforce pages. Covers SLDS 2 compliance, accessibility (WCAG 2.1 AA), 770skills.sh installs
6davila7 avatarbrowser-automationdavila7/claude-code-templatesBrowser automation powers web testing, scraping, and AI agent interactions. The difference between a flaky script and a reliable system comes down to understand753skills.sh installs