Org-based vs package-based development models, sandbox strategies, Quick Deploy, and rollback planning
From claude-sfdx-iqnpx claudepluginhub bhanu91221/claude-sfdx-iq --plugin claude-sfdx-iqThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Salesforce deployment strategy determines how metadata moves from development through testing to production. Choosing the right model -- org-based development, unlocked packages, or second-generation managed packages -- depends on team size, release cadence, and ISV requirements. This skill covers each model, sandbox topology, and operational deployment practices.
The traditional model where a sandbox is the source of truth. Developers work in sandboxes and deploy changesets or source to higher environments.
When to use:
Workflow:
sf project deploy start# Source deploy to target org
sf project deploy start --source-dir force-app --target-org production --test-level RunLocalTests
# Validate only (does not deploy)
sf project deploy start --source-dir force-app --target-org production --test-level RunLocalTests --dry-run
# Quick Deploy after successful validation
sf project deploy quick --job-id 0Af...
Metadata is organized into packages defined in sfdx-project.json. Each package is independently versioned and deployable.
When to use:
Advantages:
| Factor | Org-Based | Unlocked Packages | Managed 2GP |
|---|---|---|---|
| Source of truth | Sandbox | VCS + Package | VCS + Package |
| Versioning | Manual | Automatic | Automatic |
| Dependency mgmt | None | Declared | Declared |
| Namespace | None | Optional | Required |
| ISV distribution | No | No | Yes |
| Rollback | Manual | Uninstall version | Uninstall version |
| Team size sweet spot | 1-3 | 4-15 | ISV teams |
Production
|
+-- Full Copy Sandbox (Staging/Pre-Prod)
| - Full data copy, same config as prod
| - Final validation before production deploy
| - Refresh cycle: quarterly
|
+-- Partial Copy Sandbox (UAT)
| - Subset of data via sandbox template
| - Business user acceptance testing
| - Refresh cycle: monthly
|
+-- Developer Pro Sandbox (Integration/QA)
| - No data, config only
| - Integration testing, CI target
| - Refresh cycle: daily available
|
+-- Developer Sandbox (per developer)
- No data, config only
- Individual development
- Refresh cycle: daily available
| Sandbox Type | Storage | Data | Refresh | Use Case |
|---|---|---|---|---|
| Developer | 200 MB | None | 1/day | Individual dev work |
| Developer Pro | 1 GB | None | 1/day | CI builds, integration tests |
| Partial Copy | 5 GB | Template | 5/day | UAT with realistic data |
| Full Copy | Match prod | Full | 29 days | Staging, performance testing |
After sandbox refresh or creation, seed reference data:
# Export data from source org
sf data export tree --query "SELECT Id, Name, Type FROM Account WHERE Type = 'Reference'" --output-dir data/seed --target-org source
# Import into target sandbox
sf data import tree --plan data/seed/Account-plan.json --target-org target-sandbox
with sharing used# Deploy specific directory
sf project deploy start --source-dir force-app --target-org myorg
# Deploy with manifest
sf project deploy start --manifest manifest/package.xml --target-org myorg
# Deploy with specific test classes
sf project deploy start --source-dir force-app --target-org myorg \
--test-level RunSpecifiedTests \
--tests AccountServiceTest --tests ContactServiceTest
# Validate without deploying (dry run)
sf project deploy start --source-dir force-app --target-org myorg \
--test-level RunLocalTests --dry-run
# Quick Deploy (after validation within 10 days)
sf project deploy quick --job-id 0Af1234567890AB --target-org myorg
# Check deploy status
sf project deploy report --job-id 0Af1234567890AB --target-org myorg
| Level | Description | When to Use |
|---|---|---|
| NoTestRun | Skip tests | Sandbox deploys only |
| RunSpecifiedTests | Run named tests | When you know affected tests |
| RunLocalTests | All non-managed tests | Production deploys (standard) |
| RunAllTestsInOrg | All tests including managed | Rare, performance impact |
Quick Deploy allows skipping test execution if a validation-only deployment completed successfully within the last 10 days.
Requirements:
# Step 1: Validate
sf project deploy start --source-dir force-app --target-org prod \
--test-level RunLocalTests --dry-run
# Step 2: Note the Job ID from output
# Step 3: Quick deploy (within 10 days)
sf project deploy quick --job-id 0Af1234567890AB --target-org prod
Strategy 1: Reverse Deployment Deploy the previous version of changed components from version control.
# Checkout previous version
git checkout HEAD~1 -- force-app/main/default/classes/AccountService.cls
git checkout HEAD~1 -- force-app/main/default/classes/AccountService.cls-meta.xml
# Deploy the previous version
sf project deploy start --source-dir force-app --target-org prod --test-level RunLocalTests
Strategy 2: Destructive Changes Remove components that were newly added.
<!-- destructiveChanges.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>NewBrokenClass</members>
<name>ApexClass</name>
</types>
<version>62.0</version>
</Package>
sf project deploy start --manifest manifest/package.xml \
--post-destructive-changes manifest/destructiveChanges.xml \
--target-org prod
Strategy 3: Package Version Rollback (Unlocked Packages)
# Install previous package version
sf package install --package 04t... --target-org prod --wait 20
| Change Type | Rollback Method | Risk |
|---|---|---|
| Apex class modification | Reverse deploy from VCS | Low |
| New Apex class | Destructive change | Low |
| Field addition | Cannot easily remove if data exists | High |
| Field deletion | Cannot undo | Critical -- never delete without backup |
| Workflow/Flow change | Reverse deploy | Medium |
| Profile/Permission changes | Reverse deploy | Medium |
| Custom object deletion | Cannot undo | Critical |
# Tag the release
git tag -a v1.2.0 -m "Production release 2026-03-16"
git push origin v1.2.0
NoTestRun for production