/salesforce-pack:salesforce-architecture-variantsfrom salesforce-pack
Provides three validated Salesforce integration architecture blueprints: Direct API (simple), Event-Driven (scalable), and Middleware/iPaaS (enterprise). Helps choose between polling, CDC events, and Heroku Connect based on data volume and sync requirements.
Ships in salesforce-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Three validated architecture blueprints for Salesforce integrations: Direct API (simple), Event-Driven (scalable), and Middleware/iPaaS (enterprise). Each pattern addresses different scale, latency, and complexity requirements.
Best for: MVPs, < 50K records/day, single-direction sync
┌─────────────┐ jsforce ┌─────────────┐
│ Your App │ ──── REST API ──▶ │ Salesforce │
│ (Node.js) │ ◀── SOQL/SOSL ── │ Org │
└─────────────┘ └─────────────┘
Data flow:
- App queries SF via SOQL (polling or on-demand)
- App writes to SF via sObject CRUD
- Scheduled cron for periodic sync
// Cron-based sync — runs every 15 minutes
import cron from 'node-cron';
cron.schedule('*/15 * * * *', async () => {
const conn = await getConnection();
// Fetch recently modified accounts
const accounts = await conn.query(`
SELECT Id, Name, Industry, AnnualRevenue
FROM Account
WHERE LastModifiedDate >= ${fifteenMinutesAgo}
`);
// Sync to local database
for (const account of accounts.records) {
await localDb.upsert('accounts', mapFromSalesforce(account));
}
});
Best for: Real-time sync, 50K-5M records/day, bidirectional flow
┌─────────────┐ ┌─────────────┐
│ Your App │ ◀─── CDC Events ─── │ Salesforce │
│ (listener) │ Change Data Capture │ Org │
│ │ │ │
│ │ ── Bulk API 2.0 ──▶ │ │
│ │ (write-back) │ │
└──────┬──────┘ └─────────────┘
│
┌────▼────┐
│ Queue │ (Redis/SQS/Pub-Sub)
│ (async │
│ writes)│
└─────────┘
// Event-driven — near-real-time sync
import { getConnection } from './salesforce/connection';
const conn = await getConnection();
// Subscribe to Account changes via CDC
conn.streaming.topic('/data/AccountChangeEvent').subscribe(async (event) => {
const { changeType, recordIds, changedFields } = event.payload.ChangeEventHeader;
switch (changeType) {
case 'CREATE':
await localDb.insert('accounts', mapFromSalesforce(event.payload));
break;
case 'UPDATE':
await localDb.update('accounts', recordIds[0], mapChangedFields(event.payload, changedFields));
break;
case 'DELETE':
await localDb.delete('accounts', recordIds[0]);
break;
}
});
// Write-back via queue (async, decoupled)
queue.process('sync-to-salesforce', async (job) => {
const conn = await getConnection();
await conn.sobject(job.data.objectType).upsert(
job.data.records,
'External_ID__c'
);
});
Best for: Multi-system integration, 5M+ records/day, complex transformations
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Your App │ ── API ──────▶ │ Middleware │ ── REST ────▶ │ Salesforce │
│ │ │ (MuleSoft/ │ │ Org │
│ │ │ Workato/ │ ◀─ CDC ──────│ │
│ │ ◀─ Webhooks ── │ Zapier) │ │ │
└─────────────┘ └──────┬───────┘ └─────────────┘
│
┌─────▼──────┐
│ Other │
│ Systems │
│ (ERP, DW, │
│ Marketing) │
└─────────────┘
| Platform | Salesforce Integration | Best For |
|---|---|---|
| MuleSoft | Native (Salesforce owns it) | Enterprise, complex flows |
| Heroku Connect | Bi-directional auto-sync | Simple sync to Postgres |
| Workato | Pre-built recipes | Business user automation |
| Zapier | Trigger-based | Simple 1:1 integrations |
| Dell Boomi | Enterprise iPaaS | Legacy system integration |
| Factor | Direct API (A) | Event-Driven (B) | Middleware (C) |
|---|---|---|---|
| Records/day | < 50K | 50K-5M | 5M+ |
| Latency | Minutes (polling) | Seconds (CDC) | Depends on config |
| Direction | Usually one-way | Bidirectional | Multi-directional |
| API call efficiency | Medium | High (no polling) | High (batched) |
| Complexity | Low | Medium | Low (config-driven) |
| Cost | jsforce only | jsforce + queue infra | iPaaS license ($$$) |
| SF Edition required | Any with API | Enterprise+ (CDC) | Any |
| Team skills | Node.js developers | Node.js + streaming | Business analysts OK |
Variant A (Direct API)
│
│ Growing data volume / need real-time sync
▼
Variant B (Event-Driven)
│
│ Multiple systems / compliance / no-code needed
▼
Variant C (Middleware/iPaaS)
| Issue | Cause | Solution |
|---|---|---|
| Polling misses changes | Interval too long | Switch to CDC (Variant B) |
| CDC events lost | No replay tracking | Persist last replayId |
| API limits exhausted | Polling too frequently | Batch with Collections/Bulk API |
| Middleware cost too high | Over-engineered | Start with Variant A or B |
For common anti-patterns, see salesforce-known-pitfalls.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
30 skills in this plugin
/salesforce-advanced-troubleshootingApply Salesforce advanced debugging with debug logs, SOQL query plans, and EventLogFile analysis.
Use when standard troubleshooting fails, investigating SOQL performance issues,
or analyzing Apex governor limit violations.
Trigger with phrases like "salesforce hard bug", "salesforce debug log",
"salesforce governor limit", "salesforce query plan", "salesforce deep debug", "SOQL slow".
/salesforce-ci-integrationConfigure Salesforce CI/CD with GitHub Actions, SFDX deployments, and Apex testing.
Use when setting up automated testing, configuring CI pipelines for metadata deployment,
or integrating Salesforce tests into your build process.
Trigger with phrases like "salesforce CI", "salesforce GitHub Actions",
"salesforce automated tests", "CI salesforce", "sfdx deploy CI".
/salesforce-common-errorsDiagnose and fix Salesforce common errors, SOQL issues, and API exceptions.
Use when encountering Salesforce errors, debugging failed requests,
or troubleshooting integration issues.
Trigger with phrases like "salesforce error", "fix salesforce",
"salesforce not working", "debug salesforce", "SOQL error", "salesforce exception".
npx claudepluginhub flight505/skill-forge --plugin salesforce-packOther plugins' skills for the same job