| name | salesforce-lwc |
| description | Use before writing Lightning Web Components. |
| allowed-tools | mcp__ide__getDiagnostics, Bash(npm run *), Bash(sf code-analyzer *), Bash(sf project deploy *), Bash(sf lightning generate *) |
Workflow
-
Read project config — Get sourceApiVersion from sfdx-project.json for the component's -meta.xml file.
-
Write the component — Create the JS, HTML, and meta.xml files following code-guidance.md.
-
Check IDE diagnostics — Use mcp__ide__getDiagnostics on new files. Fix errors and warnings before proceeding.
-
Static analysis
sf code-analyzer run --target <path-to-component> --view table
Address violations before proceeding.
-
Write Jest tests (if needed) — See test-guidance.md for when tests are warranted.
-
Run tests locally (if applicable)
npm run test:unit -- --testPathPattern=<componentName>
-
Deploy
sf project deploy start --source-dir <path-to-component>
The task is complete when the component works in the org.