grzmol/vibe-force/sf-deployment-strategies
Claude Code and agent skill by grzmol/vibe-force
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Covers how Salesforce metadata reaches an org — source deploy versus Metadata API versus change sets versus DevOps Center versus packaging, the full sf project deploy start flag surface, validate plus quick deploy as the production path, test levels and coverage rules, destructive changes, per-metadata-type deployment gotchas (Profiles, Flows, custom settings, record types, picklists, sharing rules, layouts, translations), environment promotion pipelines with git branching, drift and conflict detection, rollback reality, zero-downtime schema and Apex change patterns, CI/CD wiring, and the deployment error catalogue. Use this skill when a task mentions sf project deploy start, deploy validate, deploy quick, --test-level, RunLocalTests, destructiveChanges.xml, package.xml manifests, quick deploy job ids, deployment failures, promoting to production, rollback, or the vf-check deploy-validate / deploy-quick / verify checks.
Install
npx vskill@latest install grzmol/vibe-force/sf-deployment-strategiesSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as grzmol/vibe-force/sf-deployment-strategies.
Salesforce Deployment Strategies
How vibe-force gets metadata into an org safely. Wave 3 of the harness workflow is exactly two serial steps — deploy-validate then deploy-quick — and this skill explains why, what they enforce, and everything that goes wrong around them.
API version for all examples: 67.0 (Summer '26), the apiVersion value in config/vibe-force.defaults.json.
When to use
- Building or debugging any
sf project deploy *invocation. - Deciding a test level and proving the coverage rule that applies to it.
- Deleting metadata (destructive changes) or deploying a type with known gotchas.
- Designing dev -> integration -> UAT -> production promotion and its git branching.
- Detecting drift between repo and org, or resolving source-tracking conflicts at deploy time.
- Planning a rollback, a forward-fix, or a zero-downtime schema/Apex change.
- Wiring CI/CD gates around
vf-check deploy-validate/deploy-quick/verify. - Not for scratch org or sandbox provisioning (skill
sf-scratch-orgs-sandboxes), not for
package versions (skill sf-packaging-release), not for writing the tests themselves (skill sf-apex-testing).
Decision table: which delivery mechanism
| Mechanism | Use when | Avoid when | |
|---|---|---|---|
sf project deploy start (source format) | Default for everything in this harness: dev, integration, UAT | You need a validated-then-quick production deploy | |
sf project deploy validate + sf project deploy quick | Production. Long test runs you cannot afford to fail at the end of a change window | Sandboxes — validate/quick are documented as production-only | |
sf project deploy start --metadata-dir <dir> | You hold a metadata-format ZIP/dir from another tool | Source-format projects (the normal case) | |
| Change sets | Admin-only, one-off, click-path change with no repo | Anything the repo owns; there is no review, diff, or replay | |
| DevOps Center | Org-centric teams that want a UI over git work items | Agent-driven pipelines that need deterministic CLI exit codes | |
| Unlocked / managed packages | Versioned, installable artifacts with an upgrade path | Fast iteration inside one org; see skill sf-packaging-release |
Test levels
| Level | Runs | Coverage rule | Allowed on | |
|---|---|---|---|---|
NoTestRun | nothing | none | Development environments only (sandbox, DE, trial). Default for development environments. Not accepted by deploy validate | |
RunSpecifiedTests | only --tests | each class and each trigger in the deployment package must reach 75% individually | any | |
RunLocalTests | all org tests except those from installed managed and unlocked packages | org-wide 75% overall, and Apex triggers must have some coverage | any; default for production deploys that include Apex, and the default for deploy validate | |
RunAllTestsInOrg | all tests including managed package tests | as RunLocalTests | any | |
RunRelevantTests (Beta) | tests Salesforce infers from the payload and its dependencies | each class and trigger in the package must reach 75% individually | any |
Default behaviour when --test-level is omitted depends on the payload and the target org. For a production deploy, all non-managed tests run if the package contains Apex classes or triggers; if the package has no Apex components, no tests run (API 34.0 and later). Never rely on that inference in automation — always pass --test-level explicitly. config/vibe-force.defaults.json pins testLevels.sandbox and testLevels.production to RunLocalTests.
--tests is space- or repeat-separated, not comma-separated: --tests AccountServiceTest ContactServiceTest "Test With Space".
Core patterns
1. Everyday deploy (dev / integration / UAT)
Full flag table: references/deploy-command-reference.md.
2. Narrow the payload
--source-dir, --metadata, and --manifest are mutually exclusive within one command.
3. Preview and dry run before you commit
--dry-run validates and runs Apex tests but never saves. This — not deploy validate — is the supported way to validate against a sandbox. There is no --dry-run flag on sf project retrieve start; use sf project retrieve preview to see incoming drift.
4. Production: validate, then quick deploy
The validation job id is valid for 10 days. Quick deploy succeeds only if the validation succeeded, its Apex tests passed, and coverage requirements were met. --use-most-recent on deploy quick only searches validations from the past 3 days, so automation must persist the job id rather than rely on it. Runbook, state-file contract, and hook interaction: references/validate-quick-deploy.md.
vf-check deploy-validate writes {jobId, targetOrg, testLevel, validatedAt, expiresAt, sha} to <project>/.vibeforce/state/deploy-jobs.json; vf-check deploy-quick reads the newest non-expired entry for the target org. The vibe-force hooks refuse a deploy-quick (and a raw sf project deploy start) against any alias in productionAliases unless hooks.blockProductionDeploy is false or VF_ALLOW_PROD=1 is exported. VF_HOOK_MODE=off disables the guard entirely and should never be used in CI.
5. Async, report, resume, cancel
deploy report does not update source tracking; deploy resume does. Exit codes: Succeeded 0, Canceled 1, Failed 1, SucceededPartial 68, InProgress/Pending/Canceling 69.
6. Destructive changes
Deletions travel in a manifest alongside a package.xml. Wildcards are not supported in destructive manifests.
--pre-destructive-changes deletes before additions, --post-destructive-changes after — use post when the additions remove the dependency that blocks the delete (for example, updating an Apex class to stop referencing a field, then deleting the field in the same deploy). --purge-on-delete bypasses the Recycle Bin. --ignore-warnings is the one legitimate CI use of that flag: deleting a component that no longer exists in the org raises a warning that would otherwise mark the deploy unsuccessful.
The vibe-force hooks block any command carrying --pre-destructive-changes, --post-destructive-changes, or --purge-on-delete when hooks.blockDestructive is true (the default) unless the run is explicitly approved.
7. Per-type gotchas
Profiles, Flows, custom settings, record types, picklists, sharing rules, layouts, and translations each fail in their own way. One example, then the full table in references/metadata-gotchas.md:
If a FlowDefinition is part of the deployment, its activeVersionNumber wins over the status field in the flow. Deploying flowDefinitions with a stale number silently activates the wrong version.
8. Drift detection
Production never allows source tracking, so drift there is a git question, not a CLI question: keep a scheduled job that retrieves the manifest and fails the build on a non-empty diff.
9. Environment promotion
main is what production runs. Feature branches build in scratch orgs; merges promote forward through integration and UAT; production is a validate + quick deploy off the release tag. Branch model, GitHub Actions YAML, JWT auth, and per-stage gates: references/pipeline-and-cicd.md.
| Stage | Org | Command | Gate | |
|---|---|---|---|---|
| feature | scratch | deploy start --source-dir force-app | vf-check local | |
| integration | vf-int | deploy start --test-level RunLocalTests | vf-check local + vf-check apex | |
| UAT | vf-uat | deploy start --manifest ... --test-level RunLocalTests | vf-check verify | |
| production | vf-prod | deploy validate then deploy quick | vf-check deploy-validate -> deploy-quick -> verify |
10. Rollback reality
Salesforce has no native rollback. A failed deploy rolls back itself (unless --ignore-errors), but a successful deploy that turns out to be wrong cannot be undone by the platform. Four real options, in order of preference:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/sf-deployment-strategies/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/grzmol/vibe-force/sf-deployment-strategies)