Automation: Sandbox Post-Copy Config Generate
Convert a customer's sandbox-refresh / post-copy SOP into a structured JSON array that the post-copy automation tool consumes. Each entry is a declarative instruction: which Salesforce configuration to update, which fields are involved, whether it is active, and what order it runs in.
STOP — do this before writing any JSON
Do not compose the output from memory. Before you write the file, you
MUST open and read assets/config_template.json and copy an entry from it
for each action. Every output entry is exactly one of these two shapes —
five top-level keys, no others, no wrapper object:
ConfigurationName: exactlyOutboundMessagesorRemoteSiteSettings— neverType,Name, orOperation.- OBM
Fields:EndpointUrl+Object(both required). RemoteSiteFields:RemoteSiteUrlonly — neverUrl/RemoteSiteURL. - Top level is a JSON array. No
steps/actions/recordswrapper. No<…>orREPLACE_WITH_…placeholder ever survives into the output.
If you announce "I will now write …" without having read the template and catalog, stop and read them first — a from-memory guess produces the wrong keys and fails at runtime.
Scope
- In scope: Reading a customer SOP in any of the supported formats
(PDF, xlsx, csv, JSON, docx, Markdown, plain text, pasted excerpt, or
images containing data tables — e.g., a screenshot of an
Outbound Messages list with endpoint URLs), identifying post-copy /
post-refresh actions, mapping each action to a supported
ConfigurationName, emitting the canonical JSON array. - Out of scope: Generating Salesforce metadata XML (delegate to
generating-*skills), deploying anything to an org, running the post-copy tool, inferring or fabricating values not present in the SOP — if the SOP does not give a concrete URL/value for an action, skip the action.
Every emitted entry must have every Field populated with a real value
from the customer source. No empty strings, no null, no
<from-backup> / TBD / TODO placeholders. Customers should never
see an unpopulated field in the output — if a value cannot be located,
skip the entry and surface it. See the corresponding rule below.
Required Inputs
Gather or infer before generating:
- SOP source(s): One or more paths (or pasted content) in any of: PDF, xlsx, csv, JSON, docx, Markdown, plain text, or images (.png/.jpg/.jpeg/.tiff/.bmp). Multiple files are common — the action list and the endpoint table sometimes live in different files. Read every file the user supplies.
- Target output path: Where the JSON config should be written. Default
to
post-copy-config.jsonin the current directory unless specified. - Scope filter (optional): If the SOP covers many environments (e.g., fcQA, fcUAT, multiple sandboxes), confirm which subset the user wants in the output.
If the user provides a clear SOP and target, generate immediately without asking unnecessary questions.
Workflow
All steps are sequential. Steps 1–5 (reading the SOP, the catalog, the
template, and the schema) are prerequisites to writing — you may not
skip to the write step. If you catch yourself about to emit JSON without
having read assets/config_template.json and
references/configuration_catalog.md, go back and read them first.
-
Locate and read every supplied SOP source — read
references/source_format_handling.mdfor the exact extraction recipe per format (PDF, xlsx, csv, JSON, docx, image). At a glance:- PDF: extract text with
pypdf(text layer) and OCR image-based pages withpytesseractif the text layer is empty. - xlsx: read every sheet with
openpyxl(data_only=True), scan all columns including ones outside the visible default range, check cell comments and embedded media. - csv / JSON / Markdown / text: read directly.
- docx: extract paragraphs and tables with
python-docx. - Images (.png/.jpg/...): use the
Readtool to view, then decide if the image carries data (a table of endpoint URLs, a setup screenshot showing values to capture) or is purely illustrative (architecture diagram, flow chart). Extract values only from data-bearing images. See the image-handling rules inreferences/source_format_handling.md. - For very large SOPs (>50 pages / >20 sheets), focus on sections or sheets titled "Post Refresh", "Post-Copy", "Post-Refresh Steps", "Update …", or equivalent.
- PDF: extract text with
-
Identify post-copy actions — read
references/sop_parsing_patterns.mdfor the heuristics that turn prose instructions ("Update Outbound Message endpoint X to URL Y") into structured action records. -
Map each action to a
ConfigurationName— loadreferences/configuration_catalog.md. The catalog currently supports onlyOutboundMessagesandRemoteSiteSettings. Any action that targets a different configuration type is out of scope: skip it and list it in the response so the user can extend the catalog later. -
Read the JSON template — load
assets/config_template.json. It shows the exact required shape of oneOutboundMessagesentry and oneRemoteSiteSettingsentry, with<…>placeholder slots. Copy an entry, replace every<…>slot with the concrete SOP value, and keep the exact top-level keys (ConfigurationName,Label,Fields,IsActive,ExecutionOrder) — never rename them toType,Name,Operation, etc. Never emit an entry that still contains a<…>placeholder; if you cannot fill a slot, skip the entry (see Rules). -
Validate against the schema — load
assets/json_schema.json. Every entry must conform:ConfigurationNameis one of the catalog values,Fieldsis an object,IsActiveis boolean,ExecutionOrderis a positive integer. -
Group entries by phase, then assign
ExecutionOrder—ExecutionOrderis a phase number, not a per-row counter. Entries that can run in parallel (no dependency between them) share the same value. DifferentConfigurationNametypes typically get different phases; all entries within one phase share its number. See the ordering heuristic inreferences/sop_parsing_patterns.md. -
Compare against the example — verify the output shape against
examples/sample_sop_to_config.jsonbefore writing. -
Write the JSON file — emit pretty-printed JSON (2-space indent).
Rules / Constraints
Canonical entry shape
See the entry shapes shown in the STOP section above, or copy directly from
assets/config_template.json. Do not rename the five top-level keys
(ConfigurationName, Label, Fields, IsActive, ExecutionOrder) to
Type, Name, Operation, apiName, etc., and do not wrap the array
in an object with a steps / actions / records key.
Gotchas
Output Expectations
Deliverables:
- A single JSON file (default
post-copy-config.json) containing a top-level array of post-copy action entries. - A short summary in your response listing: total entries, count per
ConfigurationName, actions skipped because they did not map to the catalog, and actions skipped because the SOP did not include a concrete value.
The output file structure conforms to assets/json_schema.json.


