building-sf-integrations
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesebuilding-sf-integrations: Salesforce Integration Patterns Expert
building-sf-integrations:Salesforce集成模式专家
Use this skill when the user needs integration architecture and runtime plumbing: Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, CDC, and event-driven integration design.
当用户需要集成架构与运行时管道相关支持时使用本技能:包括Named Credentials、External Credentials、External Services、REST/SOAP调用模式、Platform Events、CDC以及事件驱动集成设计。
When This Skill Owns the Task
本技能负责的任务场景
Use when the work involves:
building-sf-integrations- or External Credential metadata
.namedCredential-meta.xml - outbound REST/SOAP callouts
- External Service registration from OpenAPI specs
- Platform Events, CDC, and event-driven architecture
- choosing sync vs async integration patterns
Delegate elsewhere when the user is:
- configuring the OAuth app itself → configuring-connected-apps
- writing Apex-only business logic → generating-apex
- deploying metadata → deploying-metadata
- importing/exporting data → handling-sf-data
当工作涉及以下内容时,使用技能:
building-sf-integrations- 或External Credential元数据
.namedCredential-meta.xml - 出站REST/SOAP调用
- 基于OpenAPI规范注册External Service
- Platform Events、CDC与事件驱动架构
- 选择同步/异步集成模式
当用户进行以下操作时,请转交至其他技能:
- 配置OAuth应用本身 → configuring-connected-apps
- 编写仅含Apex的业务逻辑 → generating-apex
- 部署元数据 → deploying-metadata
- 导入/导出数据 → handling-sf-data
Required Context to Gather First
需先收集的必要上下文
Ask for or infer:
- integration style: outbound callout, inbound event, External Service, CDC, platform event
- auth method
- sync vs async requirement
- system endpoint / spec details
- rate limits, retry expectations, and failure tolerance
- whether this is net-new design or repair of an existing integration
询问或推断以下信息:
- 集成类型:出站调用、入站事件、External Service、CDC、平台事件
- 认证方式
- 同步/异步需求
- 系统端点/规范细节
- 速率限制、重试预期与故障容忍度
- 是全新设计还是修复现有集成
Recommended Workflow
推荐工作流程
1. Choose the integration pattern
1. 选择集成模式
| Need | Default pattern |
|---|---|
| authenticated outbound API call | Named Credential / External Credential + Apex or Flow |
| spec-driven API client | External Service |
| trigger-originated callout | async callout pattern |
| decoupled event publishing | Platform Events |
| change-stream consumption | CDC |
| 需求 | 默认模式 |
|---|---|
| 已认证的出站API调用 | Named Credential / External Credential + Apex或Flow |
| 基于规范的API客户端 | External Service |
| 触发器发起的调用 | 异步调用模式 |
| 解耦事件发布 | Platform Events |
| 变更流消费 | CDC |
2. Choose the auth model
2. 选择认证模型
Prefer secure runtime-managed auth:
- Named Credentials / External Credentials
- OAuth or JWT via the right credential model
- no hardcoded secrets in code
优先使用安全的运行时托管认证:
- Named Credentials / External Credentials
- 通过合适的凭证模型实现OAuth或JWT
- 代码中不硬编码密钥
3. Generate from the right templates
3. 从正确模板生成
Use the provided assets under:
assets/named-credentials/assets/external-credentials/assets/external-services/assets/callouts/assets/platform-events/assets/cdc/assets/soap/
使用以下路径下的提供资源:
assets/named-credentials/assets/external-credentials/assets/external-services/assets/callouts/assets/platform-events/assets/cdc/assets/soap/
4. Validate operational safety
4. 验证运行安全性
Check:
- timeout and retry handling
- async strategy for trigger-originated work
- logging / observability
- event retention and subscriber implications
检查以下内容:
- 超时与重试处理
- 触发器发起工作的异步策略
- 日志/可观测性
- 事件保留与订阅者影响
5. Hand off deployment or implementation details
5. 转交部署或实现细节
Use:
- deploying-metadata for deployment
- generating-apex for deeper service / retry code
- generating-flow for declarative HTTP callout orchestration
使用以下技能:
- deploying-metadata 用于部署
- generating-apex 用于更深入的服务/重试代码开发
- generating-flow 用于声明式HTTP调用编排
High-Signal Rules
高信号规则
- never hardcode credentials
- do not do synchronous callouts from triggers
- define timeout behavior explicitly
- plan retries for transient failures
- use middleware / event-driven patterns when outbound volume is high
- prefer External Credentials architecture for new development when supported
Common anti-patterns:
- sync trigger callouts
- no retry or dead-letter strategy
- no request/response logging
- mixing auth setup responsibilities with runtime integration design
- 绝不硬编码凭证
- 不要在触发器中执行同步调用
- 明确定义超时行为
- 为临时故障规划重试机制
- 当出站调用量较高时,使用中间件/事件驱动模式
- 当支持时,新开发优先采用External Credentials架构
常见反模式:
- 触发器同步调用
- 无重试或死信策略
- 无请求/响应日志
- 将认证设置职责与运行时集成设计混合
Output Format
输出格式
When finishing, report in this order:
- Integration pattern chosen
- Auth model chosen
- Files created or updated
- Operational safeguards
- Deployment / testing next step
Suggested shape:
text
Integration: <summary>
Pattern: <named credential / external service / event / cdc / callout>
Files: <paths>
Safety: <timeouts, retries, async, logging>
Next step: <deploy, register, test, or implement>完成任务后,按以下顺序汇报:
- 所选集成模式
- 所选认证模型
- 创建或更新的文件
- 运行安全措施
- 部署/测试下一步
建议格式:
text
Integration: <概述>
Pattern: <named credential / external service / event / cdc / callout>
Files: <路径>
Safety: <超时、重试、异步、日志>
Next step: <部署、注册、测试或实现>Cross-Skill Integration
跨技能集成
| Need | Delegate to | Reason |
|---|---|---|
| OAuth app setup | configuring-connected-apps | consumer key / cert / app config |
| advanced callout service code | generating-apex | Apex implementation |
| declarative HTTP callout / Flow wrapper | generating-flow | Flow orchestration |
| deploy integration metadata | deploying-metadata | validation and rollout |
| use integration from Agentforce | developing-agentforce | agent action composition |
| 需求 | 转交至 | 原因 |
|---|---|---|
| OAuth应用设置 | configuring-connected-apps | 消费者密钥/证书/应用配置 |
| 高级调用服务代码 | generating-apex | Apex实现 |
| 声明式HTTP调用/Flow封装 | generating-flow | Flow编排 |
| 部署集成元数据 | deploying-metadata | 验证与发布 |
| 在Agentforce中使用集成 | developing-agentforce | Agent动作组合 |
Reference Map
参考地图
Start here
入门参考
- references/named-credentials-guide.md
- references/external-services-guide.md
- references/callout-patterns.md
- references/rest-callout-patterns.md
- references/security-best-practices.md
- references/named-credentials-guide.md
- references/external-services-guide.md
- references/callout-patterns.md
- references/rest-callout-patterns.md
- references/security-best-practices.md
Event-driven / platform patterns
事件驱动/平台模式
- references/event-patterns.md
- references/platform-events-guide.md
- references/cdc-guide.md
- references/event-driven-architecture-guide.md
- references/messaging-api-v2.md
- references/event-patterns.md
- references/platform-events-guide.md
- references/cdc-guide.md
- references/event-driven-architecture-guide.md
- references/messaging-api-v2.md
CLI / automation / scoring
CLI/自动化/评分
- references/cli-reference.md
- references/named-credentials-automation.md
- references/scoring-rubric.md
- scripts/README.md — automation scripts overview (configure-named-credential.sh, set-api-credential.sh)
- references/cli-reference.md
- references/named-credentials-automation.md
- references/scoring-rubric.md
- scripts/README.md — 自动化脚本概述(configure-named-credential.sh、set-api-credential.sh)
Asset templates
资源模板
- — Named Credential XML templates (OAuth, JWT, Certificate, Custom auth)
assets/named-credentials/ - — External Credential XML templates (OAuth, JWT)
assets/external-credentials/ - — External Service registration template and operations guide
assets/external-services/ - — REST sync, Queueable, retry handler, and HTTP response handler Apex templates
assets/callouts/ - — Platform Event definition, publisher, and subscriber templates
assets/platform-events/ - — CDC handler and subscriber trigger templates
assets/cdc/ - — SOAP callout service template and wsdl2apex guide
assets/soap/ - — Remote Site Setting and CSP Trusted Site XML templates
assets/endpoint-security/
- — Named Credential XML模板(OAuth、JWT、证书、自定义认证)
assets/named-credentials/ - — External Credential XML模板(OAuth、JWT)
assets/external-credentials/ - — External Service注册模板与操作指南
assets/external-services/ - — REST同步、Queueable、重试处理器与HTTP响应处理器Apex模板
assets/callouts/ - — Platform Event定义、发布者与订阅者模板
assets/platform-events/ - — CDC处理器与订阅者触发器模板
assets/cdc/ - — SOAP调用服务模板与wsdl2apex指南
assets/soap/ - — Remote Site Setting与CSP Trusted Site XML模板
assets/endpoint-security/
Automation hooks
自动化钩子
- — auto-suggests credential configuration steps when integration files are detected
hooks/scripts/suggest_credential_setup.py - — validates integration patterns before agent responses
hooks/scripts/validate_integration.py
- — 检测到集成文件时自动建议凭证配置步骤
hooks/scripts/suggest_credential_setup.py - — 在Agent响应前验证集成模式
hooks/scripts/validate_integration.py
Output Expectations
输出预期
When this skill completes an integration task, it produces:
- Credential metadata — one or more files in or
assets/named-credentials/filled with org-specific valuesassets/external-credentials/ - Callout Apex class — a file using the Named Credential pattern, with async/sync pattern chosen based on context
.cls - Event/CDC artifacts — Platform Event , subscriber trigger, or CDC config (when event-driven pattern is chosen)
.object-meta.xml - Endpoint security metadata — Remote Site Setting and/or CSP Trusted Site XML files
- Scoring report — 120-point score across 6 categories (Security, Error Handling, Bulkification, Architecture, Best Practices, Documentation)
- Next step — a deployment or testing instruction for the generated artifacts
当本技能完成集成任务时,将生成:
- 凭证元数据 — 一个或多个填充了组织特定值的或
assets/named-credentials/路径下的文件assets/external-credentials/ - 调用Apex类 — 一个采用Named Credential模式的文件,根据上下文选择异步/同步模式
.cls - 事件/CDC制品 — Platform Event 、订阅者触发器或CDC配置(当选择事件驱动模式时)
.object-meta.xml - 端点安全元数据 — Remote Site Setting和/或CSP Trusted Site XML文件
- 评分报告 — 基于6个维度(安全性、错误处理、批量处理、架构、最佳实践、文档)的120分评分
- 下一步操作 — 生成制品的部署或测试说明
Score Guide
评分指南
| Score | Meaning |
|---|---|
| 108+ | strong production-ready integration design |
| 90–107 | good design with some hardening left |
| 72–89 | workable but needs architectural review |
| < 72 | unsafe / incomplete for deployment |
| 分数 | 含义 |
|---|---|
| 108+ | 强生产就绪型集成设计 |
| 90–107 | 良好设计,需少量强化 |
| 72–89 | 可用,但需架构评审 |
| < 72 | 不安全/未完成,无法部署 |