Create LWC with Tab

VerifiedCaution

Creates a new Lightning Web Component with a tab and flexipage for display. Use when you need to create a new standalone page/tab with an LWC component.

Sby Skills Guide Bot
DevelopmentIntermediate
3/4/2026
Claude Code
#salesforce#lwc#flexipage#metadata#deployment

Recommended for

Automated summary

Scaffolds a Salesforce Lightning Web Component together with its custom tab and flexipage metadata, then deploys it with the Salesforce CLI.

Strengths

  • Generates every required file in one pass: JS, HTML, js-meta.xml, tab and flexipage
  • Calls out the mandatory <identifier> element that otherwise breaks flexipage deployment
  • Ships a ready-to-run sf project deploy start command
  • Notes that new flexipages need activation and points to a companion skill

Limitations

  • The target org is hardcoded (lubavitchrv_partial) and must be changed per project
  • API version 62.0 and the tab motif are fixed with no parameterization
  • Creates no Apex controller, tests, or permission set/profile access
When to use it

Use it when you need to quickly stand up a new standalone Salesforce page that exposes an LWC through a tab and an App Page.

When not to use it

Avoid it if the component needs Apex logic, a dynamic target org, or placement on a Record Page rather than a tab.

Security analysis

Caution
Quality score74/100

The skill is a straightforward scaffolding recipe: it writes LWC/tab/flexipage metadata files and runs a standard Salesforce deploy. There is no obfuscation, no exfiltration, no destructive filesystem or remote commands, and no attempt to bypass safety controls. The only real concerns are the declared Bash use for org deployment, a hardcoded target org alias that reduces portability/safety of the default command, and lack of input validation on the component name before path interpolation — hence caution rather than safe.

Findings
  • •Declares and uses Bash to run `sf project deploy start`, which contacts a Salesforce org and mutates remote metadata (legitimate but non-trivial side effects).
  • •Deploy command hardcodes a specific org alias (`lubavitchrv_partial`), which could cause a user to deploy into an unintended/specific org rather than their chosen target.
  • •No validation or sanitization of `$ARGUMENTS` before interpolating it into filesystem paths; a crafted name could write outside the intended lwc directory (path traversal risk, low likelihood).
  • •Tab file is described as optional and is not included in the deploy command, so the documented flow is internally inconsistent.
How this analysis is made

Examples

New list component tab
Create a new LWC called pledgeList with a tab and an app page so it shows up as a standalone page.
Scaffold and deploy
Scaffold a donorSearch LWC with its custom tab and flexipage, then deploy it to my Salesforce org.
Home page component
Create a metricsDashboard LWC exposed as both a tab and a home page, with the flexipage metadata included.

name: create-lwc-tab description: Creates a new Lightning Web Component with a tab and flexipage for display. Use when you need to create a new standalone page/tab with an LWC component. allowed-tools: Write, Bash, Read, Glob

Create LWC with Tab

Creates a new Lightning Web Component along with the necessary tab and flexipage metadata to make it accessible as a standalone page.

Arguments

$ARGUMENTS should be the component name in camelCase (e.g., pledgeList)

Files to Create

1. LWC Component

Create directory: force-app/main/default/lwc/{componentName}/

{componentName}.js:

import { LightningElement } from 'lwc';

export default class ComponentName extends LightningElement {
    // Component logic
}

{componentName}.html:

<template>
    <!-- Component template -->
</template>

{componentName}.js-meta.xml:

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>62.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__Tab</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
    </targets>
</LightningComponentBundle>

2. Custom Tab (Optional)

Create: force-app/main/default/tabs/{TabName}.tab-meta.xml

<?xml version="1.0" encoding="UTF-8"?>
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
    <label>Tab Label</label>
    <lwcComponent>{componentName}</lwcComponent>
    <motif>Custom70: Handsaw</motif>
</CustomTab>

3. Lightning App Page (Recommended)

Create: force-app/main/default/flexipages/{Page_Name}.flexipage-meta.xml

Important: Component instances MUST have an <identifier> element or deployment fails.

<?xml version="1.0" encoding="UTF-8"?>
<FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata">
    <flexiPageRegions>
        <itemInstances>
            <componentInstance>
                <componentName>c:{componentName}</componentName>
                <identifier>{componentName}1</identifier>
            </componentInstance>
        </itemInstances>
        <name>main</name>
        <type>Region</type>
    </flexiPageRegions>
    <masterLabel>Page Label</masterLabel>
    <template>
        <name>flexipage:defaultAppHomeTemplate</name>
    </template>
    <type>AppPage</type>
</FlexiPage>

Deploy

sf project deploy start \
  --source-dir force-app/main/default/lwc/{componentName} \
  --source-dir force-app/main/default/flexipages/{Page_Name}.flexipage-meta.xml \
  --target-org lubavitchrv_partial \
  --wait 10

After Deployment

New flexipages require activation before appearing in App Launcher. Use the activate-lightning-page skill if needed.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/create-lwc-with-tab-mmbizjl0/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/create-lwc-with-tab-mmbizjl0' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-lwc-with-tab-mmbizjl0/download' --output '.skill-downloads/create-lwc-with-tab-mmbizjl0/SKILL.md.part' && mv '.skill-downloads/create-lwc-with-tab-mmbizjl0/SKILL.md.part' '.skill-downloads/create-lwc-with-tab-mmbizjl0/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Write, Bash, Read, Glob

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/create-lwc-with-tab-mmbizjl0/SKILL.md' && test -s '.skill-downloads/create-lwc-with-tab-mmbizjl0/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/create-lwc-tab' && cp -R '.skill-downloads/create-lwc-with-tab-mmbizjl0' '.claude/skills/create-lwc-tab'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/create-lwc-with-tab-mmbizjl0'

openskills read 'create-lwc-with-tab-mmbizjl0'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/create-lwc-with-tab-mmbizjl0/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills