Skip to content
12 changes: 9 additions & 3 deletions skills/generating-experience-lwr-site/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,16 @@ Use `sf` CLI to validate and deploy. Access help docs by attaching `--help`, e.g
- `sf project deploy --help`
- `sf project deploy validate --help`

Note that metadata types are space-delimited.
Note that metadata types are space-delimited. **Never** wrap them in quotes or use commas. For example, `--metadata "DigitalExperienceBundle DigitalExperience"` is **incorrect** — always use `--metadata DigitalExperienceBundle DigitalExperience`.

**Validate**:
`sf project deploy validate --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}`

```bash
sf project deploy validate --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}
```

**Deploy**:
`sf project deploy start --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}`

```bash
sf project deploy start --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,66 @@ Ask user to choose:

### Option 1: Create in Org

**Step 1:** Run the create command:

```bash
sf community create --name "{siteName}" --template-name 'Build Your Own (LWR)' --url-path-prefix "{prefix}" --target-org {usernameOrAlias} --json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the user does not have this CLI plugin installed in their machine?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an old command but we can have a fallback to ask user to create the site manually in the org if it's the very first time then retrieve

```

Site creation is an async job. As soon as the terminal returns output, capture the `jobId` and move on — do not wait for the shell command to fully exit.

**Step 2:** Ask the user: *"Would you like me to wait for the site creation to complete and then retrieve the metadata for you, or would you prefer to retrieve it yourself once it's ready?"*

**Stop here and wait for the user's response before proceeding.**

---

**If the user wants to wait and retrieve:**

Poll the `BackgroundOperation` object using the following command, replacing `{jobId}` with the ID returned from the create command:

```soql
SELECT Status FROM BackgroundOperation WHERE Id = '{jobId}'
```

Use the MCP tool `run_soql_query` to run this query on the given target org. If the MCP tool is not available, run the following command instead, replacing `{jobId}` and `{usernameOrAlias}` with the appropriate values:

```bash
sf data query --query "SELECT Status FROM BackgroundOperation WHERE Id = '{jobId}'" --target-org {usernameOrAlias} --json
```

Repeat until `Status` is `Complete`. If the query does not return `Complete` after several attempts, ask the user to manually check their target org to confirm whether site creation has completed. **Stop here and do not proceed until the user confirms the site is ready.**

Once complete, run each of the following retrieval commands **one at a time**. Do not chain them together (e.g. do not use `&&`). Wait for each command to return output before running the next. Metadata types are space-delimited — **never** wrap them in quotes or use commas:

```bash
sf community create --name "{siteName}" --template-name 'Build Your Own (LWR)' --url-path-prefix "{prefix}"
sf project retrieve start --metadata DigitalExperienceBundle --target-org {usernameOrAlias} --json
Comment thread
fcwong marked this conversation as resolved.
Comment thread
fcwong marked this conversation as resolved.
```

After creation, retrieve metadata using sf CLI.
```bash
sf project retrieve start --metadata DigitalExperienceConfig --target-org {usernameOrAlias} --json
```

```bash
sf project retrieve start --metadata Network --target-org {usernameOrAlias} --json
```

```bash
sf project retrieve start --metadata CustomSite --target-org {usernameOrAlias} --json
```

---

**If the user wants to retrieve themselves:**

Provide them with the retrieval command to run once the site is ready. Metadata types are space-delimited — **never** wrap them in quotes or use commas:

```bash
sf project retrieve start --metadata DigitalExperienceBundle DigitalExperienceConfig Network CustomSite --target-org {usernameOrAlias} --json
Comment thread
fcwong marked this conversation as resolved.
```

---


### Option 2: Scaffold Locally

Expand Down
Loading