salesforce-component-standards
Helps your agent build interface components for Salesforce. It ensures they follow quality, accessibility, and security standards.
What it does
This guide helps create Salesforce user interface components that are secure, accessible, and follow best practices. It ensures components work well with the Salesforce design system (SLDS) and are easy to use.
When to use it
- ✓When building new visual parts (components) for Salesforce.
- ✓When reviewing existing components to ensure they are secure and efficient.
- ✓When you want your components to follow Salesforce quality standards.
Example of what to ask your AI
“How can I ensure my Lightning Web component is accessible to all users?”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The guide details specific rules for different component types (LWC, Aura, Visualforce). It explains how to handle data, security, visual styling, and testing, ensuring everything adheres to defined standards.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add github/awesome-copilot --skill salesforce-component-standardsOr download just the file:
curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/salesforce-component-standards/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Salesforce Component Quality Standards
Apply these checks to every LWC, Aura component, and Visualforce page you write or review.
Section 1 — LWC Quality Standards
1.1 Data Access Pattern Selection
Choose the right data access pattern before writing JavaScript controller code:
| Use case | Pattern | Why |
|---|---|---|
| Read a single record reactively (follows navigation) | @wire(getRecord, { recordId, fields }) |
Lightning Data Service — cached, reactive |
| Standard CRUD form for a single object | <lightning-record-form> or <lightning-record-edit-form> |
Built-in FLS, CRUD, and accessibility |
| Complex server query or filtered list | @wire(apexMethodName, { param }) on a cacheable=true method |
Allows caching; wire re-fires on param change |
| User-triggered action, DML, or non-cacheable server call | Imperative apexMethodName(params).then(...).catch(...) |
Required for DML — wired methods cannot be @AuraEnabled without cacheable=true |
| Cross-component communication (no shared parent) | Lightning Message Service (LMS) | Decoupled, works across DOM boundaries |
| Multi-object graph relationships | GraphQL @wire(gql, { query, variables }) |
Single round-trip for complex related data |
1.2 Security Rules
| Rule | Enforcement |
|---|---|
No raw user data in innerHTML |
Use {expression} binding in the template — the framework auto-escapes. Never use this.template.querySelector('.el').innerHTML = userValue |
Apex @AuraEnabled methods enforce CRUD/FLS |
Use WITH USER_MODE in SOQL or explicit Schema.sObjectType checks |
| No hardcoded org-specific IDs in component JavaScript | Query or pass as a prop — never embed record IDs in source |
@api properties from parent: validate before use |
A parent can pass anything — validate type and range before using as a query parameter |
1.3 SLDS 2 and Styling Standards
- Never hardcode colours:
color: #FF3366→ usecolor: var(--slds-c-button-brand-color-background)or a semantic SLDS token. - Never override SLDS classes with
!important— compose with custom CSS properties. - Use
<lightning-*>base components wherever they exist:lightning-button,lightning-input,lightning-datatable,lightning-card, etc. - Base components include built-in SLDS 2, dark mode, and accessibility — avoid reimplementing their behaviour.
- If using custom CSS, test in both light mode and dark mode before declaring done.
1.4 Accessibility Requirements (WCAG 2.1 AA)
Every LWC component must pass all of these before it is considered done:
- All form inputs have
<label>oraria-label— never use placeholder as the only label - All icon-only buttons have
alternative-textoraria-labeldescribing the action - All interactive elements are reachable and operable by keyboard (Tab, Enter, Space, Escape)
- Colour is not the only means of conveying status — pair with text, icon, or
aria-*attributes - Error messages are associated with their input via
aria-describedby - Focus management is correct in modals — focus moves into the modal on open and back on close
1.5 Component Communication Rules
| Direction | Mechanism |
|---|---|
| Parent → Child | @api property or calling a @api method |
| Child → Parent | CustomEvent — this.dispatchEvent(new CustomEvent('eventname', { detail: data })) |
| Sibling / unrelated components | Lightning Message Service (LMS) |
| Never use | document.querySelector, window.*, or Pub/Sub libraries |
For Flow screen components:
- Events that need to reach the Flow runtime must set
bubbles: trueandcomposed: true. - Expose
@api valuefor two-way binding with the Flow variable.
1.6 JavaScript Performance Rules
- No side effects in
connectedCallback: it runs on every DOM attach — avoid DML, heavy computation, or rendering state mutations here. - Guard
renderedCallback: always use a boolean guard to prevent infinite render loops. - Avoid reactive property traps: setting a reactive property inside
renderedCallbackcauses a re-render — use it only when necessary and guarded. - Do not store large datasets in component state — paginate or stream large results instead.
1.7 Jest Test Requirements
Every component that handles user interaction or retrieves Apex data must have a Jest test:
// Minimum test coverage expectations
…
FAQ
What are LWC, Aura, and Visualforce?
These are different technologies used to build the user interface within Salesforce.
What is SLDS 2?
It's the Salesforce design system, which defines the look and feel of components to maintain visual consistency.
What does 'accessibility' (WCAG 2.1 AA) mean?
It means components should be usable by everyone, including people with visual, auditory, or motor impairments, following an international standard.
Details
Original description by the author
Quality standards for Salesforce Lightning Web Components (LWC), Aura components, and Visualforce pages. Covers SLDS 2 compliance, accessibility (WCAG 2.1 AA), data access pattern selection, component communication rules, XSS prevention, CSRF enforcement, FLS/CRUD in AuraEnabled methods, view state management, and Jest test requirements. Use this skill when building or reviewing any Salesforce UI
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #5356
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
Helps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
github/awesome-copilot
acreadiness-assess
Enables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
github/awesome-copilot
acreadiness-generate-instructions
Helps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
github/awesome-copilot
acreadiness-policy
Enables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
github/awesome-copilot
Similar skills
angular-developer
Helps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
affaan-m/ECC
frontend-a11y
Helps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
affaan-m/ECC
frontend-patterns
Has your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.
affaan-m/ECC