
integration-eventing-cdc-configure
Use to enable Salesforce Change Data Capture (CDC) on a standard or custom object, configure a custom event channel, set a filter expression, or add enrichment fields. TRIGGER broadly on any of: 'enable CDC', 'enable Change Data Capture', 'turn on CDC', 'subscribe X to change events', 'only emit events for', 'filter change events', 'enrich change events', 'create a custom event channel'; or any mention of CDC, change events, PlatformEventChannel, PlatformEventChannelMember, EnrichedField, ChangeEvents channel, enrichment fields, change event filter; or when the user wants a downstream system to receive Salesforce data changes; or when the user touches .platformEventChannelMember-meta.xml / .platformEventChannel-meta.xml files. SKIP when publishing platform events, Pub/Sub API or REST/SOAP (use integration-connectivity-generate), or ManagedEventSubscription (out of scope for CDC). Always use this skill for CDC channel-membership metadata.
- Installs
- 5.2K
- Last 24h
- +8
- Trending rank
- #9524
- Security
- Pass
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/forcedotcom/sf-skills --skill integration-eventing-cdc-configure- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads integration-eventing-cdc-configure automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
Managing Change Data Capture Enablement
Generate the metadata that subscribes Salesforce objects to Change Data Capture: PlatformEventChannelMember files for the default ChangeEvents channel or a custom channel, and PlatformEventChannel files for new custom channels. Covers enrichment fields, filter expressions, and the canonical naming and value formats that the Metadata API actually accepts (which differ from values that appear in many internal test fixtures and code-search hits).
Scope
- In scope: Generating
PlatformEventChannelMemberandPlatformEventChannelmetadata for CDC. Subscribing standard objects, custom objects, or both. Configuring enrichment fields. Configuring filter expressions. Defining custom data channels. - Out of scope: Publishing custom platform events (PE) — that's a different metadata type (
PlatformEvent). Pub/Sub API or external Kafka/Bayeux configuration. Pricing/limits guidance — refer the user to the CDC Developer Guide. Programmatic event-bus subscribers in Apex.
Clarifying Questions
Before generating, confirm with the user if not already clear:
- Which entity (or entities) need CDC enablement? Standard, custom, or both?
- Default channel (
ChangeEvents) or a custom channel? If custom, what's the channel label? - Any enrichment fields needed? (Lookup IDs that the consumer needs even when they didn't change.)
- Any filter expression needed? (A SOQL-WHERE-clause body that gates which change events emit.)
Required Inputs
Gather or infer before proceeding:
- Source entity API name(s) — e.g.
Account,Lead,Order__c. The skill internally translates this to the ChangeEvent entity name (see Workflow step 2). - Channel — either
ChangeEvents(default) or the developer name of a custom channel ending in__chn. - Enrichment fields (optional) — list of field API names on the source object whose values should be included in every change event.
- Filter expression (optional) — a predicate over fields on the change event payload (e.g.
Status__c != null).
Defaults unless specified:
- Channel:
ChangeEvents(the default CDC channel — no path prefix). - Enrichment fields: none.
- Filter expression: none.
If the user provides a clear, complete request, generate immediately without unnecessary back-and-forth.
Workflow
All steps are sequential. Do not skip or reorder.
Before generating anything, know the only valid CDC metadata types: CDC is expressed entirely through PlatformEventChannelMember (one per subscribed entity) and PlatformEventChannel (only for custom channels). Do NOT use <ChangeDataCapture>, .changeDataCapture-meta.xml, changeDataCapture/ directories, EnableChangeDataCapture, or ManagedEventSubscription — these are not in scope for CDC. If you find yourself writing any of them, stop and use a PlatformEventChannelMember file instead.
-
Identify the channel — if the user names a custom channel, you'll generate a
PlatformEventChannelfile (see step 4). Otherwise use the literal valueChangeEventsfor the default channel. -
Translate source entity to ChangeEvent entity name —
<selectedEntity>is the ChangeEvent type, NOT the source object:Source object <selectedEntity>valueAccountAccountChangeEventLeadLeadChangeEventContactContactChangeEventOrder__c(custom)Order__ChangeEventMyThing__c(custom)MyThing__ChangeEventFor standard objects: append
ChangeEvent. For custom objects: replace the trailing__cwith__ChangeEvent(the double-underscore is preserved). -
Generate the channel-member file — one file per
(entity, channel)pair. The filename and fullName always use a SINGLE underscore between the entity stem andChangeEvent— this is independent of howselectedEntityis formatted in the XML body. For custom objects, drop the__cfrom the source name when forming the filename:Source object Filename (and fullName) <selectedEntity>(in XML)AccountAccount_ChangeEvent.platformEventChannelMember-meta.xmlAccountChangeEventLeadLead_ChangeEvent.platformEventChannelMember-meta.xmlLeadChangeEventOrder__cOrder_ChangeEvent.platformEventChannelMember-meta.xml(NOTOrder__ChangeEvent)Order__ChangeEventMyThing__cMyThing_ChangeEvent.platformEventChannelMember-meta.xml(NOTMyThing__ChangeEvent)MyThing__ChangeEventThe custom-object case is the easiest place to slip — the filename uses single underscore, the
selectedEntitykeeps its double underscore. Readassets/PlatformEventChannelMember-template.xmlas the structural template. -
For a custom channel, generate a
PlatformEventChannelfile — required if any member references a non-default channel. Derive a DeveloperName from the user's label: strip spaces and non-alphanumeric characters, convert to CamelCase, then always append the literal suffix__chn. The filename and the channel's<eventChannel>reference must use this exact form, otherwise the deploy fails withInvalid channel name:User says DeveloperName Filename Partner SyncPartnerSync__chnPartnerSync__chn.platformEventChannel-meta.xml(NOTPartner_Sync...orPartnerSync...)Order UpdatesOrderUpdates__chnOrderUpdates__chn.platformEventChannel-meta.xmldata syncDataSync__chnDataSync__chn.platformEventChannel-meta.xmlMembers on this channel reference it by the same DeveloperName:
<eventChannel>PartnerSync__chn</eventChannel>. Readassets/PlatformEventChannel-template.xml. -
Add enrichment fields if requested — repeat the
<enrichedFields><name>FIELD_API_NAME</name></enrichedFields>block for each field. The name must be a single-hop API name on the source entity — verified working with: standard lookup IDs (OwnerId,ParentId), custom lookup fields (MyLookup__c), and custom non-relationship fields (Region__c,Status__c). Relationship traversals likeOwner.NameorParent.Account.Industryare rejected by deploy with "The selected field, X.Y, isn't valid". -
Add a filter expression if requested — wrap the predicate in
<filterExpression>...</filterExpression>. The body is a WHERE-clause body without theWHEREkeyword (e.g.Status__c != null, notWHERE Status__c != null). For supported operators, field types, and pitfalls, readreferences/filter-expressions.md.
Rules / Constraints
| Constraint | Rationale |
|---|---|
<selectedEntity> is the ChangeEvent type name, not the source object name | The Metadata API binds the member to a ChangeEvent entity — passing Account directly fails with "invalid event in selectedEntity". |
Member fullName uses single underscore: Account_ChangeEvent | The double-underscore form (Account__ChangeEvent) is parsed as <namespace>__<name> and rejected: "Cannot create a new component with the namespace: Account". |
Default channel value is exactly ChangeEvents — no path prefix | Older fixtures and some docs show data/ChangeEvents; the deploy returns "Unable to find the specified channel" for that value. |
| Enrichment field names are single-hop API names on the source entity | Standard (OwnerId), custom lookup (MyLookup__c), and custom non-relationship (Region__c) all validate. Traversals like Owner.Name are rejected: "The selected field, X.Y, isn't valid". |
<filterExpression> body has no WHERE keyword | Deploy returns "filter expression has syntax errors: unexpected token: 'WHERE'". |
Filter cannot reference IsDeleted or do relationship traversal (Owner.Username) | Deploy rejects with "field is invalid". |
DateTime fields support only equality in filters (=, !=) — not < / > | Deploy returns "Only equality operators are supported for this field type or value". Use a named date literal: LastModifiedDate = TODAY. |
| Filter RHS must be a literal — no field-to-field comparison | BillingCity = ShippingCity returns "unexpected token: 'ShippingCity'". |
Compound fields (e.g. BillingAddress) require dotted component access in filter | BillingAddress.City = 'X' deploys; flat BillingCity is rejected as "field is invalid"; raw BillingAddress is rejected as "has to be used with a component field". Note this is the OPPOSITE of <enrichedFields>, which uses flat names. |
Custom channel filename ends with __chn before the meta-xml suffix | Salesforce's MDAPI naming convention; mismatch causes deploy ambiguity. |
Custom channel XML must include <channelType>data</channelType> | Without data, the channel is rejected for CDC (other types exist for streaming/event channels). |
| Source custom objects must already exist (or be deployed in the same transaction) | The ChangeEvent entity for Foo__c doesn't exist until Foo__c does; member deploy fails otherwise. |
Never generate a PlatformEventChannel file for the default ChangeEvents channel | The default channel is system-provided. Reference it via <eventChannel>ChangeEvents</eventChannel> on members, but only custom (__chn) channels need a channel-meta file. |
PlatformEventChannelMember accepts ONLY four elements: <enrichedFields>, <eventChannel>, <filterExpression>, <selectedEntity> | Adding <description>, <isActive>, <masterLabel>, or any other element fails XML schema validation: "Element {...} invalid at this location". Stick to the four documented elements. |
PlatformEventChannel accepts ONLY two elements: <channelType> and <label> | Adding <masterLabel>, <description>, etc. produces "Element {...}masterLabel invalid at this location in type PlatformEventChannel". Use <label>, not <masterLabel>. |
Generated metadata files only — never run sf project deploy start from this skill | This skill produces artifacts; deployment is a separate lifecycle concern. |
Gotchas
| Issue | Resolution |
|---|---|
Unable to find the specified channel | Set <eventChannel>ChangeEvents</eventChannel> (no data/ prefix). |
The PlatformEventChannelMember can't be created because it references an invalid event in the "selectedEntity" field | Use the ChangeEvent name, not the source object: AccountChangeEvent, not Account. |
Cannot create a new component with the namespace: <Object> | Rename the file to use a single underscore: Account_ChangeEvent..., not Account__ChangeEvent.... |
The selected field, X.Y, isn't valid (in <enrichedFields>) | Replace Owner.Name with OwnerId. CDC enriches the lookup automatically; only single-hop field API names validate. |
filter expression has syntax errors: unexpected token: 'WHERE' | Remove the WHERE keyword. The body is the predicate only. |
The BillingCity field in the filter expression is invalid (or any flat Address component) | Use the compound dotted form: BillingAddress.City, not BillingCity. See references/filter-expressions.md for the full compound-field matrix. |
| Custom-object member fails with "ChangeEvent doesn't exist" | The source object isn't deployed yet. Ensure the Foo__c object metadata is in the same deploy or already in the org. |
DUPLICATE_VALUE on second deploy | The member is already subscribed. Either delete first or skip — CDC doesn't support upsert on members directly. |
sf infra error (TypeInferenceError, DeployMetadata): Could not infer a metadata type for a .changeDataCapture-meta.xml file | That file extension and metadata type don't exist. Replace the changeDataCapture/<Entity>.changeDataCapture-meta.xml file with a platformEventChannelMembers/<Entity>_ChangeEvent.platformEventChannelMember-meta.xml file. |
User says "subscribe Order__c" but means standard Order | Confirm — OrderChangeEvent (standard) and Order__ChangeEvent (custom) are different entities. |
Output Expectations
Deliverables:
- One
force-app/.../platformEventChannelMembers/<Entity>_ChangeEvent.platformEventChannelMember-meta.xmlper subscribed entity. - One
force-app/.../platformEventChannels/<DevName>__chn.platformEventChannel-meta.xmlper custom channel (if any).
File structure follows the templates in assets/.
After receiving the generated files, the user can verify them with sf project deploy start --dry-run -d <path> --target-org <alias> before deploying. If a dry-run surfaces an unfamiliar error, references/deploy-troubleshooting.md maps the common deploy errors to their metadata-side fixes.
Cross-Skill Integration
| Need | Delegate to |
|---|---|
| Generate the source custom object | platform-custom-object-generate skill |
| Generate custom fields referenced by enrichment or filter | platform-custom-field-generate skill |
| Build a permission set for users who consume change events | platform-permission-set-generate skill |
Reference File Index
| File | When to read |
|---|---|
assets/PlatformEventChannelMember-template.xml | Step 3 — starting structure for a channel member |
assets/PlatformEventChannel-template.xml | Step 4 — starting structure for a custom channel |
references/filter-expressions.md | Step 6 — for the supported operators and field-type matrix when writing a filter expression |
references/deploy-troubleshooting.md | When a user reports a dry-run deploy error and asks for help diagnosing it |
FAQ
What does the integration-eventing-cdc-configure skill do?
Use to enable Salesforce Change Data Capture (CDC) on a standard or custom object, configure a custom event channel, set a filter expression, or add enrichment fields. TRIGGER broadly on any of: 'enable CDC', 'enable Change Data Capture', 'turn on CDC', 'subscribe X to change events', 'only emit events for', 'filter change events', 'enrich change events', 'create a custom event channel'; or any mention of CDC, change events, PlatformEventChannel, PlatformEventChannelMember, EnrichedField, ChangeEvents channel, enrichment fields, change event filter; or when the user wants a downstream system to receive Salesforce data changes; or when the user touches .platformEventChannelMember-meta.xml / .platformEventChannel-meta.xml files. SKIP when publishing platform events, Pub/Sub API or REST/SOAP (use integration-connectivity-generate), or ManagedEventSubscription (out of scope for CDC). Always use this skill for CDC channel-membership metadata.
How do I install integration-eventing-cdc-configure?
Run npx skills add https://github.com/forcedotcom/sf-skills --skill integration-eventing-cdc-configure in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/integration-eventing-cdc-configure/ (personal) or .claude/skills/integration-eventing-cdc-configure/ (project).
Which AI agents can use integration-eventing-cdc-configure?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is integration-eventing-cdc-configure safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains integration-eventing-cdc-configure?
It is published by forcedotcom in forcedotcom/sf-skills. It has 5,152 recorded installs.
More from forcedotcom/sf-skills
platform-apex-generate
forcedotcom/sf-skills
Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex.
platform-apex-test-generate
forcedotcom/sf-skills
Use to generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking, assertions, and disciplined test-fix loops. Use when creating Apex test classes (for triggers, services, controllers, batch jobs, queueables, and callouts), improving coverage, debugging or fixing failing Apex tests, or running test/coverage analysis. Triggers on Test.cls files, sf apex run test, coverage reports. Do NOT trigger for production Apex (use platform-apex-generate) or Jest/LWC tests.
platform-apex-test-run
forcedotcom/sf-skills
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Use when the user runs Apex tests, checks code coverage, fixes failing tests, or touches Test.cls / Test.cls files. DO NOT TRIGGER when writing Apex production code (use platform-apex-generate), Agentforce agent testing (use agentforce-test), or Jest/LWC tests (use experience-lwc-generate).
platform-apex-logs-debug
forcedotcom/sf-skills
Salesforce debug log analysis and troubleshooting with 100-point scoring. TRIGGER when: user analyzes debug logs, hits governor limits, reads stack traces, or touches .log files from Salesforce orgs. DO NOT TRIGGER when: running Apex tests (use platform-apex-test-run), generating or fixing Apex code (use platform-apex-generate), or Agentforce session tracing (use agentforce-observe).
platform-soql-query
forcedotcom/sf-skills
Use when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan/selectivity analysis, and performance or safety improvements. TRIGGER when the user writes, optimizes, or debugs SOQL/SOSL, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER for bulk data operations (use platform-data-manage), Apex DML logic (use platform-apex-generate), or report/dashboard queries.
platform-metadata-deploy
forcedotcom/sf-skills
Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, validates a deploy or does a dry-run, deploys to a Production org, quick-deploys a validated job ID, ships/promotes to prod, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex code, building LWC components (use experience-lwc-generate), creating metadata definitions (use platform-custom-object-generate), deleting metadata from an org (use platform-destructive-deploy), or querying org data (use platform-data-manage).
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.