lwc

lwc is a command for Claude Code from bhanu91221/sfdx-iq. It costs 11 tokens per session (2,685 once invoked), scanned A, original, MIT.

A command for creating, explaining, improving, or debugging Salesforce Lightning Web Components, which are reusable interface parts in Salesforce.

In plain words
What is it for?
Use it to build new components, understand existing ones, refine their behavior, or diagnose and fix bugs.
Why use it?
It brings the component code, its server-side data access, tests, and Salesforce placement decisions into one workflow.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the sfdx-iq plugin — 20 commands, 7 agents shipped together

Good fit Use it to build new components, understand existing ones, refine their behavior, or diagnose and fix bugs.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/bhanu91221/sfdx-iq/lwc
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/bhanu91221/sfdx-iq

Made for: Claude Code.

Or install sfdx-iq, the plugin that ships this one along with the rest of its 20 commands, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lwc

README.md
[![agentmods](https://agentmods.dev/badge/commands/bhanu91221/sfdx-iq/lwc.svg)](https://agentmods.dev/commands/bhanu91221/sfdx-iq/lwc)
Your own site
<a href="https://agentmods.dev/commands/bhanu91221/sfdx-iq/lwc"><img src="https://agentmods.dev/badge/commands/bhanu91221/sfdx-iq/lwc.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,685 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.02685
Opus 5 $0.00005 $0.01342
Sonnet 5 $0.00002 $0.00537
Haiku 4.5 $0.00001 $0.00268

Measured 7d ago against content hash fcf463fc7a46, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

lwc scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/lwc.md · 324 lines

How it starts

The opening of the file, as written. The whole thing — 324 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/lwc

Work with Salesforce Lightning Web Components using --new, --explain, --refine, or --bug-fix.

Usage

/lwc --new          Create a new LWC component with Apex controller and tests
/lwc --explain      Explain what an existing LWC component does
/lwc --refine       Modify an existing LWC component
/lwc --bug-fix      Diagnose and fix a bug in an LWC component

--new: Create a New LWC Component

Gather Requirements

Ask the user:

  1. Component name (camelCase, e.g., accountSummaryCard)
  2. Purpose and what it displays/does
  3. Where is it placed? (App Page, Record Page, Home Page, utility bar, flow screen)
  4. Does it need Apex data? (which object, which fields)
  5. Any parent/child component interactions? (@api properties, custom events)
  6. Navigation, toast notifications, or Lightning Message Service?

LWC Standards (baked in)

File Structure:

force-app/main/default/lwc/accountSummaryCard/
├── accountSummaryCard.html          — template
├── accountSummaryCard.js            — controller
├── accountSummaryCard.js-meta.xml   — metadata (targets, supported contexts)
└── accountSummaryCard.css           — styles (optional)

Component Template Pattern:

<!-- accountSummaryCard.html -->
<template>
    <!-- Loading state -->
    <template if:true={isLoading}>
        <lightning-spinner alternative-text="Loading" size="small"></lightning-spinner>
    </template>

    <!-- Error state -->
    <template if:true={error}>
        <p class="slds-text-color_error">{errorMessage}</p>
    </template>

    <!-- Data state -->
    <template if:true={account}>
        <lightning-card title={account.Name} icon-name="standard:account">
            <div class="slds-p-around_medium">
                <p>{account.Industry}</p>
            </div>
            <div slot="footer">
                <lightning-button label="Edit" onclick={handleEdit}></lightning-button>
            </div>
        </lightning-card>
    </template>
</template>

Read the full file on GitHub · 324 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 324 lines · 11 tokens per session scan A fcf463fc7a46

Subscribe to this mod's changes

lwc is a command published in the GitHub repository bhanu91221/sfdx-iq (2 stars, last pushed 3mo ago), licensed MIT. It adds 11 tokens to every session and 2,685 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.