forcedotcom/sf-skills / plugins/builder/dx-org-lifecycle/skills/automation-sandbox-post-copy-configure
automation-sandbox-post-copy-configure
VerifiedApply a Salesforce sandbox post-copy automation JSON config against a target org. Use when the user asks to apply, run, execute, dry-run, or preview a post-copy or post-refresh config file (e.g. `post-copy-config.json`) against a sandbox — including activating/deactivating a Flow (PATCH `FlowDefinition.Metadata.activeVersionNumber` to the version, or `null`), re-pointing an OBM endpoint, updating a RemoteSiteSetting URL, or re-scheduling a ScheduledApex job after refresh. Also trigger for phrasings like "apply post-copy config", "run post-copy automation", "activate Flow <name> post-refresh", "deactivate Flow <name>", "re-point outbound messages after refresh", or "configure sandbox after refresh". Per entry, derive the Tooling API sobject, verify via describe, resolve the Id via SOQL, then PATCH the compound `Metadata` field (`ScheduledApex` uses anonymous Apex). DO NOT TRIGGER for generating config JSON from an SOP (use `automation-sandbox-post-copy-config-generate`) or for deploying metadata XML.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 21.3 KB |
| assets/api_request_templates.json | config | 4.2 KB |
| examples/sample_config_input.json | config | 1.1 KB |
| examples/sample_execution_summary.md | markdown | 4.0 KB |
| references/api_endpoints.md | markdown | 10.7 KB |
| references/authentication.md | markdown | 2.9 KB |
| references/execution_phasing.md | markdown | 3.6 KB |
| references/flow_activation_path.md | markdown | 7.1 KB |
| references/rules_gotchas.md | markdown | 3.5 KB |
| references/scheduled_apex_path.md | markdown | 8.1 KB |
| scripts/build-scheduled-apex.mjsexecutable | script | 2.2 KB |
| scripts/classify-patch-result.mjsexecutable | script | 3.1 KB |
| scripts/map-metadata-key.mjsexecutable | script | 3.4 KB |
| scripts/plan-phases.mjsexecutable | script | 2.8 KB |
| scripts/resolve-target-org.mjsexecutable | script | 1.9 KB |
| scripts/soql-escape-job-name.mjsexecutable | script | 1.0 KB |
assets/api_request_templates.json
View on GitHub{
"note": "Generic template — this skill does not carry a per-ConfigurationName mapping. Every entry runs through the same 5-step recipe. Replace only the documented placeholders; do not add per-type keys here. See references/api_endpoints.md for the walkthrough.",
"stepA_deriveCandidate": {
"input": "ConfigurationName from the config entry",
"output": "<Candidate> — one or two plausible Tooling API sobject names, using Salesforce knowledge (usually the singular of ConfigurationName, sometimes with a Workflow- prefix or -Proxy suffix)",
"note": "Do not commit to a candidate here; Step B verifies against the live org."
},
"stepB_describeVerify": {
"method": "GET",
"path": "/services/data/<apiVersion>/tooling/sobjects/<Candidate>/describe/",
"acceptIf": [
"HTTP 200",
"response.fields[] contains an entry with name == 'Metadata'"
],
"rejectOutcome": "API_NOT_IDENTIFIED",
"note": "Cache the verified sobject name per-ConfigurationName; do not re-describe on every entry."
},
"stepC_resolveId": {
"channel": "Tooling API SOQL over REST",
"soql": "SELECT Id, FullName FROM <VerifiedSobject> WHERE <UniqueFilter>",
"uniqueFilterHints": {
"rowExposesFullName": "Filter by EntityDefinition.QualifiedApiName = '<Fields.Object>' when the entry has Fields.Object, then pick the row whose FullName == '<Fields.Object>.<Label>' client-side (SOQL cannot filter on FullName).",
"rowExposesQueryableUniqueField": "Filter directly by that field = '<Label>' (e.g. SiteName, DeveloperName)."
},
"outcomes": {
"zeroRows": "NOT_FOUND",
"multipleRowsAfterFilter": "AMBIGUOUS",
"exactlyOneRow": "proceed to Step D"
}
},
"stepD_getPatch": {
"getCurrentMetadata": {
"method": "GET",
"path": "/services/data/<apiVersion>/tooling/sobjects/<VerifiedSobject>/<Id>",
"extract": ".Metadata",
"note": "Preserve every key already in this block — the Metadata field is replace-in-full on PATCH."
},
"fieldMapping": {
"convention": "camelCase (lowercase first letter of the config's Fields.<Xxx> key)",
"examples": {
"EndpointUrl": "endpointUrl",
"IsActive": "isActive",
"Description": "description"
},
"exceptionsNote": "Some ConfigurationName types rename fields between the customer-facing config and the Metadata API (e.g. RemoteSiteSettings.Fields.RemoteSiteUrl -> RemoteProxy.Metadata.url, not remoteSiteUrl). If the derived camelCase key is NOT present in the current Metadata block from the GET, mark the entry FIELD_MAP_UNKNOWN and stop.",
"rejectOutcome": "FIELD_MAP_UNKNOWN"
},
"patch": {
"method": "PATCH",
"path": "/services/data/<apiVersion>/tooling/sobjects/<VerifiedSobject>/<Id>",
"bodyTemplate": {
"Metadata": "<the full block from GET, with mutated camelCase keys overwritten>"
},
"success": "HTTP 204 (empty body)",
"failure": "FAILED — capture the JSON error message"
}
},
"stepE_verify": {
"channel": "prefer SOQL SELECT by Id when the mutated field is a direct-queryable column; otherwise GET the record and inspect .Metadata.<mappedKey>",
"readBackMismatchOutcome": "FAILED_VERIFY"
},
"isActiveHandling": {
"true": "apply the PATCH as described",
"false": "SKIPPED_INACTIVE — no PATCH; add a Follow-ups bullet to the summary"
},
"placeholders": {
"<apiVersion>": "vXX.0 from sf org display result.apiVersion",
"<Candidate>": "Step A output — one candidate Tooling sobject name",
"<VerifiedSobject>": "the candidate that passed Step B; cached per-ConfigurationName for the run",
"<Id>": "the record Id returned by Step C",
"<UniqueFilter>": "Step C filter derived from the sobject's queryable fields",
"<mappedKey>": "camelCase key inside the Metadata block, derived from Fields.<Xxx>",
"<ConfigValue>": "the value of Fields.<Xxx> from the config entry, sent verbatim"
},
"outcomeVocabulary": [
"SUCCESS",
"NOT_FOUND",
"AMBIGUOUS",
"API_NOT_IDENTIFIED",
"FIELD_MAP_UNKNOWN",
"FAILED",
"FAILED_VERIFY",
"SKIPPED_INACTIVE",
"SKIPPED",
"DRY_RUN",
"DELETE_NOT_SUPPORTED",
"NOT_ATTEMPTED"
]
}
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 |