salesforce-developer — скилл для Claude Code: разработка на Apex и LWC
Пишет Apex-классы, собирает Lightning Web Components, оптимизирует SOQL-запросы и настраивает пакетную обработку на платформе Salesforce. Следит за governor limits и булкифицирует код.
npx skills add Jeffallan/claude-skills --skill salesforce-developer -a claude-codeЧто делает salesforce-developer
Скилл строит Apex-классы, триггеры, батч-джобы и события платформы по правилам Salesforce: выносит SOQL и DML за пределы циклов, собирает идентификаторы перед запросами, держит покрытие тестами выше 90%. Создаёт Lightning Web Components с wire-сервисом и обработкой событий, настраивает интеграции через REST/SOAP API и platform events.
Внутри — справочники по пяти темам: разработка на Apex (классы, триггеры, асинхронные паттерны), LWC-фреймворк, оптимизация SOQL/SOSL, паттерны интеграции и деплой через Salesforce DX. Тесты пишутся с проверкой сценариев на 200 записей, чтобы триггеры не превысили лимиты платформы. Для CI/CD нужен scratch org и метаданные в репозитории.
Какие задачи решает
- вынести SOQL и DML из циклов триггера
- написать батч-класс для обновления тысяч записей
- собрать LWC-компонент с
@wireи event-шиной - оптимизировать запрос по индексированным полям
- настроить Salesforce DX и CI/CD для команды
Примеры запросов агенту
- напиши булкифицированный триггер на `Account`, который обновляет поле `Description` по данным родительской записи
- создай батч-класс для обработки `Contact` без email, покрытие тестами 90% с проверкой на 200 записей
- собери LWC-компонент счётчика с кнопкой инкремента и `@track`
Как установить salesforce-developer
1Через Skills CLI (Vercel)
npx skills add Jeffallan/claude-skills --skill salesforce-developer -a claude-code2Вручную: положить файлы
~/.claude/skills/salesforce-developer/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/salesforce-developer/
1Через Skills CLI (Vercel)
npx skills add Jeffallan/claude-skills --skill salesforce-developer -a codex2Вручную: положить файлы
.agents/skills/salesforce-developer/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Jeffallan/claude-skills --skill salesforce-developer -a cursor2Вручную: положить файлы
.cursor/skills/salesforce-developer/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Jeffallan/claude-skills salesforce-developer2Вручную: положить файлы
.github/skills/salesforce-developer/SKILL.md1Через Skills CLI (Vercel)
npx skills add Jeffallan/claude-skills --skill salesforce-developer -a gemini-cli2Командой платформы
gemini skills install https://github.com/Jeffallan/claude-skills --path skills/salesforce-developerВручную: положить файлы
.devin/skills/salesforce-developer/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Jeffallan/claude-skills --skill salesforce-developer -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
Из того же набора61
Весь набор →Похожие
Вопросы о salesforce-developer
Как установить salesforce-developer в Claude Code?
Выполни npx skills add Jeffallan/claude-skills --skill salesforce-developer -a claude-code — скилл появится в ~/.claude/skills/salesforce-developer/SKILL.md.
Что делает salesforce-developer?
Пишет Apex-код с булкификацией (SOQL и DML вне циклов), собирает Lightning Web Components, оптимизирует запросы по индексированным полям и настраивает батч-обработку для больших объёмов данных на Salesforce. Следит за governor limits платформы.
Какое покрытие тестами требует скилл?
Минимум 90% для каждого класса. Тесты включают сценарии на 200 записей, чтобы проверить работу триггеров и батчей под нагрузкой без превышения лимитов Salesforce.
Исходный текст
SKILL.md · MIT
---
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
company: https://synergetic.solutions
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:
| Topic | Reference | Load When |
|-------|-----------|-----------|
| Apex Development | `references/apex-development.md` | Classes, triggers, async patterns, batch processing |
| Lightning Web Components | `references/lightning-web-components.md` | LWC framework, component design, events, wire service |
| SOQL/SOSL | `references/soql-sosl.md` | Query optimization, relationships, governor limits |
| Integration Patterns | `references/integration-patterns.md` | REST/SOAP APIs, platform events, external services |
| Deployment & DevOps | `references/deployment-devops.md` | Salesforce 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)
```apex
// 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;
}
}
}
}
```
```apex
// 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
```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 = '[email protected]';
}
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
```apex
@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
```apex
// 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)
```html
<!-- 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>
```
```javascript
// counterComponent.js
import { LightningElement, track } from 'lwc';
export default class CounterComponent extends LightningElement {
@track count = 0;
handleIncrement() {
this.count += 1;
}
}
```
```xml
<!-- 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>
```
Maintained by [@jeffallan](https://github.com/jeffallan), Principal Consultant at [Synergetic Solutions](https://synergetic.solutions)
[Documentation](https://jeffallan.github.io/claude-skills/skills/platform/salesforce-developer/)
© https://github.com/Jeffallan · MIT · Jeffallan/claude-skills