/experience-lwc:experience-lwc-security-validatefrom Salesforce LWC
Validates Lightning Web Components (LWC) against Lightning Web Security (LWS) rules, producing severity-ranked findings or SARIF reports for compliance gating.
Ships in Salesforce LWC. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Run a structured Lightning Web Security (LWS) and Product Security compliance pass over a Lightning Web Component. Two output modes:
lws-001…lws-023b) for downstream gating, eval scoring, or CI ingest.Both modes use the same detection rules from the references; only the output format differs.
Do NOT use this skill for:
experience-lwc-generate).modules/…)..js-meta.xml.review (default — find, fix, report) or score (find, emit SARIF JSON, do NOT modify code). Confirm with the user before starting if it isn't obvious from the request.Each reference is the source of truth. Do not summarize from memory — open the reference, apply the guidelines, and cite the specific section you used in the report.
lws-001…lws-023b): Product Security Framework — for every rule the catalog gives the detection patterns and the canonical SARIF ruleId / level / message template. Score mode emits one SARIF result per match using these exact values.Collect the component path and identify the files to review. Include every file in the component bundle: .html, .js/.ts, .css, .js-meta.xml, and any child components owned by the same team that are invoked from the target.
Note any existing feature-flag gates — findings that require code changes must respect them.
Read LWS Security Expert and Product Security Framework top-to-bottom before judging. The LWS reference enumerates blocked DOM APIs and their allowed alternatives; the Product Security framework gives the severity taxonomy, the 23-rule SARIF catalog, and remediation patterns.
Run every rule in Product Security Framework (lws-001 through lws-023b) against the component bundle. For each rule:
Reflect.*, string concatenation) you must consider.ruleId, level (error / warning from the catalog), file, startLine, startColumn (column 1 if unknown), message (use the catalog's message template, substituting any {placeholder} from the actual code).scripts/check-lwc-import.sh <file> — the script prints lwc-import=yes when a from 'lwc' import is present and lwc-import=no otherwise. Skip the rule for that file when the answer is no.This catalog is the canonical detection list; the JS/TS, HTML, and .js-meta.xml bullets that follow are additional checks beyond the SARIF rules.
Walk each template for:
lwc:inner-html usage — verify the source is trusted.href, src, srcdoc, inline event handlers).style="…" with bound expressions — candidates for CSS class swaps.<iframe> or <object> without sandboxing (Step 3 catches the srcdoc and protocol cases via lws-023a/lws-023b; this step catches missing sandbox attributes).Inspect .js-meta.xml for:
lightning__FlowScreen, lightning__AppPage, etc.) when the component doesn't need it.capabilities restrictions for the target surface.Inspect Apex bindings for:
@wire to Apex methods without @AuraEnabled(cacheable=true) where caching is safe.Findings from Steps 4-5 use rule IDs lws-tpl-001…lws-tpl-NNN (HTML) and lws-meta-001…lws-meta-NNN (meta) — sequence numbers per finding within the report — so they don't collide with the SARIF catalog.
Pick the output format based on the mode confirmed in Prerequisites.
Use examples/review-report.md as the template — one bullet per finding under ## Security (LWS + Product), one totals line under ## Summary.
Severity ordering: Critical → High → Medium → Low (map SARIF error → High, warning → Medium unless the rule says otherwise). Cite the reference section that produced each finding (e.g., "Product Security § lws-001 document.createProcessingInstruction").
Emit a single SARIF 2.1.0 JSON document — and nothing else. No prose before or after. Do NOT write the JSON to a file; return it inline. Empty results array means no issues found.
Use examples/score-report.sarif.json as the shape reference — same top-level structure ($schema, version, runs[0].tool.driver.rules[], runs[0].results[]), populated with the actual rules that fired and the actual matches.
Rules:
ruleId matches a catalog entry exactly (lws-001…lws-023b, or the lws-tpl-* / lws-meta-* namespaces from Steps 4-5).level is error for catalog rules marked level: error and warning for level: warning. No other values.message.text uses the catalog's message template with placeholders substituted (e.g., replace {eventName} with the actual event name found in code).result per match. If a rule fires three times in a file, emit three results.tool.driver.rules; an empty results array still requires tool.driver.rules to be present (use []).Skip in score mode — score mode is read-only.
For each accepted finding:
scripts/validate-sarif.sh <path> — the script confirms the JSON parses, version is 2.1.0, every ruleId matches the catalog pattern (lws-NNN[a-z]? / lws-tpl-NNN / lws-meta-NNN) and is declared in tool.driver.rules, every level is error or warning, and every result has a physicalLocation.artifactLocation.uri + region.startLine. Fix any failure before returning the SARIF.experience-lwc-generate — for authoring new LWC bundles that are security-compliant from the start.design-systems-slds-validate — SLDS/design-system compliance pass (accessibility overlaps with WCAG 2.2 — run separately).dx-code-analyzer-run — repo-wide static-analysis pass; use it alongside this skill for coverage beyond the LWS catalog.lws-001…lws-023b) was evaluated against the bundle, not a hand-curated subset.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
lwc, lws, security-review, salesforce, sarif, lightning-web-components
npx claudepluginhub forcedotcom/sf-skills --plugin experience-lwc14 skills in this plugin
/experience-accessibility-validateUse this skill to determine whether a Lightning Web Component (LWC) is accessible and meets WCAG accessibility guidelines. TRIGGER when the user asks "is my component accessible?", "does my LWC meet accessibility guidelines?", "is this component WCAG compliant?", "find accessibility problems in this LWC", "is this LWC keyboard accessible?", "does this component work with a screen reader?", "does this component have sufficient color contrast?", "check ARIA usage in this LWC", or "WCAG 2.2 accessibility check". Also TRIGGER when the user wants to fix or improve accessibility (a11y, WCAG, ARIA) in an LWC's HTML, JS, or CSS — semantic markup, focus, keyboard nav, contrast, screen-reader labels, WCAG 2.2 SC. Produces `a11y-review.md` with WCAG-cited findings. DO NOT TRIGGER for general LWC generation (use `experience-lwc-generate`) or SLDS visual/design review not focused on accessibility (use `design-systems-slds-validate`)./experience-aura-lwc-migrateUse this skill to analyze a Salesforce Aura component bundle (.cmp, .app, .evt, .intf, Controller.js, Helper.js, Renderer.js) and produce a framework-agnostic migration blueprint (PRD.yaml / PRD.md / PRD.json) capturing public API, data requirements, slots, events, states, accessibility, styling, localization, and security posture. This is Phase 1 (analysis + PRD) only — it does NOT author or edit component code, wire adapters, or Jest tests, and does not write .html/.js/.css/.js-meta.xml. TRIGGER when the user says "analyze this Aura component", "migrate Aura", "convert .cmp", "produce a migration blueprint", "generate a PRD for this Aura component", or mentions aura:attribute, aura:handler, force:recordData, $Label, $Resource, component.get, cmp.find, or an input directory containing .cmp files. DO NOT TRIGGER when there is no Aura source (delegate downstream LWC authoring to experience-lwc-generate), for post-migration scoring, or for refactoring an existing modern component./experience-lds-best-practices-applyUse when reviewing or implementing Lightning Data Service best practices in an LWC (.js, .html, .js-meta.xml) — UIAPI vs Apex, refreshApex / notifyRecordUpdateAvailable, @salesforce/schema imports, LDS record-form data patterns. TRIGGER on "apply LDS best practices to this LWC", "review this LWC for LDS best-practice issues", "review this component for Lightning Data Service issues", "UIAPI or Apex for this data?", "fix stale data after record save", "sync LDS cache", "use @salesforce/schema for field names", "choose between getRecord and Apex". DO NOT TRIGGER when building a new LWC (use experience-lwc-generate), applying SLDS design tokens (use design-systems-slds-apply), picking or wiring a `lightning-*` base component's props/events/slots generically (use experience-lwc-base-components-integrate — this skill covers only the LDS data-layer rationale, even when the fix involves a base record form), or for security / RTL / accessibility reviews (separate passes)./experience-lds-data-requirements-generateUse when a Lightning Web Component data need is described in ambiguous natural language — turn "get contact info" or "show account data" into a clear, PRD-ready data-requirements spec. TRIGGER when the user says "define data requirements for this LWC", "turn this PRD data section into validated object/field names", "recommend GraphQL vs UIAPI for this data need", "validate these Salesforce API names", or "spec out the LDS adapter for this component", or references LWC bundle files (`.js`, `.js-meta.xml`) whose data layer is not yet specified. DO NOT TRIGGER when the data layer is already fully specified, when authoring the actual query or adapter code from a known spec, or when implementing an LWC end-to-end (use experience-lwc-generate)./experience-lds-graphql-generateUse ALWAYS when a prompt mentions GraphQL, lightning/uiGraphQLApi, @wire(graphql, ...), or gql template tags in an LWC context — even if the surface ask is "build an LWC". Owns the ENTIRE flow: introspect the org's LDS GraphQL schema, identify entities/fields, construct the schema-validated gql query or mutation, wire it into the LWC via lightning/uiGraphQLApi, verify against a connected org. REQUIRED whenever a prompt asks to render, list, or edit Salesforce records (Account, Contact, Case, custom objects) via GraphQL — the .html and .js scaffolding IS in scope. DO NOT delegate to experience-lwc-generate: that skill has NO GraphQL schema introspection, NO create_lds_graphql_read_query binding, and defaults to getRecord/getRelatedListRecords wire adapters which will not satisfy a GraphQL prompt. DO NOT TRIGGER only if the prompt forbids GraphQL, chooses UIAPI/Apex (use experience-lds-best-practices-apply), or asks for data requirements (use experience-lds-data-requirements-generate)./experience-lwc-accessibility-jest-runUse ALWAYS when running Sa11y accessibility Jest tests for an LWC — locally before pushing, producing the command(s), running one file vs a suite, selecting tests by naming convention, saving Sa11y-rendered HTML, or reproducing a Sa11y/A11yBug failure. Covers core (Bazel; `bazel test //<module>:<target>`) and standalone `npx jest` (`.accessibility.test.js`, `@sa11y/jest`). REQUIRED for a `run-plan.md`, a failing a11y test's exit code, or `SA11Y_*`/`A11yBug`/core-Bazel test paths. DO NOT TRIGGER for functional Jest tests, a11y review without running tests (use experience-accessibility-validate), or Selenium-based a11y tests.3 plugins in 2 repositories ship this exact skill · first indexed Aug 23, 2026
Other plugins' skills for the same job