Skip to content

forcedotcom/sf-skills / plugins/builder/experience-react/skills/experience-ui-bundle-frontend-generate

experience-ui-bundle-frontend-generate

Verified

MUST activate before editing ANY file under uiBundles/*/src/ (or the bundle's index.html) for visual or UI changes to an EXISTING app — pages, components, sections, layout, styling, colors, fonts, navigation, animations, branding, or any look-and-feel change. Use this skill when modifying pages, components, layout, styling, navigation, or branding in an existing UI bundle app. Activate when the project contains appLayout.tsx, routes.tsx, src/pages/, src/components/, src/styles/global.css, or the bundle's index.html. This skill contains critical project-specific conventions (appLayout.tsx shell, shadcn/ui components, Tailwind CSS, Salesforce base-path routing, module restrictions) that override general knowledge. Without this skill, generated code will use wrong imports, break routing, or ignore project structure. Do NOT use when creating a new app from scratch or the bundle has not been scaffolded yet (use experience-ui-bundle-app-coordinate instead).

FileKindSize
SKILL.mdskill md14.5 KB
references/component.mdmarkdown6.2 KB
references/header-footer.mdmarkdown5.7 KB
references/page.mdmarkdown5.5 KB
scripts/check-preconditions.mjsexecutablescript2.3 KB
scripts/resolve-ui-bundle.mjsexecutablescript2.5 KB
scripts/verify-rules.mjsexecutablescript3.3 KB

scripts/check-preconditions.mjs

View on GitHub
#!/usr/bin/env node
// Verify a resolved UI bundle directory is actually scaffolded before any
// rule in this skill applies.
// Usage: node check-preconditions.mjs <bundle-dir>
//   <bundle-dir> is the path printed by resolve-ui-bundle.mjs.
//
// Always invoke via `node` (never as a bare executable) so this works on
// Windows cmd/PowerShell as well as macOS/Linux/Git Bash. Quote
// <bundle-dir> so Windows paths and spaces survive the shell.
//
// Exit 0 if the bundle is scaffolded (src/appLayout.tsx, src/routes.tsx, and
// src/components/ui/ all present).
// Exit 1 with the missing pieces listed if the bundle is a fresh SFDX
// project, a non-UI-bundle React project, or only partially scaffolded —
// the caller must stop and redirect the user to
// experience-ui-bundle-app-coordinate (or experience-ui-bundle-metadata-generate)
// instead of falling back to generic React knowledge.

import fs from "node:fs";
import path from "node:path";

const BUNDLE_DIR = process.argv[2] ?? "";

function fail(message) {
  console.error(message);
  process.exit(1);
}

if (!BUNDLE_DIR) {
  fail("ERROR: check-preconditions.mjs requires a valid bundle directory argument");
}

let isDir = false;
try {
  isDir = fs.statSync(BUNDLE_DIR).isDirectory();
} catch {
  isDir = false;
}

if (!isDir) {
  fail("ERROR: check-preconditions.mjs requires a valid bundle directory argument");
}

const missing = [];
if (!fs.existsSync(path.join(BUNDLE_DIR, "src", "appLayout.tsx"))) {
  missing.push("src/appLayout.tsx");
}
if (!fs.existsSync(path.join(BUNDLE_DIR, "src", "routes.tsx"))) {
  missing.push("src/routes.tsx");
}
const uiDir = path.join(BUNDLE_DIR, "src", "components", "ui");
if (!fs.existsSync(uiDir) || !fs.statSync(uiDir).isDirectory()) {
  missing.push("src/components/ui/");
}

if (missing.length > 0) {
  console.error(`ERROR: ${BUNDLE_DIR} is not a scaffolded UI bundle. Missing:`);
  for (const item of missing) {
    console.error(`  - ${item}`);
  }
  console.error(
    "Stop here. Tell the user the bundle isn't scaffolded yet and direct them to experience-ui-bundle-app-coordinate (or experience-ui-bundle-metadata-generate) to scaffold it first.",
  );
  process.exit(1);
}

console.log(
  `SUCCESS: ${BUNDLE_DIR} is scaffolded (src/appLayout.tsx, src/routes.tsx, src/components/ui/ present)`,
);
process.exit(0);
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