forcedotcom/sf-skills / skills/dx-org-snapshot-manage
dx-org-snapshot-manage
VerifiedALWAYS USE THIS SKILL to create, check the status of, list, or delete scratch org snapshots. A snapshot is a point-in-time copy of a scratch org's metadata AND data, referenced by name in the `snapshot` field of a scratch org definition file. Use when the user asks to create/take a snapshot, check a snapshot's status or creation progress, list/show/view existing snapshots (including filtering for snapshots expiring soon), or delete/remove a snapshot. Requires a Dev Hub with Scratch Org Snapshots enabled. DO NOT TRIGGER for creating org shapes (use dx-org-shape-manage) or for creating scratch orgs, including from an existing snapshot via `--snapshot` (use dx-org-manage).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.8 KB |
| examples/create_error_output.json | config | 596 B |
| examples/create_success_output.json | config | 524 B |
| examples/delete_output.json | config | 125 B |
| examples/get_output.json | config | 528 B |
| examples/list_output.json | config | 1.0 KB |
| references/cli_flags.md | markdown | 7.8 KB |
| references/snapshot_usage.md | markdown | 1.7 KB |
references/snapshot_usage.md
View on GitHub# Using Snapshots in Scratch Org Definition Files
Snapshot lifecycle (create/get/list/delete) is owned by this skill. Once a snapshot's `Status` is `Active` (checked via `sf org get snapshot` — see `SKILL.md`), reference it by name to create new scratch orgs — that part is owned by the **`dx-org-manage`** skill.
## Scratch Org Definition File Format
Use the `snapshot` field instead of `edition` in `project-scratch-def.json`:
```json
{
"orgName": "My Company",
"snapshot": "MySnapshot",
"features": ["EnableSetPasswordInApi"]
}
```
## Key Differences from Edition-Based Definitions
| Field | Edition-based | Snapshot-based |
|-------|--------------|----------------|
| Primary field | `"edition": "Developer"` | `"snapshot": "MySnapshot"` |
| Contents | Empty org with edition defaults | Pre-configured org state (metadata + data) from the snapshot |
## Or via Command Flag
```bash
sf org create scratch --snapshot MySnapshot --target-dev-hub <alias> --alias <name> --json
```
## Common Use Cases
### 1. Package Development
```json
{ "orgName": "Package Dev Org", "snapshot": "Dependencies_v1.2.0" }
```
### 2. Testing Baseline
```json
{ "orgName": "Test Baseline", "snapshot": "TestData_Populated" }
```
### 3. CI/CD Pipeline
```json
{ "orgName": "CI Scratch Org", "snapshot": "Nightly_Build_Baseline" }
```
## Workflow Summary
1. **Create the snapshot** (`dx-org-snapshot-manage`): `sf org create snapshot --source-org <scratch> --name MySnapshot`
2. **Poll status** (`dx-org-snapshot-manage`): `sf org get snapshot --snapshot MySnapshot` until `Status` is `Active`
3. **Reference in a definition file**: `"snapshot": "MySnapshot"`
4. **Create the new scratch org** (`dx-org-manage`): `sf org create scratch --definition-file config/project-scratch-def.json`
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |