PranavNagrecha/AwesomeSalesforceSkills / skills/admin/deployment-risk-assessment
deployment-risk-assessment
VerifiedUse when a practitioner needs to classify the risk level of an upcoming Salesforce deployment, define rollback trigger conditions, or assign decision authority before the release window opens. Triggers: 'how risky is this release', 'what needs rollback planning', 'classify deployment risk', 'pre-deployment risk checklist', 'rollback decision authority', 'high risk metadata types'. NOT for executing the deployment itself, writing CI/CD pipeline code, or troubleshooting failures after a deployment has already run — use admin/change-management-and-deployment for execution planning and devops/deployment-error-troubleshooting for post-failure diagnosis.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 15.5 KB |
| references/examples.md | markdown | 4.9 KB |
| references/gotchas.md | markdown | 5.7 KB |
| references/llm-anti-patterns.md | markdown | 9.6 KB |
| references/well-architected.md | markdown | 5.2 KB |
| scripts/check_deployment_risk_assessment.pyexecutable | script | 10.5 KB |
| templates/deployment-risk-assessment-template.md | markdown | 4.5 KB |
references/examples.md
View on GitHub# Examples — Deployment Risk Assessment
## Example 1: Permissions Release Deployed Without Pre-Retrieve Backup
**Context:** A team needs to deploy an updated PermissionSet that adds field-level security access to a financial data object. The release is done via SFDX CLI deploy directly to production. The team has validated in a Full sandbox but did not capture the current production PermissionSet XML before opening the deployment window.
**Problem:** The deployment succeeds but the PermissionSet inadvertently grants access to a field that was previously restricted due to a profile-level override the team did not know existed. Within 30 minutes the team identifies the error and decides to roll back. There is no pre-retrieve backup of the prior PermissionSet XML. The team must reconstruct the prior XML from memory and from a partial sandbox capture that does not reflect production reality. The rollback takes 4 hours instead of 15 minutes.
**Solution:**
```bash
# Before opening ANY production deployment window, capture the current state of
# all components that will be overwritten. This is the rollback artifact.
# Retrieve the specific PermissionSet that will be modified
sf project retrieve start \
--metadata "PermissionSet:Financial_Data_Viewer" \
--target-org production \
--output-dir .rollback-backup/$(date +%Y-%m-%d)
# Confirm the retrieved XML matches what is actually in production
# Store the backup path in the release runbook with the timestamp
echo "Backup captured at .rollback-backup/$(date +%Y-%m-%d)" >> release-runbook.md
```
**Why it works:** The pre-retrieve backup creates a deployable artifact of the exact prior state. If rollback is needed, the team re-deploys the backed-up XML in the same way the forward deployment was done — no reconstruction required and no dependence on sandbox state.
---
## Example 2: HIGH-Risk Flow Deployed Without a Feature Flag Gate
**Context:** An operations team deploys a new version of a Record-Triggered Flow on the Opportunity object. The flow runs on every Opportunity update and changes how close date validation works. The change was validated in a sandbox but the sandbox data volume is 1% of production. No feature flag was used.
**Problem:** In production, the flow fires on a bulk import of 50,000 Opportunity records. The new close date validation logic throws an unhandled exception at scale, causing the import job to fail and leaving 30,000 records in an intermediate state. Rolling back requires re-deploying the prior Flow version (which the team has in source control) but the 30,000 partially processed records require manual data cleanup regardless.
**Solution:**
```xml
<!-- Deploy the new flow logic behind a Custom Permission gate.
The flow checks the permission before executing the new validation path. -->
<!-- In the Flow: add a Decision element at the start -->
<!-- Condition: $Permission.Enable_New_Close_Date_Validation == true -->
<!-- If false: take the existing path (old behavior) -->
<!-- If true: take the new validation path -->
<!-- Custom Permission XML (deploy alongside the Flow) -->
<?xml version="1.0" encoding="UTF-8"?>
<CustomPermission xmlns="http://soap.sforce.com/2006/04/metadata">
<description>Enables the new close date validation logic in the Opportunity flow</description>
<isLicensed>false</isLicensed>
<label>Enable New Close Date Validation</label>
</CustomPermission>
```
**Why it works:** The flow is deployed to production in the off state. Activation (granting the Custom Permission to a PermissionSet) is a separate, low-risk metadata update. If the new logic causes problems in production, rollback is a single Custom Metadata update to disable the permission — no flow re-deployment required, and the change takes effect immediately without a deployment window.
---
## Anti-Pattern: Treating "Roll Back If Needed" as a Rollback Plan
**What practitioners do:** Include a line in the release notes that says "If issues are found, we will roll back" without specifying observable trigger conditions, who has authority to make the call, or what the rollback procedure is.
**What goes wrong:** During the production incident, three things fail simultaneously: the team cannot agree on whether the symptoms are bad enough to trigger rollback (no agreed threshold), the person who knows the rollback procedure is not reachable (no alternate named), and the rollback itself takes longer than expected because the procedure was never rehearsed. The outage extends from 30 minutes to 3 hours.
**Correct approach:** Before the window opens, document: (1) the exact observable conditions that trigger a rollback call, for example error rate in the Apex debug log exceeds 5% on the affected object type; (2) the named individual with rollback authority and their named alternate; (3) the exact CLI command or UI steps to execute rollback with the estimated execution time; (4) the post-rollback smoke test to confirm the prior behavior is restored.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |