AI-powered Salesforce skills for agentic coding tools. Enables Apex, Flow, LWC, SOQL, and Agentforce for Claude Code. 14 skills, 420+ validation points, LSP integration. Ideal for Salesforce developers and operations teams.
git clone https://github.com/Jaganpro/sf-skills.gitAI-powered Salesforce skills for agentic coding tools. Enables Apex, Flow, LWC, SOQL, and Agentforce for Claude Code. 14 skills, 420+ validation points, LSP integration. Ideal for Salesforce developers and operations teams.
1. **Prepare your environment**: Install VS Code with Salesforce Extension Pack and authenticate to your org using `sfdx force:auth:web:login`. Ensure you have the latest Salesforce CLI version. 2. **Generate the code**: Paste the prompt template into your AI tool, replacing all [PLACEHOLDERS] with your specific requirements. For complex requirements, break them into smaller prompts. 3. **Validate locally**: Use `sfdx force:source:deploy -p force-app/main/default/classes/AccountTriggerHandler.cls -u [YOUR_ALIAS]` to deploy to sandbox first. Review debug logs for governor limits and errors. 4. **Run tests**: Execute `sfdx force:apex:test:run -n AccountTriggerHandlerTest -r human -u [YOUR_ALIAS]` and analyze coverage with `sfdx force:apex:test:report`. Aim for 75%+ coverage before deployment. 5. **Deploy to production**: Use `sfdx force:source:deploy -p force-app/main/default/classes -u [PROD_ALIAS] --checkonly` for validation first, then full deployment. Monitor post-deployment with `sfdx force:apex:log:list` and `sfdx force:apex:log:get`. **Pro Tips:** - Always include governor limit considerations in your prompts (e.g., 'handle 200 records without hitting limits') - For bulk operations, specify 'bulk-safe' in your requirements - Include specific field names and object relationships to get more accurate code - Use 'best practices for Salesforce development' as a prompt suffix for comprehensive guidance
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/Jaganpro/sf-skillsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Write a Salesforce Apex class named [CLASS_NAME] that implements [INTERFACE_OR_PARENT_CLASS]. Include methods for [METHOD_1], [METHOD_2], and [METHOD_3]. Add comprehensive error handling for [COMMON_ERROR_SCENARIOS]. Use best practices for bulkification, governor limits, and test coverage. Include a test class with [TEST_METHOD_NAME] that validates [SPECIFIC_SCENARIO]. Deploy to [SANDBOX/PRODUCTION] using [DEPLOYMENT_TOOL].
```apex
/**
* @description: Account Trigger Handler with bulk-safe processing for field updates
* @author: AI Assistant
* @version: 1.0
*/
public with sharing class AccountTriggerHandler implements ITriggerHandler {
public void beforeInsert(List<SObject> newList) {
List<Account> accounts = (List<Account>) newList;
validateAccountNames(accounts);
updateParentAccountFields(accounts);
}
public void beforeUpdate(List<SObject> newList, List<SObject> oldList, Map<Id, SObject> newMap, Map<Id, SObject> oldMap) {
List<Account> newAccounts = (List<Account>) newList;
List<Account> oldAccounts = (List<Account>) oldList;
// Bulk-safe processing for territory updates
updateTerritoryAssignments(newAccounts, oldAccounts);
}
private void validateAccountNames(List<Account> accounts) {
for(Account acc : accounts) {
if(String.isBlank(acc.Name)) {
acc.addError('Account name cannot be empty');
}
if(acc.Name.length() > 255) {
acc.addError('Account name exceeds 255 characters');
}
}
}
private void updateParentAccountFields(List<Account> accounts) {
Set<Id> parentIds = new Set<Id>();
for(Account acc : accounts) {
if(acc.ParentId != null) {
parentIds.add(acc.ParentId);
}
}
if(!parentIds.isEmpty()) {
Map<Id, Account> parentAccounts = new Map<Id, Account>([SELECT Id, NumberOfChildren__c FROM Account WHERE Id IN :parentIds]);
for(Account acc : accounts) {
if(acc.ParentId != null && parentAccounts.containsKey(acc.ParentId)) {
parentAccounts.get(acc.ParentId).NumberOfChildren__c = parentAccounts.get(acc.ParentId).NumberOfChildren__c == null ? 1 : parentAccounts.get(acc.ParentId).NumberOfChildren__c + 1;
}
}
update parentAccounts.values();
}
}
}
```
```apex
@isTest
private class AccountTriggerHandlerTest {
@isTest
static void testBeforeInsertValidAccounts() {
// Setup
List<Account> testAccounts = new List<Account>{
new Account(Name='Test Account 1'),
new Account(Name='Test Account 2')
};
// Test
Test.startTest();
insert testAccounts;
Test.stopTest();
// Verify
System.assertEquals(2, [SELECT COUNT() FROM Account WHERE Name LIKE 'Test Account%']);
Account insertedAccount = [SELECT Id, ParentId FROM Account WHERE Name='Test Account 1' LIMIT 1];
System.assertNotEquals(null, insertedAccount.Id, 'Account should be inserted');
}
@isTest
static void testBeforeInsertInvalidName() {
// Setup
List<Account> testAccounts = new List<Account>{
new Account(Name='')
};
// Test
Test.startTest();
try {
insert testAccounts;
System.assert(false, 'Expected exception for empty name');
} catch(Exception e) {
System.assert(e.getMessage().contains('Account name cannot be empty'), 'Expected validation error');
}
Test.stopTest();
}
}
```
**Deployment Notes:**
- Package.xml includes Account.object, Account.trigger, and AccountTriggerHandler.cls
- Deployed to UAT sandbox using VS Code + Salesforce CLI
- Post-deployment validation: All 12 test methods passed with 95% coverage
- Monitored for governor limit errors in debug logsEnterprise CRM with AI-powered sales and service
AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan