building-sf-integrations

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

building-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
building-sf-integrations
when the work involves:
  • .namedCredential-meta.xml
    or External Credential metadata
  • 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
技能:
  • .namedCredential-meta.xml
    或External Credential元数据
  • 出站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. 选择集成模式

NeedDefault pattern
authenticated outbound API callNamed Credential / External Credential + Apex or Flow
spec-driven API clientExternal Service
trigger-originated calloutasync callout pattern
decoupled event publishingPlatform Events
change-stream consumptionCDC
需求默认模式
已认证的出站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:
  1. Integration pattern chosen
  2. Auth model chosen
  3. Files created or updated
  4. Operational safeguards
  5. 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>

完成任务后,按以下顺序汇报:
  1. 所选集成模式
  2. 所选认证模型
  3. 创建或更新的文件
  4. 运行安全措施
  5. 部署/测试下一步
建议格式:
text
Integration: <概述>
Pattern: <named credential / external service / event / cdc / callout>
Files: <路径>
Safety: <超时、重试、异步、日志>
Next step: <部署、注册、测试或实现>

Cross-Skill Integration

跨技能集成

NeedDelegate toReason
OAuth app setupconfiguring-connected-appsconsumer key / cert / app config
advanced callout service codegenerating-apexApex implementation
declarative HTTP callout / Flow wrappergenerating-flowFlow orchestration
deploy integration metadatadeploying-metadatavalidation and rollout
use integration from Agentforcedeveloping-agentforceagent action composition

需求转交至原因
OAuth应用设置configuring-connected-apps消费者密钥/证书/应用配置
高级调用服务代码generating-apexApex实现
声明式HTTP调用/Flow封装generating-flowFlow编排
部署集成元数据deploying-metadata验证与发布
在Agentforce中使用集成developing-agentforceAgent动作组合

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

资源模板

  • assets/named-credentials/
    — Named Credential XML templates (OAuth, JWT, Certificate, Custom auth)
  • assets/external-credentials/
    — External Credential XML templates (OAuth, JWT)
  • assets/external-services/
    — External Service registration template and operations guide
  • assets/callouts/
    — REST sync, Queueable, retry handler, and HTTP response handler Apex templates
  • assets/platform-events/
    — Platform Event definition, publisher, and subscriber templates
  • assets/cdc/
    — CDC handler and subscriber trigger templates
  • assets/soap/
    — SOAP callout service template and wsdl2apex guide
  • assets/endpoint-security/
    — Remote Site Setting and CSP Trusted Site XML templates
  • assets/named-credentials/
    — Named Credential XML模板(OAuth、JWT、证书、自定义认证)
  • assets/external-credentials/
    — External Credential XML模板(OAuth、JWT)
  • assets/external-services/
    — External Service注册模板与操作指南
  • assets/callouts/
    — REST同步、Queueable、重试处理器与HTTP响应处理器Apex模板
  • assets/platform-events/
    — Platform Event定义、发布者与订阅者模板
  • assets/cdc/
    — CDC处理器与订阅者触发器模板
  • assets/soap/
    — SOAP调用服务模板与wsdl2apex指南
  • assets/endpoint-security/
    — Remote Site Setting与CSP Trusted Site XML模板

Automation hooks

自动化钩子

  • hooks/scripts/suggest_credential_setup.py
    — auto-suggests credential configuration steps when integration files are detected
  • hooks/scripts/validate_integration.py
    — validates integration patterns before agent responses

  • hooks/scripts/suggest_credential_setup.py
    — 检测到集成文件时自动建议凭证配置步骤
  • hooks/scripts/validate_integration.py
    — 在Agent响应前验证集成模式

Output Expectations

输出预期

When this skill completes an integration task, it produces:
  1. Credential metadata — one or more files in
    assets/named-credentials/
    or
    assets/external-credentials/
    filled with org-specific values
  2. Callout Apex class — a
    .cls
    file using the Named Credential pattern, with async/sync pattern chosen based on context
  3. Event/CDC artifacts — Platform Event
    .object-meta.xml
    , subscriber trigger, or CDC config (when event-driven pattern is chosen)
  4. Endpoint security metadata — Remote Site Setting and/or CSP Trusted Site XML files
  5. Scoring report — 120-point score across 6 categories (Security, Error Handling, Bulkification, Architecture, Best Practices, Documentation)
  6. Next step — a deployment or testing instruction for the generated artifacts

当本技能完成集成任务时,将生成:
  1. 凭证元数据 — 一个或多个填充了组织特定值的
    assets/named-credentials/
    assets/external-credentials/
    路径下的文件
  2. 调用Apex类 — 一个采用Named Credential模式的
    .cls
    文件,根据上下文选择异步/同步模式
  3. 事件/CDC制品 — Platform Event
    .object-meta.xml
    、订阅者触发器或CDC配置(当选择事件驱动模式时)
  4. 端点安全元数据 — Remote Site Setting和/或CSP Trusted Site XML文件
  5. 评分报告 — 基于6个维度(安全性、错误处理、批量处理、架构、最佳实践、文档)的120分评分
  6. 下一步操作 — 生成制品的部署或测试说明

Score Guide

评分指南

ScoreMeaning
108+strong production-ready integration design
90–107good design with some hardening left
72–89workable but needs architectural review
< 72unsafe / incomplete for deployment
分数含义
108+强生产就绪型集成设计
90–107良好设计,需少量强化
72–89可用,但需架构评审
< 72不安全/未完成,无法部署