restore-template-configs
Skill29 starsChanged 6 months agoMITView on GitHub
Re-apply ESS Workday HCM template config customisations from a backup file produced by /backup-template-configs. Use this after installing a new ESS Workday HCM package release, which would otherwise reset customised reference-data records to the package defaults. Records are matched by msdyn_uniquename (stable across envs), so the same backup file can also be used to port customisations from dev to prod (warns once, proceed-or-cancel). This is a bounded hybrid Workday operation. It writes only the msdyn_value field of matching Workday reference-data…
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 6 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Every Message block is the exact text to show the user.
- Very specific: line 26
Read .local/config.json and get dataverseEndpoint.
- Very specific: line 28
If dataverseEndpoint is missing or empty, show:
- Very specific: line 40
Do not invoke foundation setup, install a solution, bind a flow, or infer an endpoint.
- Distinctive: line 50
If the folder doesn't exist or is empty, show:
- Very specific: line 54
No backup files were found in workspace/template-config-backups/.
- Very specific: line 56
Run /backup-template-configs first to capture your customisations, or copy a backup file from another machine into that folder and re-run …
- Very specific: line 64
Use vscode_askQuestions with the discovered files as options.
- Very specific: line 83
Keep allowFreeformInput: true so the customer can paste a path to a backup file they have outside the default folder.
- Very specific: line 92
Read the chosen backup file to inspect metadata.envUrl, metadata.capturedAt, metadata.recordCount, and metadata.agentsDetected.
- Very specific: line 116
If metadata.envUrl (in the backup) does NOT match dataverseEndpoint (in the current config), show one additional line in the summary:
- Distinctive: line 141
If they pick Cancel, show:
- Distinctive: line 162
Run in the terminal:
- Distinctive: line 174
Wait for the script to finish.
- Distinctive: line 206
Stop here. Do not add commentary after this block.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Restore Template Configs Skill
Re-apply ESS Workday HCM template config customisations from a backup file
produced by /backup-template-configs. Use this after installing a new ESS
Workday HCM package release, which would otherwise reset customised
reference-data records to the package defaults.
Records are matched by msdyn_uniquename (stable across envs), so the same
backup file can also be used to port customisations from dev to prod (warns
once, proceed-or-cancel).
This is a bounded hybrid Workday operation. It writes only the
msdyn_value field of matching Workday reference-data template configurations
in the extension's Dataverse environment. It does not install an ESS parent
solution, discover or bind a Dataverse bot, register flows, or configure a
preferred solution.
Every Message block is the exact text to show the user. Copy it verbatim. Do not rephrase, add commentary, or tell the user what tools you are calling.
Start
Read .local/config.json and get dataverseEndpoint.
If dataverseEndpoint is missing or empty, show:
Message:
Workday template-config restore needs the Dataverse environment used by your hybrid Workday extension. That extension has not recorded a Dataverse endpoint in this workspace, so no records were changed.
End message.
Stop here.
Do not invoke foundation setup, install a solution, bind a flow, or infer an
endpoint. Once the Workday extension has recorded dataverseEndpoint, proceed.
Step 1: Pick the backup file
List candidate backup files in workspace/template-config-backups/:
- Glob:
workspace/template-config-backups/*.json - Sort newest first (by mtime).
If the folder doesn't exist or is empty, show:
Message:
No backup files were found in
workspace/template-config-backups/.Run
/backup-template-configsfirst to capture your customisations, or copy a backup file from another machine into that folder and re-run/restore-template-configs.End message.
Stop here.
Use vscode_askQuestions with the discovered files as options. Show the
most-recent two or three at the top with a recommended: true flag on the
newest. Include the filename, captured timestamp (read from each file's
metadata.capturedAt), and record count.
[
{
"header": "BackupFile",
"question": "Which backup file do you want to restore from?",
"options": [
{ "label": "{filename}", "description": "Captured {capturedAt} — {recordCount} records", "recommended": true },
{ "label": "{older filename}", "description": "Captured {capturedAt} — {recordCount} records" }
],
"allowFreeformInput": true
}
]Keep allowFreeformInput: true so the customer can paste a path to a
backup file they have outside the default folder.
Capture the selection as {BACKUP_PATH}.
Step 2: Confirm intent and check env match
Read the chosen backup file to inspect metadata.envUrl, metadata.capturedAt,
metadata.recordCount, and metadata.agentsDetected. Also read the current
dataverseEndpoint from .local/config.json.
Build the summary:
Restoring from:
File : {BACKUP_PATH}
Captured at : {capturedAt}
Source env : {envUrl from backup}
Records : {recordCount} across {agentsDetected}
Restoring into:
Target env : {dataverseEndpoint from .local/config.json}
Note: restore overwrites the `msdyn_value` field on each matched record
with the value captured in the backup. Other fields on the record (name,
unique name, any future fields a newer package version may have added)
keep whatever the current package shipped. Microsoft does not edit the
catalog values in `msdyn_value`, so a full overwrite is the intended
behaviour - your customisations win.If metadata.envUrl (in the backup) does NOT match dataverseEndpoint
(in the current config), show one additional line in the summary:
Note: Backup was captured from a different environment than the target.
This is fine for promoting customisations across envs (e.g. dev -> prod),
but worth confirming.Use vscode_askQuestions:
[
{
"header": "Confirm",
"question": "Proceed with restore?",
"options": [
{ "label": "Yes — restore now", "recommended": true },
{ "label": "Cancel" }
],
"allowFreeformInput": false
}
]If they pick Cancel, show:
Message:
Cancelled. Re-run /restore-template-configs whenever you're ready.
End message.
Stop here.
Step 3: Run the restore
Message:
Running restore — this takes 1-2 seconds per record. A typical multi-agent env finishes in under a minute.
End message.
Run in the terminal:
python scripts/restore_template_configs.py --url <dataverseEndpoint> --input <BACKUP_PATH> --yes --force--yesskips the script's overwrite prompt (the user already confirmed in Step 2).--forceskips the script's own cross-env-mismatch prompt (which would duplicate the Note in Step 2's summary if the envs differ; if they match,--forceis a no-op).
Wait for the script to finish. Read its final summary line, which looks like:
Restore complete: N restored, M skipped, K failed.Capture N, M, K, plus exit code.
Step 4: Show the result
4a — Full success (exit code 0, failed == 0)
Show:
Restore complete.
| | Count |
|---|---|
| Restored | {N} |
| Skipped (not in env) | {M} |
| Failed | 0 |
Your customisations are back. If `Skipped` is non-zero, those records came
from an agent installation that no longer exists in this env (e.g., a
solution was uninstalled). Re-install the missing solution(s) and re-run if
you need those records back.Stop here. Do not add commentary after this block.
4b — Partial failure (exit code 4)
The script prints the first failure's full diagnostic at the end of its output (status code, tip, URL, request id). Show:
Restore partially failed.
| | Count |
|---|---|
| Restored | {N} |
| Skipped (not in env) | {M} |
| Failed | {K} |
First failure detail:
~~~
{paste the "First failure detail" block from the script's stdout verbatim}
~~~
Follow the tip in the failure message. After fixing the underlying issue
(usually a permission gap, expired session, or transient throttling),
re-run `/restore-template-configs` — already-restored records will simply
overwrite with the same value, so re-running is safe.Stop here.
4c — Hard failure (exit code 1)
The script exits 1 only when the backup file is unusable (missing, unreadable, wrong schema version, no records). The script's stdout has the specific reason. Show:
Restore failed before any records were written.
{paste the script's last few lines of stdout}
Fix the underlying issue (usually a stale or wrong backup file) and re-run
`/restore-template-configs`.Stop here.
Notes for future maintainers of this skill
- The script is idempotent: re-running over a partially-restored env writes the same values again. There is no state on the script side to clean up.
_call_with_refresh()in the script handles 401 mid-restore by re-authenticating once and retrying. The customer may briefly see a "Access token expired" line; that is expected on multi-agent envs that take longer than one MSAL token lifetime to restore.- The script does NOT support a
--dry-runmode in v1. Showing what the PATCH would look like requires diff'ing eachmsdyn_valuepayload, which is out of scope for v1. If the customer asks "what will this overwrite", the answer is "every record listed in the summary, with the values that were in the backup at capture time."
In this repository42 other files it gives its agents.
- dev-specs/ess-nextgen-migration-toolkit/AGENTS.mdAGENTS.md
- samples/AGENTS.mdAGENTS.md
- solutions/ess-maker-skills/scripts/flightcheck/AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
- tools/ess-nextgen-migration-toolkit/AGENTS.mdAGENTS.md
- dev-specs/ess-nextgen-migration-toolkit/CLAUDE.mdCLAUDE.md
- tools/ess-nextgen-migration-toolkit/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- solutions/ess-maker-skills/.github/copilot-instructions.mdCopilot instructions
- create-or-update-sample-topicSkill
- prepare-sample-prSkill
- triage-sample-issueSkill
- validate-sample-topicSkill
- analyticsSkill
- backup-template-configsSkill
- cleanupSkill
- connectSkill
- workdaySkill
- createSkill
- deleteSkill
- dispatcherSkill
- generateSkill
- reviewSkill
- runSkill
- updateSkill
- validateSkill
- flightcheckSkill
- foundation-setupSkill
- landing-page-configSkill
- create-eval-drivenSkill
- createSkill
- deleteSkill
- reviewSkill
- testSkill
- update-eval-drivenSkill
- updateSkill
- troubleshootSkill
- createSkill
- deleteSkill
- testSkill
- updateSkill
- ESS-Diagnostics-SkillsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

