deploying-metadata

Orchestrate Salesforce metadata deployment with sf CLI v2 validate and deploy steps.

803|289|Updated Nov 7, 2025
One-click install
npx skills add https://github.com/forcedotcom/sf-skills --skill deploying-metadata
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deploying-metadata
Source: https://github.com/forcedotcom/sf-skills/tree/main/skills/deploying-metadata
Command: npx skills add https://github.com/forcedotcom/sf-skills --skill deploying-metadata

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill solves the problem of deploying Salesforce metadata reliably by providing a structured, validation-first workflow that reduces production risk and fixes common dependency and ordering failures.

Core Features & Use Cases

  • Dry-run validation orchestration: Run sf project deploy start --dry-run to catch errors before making changes.
  • Safe deploy + reporting flow: Deploy with appropriate test levels, then use sf project deploy report to clearly summarize results.
  • Deployment sequencing guidance: Enforce the correct internal order (Objects/Fields → Permission Sets → Apex → Flows as Draft → Flow activation) to prevent dependency failures.
  • CI/CD and scratch-org oriented guidance: Support pipeline shapes, org preflight checks, and failure triage for common deployment errors.

Quick Start

Provide your target org alias and request a dry-run validation to verify that your metadata deployment will succeed.

Frequently Asked Questions about deploying-metadata

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate Salesforce metadata before deploying to production?

Salesforce metadata validation uses a dry-run command to execute a pre-deployment check. Running `sf project deploy start --dry-run` catches dependency errors and validates metadata sequencing without applying changes to the target environment.

What is the correct deployment sequence for Salesforce metadata components?

The correct Salesforce metadata deployment sequence is Objects/Fields first, followed by Permission Sets, then Apex classes, and finally Flows deployed as Draft before activation. This internal ordering prevents dependency failures during CI/CD pipeline execution.

Why does my Salesforce metadata deployment fail in a CI/CD pipeline?

Salesforce metadata deployments often fail in CI/CD pipelines due to incorrect component ordering, missing dependencies, or inadequate test levels. Using a validation-first workflow with dry-run checks identifies these errors before triggering actual deployment failures.

How do I retrieve a Salesforce deployment report after starting a job?

You retrieve a Salesforce deployment report by running the `sf project deploy report` command with the specific job ID. This summarizes deployment results, verifies component success, and guides quick deploy actions for validated changes.

Can I use sf CLI v2 for scratch-org metadata deployment and troubleshooting?

Yes, sf CLI v2 supports scratch-org metadata deployment by orchestrating validate, deploy, and verify steps. It handles scratch-org preflight checks, applies appropriate test levels, and provides failure triage for common deployment errors.