本文へスキップ
Skillpedia
APIとサーバー(バックエンド)12k · #11453

salesforce-developer

できること

Salesforceのアプリケーションを作り、デバッグするようエージェントを導きます。SalesforceのCRMのワークフローや連携をカスタマイズする開発者向けです。

使う場面

  • ✓Apexのクラス、トリガー、バッチジョブを書いているとき。
  • ✓Salesforceのページ用のLightning Web Componentを作る必要があるとき。
  • ✓SOQLのクエリがガバナーの制限に達し、または遅いとき。

スキルのリンク

https://github.com/Jeffallan/claude-skills/blob/main/skills/salesforce-developer/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/Jeffallan/claude-skills/blob/main/skills/salesforce-developer/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“取引先が変わったときに、関連する取引先責任者を一括で更新するApexのトリガーを、テストクラス付きで書いてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、解決策を設計し、Apexのコードを一括処理に対応させ、クラスとクエリを書きます。ガバナーの制限を確認し、200件のバッチを含むテストを、90パーセント以上のカバレッジで書きます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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)

// 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];
     
よくある質問

ガバナーの制限とは何ですか?

Salesforceのコードが超えてはいけない、クエリ、データベースの変更、ヒープサイズ、CPU時間に対するプラットフォームの上限です。

どのテストカバレッジを目指しますか?

90パーセント以上を目指し、200件のレコードのバッチを含む一括のシナリオをテストします。

デプロイにも対応していますか?

はい。Salesforce DX、スクラッチ組織、CI/CDのパイプラインを扱います。

詳細

作者による元の説明

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.

repo: Jeffallan/claude-skills

人気

GitHubのスター
12k
ランキング
#11453
ライセンス
MIT
更新日
2026/10/30

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル