sf-lwc-development
Skill15 starsChanged 7 months agoMITView on GitHub
LWC development — components, reactive properties, wire service, Apex integration, events, lifecycle hooks. Use when building LWC components or debugging wire/reactivity. Do NOT use for Aura, Visualforce, or Flow.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- grzmol/vibe-forcetheir own version, first seen Sep 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- grzmol/vibe-force★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository58 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- asideSkill
- checkpointSkill
- configure-sccSkill
- continuous-agent-loopSkill
- mcp-server-patternsSkill
- model-routeSkill
- prompt-optimizerSkill
- refactor-cleanSkill
- resume-sessionSkill
- save-sessionSkill
- search-firstSkill
- security-scanSkill
- sessionsSkill
- sf-2gp-security-reviewSkill
- sf-agentforce-developmentSkill
- sf-agentforce-mcp-actionsSkill
- sf-apex-async-patternsSkill
- sf-apex-best-practicesSkill
- sf-apex-constraintsSkill
- sf-apex-cursorSkill
- sf-apex-enterprise-patternsSkill
- sf-apex-testingSkill
- sf-api-designSkill
- sf-approval-processesSkill
- sf-aura-developmentSkill
- sf-build-fixSkill
- sf-cli-referenceSkill
- sf-data-modelingSkill
- sf-debuggingSkill
- sf-deployment-constraintsSkill
- sf-deploymentSkill
- sf-devops-ci-cdSkill
- sf-docs-lookupSkill
- sf-e2e-testingSkill
- sf-experience-cloudSkill
- sf-flow-developmentSkill
- sf-governor-limitsSkill
- sf-harness-auditSkill
- sf-helpSkill
- sf-integrationSkill
- sf-lwc-constraintsSkill
- sf-lwc-testingSkill
- sf-metadata-managementSkill
- sf-platform-events-cdcSkill
- sf-quickstartSkill
- sf-security-constraintsSkill
- sf-securitySkill
- sf-soql-constraintsSkill
- sf-soql-optimizationSkill
- sf-tdd-workflowSkill
- sf-testing-constraintsSkill
- sf-trigger-constraintsSkill
- sf-trigger-frameworksSkill
- sf-visualforce-developmentSkill
- strategic-compactSkill
- update-docsSkill
- update-platform-docsSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
When building new Lightning Web Components from scratch
- Distinctive: line 14
When migrating Aura components to LWC
- Distinctive: line 15
When debugging reactive property or wire service issues
- Distinctive: line 16
When implementing parent-child communication with events or @api
- Distinctive: line 17
When adding LWC components to record pages, app pages, or Experience Cloud sites
- Distinctive: line 25
Every LWC component is a folder with at minimum an HTML template and a JavaScript class.
- Very specific: line 263
Use for: global CSS theming, third-party library integration, Experience Cloud sites, simple leaf components.
- Very specific: line 271
Use --slds-c-* styling hooks (replaces --lwc-* design tokens).
- Distinctive: line 286
Use getters for production code until this reaches GA.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LWC Development
Lightning Web Components (LWC) is Salesforce's modern component model based on web standards — Custom Elements, Shadow DOM, and ES modules.
When to Use
- When building new Lightning Web Components from scratch
- When migrating Aura components to LWC
- When debugging reactive property or wire service issues
- When implementing parent-child communication with events or @api
- When adding LWC components to record pages, app pages, or Experience Cloud sites
@../_reference/LWC_PATTERNS.md
Component Creation Procedure
Every LWC component is a folder with at minimum an HTML template and a JavaScript class.
force-app/main/default/lwc/
accountList/
accountList.html <- Template
accountList.js <- Component class
accountList.css <- Component-scoped styles (optional)
accountList.js-meta.xml <- Metadata (targets, properties)Step 1 — HTML Template
<template>
<lightning-card title="Accounts" icon-name="standard:account">
<template lwc:if={isLoading}>
<lightning-spinner alternative-text="Loading" size="small"></lightning-spinner>
</template>
<template lwc:elseif={hasError}>
<p class="slds-text-color_error">{errorMessage}</p>
</template>
<template lwc:else>
<template for:each={accounts} for:item="account">
<div key={account.Id} class="account-row">
<span>{account.Name}</span>
<lightning-button label="View" data-id={account.Id}
onclick={handleViewAccount}></lightning-button>
</div>
</template>
</template>
</lightning-card>
</template>Step 2 — JavaScript Class
import { LightningElement, api, wire } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import getAccounts from '@salesforce/apex/AccountsController.getAccounts';
export default class AccountList extends NavigationMixin(LightningElement) {
@api recordId;
@api maxRecords = 10;
accounts = [];
isLoading = false;
error;
get hasError() { return this.error !== undefined; }
get isEmpty() { return !this.isLoading && this.accounts.length === 0; }
get errorMessage() {
return this.error?.body?.message ?? this.error?.message ?? 'An unknown error occurred.';
}
connectedCallback() { this.loadAccounts(); }
handleViewAccount(event) {
this[NavigationMixin.Navigate]({
type: 'standard__recordPage',
attributes: { recordId: event.currentTarget.dataset.id,
objectApiName: 'Account', actionName: 'view' }
});
}
async loadAccounts() {
this.isLoading = true;
this.error = undefined;
try {
this.accounts = await getAccounts({
searchTerm: this.searchTerm, maxRecords: this.maxRecords
});
} catch (error) {
this.error = error;
} finally {
this.isLoading = false;
}
}
}Step 3 — Meta XML
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>66.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__RecordPage</target>
<target>lightning__AppPage</target>
<target>lightning__HomePage</target>
</targets>
<targetConfigs>
<targetConfig targets="lightning__RecordPage">
<property name="maxRecords" type="Integer" default="10"
label="Maximum Records to Display" />
</targetConfig>
</targetConfigs>
</LightningComponentBundle>Wire Service Usage
The wire service declaratively connects components to Salesforce data and re-runs when reactive parameters change.
Wire with Apex
import { LightningElement, wire, api } from 'lwc';
import { refreshApex } from '@salesforce/apex';
import getAccountDetails from '@salesforce/apex/AccountsController.getAccountDetails';
export default class AccountDetails extends LightningElement {
@api recordId;
_wiredResult;
@wire(getAccountDetails, { accountId: '$recordId' })
wiredAccount(result) {
this._wiredResult = result;
if (result.data) {
this.account = result.data;
this.error = undefined;
} else if (result.error) {
this.error = result.error;
this.account = undefined;
}
}
async handleSave(event) {
await updateAccount({ accountId: this.recordId, fields: event.detail.fields });
await refreshApex(this._wiredResult);
}
}Wire with Lightning Data Service
import { LightningElement, api, wire } from 'lwc';
import { getRecord, getFieldValue, updateRecord } from 'lightning/uiRecordApi';
import ACCOUNT_NAME from '@salesforce/schema/Account.Name';
import ACCOUNT_INDUSTRY from '@salesforce/schema/Account.Industry';
export default class AccountHeader extends LightningElement {
@api recordId;
@wire(getRecord, { recordId: '$recordId', fields: [ACCOUNT_NAME, ACCOUNT_INDUSTRY] })
account;
get name() { return getFieldValue(this.account.data, ACCOUNT_NAME); }
get industry() { return getFieldValue(this.account.data, ACCOUNT_INDUSTRY); }
}Event Handling — Component Communication
Child to Parent: Custom Events
// child: opportunityCard.js
handleSelect() {
this.dispatchEvent(new CustomEvent('opportunityselect', {
detail: { opportunityId: this.opportunity.Id },
bubbles: false, composed: false
}));
}<!-- parent template -->
<c-opportunity-card opportunity={opp}
onopportunityselect={handleOpportunitySelect}></c-opportunity-card>Cross-Component: Lightning Message Service
import { publish, subscribe, unsubscribe, MessageContext, APPLICATION_SCOPE }
from 'lightning/messageService';
import CHANNEL from '@salesforce/messageChannel/OpportunitySelected__c';
// Publisher
@wire(MessageContext) messageContext;
handleSelect(event) {
publish(this.messageContext, CHANNEL, { opportunityId: event.target.dataset.id });
}
// Subscriber
connectedCallback() {
this.subscription = subscribe(this.messageContext, CHANNEL,
(msg) => this.handleMessage(msg), { scope: APPLICATION_SCOPE });
}
disconnectedCallback() { unsubscribe(this.subscription); }Slots — Composition Patterns
<!-- child: modalWrapper.html -->
<template>
<div class="modal-header"><slot name="header"><h2>Default Header</h2></slot></div>
<div class="modal-body"><slot></slot></div>
<div class="modal-footer"><slot name="footer"></slot></div>
</template>
<!-- parent usage -->
<c-modal-wrapper>
<span slot="header">Edit Account</span>
<lightning-record-edit-form record-id={recordId} object-api-name="Account">
<lightning-input-field field-name="Name"></lightning-input-field>
</lightning-record-edit-form>
<div slot="footer">
<lightning-button label="Save" variant="brand" onclick={handleSave}></lightning-button>
</div>
</c-modal-wrapper>Light DOM
Renders component markup directly into the parent DOM (no shadow boundary).
export default class ThemedComponent extends LightningElement {
static renderMode = 'light';
}Use for: global CSS theming, third-party library integration, Experience Cloud sites, simple leaf components. Query with this.querySelector() instead of this.template.querySelector().
Spring '26 Features
SLDS 2.0
Use --slds-c-* styling hooks (replaces --lwc-* design tokens). Run npx slds-lint to check compliance.
TypeScript Support
npm install --save-dev @salesforce/lightning-typesComplex Template Expressions (Beta)
<p>{account.Name ?? 'Unknown Account'}</p>
<p>{formatRevenue(account.AnnualRevenue)}</p>Use getters for production code until this reaches GA.
LWC in Screen Flows
Expose components as Flow screen actions via lightning__FlowScreen target. Implement @api validate() for Flow navigation validation.
Related
Guardrails
- sf-lwc-constraints — Enforced rules for LWC naming, reactivity, security, and accessibility
Agents
- sf-lwc-agent — For interactive, in-depth LWC review guidance
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

