nadolskimm-max/sf-skills/sf-deploy

Claude Code and agent skill by nadolskimm-max/sf-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Automates Salesforce metadata deployment using Salesforce CLI v2. Use when deploying metadata to orgs, running deploy validations, managing scratch orgs, creating packages, or troubleshooting deployment errors. Do NOT use for writing Apex/Flow/LWC code (use respective skills) or metadata generation (use sf-metadata).

Install

npx vskill@latest install nadolskimm-max/sf-skills/sf-deploy

SKILL.md

The same SKILL.md was published earlier as nadolskimm-max/sf-skills/sf-deploy.

Salesforce Deployment

Core Responsibilities

  1. Deploy metadata to sandboxes and production
  2. Run deployment validations (dry runs)
  3. Manage scratch org creation and configuration
  4. Troubleshoot deployment errors and test failures
  5. Automate CI/CD workflows

Workflow

Phase 1 — Validate

Always validate before deploying:

bash
# Validate deployment (dry run)
sf project deploy start --source-dir force-app --dry-run --test-level RunLocalTests --target-org <alias>
# Validate specific metadata
sf project deploy start --metadata ApexClass:MyService --dry-run --target-org <alias>
# Quick deploy after successful validation
sf project deploy quick --job-id <validationId> --target-org <alias>
Phase 2 — Deploy
bash
# Deploy all source
sf project deploy start --source-dir force-app --target-org <alias>
# Deploy with tests
sf project deploy start --source-dir force-app --test-level RunLocalTests --target-org <alias>
# Deploy specific types
sf project deploy start --metadata ApexClass,ApexTrigger,CustomObject --target-org <alias>
# Deploy to production (requires tests)
sf project deploy start --source-dir force-app --test-level RunLocalTests --target-org production
Phase 3 — Verify
bash
# Check deploy status
sf project deploy report --job-id <deployId> --target-org <alias>
# Resume a failed deploy
sf project deploy resume --job-id <deployId> --target-org <alias>
# Cancel an in-progress deploy
sf project deploy cancel --job-id <deployId> --target-org <alias>

Test Levels

LevelWhen to UseDescription
NoTestRunSandbox onlySkip all tests
RunSpecifiedTestsWhen you know which testsRun only listed tests
RunLocalTestsStandard deployRun all non-managed tests
RunAllTestsInOrgProduction (required)Run everything including managed

Scratch Org Management

bash
# Create scratch org
sf org create scratch --definition-file config/project-scratch-def.json --alias my-scratch --duration-days 7 --set-default
# Push source to scratch
sf project deploy start --source-dir force-app --target-org my-scratch
# Pull changes from scratch
sf project retrieve start --target-org my-scratch
# Open scratch org in browser
sf org open --target-org my-scratch
# List scratch orgs
sf org list --all
# Delete scratch org
sf org delete scratch --target-org my-scratch --no-prompt
Scratch Org Definition
json
{
"orgName": "My Project Scratch",
"edition": "Developer",
"features": ["EnableSetPasswordInApi", "Communities"],
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"securitySettings": {
"passwordPolicies": {
"enableSetPasswordInApi": true
}
}
}
}

Retrieve Metadata

bash
# Retrieve from org
sf project retrieve start --target-org <alias>
# Retrieve specific metadata
sf project retrieve start --metadata ApexClass:MyService --target-org <alias>
# Retrieve by package.xml
sf project retrieve start --manifest manifest/package.xml --target-org <alias>

Common Deployment Errors

ErrorCauseFix
MISSING_ORGANIZATION_FEATUREFeature not enabled in orgEnable feature in Setup or use correct org edition
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITYMissing dependencyDeploy dependencies first or include in same deploy
TEST_FAILURETests fail during deployFix tests locally, validate with dry-run first
UNKNOWN_EXCEPTIONOrg-specific issueCheck Setup Audit Trail, retry
DUPLICATE_VALUEMetadata already exists with conflictRetrieve from org, merge changes
FIELD_INTEGRITY_EXCEPTIONRequired field missing in metadataCheck XML for required attributes

CI/CD Pipeline Pattern

yaml
# Example GitHub Actions workflow
name: Deploy to Sandbox
on:
push:
branches: [develop]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install SF CLI
run: npm install -g @salesforce/cli
- name: Authenticate
run: sf org login jwt --client-id ${{ secrets.SF_CLIENT_ID }} --jwt-key-file server.key --username ${{ secrets.SF_USERNAME }} --instance-url https://test.salesforce.com --alias target
- name: Validate
run: sf project deploy start --source-dir force-app --dry-run --test-level RunLocalTests --target-org target
- name: Deploy
run: sf project deploy start --source-dir force-app --test-level RunLocalTests --target-org target

Cross-Skill References

  • For metadata to deploy: see sf-metadata, sf-apex, sf-flow, sf-lwc
  • For running tests during deploy: see sf-testing
  • For Connected App auth in CI/CD: see sf-connected-apps

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/nadolskimm-max/sf-skills/sf-deploy/badge)](https://verified-skill.com/skills/nadolskimm-max/sf-skills/sf-deploy)

Something wrong with this skill or its page? Tell us.