commerce-b2b-open-code…
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce stores. Use when users mention \"integrate open code components\",…
Custom Apex adapter generation for Salesforce Connect — connects any external REST API to Salesforce as live, queryable External Objects without ETL or data copying. TRIGGER when: user wants to connect a non-standard external API to Salesforce, asks to write a
$ npx -y skills add forcedotcom/afv-library --skill platform-salesforce-connect-adapter-generate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/platform-salesforce-connect-adapter-generateContext preview
The summary Claude sees to decide when to auto-load this skill.
Custom Apex adapter generation for Salesforce Connect — connects any external REST API to Salesforce as live, queryable External Objects without ETL or data copying. TRIGGER when: user wants to connect a non-standard external API to Salesforce, asks to write a
name: platform-salesforce-connect-adapter-generate
description: "Custom Apex adapter generation for Salesforce Connect — connects any external REST API to Salesforce as live, queryable External Objects without ETL or data copying. TRIGGER when: user wants to connect a non-standard external API to Salesforce, asks to write a DataSource.Provider or DataSource.Connection, wants to surface external data as Salesforce records, says \"connect my API to Salesforce without copying data\", or asks whether custom Apex is the right approach for any system. Also trigger on: \"custom adapter\", \"ExternalId field\", \"DataSource namespace\". DO NOT TRIGGER when: user is configuring a standard adapter they already have and is NOT asking about custom Apex (e.g., OData endpoint setup, Snowflake connector config). DO NOT TRIGGER when: user wants to copy or bulk-sync data — use platform-data-manage. DO NOT TRIGGER for Apex callouts outside Connect — use platform-apex-generate or integration-connectivity-generate."
metadata:
version: "1.0"
minApiVersion: "66.0"
accessCheck:
- type: license
value: SalesforceConnect
domains:
- Platform
relatedSkills:
- integration-connectivity-generate
- platform-apex-generate
- platform-data-manage
cliTools:
- tool: ["sf"]
semver: ">=2.0.0"Route the user through building a complete custom Salesforce Connect Apex adapter: two Apex classes, metadata deployment, and registration. Do not guess at the user's API shape — ask before generating.
**In scope:** Generating `DataSource.Connection` and `DataSource.Provider` Apex classes, Named Credential metadata, deployment via sf CLI, and step-by-step Setup registration guidance for any REST API.
**Out of scope:** Configuring standard adapters (OData, Snowflake, GraphQL — those have their own flows). Generating the External Data Source metadata file (not deployable via sf CLI — must be registered manually in Setup). Writing Apex that calls external APIs outside the Salesforce Connect framework (use [platform-apex-generate](../platform-apex-generate/SKILL.md) or [integration-connectivity-generate](../integration-connectivity-generate/SKILL.md)).
Confirm two things. If either is missing, ask before proceeding.
**1. Is this actually a Salesforce Connect use case?**
| The user wants to… | Right tool | |---|---| | Query external data live without copying it — read-only or read-write, appears as Salesforce records | **This skill** | | Copy or sync data into Salesforce on a schedule | [platform-data-manage](../platform-data-manage/SKILL.md) | | Connect to OData, GraphQL, DynamoDB, Athena, or Cross-Org | Standard adapter setup — no Apex needed, different flow | | Connect to Snowflake via Salesforce's native Snowflake adapter (direct Snowflake protocol) | Built-in Snowflake adapter — no Apex needed | | Access Snowflake (or any database) data via a REST or HTTP API | **This skill** — Snowflake REST endpoint → custom Apex adapter | | Call an external API from Apex or Flow logic | [platform-apex-generate](../platform-apex-generate/SKILL.md) or [integration-connectivity-generate](../integration-connectivity-generate/SKILL.md) | | Expose Salesforce data to an external system | [integration-connectivity-generate](../integration-connectivity-generate/SKILL.md) | | Receive real-time pushed data or subscribe to external events | Not Salesforce Connect — Connect is pull-only. Use Platform Events or Change Data Capture instead | | Sync or copy data for analytics or bulk processing | Data Cloud or ETL — Connect is zero-copy virtualization only |
If the user has a standard adapter available, tell them — writing a custom adapter when a standard one fits is unnecessary work.
**2. Do they have a Salesforce Connect license?**
A custom adapter requires a Salesforce Connect license (one license per External Data Source). Without it, the External Data Source menu won't show the Apex option. If the user doesn't have one, tell them before going further.
---
If the user does not specify an org alias, use `demo-org`. If the user does not specify an SFDX project path, use `~/salesforce-connect-apex-skill/sfconnect-demo/`. These are the defaults for local testing — always override if the user specifies their own.
---
Never generate code without these. If any are missing, ask:
| Input | Why it matters | |---|---| | API name and what it does | Names the classes and sets context for field mapping | | Base URL | Becomes the Named Credential endpoint | | Auth type | Determines Named Credential setup and `getAuthenticationMode()` | | Key GET endpoint(s) + sample response | Defines the External Object schema — field names, types, nesting | | Write support needed? | Determines whether to implement `upsertRows()` and `deleteRows()` | | Org type (DE, scratch, sandbox) | Sets `apiVersion` in `.cls-meta.xml` |
If the user provides an OpenAPI spec, extract:
---
Every custom Salesforce Connect adapter is exactly two Apex classes.
Handles communication with the external API. Exact signatures:
override global DataSource.TableResult query(DataSource.QueryContext context) override global List<DataSource.TableResult> search(DataSource.SearchContext context) // Write support — only if API supports it: global override List<DataSource.UpsertResult> upsertRows(DataSource.UpsertContext context) global override List<DataSource.DeleteResult> deleteRows(DataSource.DeleteContext context)
Key distinction: `query()` always operates on **one** table (`QueryContext` has a sing
This repository provides a curated collection of Salesforce agent skills for building applications.
Repo: forcedotcom/afv-library
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce stores. Use when users mention \"integrate open code components\",…
Replace OOTB (out-of-the-box) B2B Commerce components with open source equivalents in site metadata content.json files, or look up the equivalent open code…
Use this skill to diagnose and resolve what blocks a DevOps Center promotion of a work item's feature branch: Git merge conflicts and deployment failures.…
Use this skill to manage the full lifecycle of a DevOps Center pipeline — list all pipelines, get a single pipeline's details, create a new pipeline linked to…
Analyzes DevOps Center test failures and Code Analyzer violations in plain language — failure category, offending file/class/method/line, rule violated, fix…
Configures DevOps Center pipeline testing infrastructure: enables a test provider so its suites become available, re-syncs a configured provider to pull in new…