Skip to content

forcedotcom/sf-skills / plugins/builder/experience-lwc/skills/experience-lwc-runtime-observe

experience-lwc-runtime-observe

Verified

Use 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.

FileKindSize
SKILL.mdskill md10.0 KB
examples/component-preview-and-dom.mdmarkdown1.5 KB
scripts/extract-dom.shexecutablescript2.1 KB
scripts/open-frontdoor.shexecutablescript1.8 KB
scripts/verify-toolchain.shexecutablescript1.7 KB

scripts/verify-toolchain.sh

View on GitHub
#!/usr/bin/env bash
# Verifies the toolchain required for Lightning Preview: `sf` CLI on PATH,
# `@salesforce/plugin-lightning-dev` installed, and the specified target
# org alias authenticated and Connected. Exits nonzero with an actionable
# message on failure so the agent can surface a single, deterministic
# error instead of parsing prose from three separate commands.
#
# Usage:
#   <skill_dir>/scripts/verify-toolchain.sh <orgAlias>

set -euo pipefail

fail() {
  echo "verify-toolchain: $*" >&2
  exit 1
}

if [ "$#" -lt 1 ] || [ -z "${1:-}" ]; then
  fail "usage: $0 <orgAlias>"
fi
alias="$1"

command -v sf >/dev/null 2>&1 \
  || fail "Salesforce CLI (\`sf\`) not found on PATH. Install via https://developer.salesforce.com/tools/salesforcecli then re-run."

sf version >/dev/null 2>&1 \
  || fail "\`sf version\` failed. Reinstall the Salesforce CLI."

if ! sf plugins --core 2>/dev/null | grep -Eq '(^|[[:space:]])@salesforce/plugin-lightning-dev([[:space:]]|$)'; then
  if ! sf plugins 2>/dev/null | grep -Eq '(^|[[:space:]])@salesforce/plugin-lightning-dev([[:space:]]|$)'; then
    fail "Plugin \`@salesforce/plugin-lightning-dev\` is not installed. Install via: sf plugins install @salesforce/plugin-lightning-dev"
  fi
fi

if ! sf org display --target-org "$alias" --json 2>/dev/null \
     | python3 -c 'import json,sys
try:
    d = json.load(sys.stdin)
except Exception:
    sys.exit(1)
if d.get("status") != 0:
    sys.exit(1)
r = d.get("result", {}) or {}
sys.exit(0 if r.get("connectedStatus") == "Connected" else 1)'; then
  fail "Target org alias \`$alias\` is not authenticated or not Connected. Run \`sf org login web --alias $alias\` and re-run."
fi

echo "verify-toolchain: OK ($alias)"
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: 322kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall