Skip to content

forcedotcom/sf-skills / plugins/builder/experience-lwc/skills/experience-lwc-design-generate

experience-lwc-design-generate

Verified

Use when you need to create a brand new Lightning Web Component from a Figma design, a Product Requirements Document, or another design artifact — orchestrating the five-phase workflow (gather requirements → generate code → optimize → lint/format/compile → test) and stitching together the specialized skills for SLDS, LDS, base components, optimization, and testing. Use this skill whenever the user mentions building a new LWC from Figma, building an LWC from a PRD, generating an LWC from a design or screenshot, or migrating an Aura component as a fresh LWC build. DO NOT TRIGGER when refactoring an existing LWC (use experience-lwc-generate), for Aura → LWC in-place migration (out of scope for this skill), for standalone SLDS token or styling work (use design-systems-slds-apply), or for standalone data-layer work (use experience-lds-best-practices-apply or experience-lds-data-requirements-generate).

FileKindSize
SKILL.mdskill md15.6 KB
references/figma-to-prd-blueprint.mdmarkdown2.7 KB
references/prd-analysis-template.mdmarkdown617 B
scripts/check-component-name.shexecutablescript2.2 KB
scripts/detect-project-tools.shexecutablescript2.4 KB

scripts/check-component-name.sh

View on GitHub
#!/usr/bin/env bash
# Validates that the two names an LWC bundle requires are in the correct
# case conventions and are consistent with each other:
#
#   componentName — camelCase (e.g. `productCard`)
#   tagName       — kebab-case (e.g. `product-card`)
#
# Also verifies the kebab-case form of `componentName` equals `tagName`,
# so `productCard` / `product-card` passes but `productCard` /
# `productcard` (missing dash) does not.
#
# Usage:
#   <skill_dir>/scripts/check-component-name.sh <componentName> <tagName>
#
# Exit codes:
#   0 — both names conform to their conventions and are consistent
#   1 — validation failure (message on stderr describing which rule failed)
#   2 — usage error

set -euo pipefail

fail() {
  echo "check-component-name: $*" >&2
  exit 1
}

if [ "$#" -ne 2 ]; then
  echo "usage: $0 <componentName> <tagName>" >&2
  exit 2
fi

component_name="$1"
tag_name="$2"

python3 - "$component_name" "$tag_name" <<'PY'
import re
import sys

component_name, tag_name = sys.argv[1], sys.argv[2]

CAMEL_RE = re.compile(r"^[a-z][a-zA-Z0-9]*$")
KEBAB_RE = re.compile(r"^[a-z][a-z0-9]*(-[a-z0-9]+)+$")

errors = []

if not CAMEL_RE.match(component_name):
    errors.append(
        f"componentName `{component_name}` is not camelCase — must start with a "
        "lowercase letter and contain only letters/digits (e.g. `productCard`)."
    )

if not KEBAB_RE.match(tag_name):
    errors.append(
        f"tagName `{tag_name}` is not kebab-case — must start with a lowercase "
        "letter and contain at least one `-` separator with lowercase segments "
        "(e.g. `product-card`)."
    )

if not errors:
    # componentName -> expected kebab-case: insert `-` before each interior
    # uppercase letter and lowercase everything.
    expected = re.sub(r"([A-Z])", r"-\1", component_name).lower()
    if expected != tag_name:
        errors.append(
            f"tagName `{tag_name}` does not match componentName `{component_name}` "
            f"— expected kebab-case form `{expected}`."
        )

if errors:
    for e in errors:
        print(f"check-component-name: {e}", file=sys.stderr)
    sys.exit(1)

print(f"check-component-name: OK ({component_name} / {tag_name})")
PY
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall