/salesforce-development:salesforce-component-standardsfrom salesforce-development
Applies Salesforce UI component standards for LWC, Aura, Visualforce, SLDS 2, WCAG 2.1 AA, secure Apex access, component communication, XSS, CSRF, FLS/CRUD, view state, and Jest tests.
Ships in salesforce-development. 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.
None: SKILL.md is the whole skill.
Review or build Salesforce UI components with platform-specific rules for data access, security, SLDS 2 styling, accessibility, component communication, performance, and tests.
| Use case | Pattern | Why |
|---|---|---|
| Read one record reactively | @wire(getRecord, { recordId, fields }) | Lightning Data Service is cached and reactive. |
| Standard CRUD form | <lightning-record-form> or <lightning-record-edit-form> | Built-in FLS, CRUD, and accessibility. |
| Complex server query or filtered list | @wire(apexMethodName, { param }) on cacheable=true Apex | Cacheable wire re-runs when params change. |
| User-triggered DML or non-cacheable call | Imperative apexMethodName(params).then(...).catch(...) | DML cannot be wired unless @AuraEnabled(cacheable=true) and read-only. |
| Cross-component communication without shared parent | Lightning Message Service (LMS) | Decoupled across DOM boundaries. |
| Multi-object graph relationships | GraphQL @wire(gql, { query, variables }) | Fetch related data in one round trip. |
| Area | Rule |
|---|---|
| XSS | Never assign raw user data to innerHTML; use template {expression} binding. |
| Apex permissions | @AuraEnabled methods enforce CRUD/FLS using WITH USER_MODE in SOQL or explicit Schema.sObjectType checks. |
| Org IDs | Do not hardcode org-specific IDs in component JavaScript; query them or pass as props. |
@api input | Validate type and range before using parent-supplied values in SOQL or Apex parameters. |
| SLDS 2 | Use <lightning-*> base components such as lightning-button, lightning-input, lightning-datatable, and lightning-card. |
| Colors | Do not hardcode color: #FF3366; use semantic SLDS tokens such as var(--slds-c-button-brand-color-background). |
| CSS overrides | Do not override SLDS classes with !important; compose with custom CSS properties. |
| Modes | Test custom CSS in light mode and dark mode. |
| Parent to child | Use an @api property or an @api method. |
| Child to parent | Use CustomEvent and this.dispatchEvent(new CustomEvent('eventname', { detail: data })). |
| Siblings/unrelated | Use Lightning Message Service. |
| Never use | document.querySelector, window.*, or Pub/Sub libraries for component communication. |
| Flow screen components | Events reaching Flow need bubbles: true and composed: true; expose @api value for two-way binding. |
Every LWC must satisfy WCAG 2.1 AA checks:
<label> or aria-label; placeholder text is not the only label.alternative-text or aria-label.aria-* attributes.aria-describedby.Performance rules:
connectedCallback because it runs on every DOM attach.renderedCallback with a boolean to prevent infinite render loops.renderedCallback unless necessary and guarded.| Technology | Rule |
|---|---|
| Aura vs LWC | New components should be LWC unless the target is Aura-only, such as extending force:appPage or using legacy Aura-specific events. |
| Aura controllers | @AuraEnabled methods must use with sharing and enforce CRUD/FLS; Aura does not enforce them automatically. |
| Aura output | Avoid unescaped {!v.something} in raw helpers; use <ui:outputText value="{!v.text}" /> or escaping components. |
| Aura events | Prefer component events for parent-child; application events broadcast to the whole app and should be rare. |
| Hybrid stacks | Use Lightning Message Service between LWC and Aura. |
| Visualforce XSS | Never use <apex:outputText value="{!userInput}" escape="false" /> for user-controlled data. |
| Visualforce CSRF | Use <apex:form> for postbacks; do not use raw <form method="POST">. |
| SOQL injection | Bind URL parameters: WHERE Name = :nameParam; do not concatenate ApexPages.currentPage().getParameters().get('name'). |
| View state | Keep view state under 135 KB, use transient, avoid persisting large collections, and set readonly="true" on read-only pages. |
| Custom controllers | Standard controllers enforce FLS for bound fields; custom controllers must check Schema.sObjectType.Account.fields.Revenue__c.isAccessible() and DML permissions such as Schema.sObjectType.Account.isDeletable(). |
Every component with user interaction or Apex data retrieval needs Jest tests covering render, data, event, and error behavior.
it('renders the component with correct title', async () => { /* ... */ });
it('calls apex method and displays results', async () => { /* wire mock */ });
it('dispatches event when button is clicked', async () => { /* ... */ });
it('shows error state when apex call fails', async () => { /* error path */ });
Use @salesforce/sfdx-lwc-jest utilities: setImmediate plus emit({ data, error }) for wire adapter mocking, and jest.mock('@salesforce/apex/MyClass.myMethod', ...) for Apex method mocking.
| Anti-pattern | Technology | Risk | Fix |
|---|---|---|---|
innerHTML with user data | LWC | XSS | Use template bindings {expression}. |
| Hardcoded hex colors | LWC/Aura | Dark-mode and SLDS 2 breakage | Use SLDS CSS custom properties. |
Missing aria-label on icon buttons | LWC/Aura/VF | Accessibility failure | Add alternative-text or aria-label. |
No guard in renderedCallback | LWC | Infinite rerender loop | Add a hasRendered boolean guard. |
| Application event for parent-child | Aura | Unnecessary broadcast | Use component event. |
escape="false" on user data | Visualforce | XSS | Remove it or sanitize rich text with a whitelist. |
Raw <form> postback | Visualforce | CSRF vulnerability | Use <apex:form>. |
No with sharing | VF / Apex | Data exposure | Add with sharing. |
| FLS not checked | VF / Apex | Privilege escalation | Add Schema.sObjectType checks. |
| SOQL concatenated with URL param | VF / Apex | SOQL injection | Use bind variables. |
Preserve these legacy terms, API names, command placeholders, and literal phrases when applying or migrating this skill:
<apex:page><c:something><div>ALWAYSERRORFROMHTMLNEVERSELECTauto-escapesauto-escapingbuilt-incolor: var(--slds-c-button-brand-color-background)component-by-componenticon-onlyre-firesre-renderround-tripserver-sidethis.template.querySelector('.el').innerHTML = userValueview-statewireApexPages.MessageApexPages.Severity.ERRORNoAccessExceptionSystem.NoAccessException## Salesforce component standards result
**Status:** pass | fixes required | blocked
**Scope:** <LWC/Aura/Visualforce/Apex files>
| Area | Finding | Severity | Evidence | Required fix |
| --- | --- | --- | --- | --- |
| Security | <finding> | <High/Medium/Low> | <file/line or snippet> | <fix> |
| Accessibility | <finding> | <High/Medium/Low> | <file/line or snippet> | <fix> |
| Tests | <finding> | <High/Medium/Low> | <file/line or snippet> | <fix> |
### Validation
- <Jest, Apex test, manual accessibility, or code review check>
innerHTML or escape="false".WITH USER_MODE or Schema.sObjectType checks.<apex:form> and view state stays under 135 KB.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
salesforce, lwc, aura, visualforce, slds, apex
3 skills in this plugin
/salesforce-apex-qualityReview or generate Salesforce Apex classes, triggers, handlers, batch jobs, and test classes with quality guardrails for bulk safety, explicit sharing, CRUD/FLS enforcement, SOQL injection prevention, PNB tests, trigger architecture, and modern Apex idioms. Use when asked to catch governor limit risks, security gaps, and Apex deployment quality issues./salesforce-flow-designSalesforce Flow architecture decisions, flow type selection, bulk safety validation, fault handling, automation density, Screen Flow UX, and deployment safety. Use this skill when designing or reviewing Record-Triggered, Screen, Autolaunched, Scheduled, or Platform Event flows before activation or deployment.npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin salesforce-developmentOther plugins' skills for the same job