From 6be588acf5a72cf413a15286c923709ef7d8da62 Mon Sep 17 00:00:00 2001 From: Suhani Gupta Date: Tue, 12 May 2026 17:37:17 +0530 Subject: [PATCH] refactor-clt-skills-using-progressive-disclosure --- .../generating-custom-lightning-type/SKILL.md | 38 +---------------- .../assets/primitive-types-and-constraints.md | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+), 37 deletions(-) create mode 100644 skills/generating-custom-lightning-type/assets/primitive-types-and-constraints.md diff --git a/skills/generating-custom-lightning-type/SKILL.md b/skills/generating-custom-lightning-type/SKILL.md index 45511e0..fd15ed1 100644 --- a/skills/generating-custom-lightning-type/SKILL.md +++ b/skills/generating-custom-lightning-type/SKILL.md @@ -56,39 +56,8 @@ Custom Lightning Types (CLTs) are JSON Schema-based type definitions used by the - **Object type validation**: the CLT root is validated to ensure `lightning:type` is exactly `lightning__objectType`. ## Primitive Types & Constraints -- `lightning__textType` - - Max length 255 -- `lightning__multilineTextType` - - Max length 2000 -- `lightning__richTextType` - - Max length 100000 -- `lightning__urlType` - - Max length 2000 - - Optional `lightning:allowedUrlSchemes` enum values: `https`, `http`, `relative`, `mailto`, `tel` -- `lightning__dateType` - - Data pattern: YYYY-MM-DD -- `lightning__timeType` - - Data pattern: HH:MM:SS.sssZ -- `lightning__dateTimeType` - - Data shape is an object with required `dateTime` and optional `timeZone` -- `lightning__numberType` - - Decimal numbers; optional `maximum`, `minimum`, `multipleOf` -- `lightning__integerType` - - Whole numbers only; optional `maximum`, `minimum` -- `lightning__booleanType` - - true/false -## Allowed Property-Level Keywords -When strict validation is enabled (`unevaluatedProperties: false`), keep each property minimal and prefer only keywords known to be allowed: -- `title`, `description`, `einstein:description` -- `type` (when used, ensure it matches the chosen `lightning:type`) -- `lightning:type` -- `maximum`, `minimum`, `multipleOf` (numeric) -- `maxLength`, `minLength` (string) -- `const`, `enum` -- `lightning:textIndexed`, `lightning:supportsPersonalization`, `lightning:localizable` -- `lightning:uiOptions`, `lightning:allowedUrlSchemes` -- `lightning:tags` (metaschema restricts values; currently `flow` is the only known allowed tag) +When you need the full list of supported primitive types, their constraints, and allowed property-level keywords, read `assets/primitive-types-and-constraints.md`. ## Generation Workflow 1. **Confirm the CLT approach** @@ -164,11 +133,6 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr ``` -7. **Deploy and validate** - - Run a final schema sanity check before deploy: valid `lightning:type` names, required fields present, and no disallowed keywords. - - Deploy the bundle using your org's standard metadata deployment flow (e.g. Salesforce CLI or IDE). The MCP client or tooling in use should provide or integrate with the appropriate deploy/retrieve commands for Lightning Type bundles. - - Validate incrementally: if deployment fails, remove disallowed keywords first (especially `examples`, `items`, nested `lightning:type`). - ## Common Deployment Errors | Error / Symptom | Likely Cause | Fix | |---|---|---| diff --git a/skills/generating-custom-lightning-type/assets/primitive-types-and-constraints.md b/skills/generating-custom-lightning-type/assets/primitive-types-and-constraints.md new file mode 100644 index 0000000..9d2de68 --- /dev/null +++ b/skills/generating-custom-lightning-type/assets/primitive-types-and-constraints.md @@ -0,0 +1,41 @@ +# Primitive Types & Constraints + +Reference for all supported Lightning primitive types and their allowed constraints. + +## Supported Types + +- `lightning__textType` + - Max length 255 +- `lightning__multilineTextType` + - Max length 2000 +- `lightning__richTextType` + - Max length 100000 +- `lightning__urlType` + - Max length 2000 + - Optional `lightning:allowedUrlSchemes` enum values: `https`, `http`, `relative`, `mailto`, `tel` +- `lightning__dateType` + - Data pattern: YYYY-MM-DD +- `lightning__timeType` + - Data pattern: HH:MM:SS.sssZ +- `lightning__dateTimeType` + - Data shape is an object with required `dateTime` and optional `timeZone` +- `lightning__numberType` + - Decimal numbers; optional `maximum`, `minimum`, `multipleOf` +- `lightning__integerType` + - Whole numbers only; optional `maximum`, `minimum` +- `lightning__booleanType` + - true/false + +## Allowed Property-Level Keywords + +When strict validation is enabled (`unevaluatedProperties: false`), keep each property minimal and prefer only keywords known to be allowed: + +- `title`, `description`, `einstein:description` +- `type` (when used, ensure it matches the chosen `lightning:type`) +- `lightning:type` +- `maximum`, `minimum`, `multipleOf` (numeric) +- `maxLength`, `minLength` (string) +- `const`, `enum` +- `lightning:textIndexed`, `lightning:supportsPersonalization`, `lightning:localizable` +- `lightning:uiOptions`, `lightning:allowedUrlSchemes` +- `lightning:tags` (metaschema restricts values; currently `flow` is the only known allowed tag)