forcedotcom/sf-skills / plugins/builder/experience-lwc/skills/experience-lwc-runtime-observe
experience-lwc-runtime-observe
VerifiedUse when running Salesforce Lightning Preview for an app or a single LWC component to extract the runtime DOM for inspection. TRIGGER when the user says "preview an LWC locally", "run sf lightning dev", "launch Local Dev", "inspect a component's shadow DOM at runtime", "grab rendered HTML from a live preview", "troubleshoot what actually renders versus the template", "set up Salesforce Live Preview plugin", "lightning preview", "local dev server", or "extract runtime DOM". DO NOT TRIGGER when the user is authoring or editing LWC source code (use experience-lwc-generate) or reviewing component code statically without running it.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.0 KB |
| examples/component-preview-and-dom.md | markdown | 1.5 KB |
| scripts/extract-dom.shexecutable | script | 2.1 KB |
| scripts/open-frontdoor.shexecutable | script | 1.8 KB |
| scripts/verify-toolchain.shexecutable | script | 1.7 KB |
scripts/open-frontdoor.sh
View on GitHub#!/usr/bin/env bash
# Captures the Salesforce front-door URL into a mode-0600 tempfile without
# printing it to stdout OR stderr, then hands the browser driver the path.
# This keeps the OTP-bearing URL out of agent tool traces (S1: no auth
# tokens in context).
#
# Usage (capture output first so a helper failure aborts the caller —
# `eval "$(...)"` alone swallows the helper's nonzero exit status):
# frontdoor_env="$(scripts/open-frontdoor.sh <org-alias> <preview-url>)" || exit 1
# eval "$frontdoor_env"
# # now $FRONTDOOR_URL_FILE and $PREVIEW_URL are exported for children
#
# The browser automation driver must read the URL from the tempfile,
# navigate to it, then delete the file. Do NOT `cat` this file into your
# agent's stdout.
set -euo pipefail
if [[ $# -lt 2 ]]; then
echo "usage: $0 <org-alias> <preview-url>" >&2
exit 2
fi
ORG_ALIAS="$1"
PREVIEW_URL="$2"
TMP_URL_FILE="$(mktemp -t sf-frontdoor.XXXXXX)"
chmod 600 "$TMP_URL_FILE"
# Redirect BOTH stdout and stderr from sf and python3 so no URL fragment,
# progress message, or JSON error trace can reach the agent's tool-output
# stream. Only the extracted URL lands in $TMP_URL_FILE.
if ! sf org open --url-only --json --target-org "$ORG_ALIAS" 2>/dev/null \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["result"]["url"])' 2>/dev/null \
> "$TMP_URL_FILE"
then
rm -f "$TMP_URL_FILE"
echo "error: failed to capture front-door URL for org '$ORG_ALIAS'" >&2
exit 1
fi
# Emit `export` assignments so the caller must `eval` the output to make
# the variables reach child processes (the browser driver). No token material
# is printed — only the tempfile path and the preview URL.
printf 'export FRONTDOOR_URL_FILE=%q\n' "$TMP_URL_FILE"
printf 'export PREVIEW_URL=%q\n' "$PREVIEW_URL"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |