
Generating Custom Lightning Type
Generate Custom Lightning Types (CLTs) with JSON Schema, editor/renderer config, and deployment-safe patterns for Einstein Agent actions on Salesforce.
Install
npx skills add https://github.com/forcedotcom/sf-skills --skill generating-custom-lightning-typeWhat is this skill?
- End-to-end CLT creation for Einstein Agent structured inputs and outputs
- JSON Schema type definitions aligned with Lightning Platform conventions
- Referenced nested CLT pattern via `lightning:type` `c__<CLTName>` FQN rules
- Editor and renderer configuration guidance for custom Lightning UI
- Troubleshooting deployment errors specific to Custom Lightning Types
Adoption & trust: 729 installs on skills.sh; 513 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Microsoft Foundrymicrosoft/azure-skills
Azure Aimicrosoft/azure-skills
Azure Hosted Copilot Sdkmicrosoft/azure-skills
Lark Eventlarksuite/cli
Running Claude Code Via Litellm Copilotxixu-me/skills
Setup Matt Pocock Skillsmattpocock/skills
Journey fit
Primary fit
Build is where Salesforce teams define structured agent I/O and Lightning metadata before agents ship to org users. Integrations captures platform-specific type registration, `lightning:type` references, and agent action schemas—not generic UI polish alone.
Common Questions / FAQ
Is Generating Custom Lightning Type safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Generating Custom Lightning Type
## When to Use This Skill Use this skill when you need to: - Create Custom Lightning Types (CLTs) for structured inputs/outputs - Generate JSON Schema-based type definitions for Lightning Platform - Configure CLTs for Einstein Agent actions - Set up editor and renderer configurations for custom UI - Troubleshoot deployment errors related to Custom Lightning Types ## Specification # CustomLightningType Metadata Specification ## Overview & Purpose Custom Lightning Types (CLTs) are JSON Schema-based type definitions used by the Lightning Platform (including Einstein Agent actions) to describe structured inputs/outputs and drive editor/renderer experiences. ## Configuration - **Choose referenced CLT pattern for nested objects** - When you need a **reusable** or **separately deployed** nested type, create a CLT for that shape and reference it with `"lightning:type": "c__<CLTName>"`. That string is the referenced type’s **`lightning:type` value / FQN / registered identifier** — not the JSON Schema `title`. - **Choose standard Lightning types** when the structure is simple and can be expressed with properties and supported primitive `lightning:type` identifiers. - **Choose Apex class types** (`@apexClassType/...`) when the structure already exists server-side and you want the Apex class to define the shape. - **Include editor/renderer config** only when you need custom UI behavior (custom LWC input/output components). Otherwise, omit. ## Critical Rules (Read First) - **Root object schemas MUST include**: - `"type": "object"` - `"title"` - `"lightning:type": "lightning__objectType"` - `"unevaluatedProperties": false` - `"unevaluatedProperties"` is enforced as `false` by the CLT metaschema. Do not set it to `true`. - **Root object schemas MUST NOT include** `"examples"` when `"unevaluatedProperties": false` is set. - **Nested objects (inside `properties`) MUST NOT set** `"lightning:type": "lightning__objectType"`. - Nested objects can be: references to other CLTs using `c__<CLTName>` syntax. - **List/array properties are highly restricted by the CLT metaschema**: - **CRITICAL LIMITATION**: the CLT metaschema may reject the `items` keyword entirely. Treat `items` as **disallowed by default**. - **Root-level arrays** (direct children of the root `properties`): - **MUST include** `"lightning:type": "lightning__listType"` - **MUST NOT include** `"items"` - **OPTIONAL** `"type": "array"` - **Nested arrays** (arrays inside nested objects) are the most common failure: - **MUST include** `"type": "array"` - **MUST NOT include** `"lightning:type": "lightning__listType"` - **MUST NOT include** `"items"` - **When `"unevaluatedProperties": false` is set, any unknown keyword will fail validation**. Prefer removing keywords over relaxing strictness. - **Apex class CLTs are minimal**: - Include **only** `title`, `description` (optional), and `lightning:type` set to `@apexClassType/...`. - Do **not** add `type`, `properties`, `required`, or `unevaluatedProperties`. ## Additional CLT Metaschema Validations - **Org namespace validation**: titles/descriptions and other string fields may be validated to ensure you are not using an org namespace in places that are disallowed. - **Lightning type validation**: CLTs are validated to prevent referencing internal namespaces (for example, disallowing types from internal namespaces like `sfdc_cms` where not permitted). - **Object type validation**: the CLT root is validated to ensure `lightning:type` is exactly `lightning__objectType`