salesforce-component-standards

Enforces security, accessibility, and quality standards for Salesforce LWC, Aura, and Visualforce components.

38.5k|4.9k|Updated Jun 11, 2025
One-click install
npx skills add https://github.com/github/awesome-copilot --skill salesforce-component-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: salesforce-component-standards
Source: https://github.com/github/awesome-copilot/tree/main/skills/salesforce-component-standards
Command: npx skills add https://github.com/github/awesome-copilot --skill salesforce-component-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Salesforce UI components often ship with XSS vulnerabilities, missing FLS/CRUD enforcement, accessibility failures, and SLDS styling violations that only surface in security reviews or production. This Skill applies a consistent set of platform-specific quality checks to every Lightning Web Component, Aura component, and Visualforce page you write or review.

Core Features & Use Cases

  • LWC Standards: Guides data access pattern selection (wire, imperative Apex, LMS, GraphQL), enforces XSS prevention, SLDS 2 styling tokens, WCAG 2.1 AA accessibility checklists, component communication rules, and Jest test requirements.
  • Aura Standards: Covers when to use Aura vs LWC, CRUD/FLS enforcement in @AuraEnabled methods, and component vs application event design.
  • Visualforce Security: Prevents XSS via output escaping, CSRF via apex:form, SOQL injection via bind variables, and manages view state limits and FLS in custom controllers.
  • Use Case: When building a new LWC that displays account data, use this Skill to choose the correct wire pattern, enforce WITH USER_MODE in Apex, add proper aria-labels, and write the required Jest tests before submitting for review.

Quick Start

Review this Lightning Web Component against the Salesforce component quality standards and flag any security, accessibility, or styling violations.

Frequently Asked Questions about salesforce-component-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right data access pattern in LWC?

Choose based on use case: use @wire(getRecord) for reactive single-record reads, lightning-record-form for standard CRUD forms, wired cacheable Apex for complex queries, imperative Apex for DML or user-triggered actions, and GraphQL wire for multi-object relationships.

How do I prevent XSS in Lightning Web Components?

Use template expression binding {expression} instead of setting innerHTML with user data, since the framework auto-escapes bound values. Never assign user-controlled values to innerHTML via querySelector.

When should I use Aura vs LWC for new components?

Always use LWC for new components unless the target context is Aura-only, such as extending force:appPage or using Aura-specific events in legacy managed packages. LWC can be embedded inside Aura components during incremental migration.

Does Visualforce enforce FLS and CRUD automatically?

Standard controllers enforce FLS for bound fields automatically, but custom controllers do not. You must add explicit Schema.sObjectType checks like isAccessible() and isDeletable() before reading fields or performing DML.

Why does my LWC re-render infinitely in renderedCallback?

Setting a reactive property inside renderedCallback triggers another render cycle, causing an infinite loop. Always guard renderedCallback with a boolean flag like hasRendered and avoid mutating reactive state there.

What Jest tests are required for Lightning Web Components?

Components handling user interaction or Apex data need tests for rendering, Apex wire mocking with emit({data, error}), event dispatch verification, and error-state handling. Use @salesforce/sfdx-lwc-jest mocking utilities for wire adapters and Apex methods.