optimizely-model-reactlisted
Install: claude install-skill tgardner18/optitech-nextjs
# Optimizely React Component Generator
This skill generates React components for Optimizely CMS content types and display templates, following SDK patterns and best practices.
## When to Use This Skill
Use this skill when the user wants to:
- Create a React component for an existing content type definition
- Implement rendering logic for a page, component, or experience type
- Add a React component for a display template
- Generate component boilerplate that follows Optimizely SDK patterns
## Prerequisites
Before generating a React component, you need:
1. An existing content type or display template definition (created via `optimizely-model` skill)
2. The `optimizely.config.mjs` file to determine the components directory
3. The SDK package `@optimizely/cms-sdk` installed
## Step 1: Locate the Content Type or Display Template
First, find where the content type or display template is defined:
1. Ask the user which content type or display template they want to create a component for
2. Search for the content type definition using Grep:
```
pattern: "export const.*ContentType = contentType"
or
pattern: "export const.*DisplayTemplate = displayTemplate"
```
3. Read the file containing the definition to understand:
- Property names and types
- Base type (page, component, experience)
- Array items and content references
- Embedded components
- Display template settings
## Step 2: Determine File Strategy
Choose where to add the React component: