Skip to content
Back to skills

Lwc Component Scaffold

ASecurity

Scaffold a Lightning Web Component bundle (.html / .js / .js-meta.xml) with an FLS-aware Apex controller. Use when creating a new LWC.

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 23, 2026
ai-agentsapisecurity

Works with

  • api

Security analysis

A100/100

Scanned September 23, 2026

npx -y skills add mcorbett51090/RavenClaude --skill lwc-component-scaffold --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lwc Component Scaffold?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lwc Component Scaffold
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mcorbett51090-lwc-component-scaffold/badge)](https://www.skillsdirectory.com/skills/mcorbett51090-lwc-component-scaffold)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: lwc-component-scaffold
description: Scaffold a Lightning Web Component bundle (.html / .js / .js-meta.xml) with an FLS-aware Apex controller. Use when creating a new LWC.
---

# LWC Component Scaffold

Generate a complete LWC bundle wired to a secure, cacheable Apex controller.

## When to use

Creating a new Lightning Web Component that reads or writes Salesforce data.

## Steps

1. **Bundle trio.** Produce `<name>.html`, `<name>.js`, and `<name>.js-meta.xml` with the right `apiVersion`, targets, and exposure. See `templates/lwc-bundle.md`.
2. **Wire data the lightning way.** Prefer `@wire` to a cacheable Apex method or to `getRecord`/UI API over imperative calls; reach for imperative Apex only for user-triggered actions.
3. **FLS-aware controller.** The Apex controller method is `@AuraEnabled(cacheable=true)` for reads, uses `WITH USER_MODE` (or `Security.stripInaccessible`), and is `with sharing`. **At API v67.0+ `WITH SECURITY_ENFORCED` no longer compiles** — use `WITH USER_MODE`. (House opinions #6-#7.) `[verify-at-build]`
4. **Bulk-safe controller.** No SOQL/DML in loops; accept and return collections where the UI is list-shaped.
5. **Error handling.** Surface controller errors to the template; never swallow them.

## Output

The three bundle files, the Apex controller, and a note on which FLS enforcement and sharing mode were applied. Escalate any security concern to `ravenclaude-core/security-reviewer`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…