salesforce-dev
Skill2 starsChanged 3 months agoMITView on GitHub
Salesforce development guide. Covers Apex triggers, Lightning Web Components (LWC), SOQL, SOSL, platform events, and deployment via SFDX.
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 261
Use with sharing / without sharing / inherited sharing explicitly.
- Very specific: line 262
Use WITH SECURITY_ENFORCED in SOQL.
- Very specific: line 264
Use stripInaccessible for safe object mapping.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Salesforce Development
1. Apex
Trigger
trigger AccountTrigger on Account (before insert, before update, after insert, after update) {
if (Trigger.isBefore) {
if (Trigger.isInsert) {
AccountTriggerHandler.beforeInsert(Trigger.new);
} else if (Trigger.isUpdate) {
AccountTriggerHandler.beforeUpdate(Trigger.new, Trigger.oldMap);
}
} else if (Trigger.isAfter) {
if (Trigger.isInsert) {
AccountTriggerHandler.afterInsert(Trigger.new);
}
}
}Handler Class
public with sharing class AccountTriggerHandler {
public static void beforeInsert(List<Account> newAccounts) {
for (Account acc : newAccounts) {
if (String.isBlank(acc.Industry)) {
acc.Industry.addError('Industry is required');
}
}
}
public static void afterInsert(List<Account> newAccounts) {
List<Task> tasks = new List<Task>();
for (Account acc : newAccounts) {
tasks.add(new Task(
Subject = 'Follow up with new account',
WhatId = acc.Id,
Status = 'Not Started',
Priority = 'Normal'
));
}
insert tasks;
}
}SOQL
// Basic query
List<Account> accounts = [
SELECT Id, Name, Industry, (SELECT Name FROM Contacts)
FROM Account
WHERE Industry = 'Technology'
WITH SECURITY_ENFORCED
LIMIT 100
];
// Aggregate
AggregateResult[] results = [
SELECT Industry, COUNT(Id) cnt
FROM Account
GROUP BY Industry
HAVING COUNT(Id) > 5
];
// Dynamic SOQL
String query = 'SELECT Id, Name FROM Account WHERE Industry = :industry';
List<Account> accs = Database.query(query);2. Lightning Web Components (LWC)
Component Structure
myComponent/
myComponent.html
myComponent.js
myComponent.js-meta.xml
myComponent.cssJavaScript
// myComponent.js
import { LightningElement, wire, api, track } from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';
import getAccounts from '@salesforce/apex/AccountController.getAccounts';
const FIELDS = ['Account.Name', 'Account.Industry'];
export default class MyComponent extends LightningElement {
@api recordId;
@track accounts = [];
error;
@wire(getRecord, { recordId: '$recordId', fields: FIELDS })
wiredRecord({ error, data }) {
if (data) {
this.account = data;
} else if (error) {
this.error = error;
}
}
@wire(getAccounts)
wiredAccounts({ error, data }) {
if (data) {
this.accounts = data;
} else if (error) {
this.error = error;
}
}
handleSelect(event) {
const selectedId = event.target.dataset.id;
// Handle selection
}
}HTML Template
<!-- myComponent.html -->
<template>
<lightning-card title="Account List" icon-name="standard:account">
<template if:true={accounts}>
<lightning-datatable
key-field="id"
data={accounts}
columns={columns}
onrowselection={handleSelect}>
</lightning-datatable>
</template>
<template if:true={error}>
<div class="slds-text-color_error">{error.body.message}</div>
</template>
</lightning-card>
</template>Meta XML
<!-- myComponent.js-meta.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>60.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__RecordPage</target>
<target>lightning__AppPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>3. SFDX (Salesforce DX)
Project Setup
sfdx force:project:create -n my-project
cd my-project
sfdx auth:web:login -a devhub
sfdx force:org:create -f config/project-scratch-def.json -a scratch -s -d 7Deploy
# Deploy source
sfdx force:source:deploy -p force-app/main/default
# Retrieve changes
sfdx force:source:retrieve -p force-app/main/default
# Run tests
sfdx force:apex:test:run -n AccountTriggerTest -r humanPackage Development
# Create unlocked package
sfdx force:package:create -n "My Package" -r force-app -t Unlocked -v devhub
# Create package version
sfdx force:package:version:create -p "My Package" -x -c
# Install in org
sfdx force:package:install -p "My Package@1.0.0-1" -u target-org4. Platform Events
// Publish event
EventBus.publish(new Customer_Event__e(
Account_Id__c = acc.Id,
Event_Type__c = 'CREATED'
));
// Subscribe via trigger
trigger CustomerEventTrigger on Customer_Event__e (after insert) {
for (Customer_Event__e event : Trigger.new) {
// Process event
}
}5. Testing
@isTest
private class AccountTriggerTest {
@isTest
static void testBeforeInsert() {
Account acc = new Account(Name = 'Test', Industry = '');
Test.startTest();
Database.SaveResult result = Database.insert(acc, false);
Test.stopTest();
System.assert(!result.isSuccess(), 'Should fail without Industry');
}
@isTest
static void testAfterInsert() {
Account acc = new Account(Name = 'Test', Industry = 'Technology');
Test.startTest();
insert acc;
Test.stopTest();
List<Task> tasks = [SELECT Id FROM Task WHERE WhatId = :acc.Id];
System.assertEquals(1, tasks.size(), 'Task should be created');
}
}6. Security
- Use
with sharing/without sharing/inherited sharingexplicitly. - Use
WITH SECURITY_ENFORCEDin SOQL. - Validate CRUD/FLS before DML operations.
- Use
stripInaccessiblefor safe object mapping.
SObjectAccessDecision decision = Security.stripInaccessible(
AccessType.CREATABLE,
new List<Account>{ acc }
);
insert decision.getRecords();Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- snathpatil/sf-claude-skill★ 5same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- allure-reportsSkill
- android-nativeSkill
- appian-lowcodeSkill
- appium-mobileSkill
- behave-bddSkill
- BiDiWave Cross-BrowserSkill
- BiDiWave Network InterceptionSkill
- CDPWave DebuggingSkill
- CDPWave TestingSkill
- db2-oracleSkill
- ebook-writerSkill
- flask-apiSkill
- flet-desktopSkill
- google-crawling-indexingSkill
- google-ranking-appearanceSkill
- google-seo-fundamentalsSkill
- google-seo-monitoringSkill
- jinja2-templatesSkill
- jmeter-load-testingSkill
- k6-load-testingSkill
- karate-api-testingSkill
- octane-almSkill
- paramiko-sshSkill
- postman-api-automationSkill
- prestashop-moduleSkill
- prompt-engineering-best-practicesSkill
- pytest-advancedSkill
- robot-frameworkSkill
- sonarqube-quality-gatesSkill
- sql-serverSkill
- Skill NameSkill
- testcontainersSkill
- wave-ecosystem-guideSkill
- WaveXis AccessibilitySkill
- WaveXis CI/CD IntegrationSkill
- wavexis-cli-automationSkill
- wavexis-mcp-agent-integrationSkill
- WaveXis Network TestingSkill
- WaveXis Performance AuditSkill
- WaveXis Session RecordingSkill
- WaveXis Web ScrapingSkill
- webdriverioSkill
- wordpress-themesSkill
- xctest-iosSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

