Deployments
Deploy metadata between Salesforce orgs. AI handles the CLI commands, validation, and flags the things that could go wrong.
Skill Details
Install this skill
Works with
Use this skill when the user needs deployment orchestration: dry-run validation, targeted or manifest-based deploys, CI/CD workflow advice, scratch-org management, failure triage, or safe rollout sequencing for Salesforce metadata.
When This Skill Owns the TaskWorkflow
Use sf-deploy when the work involves:
sf project deploy start,quick,report, or retrieval workflows- release sequencing across objects, permission sets, Apex, and Flows
- CI/CD gates, test-level selection, or deployment reports
- troubleshooting deployment failures and dependency ordering
Delegate elsewhere when the user is:
- authoring Apex or LWC code → sf-apex, sf-lwc
- creating metadata definitions → sf-metadata
- building Flows → sf-flow
- doing org data operations → sf-data
- authoring Agent Script logic → sf-ai-agentscript
Critical Operating Rules
- Use
sfCLI v2 only. - On non-source-tracking orgs, deploy/retrieve commands require an explicit scope such as
--source-dir,--metadata, or--manifest. - Prefer
--dry-runfirst before real deploys. - For Flows, deploy safely and activate only after validation.
- Keep test-data creation guidance delegated to
sf-dataafter metadata is validated or deployed.
Default deployment order
| Phase | Metadata | |
|---|---|---|
| 1 | Custom objects / fields | |
| 2 | Permission sets | |
| 3 | Apex | |
| 4 | Flows as Draft | |
| 5 | Flow activation / post-verify | |
| Error / symptom | Likely cause | Default fix direction |
FIELD_CUSTOM_VALIDATION_EXCEPTION | validation rule or bad test data | adjust data or rule timing |
INVALID_CROSS_REFERENCE_KEY | missing dependency | include referenced metadata first |
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY | trigger / Flow / validation side effect | inspect automation stack and failing logic |
| tests fail during deploy | broken code or fragile tests | run targeted tests, fix root cause, revalidate |
| field/object not found in permset | wrong order | deploy objects/fields before permission sets |
| Flow invalid / version conflict | dependency or activation problem | deploy as Draft, verify, then activate |
| Need | Delegate to | Reason |
| custom object / field creation | sf-metadata | define metadata before deploy |
| Apex compile / review / fixes | sf-apex | code authoring and repair |
| Flow creation / repair | sf-flow | Flow authoring and activation guidance |
| test data or seed records | sf-data | describe-first data setup and cleanup |
| Agent Script build/publish readiness | sf-ai-agentscript | agent-specific correctness |
| Score | Meaning | |
| 90+ | strong deployment plan and execution guidance | |
| 75–89 | good deploy guidance with minor review items | |
| 60–74 | partial coverage of deployment risk | |
| < 60 | insufficient confidence; tighten plan before rollout |
Completion Format
Deployment goal: <validate / deploy / retrieve / pipeline>
Target org: <alias>
Scope: <source-dir / metadata / manifest>
Result: <passed / failed / partial>
Key findings: <errors, ordering, tests, skipped items>
Next step: <safe follow-up action>
More in Apex & Flow
Apex Code
Write custom Apex classes, triggers, and batch jobs. Describe what you need in plain English and AI builds production-ready Salesforce code.
Debug Logs
Read and analyze Salesforce debug logs. Paste the error, AI finds the root cause and tells you exactly what to fix.
Flow Builder
Build record-triggered and screen flows. Describe your business logic and AI generates the flow structure with best practices built in.
Navigate Apex & Flow