Skip to main content
skill CX Codex

platform-custom-tab-generate — Claude Code skill: Salesforce tabs

Writes Salesforce custom tab metadata for objects, external web pages and Visualforce pages. Useful when an app needs new navigation or a tab file keeps failing to deploy.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add forcedotcom/sf-skills --skill platform-custom-tab-generate -a claude-code
Open on GitHub

What platform-custom-tab-generate does

The skill drafts *.tab-meta.xml files. Three tab kinds are covered: navigation to an object, a link out to a website, a Visualforce page opened as a tab. Its description picks up requests about tabs, app navigation and object pages, then it follows one strict spec.

That spec is an allowlist, and the root element matters: <CustomTab>, never <Tab>, inside the metadata namespace. Children differ by type. An object tab keeps <customObject>true</customObject> plus <motif>. A web tab needs <label>, <url> and <urlEncodingKey> set to UTF-8. A Visualforce tab carries <page> instead of an address.

Anything outside the list breaks the deploy: <sobjectName>, <isHidden>, a <label> on an object tab, an empty <page></page>. One stray element is enough. The skill also insists on a motif that fits each tab's purpose rather than repeating one icon, and reads the object name from the filename, as in Space_Station__c.tab-meta.xml.

What it helps with

  • build an object tab with a fitting icon
  • point a tab at an external site and set the frame height
  • expose a Visualforce page as its own tab
  • trace a deploy error back to a stray XML element
  • give every tab a different motif

Example prompts for the agent

  • Create a web tab named Knowledge_Base for our external help site, frame height 600.
  • Add an object tab for Space_Station__c and pick a matching motif.
  • The deploy broke on Custom_Page_Tab.tab-meta.xml, find the bad element and fix it.

How to install platform-custom-tab-generate

1Skills CLI (Vercel)

npx skills add forcedotcom/sf-skills --skill platform-custom-tab-generate -a claude-code

2Manually: put the files in place

~/.claude/skills/platform-custom-tab-generate/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/platform-custom-tab-generate/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about platform-custom-tab-generate

How do I install platform-custom-tab-generate in Claude Code?

Run npx skills add forcedotcom/sf-skills --skill platform-custom-tab-generate -a claude-code. The skill file lands at ~/.claude/skills/platform-custom-tab-generate/SKILL.md.

What does platform-custom-tab-generate do?

It generates Salesforce custom tab metadata for objects, web pages and Visualforce pages, checking each file against a fixed list of allowed <CustomTab> elements.

Why does a custom tab deploy fail?

Usually a field the schema does not permit: <sobjectName>, <isHidden>, <label> on an object tab, or an empty tag such as <page></page>. The skill strips those and keeps only the allowed elements.

Source text

SKILL.md · Apache-2.0
---
name: platform-custom-tab-generate
description: "Use this skill when users need to create or configure Salesforce Custom Tabs. Trigger when users mention tabs, navigation tabs, object tabs, web tabs, Visualforce tabs, Lightning component tabs, app page tabs, or tab configuration. Also use when users want to add navigation to custom objects, create tabs for external content, or set up Lightning page tabs. Always use this skill for any custom tab work."
metadata:
  version: "1.0"
  domains: ["Platform"]
  minApiVersion: "60.0"
---

## When to Use This Skill

Use this skill when you need to:
- Create tabs for objects, web pages, or Visualforce pages
- Add navigation tabs to applications
- Configure tab visibility and access
- Troubleshoot deployment errors related to custom tabs

## Specification

# CustomTab Metadata Specification

## Overview
Custom tabs for navigating to objects, web content, or Visualforce pages within Salesforce applications.

## Purpose
- Provide navigation to custom objects
- Link to external web content
- Access Visualforce pages
- Organize application navigation

## Required Properties

### Core Tab Properties
- **customObject**: `true` for custom object tabs, `false` for all others.
- **motif**: Tab icon style — choose a motif that semantically matches the object's purpose. Do NOT reuse the same motif for every tab.
- **label**: Display name (required for non-object tabs ONLY; object tabs inherit label from the object)
- **url**: Web URL (for web tabs)
- **page**: Visualforce page name (for Visualforce tabs)


### STRICT ELEMENT ALLOWLIST — READ THIS FIRST

**The root element MUST always be `<CustomTab>` (NOT `<Tab>`).** The XML namespace must be `xmlns="http://soap.sforce.com/2006/04/metadata"`.

Only the elements listed below are valid. **Any element not on this list WILL cause a deployment error.**

| Tab Type | ONLY these elements are allowed (nothing else) |
|---|---|
| **Object tabs** | `<customObject>` (required, set to `true`), `<motif>` (required), `<description>` (optional) |
| **Web tabs** | `<customObject>` (required, set to `false`), `<label>` (required), `<motif>` (required), `<url>` (required), `<urlEncodingKey>` (required, set to `UTF-8`), `<description>` (optional), `<frameHeight>` (optional) |
| **Visualforce tabs** | `<customObject>` (required, set to `false`), `<label>` (required), `<motif>` (required), `<page>` (required), `<description>` (optional) |

### FORBIDDEN ELEMENTS (every one of these causes a deployment error)
`<sobjectName>`, `<name>`, `<fullName>`, `<apiVersion>`, `<isHidden>`, `<tabVisibility>`, `<type>`, `<mobileReady>`, `<urlFrameHeight>`, `<urlType>`, `<urlRedirect>`, `<encodingKey>`, `<height>`, `<auraComponent>`

Also forbidden:
- `<label>` on object tabs (object tabs inherit their label from the custom object)
- `<page>` on web tabs (only for Visualforce tabs)
- Empty elements like `<page></page>` or `<description></description>`
- Any element not in the allowlist table above

## Tab Types

### Object Tabs
- **Purpose**: Navigate to custom or standard objects
- **File name** determines the object: `{ObjectApiName}.tab-meta.xml` (e.g., `Space_Station__c.tab-meta.xml`)
- **Required elements**: `<customObject>true</customObject>` and `<motif>`
- **Correct example** (for a Space_Station__c.tab-meta.xml):
```xml
<?xml version="1.0" encoding="UTF-8"?>
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
    <customObject>true</customObject>
    <motif>Custom39: Telescope</motif>
</CustomTab>
```
- **Correct example** (for a Supply__c.tab-meta.xml — note different motif):
```xml
<?xml version="1.0" encoding="UTF-8"?>
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
    <customObject>true</customObject>
    <motif>Custom98: Truck</motif>
</CustomTab>
```
- **WRONG** — do NOT add `<sobjectName>`, `<name>`, `<fullName>`, or `<label>`:
```xml
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
    <sobjectName>Space_Station__c</sobjectName>  <!-- DEPLOYMENT ERROR -->
    <label>Space Station</label>                  <!-- DEPLOYMENT ERROR on object tabs -->
    <customObject>true</customObject>
    <motif>Custom57: Desert</motif>
</CustomTab>
```

### Web Tabs
- **Purpose**: Link to external websites or web applications
- **File name**: Use a descriptive name: `{TabName}.tab-meta.xml` (e.g., `Knowledge_Base.tab-meta.xml`)
- **COPY THIS EXACT TEMPLATE** — only replace the placeholder values. Do NOT add, remove, or rename any XML elements:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
    <customObject>false</customObject>
    <description>REPLACE_WITH_DESCRIPTION</description>
    <frameHeight>600</frameHeight>
    <label>REPLACE_WITH_LABEL</label>
    <motif>REPLACE_WITH_MOTIF</motif>
    <url>REPLACE_WITH_URL</url>
    <urlEncodingKey>UTF-8</urlEncodingKey>
</CustomTab>
```
- **These 7 elements above are the ONLY elements allowed in a web tab file.** Do not add ANY other elements.
- The `<description>` element is optional — you may remove it if not needed, but do not add anything else.

### Visualforce Tabs
- **Purpose**: Access custom Visualforce pages
- **File name**: `{TabName}.tab-meta.xml` (e.g., `Custom_Page_Tab.tab-meta.xml`)
- **Required elements**: `<customObject>false</customObject>`, `<label>`, `<motif>`, `<page>`
- **Correct example**:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
    <customObject>false</customObject>
    <label>Custom Page</label>
    <motif>Custom46: Computer</motif>
    <page>CustomPage</page>
</CustomTab>
```

## Tab Configuration

### Tab Style
- **Default**: Use standard tab styling
- **Custom**: Can specify custom tab styles if needed

### Tab Visibility
- **Default**: Visible to all users with access
- **Custom**: Can be configured for specific user profiles

## Supported Applications
- **Standard Apps**: Available in standard Salesforce applications
- **Custom Apps**: Can be included in custom applications
- **Community Apps**: Available in community applications

## Integration Points
- **Object Relationships**: Links to related object records
- **Web Content**: External website integration
- **Visualforce Pages**: Custom page functionality
- **Lightning Components**: Modern component integration
## Best Practices
- Use clear, descriptive tab labels
- Choose appropriate tab types for functionality
- **Select a unique, contextually relevant motif for each tab** — do not default every tab to the same icon
- Consider user experience and navigation flow
- Test tab functionality across different applications
- Ensure proper permissions and visibility settings
- Follow consistent naming conventions
- Object tab files MUST only contain `<customObject>true</customObject>` and `<motif>` — nothing else
- Web tab files MUST only contain: `<customObject>false</customObject>`, `<label>`, `<motif>`, `<url>`, `<urlEncodingKey>`, and optionally `<description>`, `<frameHeight>` — nothing else
- Never include `<isHidden>`, `<tabVisibility>`, `<type>`, `<mobileReady>`, or empty elements

© forcedotcom · Apache-2.0 · forcedotcom/sf-skills

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set181

design-systems-slds-validate Checks Lightning Web Components against SLDS, runs the linter plus its own CSS and markup analysis, and returns a graded scorecard. CX Codex +1 5,900installs agentforce-generate Builds, audits, and debugs Salesforce Agentforce agents using Agent Script. Automates .agent files, AiAuthoringBundle metadata, and deployment via sf CLI. CX Codex +1 5,900installs platform-custom-application-generate Generates Salesforce Lightning CustomApplication metadata with tab navigation, custom branding, and action overrides. Useful when structuring role-specific apps. CX Codex +1 5,800installs agentforce-architecture-analyze Builds a metadata tree for one Agentforce agent: planner, topics, actions, flows, Apex, prompts and NGA plugins. Renders a document and a Mermaid invocation graph. CX Codex +1 5,800installs dx-code-analyzer-configure Configures Salesforce Code Analyzer, manages code-analyzer.yml, and sets up CI/CD pipelines. It validates project prerequisites and troubleshoots failing scans. CX Codex +1 5,800installs platform-custom-lightning-type-generate Builds Custom Lightning Types as JSON Schema — the input and output shapes for Einstein Agent actions. Useful when the validator keeps rejecting your schema. CX Codex +1 5,700installs agentforce-observe Analyzes production Agentforce agent behavior via Data Cloud session traces and manages Agent Health Monitoring alerts. CX Codex +1 5,700installs agentforce-test Writes and runs test suites for Agentforce agents: smoke checks, batch runs and adversarial probes. Useful once an agent is built and needs checking before it ships. CX Codex +1 5,700installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor