PluginBench
Skill
Fail
Audit score 45

salesforce-developer

jeffallan/claude-skills

Write and debug Apex, Lightning Web Components, and SOQL queries on Salesforce with governor limit awareness and best practices.

What is salesforce-developer?

Expert-level Salesforce development skill for building applications, customizing CRM workflows, and managing the Salesforce platform. Use when writing Apex code, creating Lightning Web Components, optimizing queries, implementing triggers and batch jobs, or setting up Salesforce DX and CI/CD pipelines.

  • Writes and debugs Apex classes, triggers, and async patterns (batch, queueable, future)
  • Builds Lightning Web Components with proper event handling and wire service integration
  • Optimizes SOQL/SOSL queries with indexed fields and relationship queries to stay within governor limits
  • Implements bulkified triggers, batch jobs, and platform events for bulk processing
  • Designs and validates integrations using REST/SOAP APIs and external services
  • Sets up Salesforce DX, scratch orgs, and CI/CD metadata deployment pipelines

How to install salesforce-developer

npx skills add https://github.com/jeffallan/claude-skills --skill salesforce-developer
Prerequisites
  • Salesforce org (sandbox or production) with appropriate permissions
  • Salesforce DX CLI installed for local development and scratch orgs
  • Basic understanding of Apex, SOQL, and Salesforce data model
Claude Code
Cursor
Windsurf
Cline

How to use salesforce-developer

  1. 1.Analyze business requirements and data model, considering governor limits and scalability
  2. 2.Design solution architecture choosing between declarative and programmatic approaches
  3. 3.Implement Apex classes, triggers, or LWC components following bulkification and best practices
  4. 4.Validate governor limits (SOQL/DML counts, heap size, CPU time) before proceeding
  5. 5.Write test classes with 90%+ code coverage including bulk scenarios (200-record batches)
  6. 6.Deploy using Salesforce DX, scratch orgs, and CI/CD pipelines

Use cases

Good for
  • Developing custom Salesforce applications with Apex and LWC components
  • Optimizing slow or governor-limit-violating queries and triggers
  • Building batch jobs to process large record volumes (200+ records)
  • Implementing real-time integrations via platform events or REST APIs
  • Setting up source-driven development with Salesforce DX and automated deployments
Who it's for
  • Salesforce developers and architects
  • CRM customization specialists
  • Platform engineers managing Salesforce deployments
  • Teams building Sales Cloud or Service Cloud extensions

salesforce-developer FAQ

How do I avoid governor limit violations?

Bulkify Apex code by collecting IDs/records before loops and executing SOQL/DML outside loops. Use selective SOQL queries with indexed fields, leverage relationship queries to reduce round-trips, and use appropriate async processing (batch, queueable) for long-running work. Always validate limits before deployment.

What is the minimum test coverage required?

Salesforce requires 75% code coverage org-wide, but this skill enforces 90%+ coverage per class. Test classes must include bulk scenarios (200-record batches) to validate bulkification and governor limit handling.

When should I use batch jobs vs queueable vs future methods?

Use future methods for simple async operations with few parameters. Use queueable for chaining async jobs and more complex logic. Use batch jobs for processing large record volumes (1000+) with built-in chunking and error handling.

How do I optimize slow SOQL queries?

Use indexed fields (Id, Name, custom indexes) in WHERE clauses, avoid SOSL when SOQL suffices, use relationship queries to fetch related records in one query, add LIMIT clauses, and avoid querying all fields—select only needed fields.

What is Salesforce DX and why should I use it?

Salesforce DX enables source-driven development, version control integration, scratch org automation, and CI/CD pipelines. It replaces change sets with metadata API-based deployments, improving team collaboration and deployment reliability.

Full instructions (SKILL.md)

Source of truth, from jeffallan/claude-skills.


name: salesforce-developer description: Writes and debugs Apex code, builds Lightning Web Components, optimizes SOQL queries, implements triggers, batch jobs, platform events, and integrations on the Salesforce platform. Use when developing Salesforce applications, customizing CRM workflows, managing governor limits, bulk processing, or setting up Salesforce DX and CI/CD pipelines. license: MIT metadata: author: https://github.com/Jeffallan version: "1.1.0" domain: platform triggers: Salesforce, Apex, Lightning Web Components, LWC, SOQL, SOSL, Visualforce, Salesforce DX, governor limits, triggers, platform events, CRM integration, Sales Cloud, Service Cloud role: expert scope: implementation output-format: code related-skills: api-designer, java-architect, cloud-architect, devops-engineer

Salesforce Developer

Core Workflow

  1. Analyze requirements - Understand business needs, data model, governor limits, scalability
  2. Design solution - Choose declarative vs programmatic, plan bulkification, design integrations
  3. Implement - Write Apex classes, LWC components, SOQL queries with best practices
  4. Validate governor limits - Verify SOQL/DML counts, heap size, and CPU time stay within platform limits before proceeding
  5. Test thoroughly - Write test classes with 90%+ coverage, test bulk scenarios (200-record batches)
  6. Deploy - Use Salesforce DX, scratch orgs, CI/CD for metadata deployment

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Apex Developmentreferences/apex-development.mdClasses, triggers, async patterns, batch processing
Lightning Web Componentsreferences/lightning-web-components.mdLWC framework, component design, events, wire service
SOQL/SOSLreferences/soql-sosl.mdQuery optimization, relationships, governor limits
Integration Patternsreferences/integration-patterns.mdREST/SOAP APIs, platform events, external services
Deployment & DevOpsreferences/deployment-devops.mdSalesforce DX, CI/CD, scratch orgs, metadata API

Constraints

MUST DO

  • Bulkify Apex code — collect IDs/records before loops, query/DML outside loops
  • Write test classes with minimum 90% code coverage, including bulk scenarios
  • Use selective SOQL queries with indexed fields; leverage relationship queries
  • Use appropriate async processing (batch, queueable, future) for long-running work
  • Implement proper error handling and logging; use Database.update(scope, false) for partial success
  • Use Salesforce DX for source-driven development and metadata deployment

MUST NOT DO

  • Execute SOQL/DML inside loops (governor limit violation — see bulkified trigger pattern below)
  • Hard-code IDs or credentials in code
  • Create recursive triggers without safeguards
  • Skip field-level security and sharing rules checks
  • Use deprecated Salesforce APIs or components

Code Patterns

Bulkified Trigger (Correct Pattern)

// CORRECT: collect IDs, query once outside the loop
trigger AccountTrigger on Account (before insert, before update) {
    AccountTriggerHandler.handleBeforeInsert(Trigger.new);
}

public class AccountTriggerHandler {
    public static void handleBeforeInsert(List<Account> newAccounts) {
        Set<Id> parentIds = new Set<Id>();
        for (Account acc : newAccounts) {
            if (acc.ParentId != null) parentIds.add(acc.ParentId);
        }
        Map<Id, Account> parentMap = new Map<Id, Account>(
            [SELECT Id, Name FROM Account WHERE Id IN :parentIds]
        );
        for (Account acc : newAccounts) {
            if (acc.ParentId != null && parentMap.containsKey(acc.ParentId)) {
                acc.Description = 'Child of: ' + parentMap.get(acc.ParentId).Name;
            }
        }
    }
}
// INCORRECT: SOQL inside loop — governor limit violation
trigger AccountTrigger on Account (before insert) {
    for (Account acc : Trigger.new) {
        Account parent = [SELECT Id, Name FROM Account WHERE Id = :acc.ParentId]; // BAD
        acc.Description = 'Child of: ' + parent.Name;
    }
}

Batch Apex

public class ContactBatchUpdate implements Database.Batchable<SObject> {
    public Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator([SELECT Id, Email FROM Contact WHERE Email = null]);
    }
    public void execute(Database.BatchableContext bc, List<Contact> scope) {
        for (Contact c : scope) {
            c.Email = 'unknown@example.com';
        }
        Database.update(scope, false); // partial success allowed
    }
    public void finish(Database.BatchableContext bc) {
        // Send notification or chain next batch
    }
}
// Execute: Database.executeBatch(new ContactBatchUpdate(), 200);

Test Class

@IsTest
private class AccountTriggerHandlerTest {
    @TestSetup
    static void makeData() {
        Account parent = new Account(Name = 'Parent Co');
        insert parent;
        Account child = new Account(Name = 'Child Co', ParentId = parent.Id);
        insert child;
    }

    @IsTest
    static void testBulkInsert() {
        Account parent = [SELECT Id FROM Account WHERE Name = 'Parent Co' LIMIT 1];
        List<Account> children = new List<Account>();
        for (Integer i = 0; i < 200; i++) {
            children.add(new Account(Name = 'Child ' + i, ParentId = parent.Id));
        }
        Test.startTest();
        insert children;
        Test.stopTest();

        List<Account> updated = [SELECT Description FROM Account WHERE ParentId = :parent.Id];
        System.assert(!updated.isEmpty(), 'Children should have descriptions set');
        System.assert(updated[0].Description.startsWith('Child of:'), 'Description format mismatch');
    }
}

SOQL Best Practices

// Selective query — use indexed fields in WHERE clause
List<Opportunity> opps = [
    SELECT Id, Name, Amount, StageName
    FROM Opportunity
    WHERE AccountId IN :accountIds      // indexed field
      AND CloseDate >= :Date.today()    // indexed field
    ORDER BY CloseDate ASC
    LIMIT 200
];

// Relationship query to avoid extra round-trips
List<Account> accounts = [
    SELECT Id, Name,
           (SELECT Id, LastName, Email FROM Contacts WHERE Email != null)
    FROM Account
    WHERE Id IN :accountIds
];

Lightning Web Component (Counter Example)

<!-- counterComponent.html -->
<template>
    <lightning-card title="Counter">
        <div class="slds-p-around_medium">
            <p>Count: {count}</p>
            <lightning-button label="Increment" onclick={handleIncrement}></lightning-button>
        </div>
    </lightning-card>
</template>
// counterComponent.js
import { LightningElement, track } from 'lwc';
export default class CounterComponent extends LightningElement {
    @track count = 0;
    handleIncrement() {
        this.count += 1;
    }
}
<!-- counterComponent.js-meta.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>59.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
    </targets>
</LightningComponentBundle>

Documentation