Skip to content

forcedotcom/sf-skills / plugins/builder/dx-org-lifecycle/skills/automation-sandbox-post-copy-configure

automation-sandbox-post-copy-configure

Verified

Apply 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.

scripts/resolve-target-org.mjs

View on GitHub
#!/usr/bin/env node
// Deterministic target-org alias resolver for automation-sandbox-post-copy-configure.
//
// Resolves the org alias that goes into the summary header so it never
// contains an unresolved `$SF_TARGET_ORG` / `<env:SF_TARGET_ORG>` placeholder
// (authoring standard A9 — this is deterministic string substitution, not
// model judgment).
//
// Precedence:
//   1. $SF_TARGET_ORG (set by the eval harness or the caller)
//   2. `sf config get target-org --json` → .result[0].value
//
// Usage:
//   node resolve-target-org.mjs
//
// Emits to stdout (single JSON object):
//   { "alias": "<value>", "source": "env|sf-config" }
//   { "error":  "<message>" }
//
// Exit code 0 when an alias is resolved; 1 when neither source yields one
// (so the caller can hard-fail before writing a report with a broken header).

import { execFileSync } from 'node:child_process';

const envAlias = process.env.SF_TARGET_ORG?.trim();
if (envAlias) {
  process.stdout.write(JSON.stringify({ alias: envAlias, source: 'env' }) + '\n');
  process.exit(0);
}

try {
  const raw = execFileSync('sf', ['config', 'get', 'target-org', '--json'], {
    encoding: 'utf-8',
    stdio: ['ignore', 'pipe', 'pipe'],
  });
  const parsed = JSON.parse(raw);
  const alias = parsed?.result?.[0]?.value;
  if (typeof alias === 'string' && alias.trim().length > 0) {
    process.stdout.write(JSON.stringify({ alias: alias.trim(), source: 'sf-config' }) + '\n');
    process.exit(0);
  }
  process.stdout.write(
    JSON.stringify({
      error: 'no target-org configured — set $SF_TARGET_ORG or run `sf config set target-org=<alias>`',
    }) + '\n',
  );
  process.exit(1);
} catch (err) {
  const detail = err instanceof Error ? err.message : String(err);
  process.stdout.write(
    JSON.stringify({
      error: `sf config get target-org failed: ${detail.slice(0, 400)}`,
    }) + '\n',
  );
  process.exit(1);
}
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 119kUpdated Claude CodeCodexVerifiedInstall
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: 118kUpdated Claude CodeCodexVerifiedInstall