/salesforce-pack:salesforce-multi-env-setupfrom salesforce-pack
Configures Salesforce across Developer, Sandbox, and Production orgs with environment-specific credentials, login URLs, and sandbox-to-production promotion flows.
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.
Configure Salesforce integrations across Developer, Sandbox, and Production orgs with environment-specific credentials, login URLs, and deployment promotion flows.
| Environment | Org Type | Login URL | Purpose | Data |
|---|---|---|---|---|
| Development | Developer Edition or Scratch Org | login.salesforce.com | Local dev | Sample data |
| QA | Developer Sandbox | test.salesforce.com | Testing | Subset of prod |
| Staging | Full Sandbox | test.salesforce.com | Pre-prod validation | Copy of prod |
| Production | Production Org | login.salesforce.com | Live traffic | Real data |
| Sandbox Type | Data | Metadata | Refresh Interval | Use Case |
|---|---|---|---|---|
| Developer | None | Copy of prod | 1 day | Feature development |
| Developer Pro | None | Copy of prod | 1 day | Integration testing |
| Partial Copy | Sampled | Copy of prod | 5 days | QA with realistic data |
| Full | Full copy | Copy of prod | 29 days | Staging, UAT, load testing |
// src/config/salesforce.ts
interface SalesforceEnvConfig {
loginUrl: string;
username: string;
apiVersion: string;
isSandbox: boolean;
}
const envConfigs: Record<string, SalesforceEnvConfig> = {
development: {
loginUrl: 'https://login.salesforce.com', // Or test.salesforce.com for sandbox
username: process.env.SF_USERNAME_DEV!,
apiVersion: '59.0',
isSandbox: false, // true if using a sandbox for dev
},
staging: {
loginUrl: 'https://test.salesforce.com', // ALL sandboxes use test.salesforce.com
username: process.env.SF_USERNAME_STAGING!,
apiVersion: '59.0',
isSandbox: true,
},
production: {
loginUrl: 'https://login.salesforce.com',
username: process.env.SF_USERNAME_PROD!,
apiVersion: '59.0',
isSandbox: false,
},
};
export function getSalesforceConfig(): SalesforceEnvConfig {
const env = process.env.NODE_ENV || 'development';
const config = envConfigs[env];
if (!config) throw new Error(`No Salesforce config for environment: ${env}`);
return config;
}
# Authenticate to each environment with aliases
sf org login web --alias sf-dev --instance-url https://login.salesforce.com
sf org login web --alias sf-staging --instance-url https://test.salesforce.com
sf org login web --alias sf-prod --instance-url https://login.salesforce.com
# For CI — use JWT (no browser needed)
sf org login jwt \
--client-id $SF_CLIENT_ID \
--jwt-key-file server.key \
--username [email protected] \
--alias sf-staging \
--instance-url https://test.salesforce.com
# List all authenticated orgs
sf org list --all
# Set default org
sf config set target-org sf-dev
# Local development — .env.local (git-ignored)
SF_LOGIN_URL=https://test.salesforce.com
[email protected]
SF_PASSWORD=devpassword
SF_SECURITY_TOKEN=devtoken
# CI/CD (GitHub Actions)
# Use environment-specific secrets:
# Settings > Environments > "staging" > Add secret SF_USERNAME
# Settings > Environments > "production" > Add secret SF_USERNAME (different value)
# Production (Vault / Secrets Manager)
# AWS:
aws secretsmanager get-secret-value --secret-id salesforce/production
# GCP:
gcloud secrets versions access latest --secret=sf-prod-credentials
# HashiCorp Vault:
vault kv get -field=password secret/salesforce/production
# 1. Develop in scratch org or developer sandbox
sf project deploy start --target-org sf-dev
# 2. Run Apex tests in dev
sf apex run test --target-org sf-dev --result-format human
# 3. Deploy to staging sandbox
sf project deploy start --target-org sf-staging --test-level RunLocalTests
# 4. Run integration tests against staging
SF_LOGIN_URL=https://test.salesforce.com npm run test:integration
# 5. Deploy to production (requires test coverage)
sf project deploy start --target-org sf-prod --test-level RunLocalTests --wait 30
# Rollback if needed
sf project deploy cancel --target-org sf-prod
// Prevent destructive operations in production
function guardProductionOperation(operation: string): void {
const config = getSalesforceConfig();
if (!config.isSandbox && process.env.NODE_ENV === 'production') {
const blocked = ['deleteAllAccounts', 'truncateContacts', 'resetData'];
if (blocked.includes(operation)) {
throw new Error(`Operation '${operation}' blocked in production Salesforce org`);
}
}
}
// Prevent using production credentials in dev
function validateEnvironment(): void {
const config = getSalesforceConfig();
if (process.env.NODE_ENV === 'development' && !config.isSandbox) {
console.warn('WARNING: Development mode connected to production org!');
}
}
| Issue | Cause | Solution |
|---|---|---|
INVALID_LOGIN in sandbox | Wrong login URL | Use test.salesforce.com for ALL sandboxes |
| Sandbox username format | Missing .sandbox suffix | Username format: [email protected] |
| Config merge fails | Wrong NODE_ENV | Verify environment variable |
| Production guard triggered | Destructive operation | Use sandbox for testing |
For observability setup, see salesforce-observability.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub flight505/skill-forge --plugin salesforce-pack30 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-architecture-variantsChoose and implement Salesforce integration architecture patterns for different scales.
Use when designing new Salesforce integrations, choosing between polling/event-driven/Heroku Connect,
or planning migration paths for Salesforce applications.
Trigger with phrases like "salesforce architecture", "salesforce integration pattern",
"how to structure salesforce integration", "salesforce event-driven", "salesforce Heroku Connect".
/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".
/salesforce-core-workflow-aExecute Salesforce CRUD operations on standard sObjects with SOQL and REST API.
Use when creating, reading, updating, or deleting Accounts, Contacts, Leads,
or Opportunities via the Salesforce API.
Trigger with phrases like "salesforce CRUD", "salesforce create record",
"salesforce update account", "salesforce SOQL query", "salesforce REST API".
/salesforce-core-workflow-bExecute Salesforce Bulk API 2.0 and Composite API operations for high-volume data.
Use when importing/exporting large datasets, performing multi-object transactions,
or chaining dependent API calls.
Trigger with phrases like "salesforce bulk API", "salesforce composite",
"salesforce batch", "salesforce mass import", "salesforce large data".
Other plugins' skills for the same job