Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计通过

wix-cli-site-componentWIX CLI site component CLI

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

6,728

周安装

289

GitHub Stars

9

下载量

2,358
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:wix-cli-site-component(WIX CLI site component CLI)
来源仓库:https://github.com/wix/skills
仓库路径:skills/wix-cli-site-component
安装命令:
npx skills add https://github.com/wix/skills --skill wix-cli-site-component
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/wix/skills --skill wix-cli-site-component

简介

用于辅助前端页面、组件和样式开发。

  • 适合生成或审查 React、Vue、Tailwind CSS 等相关代码。
  • 通过 npx skills add 命令从指定仓库安装并使用。
  • 需结合项目现有设计系统和路由方式,避免生成孤立片段。
  • wix-cli-site-component 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Wix Site Component Builder

Creates production-quality React site components with editor manifests for Wix CLI applications. Site components are React components that integrate with the Wix Editor, allowing site owners to customize content, styling, and behavior through a visual interface.

Prerequisite: Install @wix/editor-react-types as a dev dependency before writing any files.

Architecture

Site components consist of four required files:

1. Component Manifest (manifest.json)

Defines the contract between the React component and Wix ecosystem:

  • editorElement: Root element configuration (selector, displayName, archetype, layout)
  • cssProperties: CSS API for styling customization
  • data: Data API for content configuration
  • elements: Nested element definitions for granular editing
  • behaviors: Editor interaction behaviors

2. React Component (component.tsx)

Production-ready React functional component:

  • Implements props interface matching manifest data structure
  • Applies className and id to root element
  • Handles element removal state via wix.elementsRemovalState
  • Uses sub-component pattern for nested elements
  • Includes proper TypeScript typing and error handling

3. CSS Styles (style.css)

Modern CSS with responsive design:

  • Synced selectors with manifest and React classNames
  • CSS variables for dynamic styling
  • Responsive design without media queries (flexbox, grid, clamp)
  • Pointer events enabled for editor elements
  • No inline styles for static values
  • Each selector once only, box-sizing: border-box all elements
  • NO transition: all, NO media queries (except prefers-reduced-motion)
  • Root display: Declare --display: [value] CSS variable, then use display: var(--display) on root

4. TypeScript Types (types.ts)

Strict type definitions:

  • Import types: import type {Wix, Link, Image, Text, NumberType, BooleanValue, WebUrl, Direction} from '@wix/editor-react-types' — do NOT define these locally (installed in Prerequisites)
  • Exception: RichText — define locally as type RichText = string (the @wix/editor-react-types version is {text, html, linkList}, not a plain string)
  • Props interfaces for all components
  • Element props structure with optional chaining

Component Manifest Structure

You MUST read MANIFEST_GUIDELINES.md before implementing a site component. It contains the complete manifest structure, all data types, element configurations, and required patterns.

The manifest defines the editor contract using these key sections:

installation (Initial Placement)

{
  "installation": {
    "staticContainer": "HOMEPAGE",
    "initialSize": {
      "width": { "sizingType": "pixels", "pixels": 400 },
      "height": { "sizingType": "pixels", "pixels": 300 }
    }
  }
}
  • staticContainer: Use "HOMEPAGE" for automatic installation on Harmony editor
  • initialSize: Defines initial dimensions with sizingType options:

- "content" - Auto-size based on content - "stretched" - Fill available space - "pixels" - Fixed pixel dimension (requires pixels property)

editorElement (Root Configuration)

{
  "selector": ".component-name",
  "displayName": "Component Name",
  "archetype": "Container",
  "layout": {
    "resizeDirection": "horizontalAndVertical",
    "contentResizeDirection": "horizontal"
  },
  "cssProperties": {
    "backgroundColor": {
      "displayName": "Background Color",
      "defaultValue": "#ffffff"
    }
  },
  "data": {
    "columns": {
      "dataType": "number",
      "displayName": "Number of Columns",
      "number": { "minimum": 1, "maximum": 4 }
    }
  },
  "elements": {
    "title": {
      "elementType": "inlineElement",
      "inlineElement": {
        "selector": ".component-name__title",
        "displayName": "Title",
        "data": {
          "titleText": {
            "dataType": "text",
            "displayName": "Title Text"
          }
        },
        "behaviors": {
          "selectable": true,
          "removable": true
        }
      }
    }
  }
}

Data Types Reference

All runtime types are from @wix/editor-react-types.

Manifest dataTypeTypeScript typeUse Case
textTextNames, titles, descriptions
textEnumTextEnumPredefined options
numberNumberTypeQuantities, dimensions
booleanValueBooleanValueToggles, flags
a11yA11yAccessibility attributes
linkLinkNavigation links
imageImageImages
videoVideoMedia content
audioAudioAudio content
vectorArtVectorArtIcons, graphics
localDateLocalDate (string, YYYY-MM-DD)Date values
localTimeLocalTime (string, hh:mm[:ss][.sss])Time values
localDateTimeLocalDateTime (string, YYYY-MM-DDThh:mm[:ss][.sss])Date + time values
webUrlWebUrl (string)External URLs
richTextRichText (define locally as string)Formatted content
arrayItemsArrayItemsCollections, lists
directionDirectionHTML dir attribute
menuItemsMenuItemsNavigation menus

CSS Properties Reference

Common CSS properties for styling customization:

  • Layout: display, gap, padding, margin, width, height
  • Typography: font, fontSize, fontWeight, textAlign, color
  • Background: backgroundColor, backgroundImage
  • Border: border, borderRadius, boxShadow
  • Positioning: alignItems, justifyContent, flexDirection

Complete CSS properties reference: See CSS_GUIDELINES.md for all CSS properties, variable patterns, and styling best practices.

React Component Patterns

For components using hooks, effects, or callbacks: See REACT_PATTERNS.md — read this when your component uses useEffect, useCallback, complex state, or async operations. Contains complete patterns for hooks, arrays, refs, and SSR-safe data fetching.

Props Structure

import type { Wix, Link, Image } from '@wix/editor-react-types'; // also: Text, NumberType, BooleanValue, WebUrl, Direction

interface ComponentProps {
  // Standard props (always present)
  className: string;
  id: string;
  wix?: Wix;

  // Component-level data (from editorElement.data)
  columns?: number;
  layout?: string;

  // Element props (from elements definitions)
  elementProps?: {
    title?: {
      titleText?: string;
      wix?: Wix;
    };
    button?: {
      buttonText?: string;
      buttonLink?: Link;
      wix?: Wix;
    };
  };
}

Sub-Component Pattern

Extract every distinct UI element into a named sub-component. Each sub-component receives a className prop matching the manifest selector plus its own data props:

const Title: FC<{ titleText?: string; className: string }> = ({
  titleText = "Default Title", className
}) => <h2 className={className}>{titleText}</h2>;

const MyComponent: FC<MyComponentProps> = ({ className, id, elementProps, wix }) => {
  const removalState = wix?.elementsRemovalState || {};
  return (
    <div className={`my-component ${className}`} id={id}>
      {!removalState['title'] && <Title className="my-component__title" {...elementProps?.title} />}
    </div>
  );
};

See REACT_PATTERNS.md for full sub-component architecture, array handling, and TypeScript patterns.

Conditional Rendering

Conditionally render ALL elements per wix.elementsRemovalState: {!removalState['elementKey'] && <Element />} where removalState = wix?.elementsRemovalState || {}.

CSS Guidelines

Responsive Design Strategy

Components live in user-resizable containers (300-1200px) within varying viewports:

  • Root element: width: 100%; height: 100%
  • Layout structure: Use CSS Grid and Flexbox for fluid responsiveness
  • Typography: Use clamp() for fluid scaling
  • Spacing: Fixed or tight clamp spacing (≤50% variation)

CSS Variables for Dynamic Styling

.component {
  --display: block;
  --background-color: #ffffff;
  --text-color: #333333;

  display: var(--display);
  background-color: var(--background-color);
  color: var(--text-color);
  pointer-events: auto;
}

Selector Synchronization

CRITICAL: CSS selectors must match manifest selectors and React classNames exactly:

  • React: className="profile-card__name"
  • CSS: .profile-card__name {...}
  • Manifest: "selector": ".profile-card__name"

Design Guidelines

Complete reference: See DESIGN_SYSTEM.md for visual design principles, creative guidelines, and aesthetic best practices.

Spacing as Communication

RelationshipValueUse Case
Tight (icon + label)0.25-0.5rem (4-8px)Clustering related items
Same category1-1.5rem (16-24px)Card sections, form fields
Different sections2-3rem (32-48px)Major content blocks
Emphasis/Drama4rem+ (64px+)Hero content, luxury feel

Visual Consistency

  • Corner Radius: All similar elements share same radius (0-4px sharp, 6-12px rounded)
  • Shadow Levels: Max 3 levels (rest, hover, floating)
  • Element Heights: Consistent heights for similar elements
  • Color Strategy: Use full palette purposefully for hierarchy and zones

Creative Exploration

Push beyond obvious solutions:

  • Cards: Asymmetric grids, overlapping elements, thick accent borders
  • Lists: Alternating styles, spotlight patterns, color rhythm
  • Interactive Elements: Split buttons, colored icon circles, smooth transitions
  • Content Hierarchy: Large numbers for stats, quote callouts, whitespace dividers

Component Elements Guidelines

One Element = One Manifest Entry

Each distinct visual part requires a separate manifest element:

  • ✅ 3 buttons → 3 separate elements
  • ✅ Image + text → 2 separate elements
  • ❌ Multiple items grouped as one element

Data Scoping Rules

editorElement.data - Component-wide configuration only:

  • ✅ Layout enums, numbers (columns: 3, speed: 500)
  • ❌ Text, links, images (belongs to elements)
  • ❌ show/hide booleans (use removable: true instead)

elements[key].data - Content for that specific element:

  • ✅ Element-specific content (title text, button link, image)

Asset Requirements

When components need default images, use this format:

// Import in component
import { heroImage } from './assets/defaultImages';

// Usage
<img src={heroImage} alt="Hero" />

Asset specification format:

<imageUrlName>
{ "description": "Modern cityscape at sunset", "width": 1920, "height": 1088 }
</imageUrlName>

Rules:

  • Import as named export from './assets/defaultImages'
  • Width/height: multiples of 64, between 128-2048px
  • NEVER use external URLs

Output Structure

src/extensions/site/components/
└── {component-name}/
    ├── manifest.json        # Component manifest
    ├── component.tsx        # React component
    ├── style.css           # CSS styles
    ├── types.ts            # TypeScript types
    └── assets/             # Optional assets
        └── defaultImages.ts

Examples

Complete working example: See EXAMPLE.md for a profile card with nested elements, all data types, and three component types (Leaf, Container, Root). Read this when building a complex multi-element component, when you want to verify you have all patterns right, or when you need a cross-reference. For components with ≤5 elements, the patterns documented in this file are sufficient — EXAMPLE.md is not required reading.

Profile Card Component

Request: "Create a team member profile card with photo, name, experience, and contact button"

Output:

  • Manifest with 8 elements in 2-level nesting (photo section, info section)
  • React component with Leaf, Container, and Root sub-components
  • CSS with responsive layout and hover effects
  • TypeScript types for all props and data structures

Hero Section Component

Request: "Build a hero section with background image, headline, subtitle, and CTA button"

Output:

  • Manifest with background image CSS property and 3 text elements
  • React component with overlay design and typography hierarchy
  • CSS with responsive text scaling and dramatic spacing
  • Asset specifications for default hero images

Feature List Component

Request: "Create a features component with configurable number of items"

Output:

  • Manifest with arrayItems data type for feature collection
  • React component mapping over features array with safety checks
  • CSS with flexible grid layout adapting to item count
  • Sub-components for feature icons, titles, and descriptions

Extension Registration

Extension registration is MANDATORY and has TWO required steps.

Step 1: Create Component-Specific Extension File

Each site component requires an extensions.ts file in its folder:

import { extensions } from "@wix/astro/builders";
import manifest from "./manifest.json";

export const sitecomponentMyComponent = extensions.siteComponent({
  ...manifest,
  id: "{{GENERATE_UUID}}",
  description: "My Component",
  type: "<CODE_IDENTIFIER>.MyComponent",
  resources: {
    client: {
      component: "./extensions/site/components/my-component/component.tsx",
      componentUrl: "./extensions/site/components/my-component/component.tsx",
    },
  },
});

CRITICAL: Type Naming Convention

The type field uses the format {CODE_IDENTIFIER}.{PascalCaseFolderName}:

  • Folder my-componenttype: "<CODE_IDENTIFIER>.MyComponent"
  • Folder profile-cardtype: "<CODE_IDENTIFIER>.ProfileCard"
  • Folder hero-sectiontype: "<CODE_IDENTIFIER>.HeroSection"

The folder name is converted to PascalCase (hyphens removed, each word capitalized).

CODE_IDENTIFIER Requirement: The Code Identifier is a required value that cannot be guessed. Every Wix app has one automatically.

If Code Identifier is provided in the prompt:

  • Use it as the type prefix: <actual-code-identifier>.ComponentName

If Code Identifier is NOT provided:

  • Use the placeholder <CODE_IDENTIFIER> in the type field: <CODE_IDENTIFIER>.ComponentName
  • Add to Manual Action Items: "Replace <CODE_IDENTIFIER> with your actual Code Identifier from Wix Dev Center"

CRITICAL: UUID Generation

The id must be a unique, static UUID v4 string. Generate a fresh UUID for each extension - do NOT use randomUUID() or copy UUIDs from examples.

Step 2: Register in Main Extensions File

CRITICAL: After creating the component-specific extension file, you MUST read wix-cli-extension-registration and follow the "App Registration" section to update src/extensions.ts.

Without completing Step 2, the site component will not be available in the Wix Editor.

Code Quality Requirements

Complete reference: See TYPESCRIPT_QUALITY.md for strict TypeScript configuration and code quality standards.

TypeScript Standards

  • Strict TypeScript with no any types
  • ALL data props must be optional (use ?)
  • Explicit return types for all functions
  • Proper null/undefined handling with optional chaining
  • No @ts-ignore or @ts-expect-error comments

React Best Practices

  • React 16 compatible — no React 18+ features (useId, useDeferredValue, useTransition, etc.)
  • Functional components with hooks
  • Proper dependency arrays in useEffect
  • Component must react to prop changes
  • SSR-safe code (no browser APIs at module scope)

ESLint Compliance

  1. No unused vars/params/imports (@typescript-eslint/no-unused-vars)
  2. No external images: img src not https://... (allowed: local imports, wixstatic.com, variables)
  3. SSR-safe: No window/document at module scope/constructor, guard browser APIs in useEffect/handlers
  4. No dangerouslySetInnerHTML or inline <style> tags - use CSS variables or inline style prop for dynamic values
  5. No window.fetch (no-restricted-properties)
  6. Hooks exhaustive-deps: ALL values from component scope used inside useEffect/useCallback MUST be in dependency array
  7. Use const/let (no var), no unknown JSX properties

Common Mistakes

MistakeWhy It FailsFix
CSS selector doesn't match manifestEditor can't apply styles to the elementEnsure manifest selector, React className, and CSS selector are identical
Putting content text in editorElement.dataContent belongs to specific elements, not rootMove text/image/link data into elements[key].data
Using display: flex directly on rootBreaks editor override mechanismUse --display: flex CSS variable, then display: var(--display)
Missing removable: true on elementsSite owner can't hide the elementAdd behaviors: {selectable: true, removable: true} to all elements
arrayItems without data/dataItem/dynamicItemsDeploy validation failsThe arrayItems object must include one of: data, dataItem, or dynamicItems
Using window/document at module scopeSSR fails during buildGuard browser APIs inside useEffect or event handlers
Importing from @wix/design-systemNot available in site componentsUse plain HTML/CSS or custom components only
import {FC} from 'react'verbatimModuleSyntax in Astro tsconfig requires type-only importsUse import {type FC} or import type {FC} from React

Hard Constraints

  • Do NOT invent or assume new types, modules, functions, props, events, or imports
  • Use only entities explicitly present in the provided references or standard libraries already used in this project
  • Do NOT add dependencies; do NOT use @wix/design-system or @wix/wix-ui-icons-common
  • All user-facing content must come from props (no hardcoded text)
  • Links/media from manifest only, never hardcode URLs
  • NEVER use mocks, placeholders, or TODOs in any code
  • ALWAYS implement complete, production-ready functionality

Reference Documentation

FileWhen to read
MANIFEST_GUIDELINES.mdAlways — manifest structure, element rules, CSS properties, sync
MANIFEST_ADVANCED.mdWhen using arrayItems, link constraints, richText abilities, or non-default installation sizing
REACT_PATTERNS.mdWhen using hooks (useEffect, useCallback), complex state, or arrays
EXAMPLE.mdWhen building complex (5+ element) components, or to cross-check all patterns
CSS_GUIDELINES.mdWhen you need advanced CSS patterns or animations
DESIGN_SYSTEM.mdWhen building visually rich/branded components
TYPESCRIPT_QUALITY.mdWhen you need strict TypeScript configuration and props interface patterns

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

26.74%
按下载量换算631

Cursor

25.43%
按下载量换算600

OpenCode

18.13%
按下载量换算428

Gemini CLI

12.77%
按下载量换算301

Antigravity

7.98%
按下载量换算188

windsurf

3.69%
按下载量换算87

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills