> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: AI-Assisted Development

## Article: AI-Assisted Development

## Article Link: https://dev.wix.com/docs/wix-design-system/contributing/ai-assisted-development.md

## Article Content:

<!-- heading -->

# AI-Assisted Development

<!-- end heading -->

<br />

> This repository is equipped with AI agent instructions, slash commands, and migration guides that help you work faster with AI coding assistants. Whether you're migrating a component, creating tokens, or writing tests, there's likely an AI-assisted workflow ready to help.

---

## Getting Started

Open the repo in any AI coding assistant (Claude Code, Cursor, Codex, etc.) and it automatically picks up all the agent configuration, with no setup required.

The repo ships with:

- **Slash commands**: one-shot workflows you invoke with `/command-name`
- **Migration guides**: detailed instructions the AI follows when converting components
- **Coding conventions**: rules the AI enforces automatically (testing patterns, code style, etc.)

---

## Slash Commands

Slash commands are ready-made workflows that handle common tasks end-to-end. Type the command in your AI coding tool and it takes it from there.

### /create-pr

Creates a pull request following the repo's conventions. It handles branch naming, Conventional Commits title formatting, and description templates, including the "How did you test this?" checklist for `feat` and `fix` PRs.

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
/create-pr
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

The AI will:
- Rename your branch to match the PR type (for example, `feat-button-loading-prop`)
- Format the title as `type(scope): subject`
- Ask you for references (Slack thread, Figma spec) before creating the PR
- Include the appropriate testing checklist

### /create-goal

Turns a vague task request into a precise, self-contained goal document to paste into the `goal` command. It grounds the brief in the codebase first (relevant code, git history, conventions), asks you only the decisions that are genuinely yours, then writes a standalone goal under the runner's 4000-character limit.

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
/create-goal
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

The goal covers the whole lifecycle: change, tests, build/verify, and branch/commit/push/PR. It carries concrete anchors, such as commit SHAs, file paths, and component and token names, so it stands alone without the originating conversation.

### /create-code-snippet

Generates a Storybook playground code snippet for quick demos and testing. Just describe what you want to see and the AI produces a runnable snippet.

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
/create-code-snippet Button with all sizes and a loading state
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

Snippets follow playground conventions: no imports needed, `Box` for layout, `React.` prefix for hooks.

### /create-token

Creates a design token across all five themes (`default`, `odeditor`, `odeditor-dark`, `studio`, `studio2-light`) with optional per-theme overrides. Supports `foundation`, `semantic`, and `component` levels.

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
/create-token sidebar.item.gap component "{space.100}" odeditor-dark:{space.150} studio:{space.50}
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

The AI handles JSON structure, type inference, validation against existing tokens, and runs `pnpm generate` afterward.

### /tokenize-component-from-figma

Automates applying design tokens from a Figma spec to a component's CSS files. Give it a Figma link and the component name, and it will:

1. Fetch tokens from Figma
2. Map Figma token names to codebase CSS variables
3. Replace hardcoded `value()` calls with `var(--wds-...)` using proper fallbacks
4. Apply typography mixins where appropriate
5. Handle nested sub-component style files

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
/tokenize-component-from-figma https://www.figma.com/design/abc123/...?node-id=123-456
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

### /visual-test-renaming

Guides you through renaming visual tests and cleaning up generated screenshots across all themes. Handles the full lifecycle: renaming in source `.visual.tsx` files, deleting old screenshots, and regenerating new ones.

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
/visual-test-renaming
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

---

## Migrations

The repo includes detailed migration guides that the AI follows step-by-step. You don't need to memorize the rules. Just ask the AI to perform the migration on a component.

### JavaScript to TypeScript

Converts JS components to TypeScript with zero breaking changes. The AI handles:

- File renames (`.js` → `.tsx`, removing `.d.ts` files)
- Type extraction into `ComponentName.types.ts`
- Data hooks consolidation into `ComponentName.constants.ts`
- Driver typing (`ComponentName.uni.driver.ts`), keeping method descriptions but dropping the `@param`, `@return` and `@returns` tags the types now cover

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
Migrate the Accordion component from JS to TypeScript
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

### Class to functional components

Converts class components to functional components using hooks. The AI maps:

| Class Pattern | Functional Pattern |
| --- | --- |
| `this.state` | `useState` |
| `componentDidMount` | `useEffect(() => {}, [])` |
| `componentWillUnmount` | cleanup in `useEffect` |
| `componentDidUpdate` | `useEffect(() => {}, [deps])` |
| Public methods via ref | `forwardRef` + `useImperativeHandle` |

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
Convert the Stepper component from class to functional
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

Both migrations preserve the public API. Props, ref methods, events, and display names remain identical.

---

## Built-in Conventions

The AI is pre-loaded with coding conventions specific to this repo. These are enforced automatically when it writes code, so you don't need to remember them all:

| Convention | What it does |
| --- | --- |
| **Visual testing** | Follows the `visualize → story → snap` pattern with `storybook-snapper` |
| **E2E testing** | Uses Playwright with Sled infrastructure, correct file naming, and `data-hook` patterns |
| **No setTimeout** | Avoids `setTimeout` for timing workarounds and uses proper async patterns instead |
| **TypeScript types** | Maintains TypeScript type definitions as the source of truth |
| **Prop documentation** | Writes the description of every prop it adds or changes in the same change, in the Wix writing style |
| **Unused CSS vars** | Removes unused CSS variables from Stylable files |
| **Component token overrides** | Overrides literal CSS properties on Stylable-extended selectors instead of reassigning global tokens |
| **Design tokens** | Follows the token hierarchy (foundation → semantic → component) |
| **Illustration conventions** | Follows the SVG build pipeline and naming patterns |
| **Docs content** | Writes guideline and introduction pages in the house voice, with real image alt text and the page conventions this site uses |

---

## Example Prompts

Here are some prompts you can use directly with the AI to accomplish common tasks:

**Component work:**

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
Add a "loading" prop to the Button component with visual and unit tests
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
Fix the DatePicker week start day bug — it should respect the locale
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

**Testing:**

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
Write visual tests for the Accordion component covering all skins and sizes
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
Add E2E tests for the Modal close-on-overlay-click behavior
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

**Tokens and Figma:**

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
Tokenize the Sidebar component using this Figma link: https://figma.com/design/...
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
Create a component token for carousel.slide.gap with value {space.200}
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

**Migrations:**

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
Migrate the ToggleSwitch component from JS to TypeScript
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
Convert the ColorPicker from a class component to functional
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->

**Pull requests:**

<!-- grid layout -->

<!-- grid layout item -->

<!-- grid layout content -->

```
/create-pr
```

<!-- end grid layout content -->

<!-- end grid layout item -->

<!-- end grid layout -->


<br>
<br>
<br>
<br>
<br>