Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

salesforce-developerSalesforce 开发者

Agent Skill

salesforce-developer 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

441

周安装

18

GitHub Stars

24

下载量

141
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:salesforce-developer(Salesforce 开发者)
来源仓库:https://github.com/salesforcediariesbysanket/copilot-skills-salesforce
仓库路径:skills/salesforce-developer
安装命令:
npx skills add https://github.com/salesforcediariesbysanket/copilot-skills-salesforce --skill salesforce-developer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/salesforcediariesbysanket/copilot-skills-salesforce --skill salesforce-developer

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理。
  • 可结合来源仓库和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围和维护状态。salesforce-developer 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 注意是否会触发联网、命令执行或文件读写。

SKILL.md

Salesforce Developer Skill

How to Use This Skill

Read the appropriate reference file(s) AND the corresponding coding ruleset before generating code:

Step 1: Read the Coding Rulesets (MANDATORY for all code generation)

Code TypeRuleset File
Apex (classes, triggers, tests, async, integrations)../../Blogs/salesforce-apex-coding-rules.md
LWC (components, templates, JS, events, Jest tests)../../Blogs/salesforce-lwc-coding-rules.md

These rulesets contain comprehensive coding standards, anti-patterns, PMD/ESLint rules, and code examples. Always apply these rules to all generated code.

Step 2: Read the Appropriate Reference File(s)

User's TaskReference File
Apex classes, triggers, testing, DML, async, dynamic Apex, JSON, wrappers, interfaces, debuggingreferences/apex-patterns.md
SOQL/SOSL, query optimization, dynamic SOQL, Big Objects, LDV, cursorsreferences/soql-optimization.md
LWC, Aura, dynamic components, lazy loadingreferences/lwc-guide.md
REST/Bulk/SOAP API, integrations, OAuth, Named Credentialsreferences/api-integration.md
Formulas, validation rulesreferences/formulas-validation.md
Flows, screen flows, record-triggered flows, process automationreferences/flows-automation.md
Security, sharing, CRUD/FLS, permissions, encryptionreferences/security-sharing.md
Deployment, sf CLI, scratch orgs, CI/CD, packagingreferences/deployment-devops.md
Agentforce, AI agents, Prompt Builder, platform events, CDCreferences/agentforce-ai.md

Step 3: Cross-Reference the Architect Skill (for design questions)

For tasks involving architecture, data modeling, integration patterns, or solution design, also read:

  • Architect Skill: ../salesforce-architect-skill/SKILL.md — Well-Architected framework, decision guides, integration patterns
  • Then read the relevant reference files inside ../salesforce-architect-skill/references/ (e.g., data-model-patterns.md, integration-patterns.md, well-architected-checklist.md)

For complex tasks (e.g., "build an LWC that calls Apex with integration"), read multiple reference files from both skills AND both rulesets.


Mandatory Rules

  1. Bulkify all Apex — no SOQL/DML inside loops. Handle 200+ records in triggers.
  2. Governor limits — 100 SOQL (sync), 150 DML, 50k rows, 10s CPU, 6 MB heap.
  3. One trigger per object — handler class with switch on Trigger.operationType.
  4. Securitywith sharing on classes, WITH SECURITY_ENFORCED in SOQL, Security.stripInaccessible() for DML.
  5. Testing — 200-record bulk tests, positive/negative/edge, @TestSetup, Test.startTest()/Test.stopTest().
  6. Error handling — try-catch on DML, AuraHandledException for LWC, Database.insert(records, false) for partial success.
  7. Latest GA API version (currently 66.0) on all new metadata. Update when Salesforce releases a new version.
  8. Always include -meta.xml for classes, triggers, LWC.
  9. Use sf CLI (not deprecated sfdx).
  10. Layered architecture — Trigger → Handler → Service → Selector.

LLM Anti-Patterns — NEVER Generate These

These are the most common AI mistakes in Salesforce code. For full code examples of each rule, see references/apex-patterns.md.

Apex Compilation Errors

  • A1: SOQL Field Coverage — Every field referenced in Apex MUST be in the SOQL SELECT clause. This is the #1 AI mistake.
  • A2: Relationship Fields — Parent = dot notation (Account.Name), child = subquery ((SELECT Id FROM Contacts)). Never mix them.
  • A3: Non-Existent MethodsDatetime.addMilliseconds(), String.contains() with regex, List.sort(comparator), Map.values().sort() do NOT exist.
  • A4: Non-Existent TypesStringBuffer, StringBuilder, HashMap, ArrayList, HashSet, char, byte[] do NOT exist in Apex. Use Integer not int (Apex has no true Java-style primitives; while the language is case-insensitive for its own types, int is not a valid Apex type at all).
  • A5: Static vs InstanceString.toLowerCase() is wrong (instance method). myString.valueOf() is wrong (static method).
  • A6: String Utilities — Use String.isBlank() for user input (handles null, empty, whitespace). isEmpty() misses whitespace.

LWC Template Errors

  • L1: No Inline Expressions — LWC templates do NOT support {a + b}, ternary, negation, or object literals. Use JavaScript getters.
  • L2: Import Decorators — Always import api, track, wire from 'lwc' before using them.
  • L3: Event Naming — Custom events must be all lowercase, no hyphens. Parent uses on prefix: onmyevent.

Runtime Errors

  • R1: Null Checks — Always query into a List, then check !isEmpty() before accessing [0].
  • R2: Map.containsKey() — Check before Map.get() to avoid NPE.
  • R3: Recursive Trigger Prevention — Use static Set<Id>, NOT static Boolean. Boolean blocks all subsequent records.
  • R4: Guard DML — Check !list.isEmpty() before DML. Saves CPU even though empty DML doesn't consume limits.
  • R5: MIXED_DML — Cannot DML setup objects (User, Profile) and non-setup objects in same transaction. Use @future or Queueable.

Deployment Errors

  • D1: Permission Set Fields — Only include FLS for fields on the correct object. Skip standard non-FLS fields (Name, Id, CreatedDate).
  • D2: Permission Set Apex Access — Include classAccesses for Apex classes used by LWC via @AuraEnabled.
  • D3: package.xml Order — CustomObject → CustomField → ApexClass → ApexTrigger → Layout → PermissionSet → Profile.

Integration Errors

  • I1: Same-Org Endpoints — Use org's instance URL, not api.salesforce.com.
  • I2: Callout After DML — Cannot make HTTP callout after DML in same transaction. Callout first, or use @future(callout=true).

Agentforce & Flow Errors

  • AF1: @AuraEnabled — Must be public static. With @wire, must have cacheable=true. Class must be with sharing.
  • AF2: @InvocableVariable Types — Primitives, List<String>, List<Id>, SObject, List<SObject>, Apex-defined types. NO Maps.
  • AF3: @JsonAccess — Custom return types for Agentforce actions need @JsonAccess(serializable='always').

Naming Conventions

ElementConventionExample
ClassesPascalCase + suffixAccountTriggerHandler, OrderService, ContactSelector
Test ClassesPascalCase + TestAccountServiceTest
MethodscamelCase, verb-firstgetAccountsByIds(), calculateTotal()
VariablescamelCaseaccountList, totalRevenue
ConstantsUPPER_SNAKE_CASEMAX_RETRY_COUNT, DEFAULT_PAGE_SIZE
Triggers{Object}TriggerAccountTrigger
LWCcamelCase folder, kebab-case markupaccountList<c-account-list>
Custom ObjectsPascalCase + __cInvoice_Line_Item__c
Custom FieldsPascalCase + __cTotal_Amount__c
Platform EventsPascalCase + __eOrder_Placed__e
Custom MetadataPascalCase + __mdtIntegration_Config__mdt

Governor Limits Quick Reference

ResourceSync LimitAsync Limit
SOQL queries100200
SOQL rows50,00050,000
DML statements150150
DML rows10,00010,000
CPU time10,000 ms60,000 ms
Heap size6 MB12 MB
Callouts100100
Future calls500 (in future)
Queueable jobs501

Async Apex Decision Guide

PatternUse WhenKey Notes
@futureFire-and-forget, calloutsPrimitives only, max 50/txn, can't chain
QueueableChaining, complex types, job ID50/txn sync, 1 child async, Transaction Finalizers
Batch Apex50k+ records200/execute, QueryLocator up to 50M rows
SchedulableRecurring CRON jobs100 scheduled jobs/org
Platform EventsEvent-driven, decoupledEventBus.publish(), RetryableException for retry

For full async patterns, see references/apex-patterns.md.


Order of Execution

  1. Load original record / initialize for insert
  2. Overwrite with new field values
  3. System validation (required fields, formats)
  4. Before-save record-triggered flows
  5. Before triggers
  6. System validation + custom validation rules
  7. Duplicate rules
  8. Record saved to DB (not yet committed)
  9. After triggers
  10. Assignment/auto-response rules
  11. Workflow rules (field updates re-fire triggers ONCE)
  12. Process Builder / flow trigger workflow actions
  13. After-save record-triggered flows
  14. Roll-up summary calculations
  15. Criteria-based sharing evaluation
  16. DML committed
  17. Post-commit: email, async Apex, async flow paths

Key: Before triggers can modify Trigger.new without DML. After triggers CANNOT.


Code Generation Checklist

  1. Every field referenced in code MUST be in the SOQL SELECT clause (Rule A1)
  2. Include -meta.xml for all new classes, triggers, LWC
  3. Latest GA API version (currently 66.0) on all metadata
  4. Include JSDoc in LWC JavaScript and ApexDoc in Apex
  5. Wrap DML in try-catch, use AuraHandledException for LWC
  6. Use WITH SECURITY_ENFORCED in SOQL
  7. Use Database.insert(records, false) for partial success
  8. Null-check query results, Map.get() returns, parent relationship fields
  9. Guard DML with !list.isEmpty()
  10. Use with sharing on user-facing classes, inherited sharing on utilities
  11. Use switch on Trigger.operationType in handlers
  12. Never hardcode IDs — use Schema.describe, Custom Metadata, or Custom Labels
  13. Prefer Assert.areEqual() (modern Assert class) over System.assertEquals() for new code
  14. Test methods use Arrange-Act-Assert with descriptive names

Common Error Solutions

ErrorFix
Too many SOQL queries: 101Move query outside loop, use Maps
MIXED_DML_OPERATIONUse @future or Queueable for setup object DML
Non-selective queryAdd indexed filter, request custom index
You have uncommitted workMove callout before DML or use @future(callout=true)
NullPointerExceptionAdd null checks; query into List + isEmpty()
SObject row was retrieved via SOQL without querying the requested fieldAdd field to SOQL SELECT (Rule A1)
Too many DML statements: 151Collect records in lists, single DML outside loop
UNABLE_TO_LOCK_ROWUse FOR UPDATE or implement retry
Apex CPU time limit exceededOptimize loops, use async Apex

For full error patterns and JSON/debugging details, see references/apex-patterns.md.


Metadata XML Templates

Apex Class

<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>66.0</apiVersion>
    <status>Active</status>
</ApexClass>

Apex Trigger

<?xml version="1.0" encoding="UTF-8"?>
<ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>66.0</apiVersion>
    <status>Active</status>
</ApexTrigger>

LWC Component

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>66.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
    </targets>
</LightningComponentBundle>

Project Structure

force-app/main/default/
├── classes/         # Handler, Service, Selector, Controller, Test classes + -meta.xml
├── triggers/        # One trigger per object + -meta.xml
├── lwc/             # camelCase folders with html/js/css/js-meta.xml + __tests__/
├── objects/         # fields/, validationRules/, listViews/
├── permissionsets/
├── customMetadata/
└── labels/

Architecture: Trigger (thin) → Handler (routing, recursion guard) → Service (business logic, DML) → Selector (SOQL, with sharing)


Quick Reference Pointers

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.21%
按下载量换算50

Claude

30.89%
按下载量换算44

Cursor

17.06%
按下载量换算24

Gemini CLI

9.6%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills