generating-custom-lightning-type

Generate Custom Lightning Type JSON Schemas for Einstein Agent inputs and outputs.

803|289|Updated Nov 7, 2025
One-click install
npx skills add https://github.com/forcedotcom/sf-skills --skill generating-custom-lightning-type-forcedotcom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generating-custom-lightning-type
Source: https://github.com/forcedotcom/sf-skills/tree/main/skills/generating-custom-lightning-type
Command: npx skills add https://github.com/forcedotcom/sf-skills --skill generating-custom-lightning-type-forcedotcom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create valid Custom Lightning Type (CLT) JSON Schemas so Einstein Agent actions and structured editor/renderer experiences can reliably ingest and output typed data.

Core Features & Use Cases

  • CLT schema generation & validation rules: Produces root object schemas with the required Lightning metadata and strict validation constraints.
  • Correct Lightning type patterns: Supports primitive lightning__* types, CLT reference patterns ("c__<CLTName>"), and Apex class-based CLTs (@apexClassType/...).
  • Optional editor/renderer configurations: Applies safe, supported editor.json and renderer.json layout/component override patterns when custom UI components are needed.
  • Troubleshooting for deployment failures: Targets common CLT validation errors like disallowed keywords and incorrect lightning:type usage.

Quick Start

Use this skill when you need a Lightning Platform Custom Lightning Type (CLT) JSON Schema for a specific Einstein Agent action input/output structure and optionally matching editor/renderer configuration.

Frequently Asked Questions about generating-custom-lightning-type

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a JSON schema for a custom Lightning type in Salesforce?

To generate a custom Lightning type JSON schema, define a root object with required Lightning metadata, use primitive lightning__* types, and reference nested objects via the c__<CLTName> pattern for valid Einstein Agent structured inputs.

Why does my custom Lightning type schema fail deployment validation?

Custom Lightning type schema deployment validation fails when forbidden keywords like examples are present, required root fields are missing, or disallowed array patterns and incorrect lightning:type usage violate the strict metaschema constraints.

Can I use an Apex class to define a custom Lightning type schema?

Yes, you can define a custom Lightning type schema using Apex class-based shape definitions by applying the @apexClassType annotation pattern to map your Apex structures directly into the Lightning Platform typed schema.

How do I configure editor and renderer overrides for a Lightning custom type?

You can configure editor and renderer overrides for a Lightning custom type by applying safe, supported componentOverride layouts within editor.json and renderer.json files to render custom UI components for your structured inputs.

What is the correct pattern for referencing nested objects in a Lightning schema?

The correct pattern for referencing nested objects in a Lightning schema is using the c__<CLTName> reference format, which allows you to define reusable typed object structures across multiple Einstein Agent action inputs and outputs.

Do I need a custom Lightning type schema for Einstein Agent actions?

Yes, Einstein Agent actions require custom Lightning type JSON schemas to reliably ingest and output typed data, ensuring structured editor and renderer experiences validate correctly against strict Lightning Platform metaschema constraints.