home / skills / davila7 / claude-code-templates / salesforce-development
/cli-tool/components/skills/development/salesforce-development
This skill helps you develop Salesforce apps by applying bulkified Apex, LWC wiring, and async patterns with best practices.
npx playbooks add skill davila7/claude-code-templates --skill salesforce-developmentReview the files below or copy the command above to add this skill to your agents.
---
name: salesforce-development
description: "Expert patterns for Salesforce platform development including Lightning Web Components (LWC), Apex triggers and classes, REST/Bulk APIs, Connected Apps, and Salesforce DX with scratch orgs and 2nd generation packages (2GP). Use when: salesforce, sfdc, apex, lwc, lightning web components."
source: vibeship-spawner-skills (Apache 2.0)
---
# Salesforce Development
## Patterns
### Lightning Web Component with Wire Service
Use @wire decorator for reactive data binding with Lightning Data Service
or Apex methods. @wire fits LWC's reactive architecture and enables
Salesforce performance optimizations.
### Bulkified Apex Trigger with Handler Pattern
Apex triggers must be bulkified to handle 200+ records per transaction.
Use handler pattern for separation of concerns, testability, and
recursion prevention.
### Queueable Apex for Async Processing
Use Queueable Apex for async processing with support for non-primitive
types, monitoring via AsyncApexJob, and job chaining. Limit: 50 jobs
per transaction, 1 child job when chaining.
## Anti-Patterns
### ❌ SOQL Inside Loops
### ❌ DML Inside Loops
### ❌ Hardcoding IDs
## ⚠️ Sharp Edges
| Issue | Severity | Solution |
|-------|----------|----------|
| Issue | critical | See docs |
| Issue | high | See docs |
| Issue | medium | See docs |
| Issue | high | See docs |
| Issue | critical | See docs |
| Issue | high | See docs |
| Issue | high | See docs |
| Issue | critical | See docs |
This skill provides expert patterns and practical guidance for Salesforce platform development, covering Lightning Web Components (LWC), Apex triggers and classes, REST/Bulk APIs, Connected Apps, and Salesforce DX with scratch orgs and 2nd generation packages (2GP). It focuses on reliable, scalable patterns and common anti-patterns to avoid. Use it to standardize implementations, improve testability, and reduce runtime errors in production orgs.
The skill codifies proven patterns: reactive LWC wiring, bulkified Apex triggers with a handler layer, and Queueable Apex for asynchronous processing. It also highlights anti-patterns—SOQL/DML inside loops and hardcoded IDs—and provides pragmatic mitigations. Guidance includes DX workflows with scratch orgs and 2GP packaging for repeatable development and CI/CD.
How do I prevent trigger recursion?
Use a static boolean or a trigger framework that tracks processed record IDs in the transaction and short-circuits repeated execution.
When should I use Queueable vs Batch Apex?
Use Queueable for shorter, non-batch async work that needs complex types or chaining. Use Batch Apex for very large datasets that must be processed in batches with governor limits in mind.
How do I avoid hardcoded IDs across environments?
Store environment-specific values in Custom Metadata, Custom Settings, or Named Credentials, and reference them in code and configuration rather than embedding IDs.