grzmol/vibe-force/sf-lwc-development
Claude Code and agent skill by grzmol/vibe-force
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"},{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Covers building Lightning Web Components on the Salesforce platform - bundle anatomy and js-meta.xml targets/targetConfigs, the reactivity model, @api/@wire/@track decorators, Lightning Data Service and imperative Apex, CustomEvent and Lightning Message Service communication, lifecycle hooks, template directives (lwc:if, for:each, iterator, lwc:ref, lwc:dom="manual", slots), SLDS styling hooks, shadow vs light DOM, NavigationMixin, toasts, labels and i18n, static resources and third-party JS, Lightning Web Security constraints, and performance/accessibility rules. Use this skill whenever work touches force-app/**/lwc/**, a *.js-meta.xml file, a wire adapter such as getRecord or graphql, an @AuraEnabled(cacheable=true) method consumed from JavaScript, refreshApex, a LightningMessageChannel, or when a component must be exposed to a Lightning App Page, Record Page, Flow screen, quick action, or Experience Cloud site.
Install
npx vskill@latest install grzmol/vibe-force/sf-lwc-developmentSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as grzmol/vibe-force/sf-lwc-development.
Lightning Web Components Development
When to use
| Situation | Use this skill | |
|---|---|---|
Creating or editing anything under force-app/main/default/lwc/ | Yes | |
Choosing between @wire, imperative Apex, and Lightning Data Service | Yes | |
| Component must appear in Lightning App Builder, Flow Builder, or Experience Builder | Yes | |
| Writing the Apex controller behind the component | Skill sf-apex-development (this skill covers only the JS side of the contract) | |
| Writing Jest tests for the component | Skill sf-lwc-jest-testing | |
| Previewing the component without deploying | Skill sf-local-development | |
| ESLint/PMD/Code Analyzer findings on LWC JS | Skill sf-code-analyzer-quality | |
| Generating a component, spec or migration with Salesforce DX MCP tools or Agentforce Vibes LWC skills | Yes - `references/mcp-and-skills.md`, then the same gates apply |
LWC is the owner slice of sf-lwc-engineer in wave 1: lwc/ and aura/ only. Apex signatures the component consumes are fixed in wave 0 and recorded in .vibeforce/state/contract.md.
Decision table
| Need | Mechanism | Cacheable | Refresh path | |
|---|---|---|---|---|
| Read one record, fields known at build time | @wire(getRecord, {recordId, fields}) | Yes (LDS) | Automatic; notifyRecordUpdateAvailable() after out-of-band writes | |
| Read several related objects in one round trip | @wire(graphql, {query, variables}) | Yes (LDS) | refreshGraphQL / re-evaluate variables | |
| Read object metadata or picklists | getObjectInfo, getPicklistValues | Yes (LDS) | Automatic | |
| Read a query/aggregate LDS cannot express | @wire(apexMethod) with @AuraEnabled(cacheable=true) | Yes (client cache) | refreshApex(this.wiredResult) | |
| Write one record, standard fields | createRecord / updateRecord / deleteRecord (lightning/uiRecordApi) | n/a | LDS updates wires automatically | |
| Write with server-side business logic | imperative Apex (@AuraEnabled, never cacheable=true) | No | await notifyRecordUpdateAvailable([{recordId}]) | |
| Form UI with zero JS | lightning-record-form / lightning-record-edit-form | n/a | onsuccess event | |
| Fire-and-forget action on user click | imperative Apex in an async handler | No | n/a |
Rule: a method annotated @AuraEnabled(cacheable=true) cannot perform DML; it is the only shape @wire accepts. Any DML path must be a separate non-cacheable @AuraEnabled method.
Core patterns
1. Bundle anatomy and configuration
apiVersion comes from config/vibe-force.defaults.json (67.0). Beginning in Spring '25 every component must carry an apiVersion tag to be saved back to Salesforce. isExposed=false hides the component from all builders; exposure additionally requires at least one <target>. Full target list: references/component-reference.md.
2. Reactivity: fields, not state objects
Reassigning a field to an ===-equal primitive is not a mutation and does not rerender. Prefer immutable replacement ({...obj}, [...arr]) over @track; reserve @track for deep mutation you genuinely cannot avoid. @track and @api on the same property is a compile error (LWC1093).
3. Public API: @api properties and methods
Never mutate an @api property from inside the component; the owner owns the value. Public property setters run before connectedCallback() on initial render and again on every reassignment by the owner.
4. Wire service and refresh
$recordId makes the configuration dynamic: when recordId changes, the adapter re-provisions. refreshApex takes the value provisioned by an Apex @wire (the whole result object, not result.data). Never mutate a wire configuration property inside renderedCallback(); that is an infinite-loop generator.
5. Imperative Apex and error shape
Apex errors reach JavaScript as { body: { message } } for AuraHandledException, and as { body: { pageErrors: [], fieldErrors: {}, output: {...} } } for DML/record errors from LDS. Always reduce defensively - see references/data-access-patterns.md for a complete reduceErrors helper.
6. Events: child to parent, and cross-tree
Defaults are bubbles: false, composed: false: the event stops at the component boundary, which is what you want for parent/child. Use { bubbles: true, composed: true } only for genuinely application-level events, and never put mutable objects in detail. For sibling or cross-DOM communication use Lightning Message Service, not a home-grown pubsub module:
7. Lifecycle hooks
| Hook | Fires | Safe to do | Never do | |
|---|---|---|---|---|
constructor() | Once, before insertion | Call super() first, set non-DOM defaults | Touch this.template, read @api values | |
connectedCallback() | On DOM insertion, parent to child | Subscribe (LMS, message bus), read @api props, kick off imperative calls | Assume children rendered | |
render() | Before each render | Return an imported template for multi-template components | Side effects | |
renderedCallback() | After every render, child to parent | One-time third-party init guarded by a boolean, imperative DOM reads | Mutate @api/wire-config props (infinite loop) | |
disconnectedCallback() | On DOM removal | unsubscribe, clearInterval, abort fetches | Assume it runs on tab close | |
errorCallback(error, stack) | Child throws in lifecycle/render | Render a fallback, log | Swallow silently |
8. Templates
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/sf-lwc-development/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooksconfigConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/grzmol/vibe-force/sf-lwc-development)