Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

wix-cli-data-collectionWIX CLI 数据 collection

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

6,957

周安装

287

GitHub Stars

9

下载量

2,273
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/wix/skills --skill wix-cli-data-collection

简介

用于辅助数据整理、表格处理和指标计算。

  • 适合清洗字段、汇总数据或生成统计口径说明。
  • 通过 npx skills add 命令从指定仓库安装并使用。
  • 需确认数据来源和时间范围,避免将样本当作全量事实。
  • wix-cli-data-collection 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Wix Data Collection Builder

Creates CMS data collections for Wix CLI apps. The data collections extension allows your app to automatically create CMS collections when it's installed on a site. Collections store structured data that can be accessed from dashboard pages, site pages, backend code, and external applications.

Important: This extension automatically enables the site's code editor, which is required for the Wix Data APIs to work. Without this extension, apps using Data APIs would need the Wix user to manually enable the code editor on their site, which isn't guaranteed. With the data collections extension, your app can reliably use Data APIs to read and write data in the collections.


App Namespace Handling

App namespace is REQUIRED for data collections to work. The namespace scopes your collection IDs to prevent conflicts between apps.

Implementation Behavior

If app namespace is provided in the prompt:

  • Use it in all code examples: <actual-namespace>/collection-suffix

If app namespace is NOT provided:

  • Use the placeholder <app-namespace> in all code examples: <app-namespace>/collection-suffix
  • Add to Manual Action Items: "Replace <app-namespace> with your actual app namespace from Wix Dev Center"

Collection ID Format

  • In extension definition (idSuffix): Use just the suffix, e.g., "products"
  • In API calls: Use the full scoped ID: "<app-namespace>/products" — MUST match idSuffix exactly (case-sensitive, no camelCase/PascalCase transformation)
  • In referencedCollectionId: Use the idSuffix only (not the full scoped ID) — the system resolves it automatically
  • Example: If idSuffix is "product-recommendations", API calls use "<app-namespace>/product-recommendations" NOT "<app-namespace>/productRecommendations"

File Structure

In Wix CLI apps, all CMS collections are defined in a single file:

File: src/extensions/data/extensions.ts

This file uses the extensions.genericExtension() pattern from @wix/astro/builders to register all collections:

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

export const dataExtension = extensions.genericExtension({
  compId: "{{GENERATE_UUID}}",
  compName: "data-extension",
  compType: "DATA_COMPONENT",
  compData: {
    dataComponent: {
      collections: [
        // All collections defined here
      ],
    },
  },
});

CRITICAL: The compId must be a unique, static UUID string. Generate a fresh UUID v4 for each app - do NOT use randomUUID() or copy UUIDs from examples. After creating or modifying this file, follow wix-cli-extension-registration for UUID generation and to register the extension in src/extensions.ts (required for collections to work).

Key points:

  • Single file contains all collections
  • Uses extensions.genericExtension() from @wix/astro/builders
  • Each collection includes: idSuffix, displayName, displayField, fields, dataPermissions, and optionally initialData
  • displayField specifies which field the CMS displays when referencing items in this collection from other collections
  • Collections are generated by merging operations (INSERT, UPDATE, DELETE) with existing collections
  • See extension template for complete structure

Field Types

TypeDescriptionUse Case
TEXTSingle-line textNames, titles
RICH_TEXTFormatted HTML textBlog content
RICH_CONTENTRich content with embedded mediaComplex blog posts
NUMBERDecimal numbersPrices, quantities
BOOLEANTrue/falseToggles, flags
DATEDate onlyBirthdays
DATETIMEDate with timeTimestamps
TIMETime onlySchedules
IMAGESingle imageThumbnails
DOCUMENTFile attachmentPDFs
VIDEOVideo fileMedia
AUDIOAudio filePodcasts
MEDIA_GALLERYMultiple mediaGalleries
REFERENCELink to one itemAuthor → User
MULTI_REFERENCELink to many itemsPost → Tags
ADDRESSStructured addressLocations
URLURL validationLinks
PAGE_LINKLink to Wix pageInternal navigation
LANGUAGELanguage codeMulti-language content
OBJECTJSON objectFlexible data
ARRAYArray of valuesGeneric arrays
ARRAY_STRINGArray of stringsTags list
ARRAY_DOCUMENTArray of documentsFile collections
ANYAny typeMost flexible

CRITICAL: OBJECT fields require objectOptions. When using type: "OBJECT", you MUST include the objectOptions property — the API will reject OBJECT fields without it. Use an empty object {} if you don't need schema validation:

{
  "key": "settings",
  "displayName": "Settings",
  "type": "OBJECT",
  "objectOptions": {}
}

For structured objects, define nested fields inside objectOptions.fields:

{
  "key": "triggerRules",
  "displayName": "Trigger Rules",
  "type": "OBJECT",
  "objectOptions": {
    "fields": [
      { "key": "url", "displayName": "URL Condition", "type": "TEXT" },
      {
        "key": "scrollDepth",
        "displayName": "Scroll Depth %",
        "type": "NUMBER"
      },
      { "key": "dateStart", "displayName": "Start Date", "type": "DATE" }
    ]
  }
}

Field Properties

{
  "key": "email",
  "displayName": "Email Address",
  "type": "TEXT",
  "required": true,
  "unique": true,
  "defaultValue": null,
  "description": "User's primary email"
}
PropertyDescription
keyField identifier (camelCase)
displayNameLabel shown in CMS
typeField data type
requiredMust have value
uniqueNo duplicates allowed
defaultValueInitial value
descriptionHelp text

Naming Conventions

  • Field keys: lowerCamelCase, ASCII only (e.g., productName, isActive, createdAt)
  • Collection IDs (idSuffix): lower-kebab-case or lower_underscore (e.g., product-categories, blog_posts)
  • Display names: Human-readable, can contain spaces (e.g., "Product Name", "Is Active")

System Fields (Automatic)

Every collection includes: _id, _createdDate, _updatedDate, _owner

Permissions

Access levels control who can read, create, update, and delete items in collections.

LevelDescription
UNDEFINEDNot set (inherits defaults)
ANYONEPublic access (including visitors)
SITE_MEMBERAny signed-in user (members and collaborators)
SITE_MEMBER_AUTHORSigned-in users, but members only access own items
CMS_EDITORSite collaborators with CMS Access permission
PRIVILEGEDCMS administrators and privileged users

Common patterns:

  • Public content (default, recommended): read: ANYONE, write: PRIVILEGED
  • User-generated content: read: SITE_MEMBER, write: SITE_MEMBER_AUTHOR
  • Editorial workflow: read: ANYONE, write: CMS_EDITOR
  • Private/admin: read: PRIVILEGED, write: PRIVILEGED

Permission hierarchy (most to least restrictive): PRIVILEGED > CMS_EDITOR > SITE_MEMBER_AUTHOR > SITE_MEMBER > ANYONE > UNDEFINED

Context-Based Permission Rules

CRITICAL: Permissions must match where and how the data is accessed. The consumer of the data determines the minimum permission level — setting permissions more restrictive than the access context will cause runtime failures (empty results or permission-denied errors).

Determine permissions by asking: "Who interacts with this data, and from where?"

Access ContextWho Sees / Uses ItImplication
Site Widget (SITE_WIDGET)Any site visitor (public)Reads must be ANYONE. If the widget accepts input (e.g., reviews, submissions), inserts must also be ANYONE or SITE_MEMBER.
Embedded ScriptAny site visitor (public)Same as site widget — reads must be ANYONE. Writes depend on whether visitors can submit data.
Dashboard Page (DASHBOARD_PAGE)Site owner / collaborators onlyCan use CMS_EDITOR or PRIVILEGED for all operations since only authorized users access the dashboard.
Backend code (site-side)Runs in visitor contextIf called from page code or site-side modules, the caller has visitor-level permissions — data must be readable/writable at the appropriate public level.
Backend code (elevated)Runs with auth.elevate() from @wix/essentialsCan bypass permissions, but the collection still needs correct defaults for any non-elevated callers.

How to apply this:

  1. Identify every place the collection is read or written — site widgets, dashboard pages, embedded scripts, backend APIs.
  2. Use the least restrictive context as the floor. If a site widget reads the data AND a dashboard page also reads it, itemRead must be ANYONE (because the widget is public).
  3. Apply per-operation. A collection can have itemRead: ANYONE (widget displays it) but itemInsert: CMS_EDITOR (only dashboard users add items). Each operation is independent.

Examples by blueprint type:

  • Dashboard manages data, site widget displays it: itemRead: ANYONE, itemInsert: CMS_EDITOR, itemUpdate: CMS_EDITOR, itemRemove: CMS_EDITOR
  • Site widget collects user submissions (e.g., reviews), dashboard moderates: itemRead: ANYONE, itemInsert: ANYONE, itemUpdate: CMS_EDITOR, itemRemove: CMS_EDITOR
  • Members-only widget reads data, members can submit: itemRead: SITE_MEMBER, itemInsert: SITE_MEMBER, itemUpdate: SITE_MEMBER_AUTHOR, itemRemove: CMS_EDITOR
  • Dashboard-only (no public surface): itemRead: CMS_EDITOR, itemInsert: CMS_EDITOR, itemUpdate: CMS_EDITOR, itemRemove: CMS_EDITOR

Anti-pattern: Setting itemRead: PRIVILEGED on a collection that a site widget queries — the widget will return empty results for all visitors because they lack privileged access.

Relationships

One-to-One / Many-to-One (REFERENCE):

{
  "key": "category",
  "displayName": "Category",
  "type": "REFERENCE",
  "referenceOptions": {
    "referencedCollectionId": "categories"
  }
}

Many-to-Many (MULTI_REFERENCE):

{
  "key": "tags",
  "displayName": "Tags",
  "type": "MULTI_REFERENCE",
  "multiReferenceOptions": {
    "referencedCollectionId": "tags"
  }
}

CRITICAL Constraints:

  • REFERENCE/MULTI_REFERENCE fields can ONLY link to other custom CMS collections defined in your app
  • The referencedCollectionId MUST be the idSuffix of another collection in the same plan
  • NEVER use REFERENCE fields to link to Wix business entities (Products, Orders, Contacts, Members, etc.)
  • Use Wix SDK APIs to access Wix business entities instead

Collection Operations

Collections support three operation types for modifying collections:

INSERT

Creates a new collection or replaces an existing one with the same idSuffix.

Use when: Creating a new collection or completely replacing an existing collection.

UPDATE

Modifies an existing collection by merging new data with existing fields.

Use when: Adding fields, updating permissions, or modifying collection properties.

Behavior:

  • If collection exists: Merges new data with existing collection
  • If collection doesn't exist: Treats update as insert (creates new collection)

DELETE

Removes a collection from the app.

Use when: Removing a collection that is no longer needed.

Behavior:

  • Removes the collection from src/extensions/data/extensions.ts
  • If all collections are deleted, the entire file is deleted

Merge logic: Operations are applied using a Map keyed by idSuffix. Existing collections are loaded into the Map first, then each operation modifies it: INSERT sets/replaces, UPDATE merges with existing (or creates if missing), DELETE removes. The final Map values become the output collections.

App Version Updates

Changes to your data collections extension require releasing a new major version of your app. When a user updates to the new major version, their collections are updated as follows:

  • Adding a new collection: The new collection is created on the site.
  • Removing a collection: If the old app version defined a collection and the new version doesn't, the collection is removed from the site.
  • Modifying a collection schema: Field additions, removals, and type changes are applied to the collection. Existing data is preserved.

Important notes:

  • Collection changes only affect users who update to the new major version. Users who don't update retain their current collections.
  • Collection changes take up to 5 minutes to propagate after an update.
  • Initial data is only imported when a collection is first created. If a collection already contains data, initialData is ignored during updates.

Wix CLI-Specific Constraints

Embedded Script Parameters vs Collections

CRITICAL: NEVER create CMS collections to store configuration for embedded scripts.

All embedded script configuration must go through embedded script parameters (embeddedScriptParameters), not CMS collections.

DO NOT create collections for:

  • Colors, messages, headlines, text content
  • Coupon codes, display settings
  • UI customization (positions, sizes, styles)
  • Timing settings, feature toggles
  • Display frequencies, thresholds
  • Minimums/maximums
  • ANY configuration that controls how an embedded script behaves or appears

Examples of configuration (use parameters, NOT collections):

  • Popup headline → embedded script parameter
  • Coupon code → embedded script parameter
  • Background color → embedded script parameter
  • Display position → embedded script parameter
  • Show/hide toggles → embedded script parameter

CMS collections should ONLY be created for:

  • Business data (products, orders, inventory, etc.)
  • User-generated content (reviews, comments, submissions)
  • Event logs (if explicitly requested for analytics/tracking)
  • Multi-record relational data that is NOT configuration

Decision Rule:

  • If it controls HOW the embedded script works or looks → it's configuration → use embedded script parameters
  • If it's business data or user-generated content → it's data → use CMS collections

Site Widget Settings vs Collections

CRITICAL: Site widgets have a built-in settings panel (panel.tsx) that handles ALL widget configuration.

For SITE_WIDGET-only blueprints (no DASHBOARD_PAGE or other extensions):

  • ALWAYS return collections: [] (empty array)
  • The widget panel handles everything
  • NEVER create collections to store widget configuration data

Configuration handled by widget panel (NOT collections):

  • Target date/time for countdown → widget panel
  • Display colors, fonts, sizes → widget panel
  • Headlines, labels, messages → widget panel
  • Feature toggles, show/hide options → widget panel
  • Numeric settings (delays, intervals, thresholds) → widget panel

Only create collections for SITE_WIDGET when ALL of these conditions are met:

  1. The blueprint ALSO includes a DASHBOARD_PAGE extension that needs to manage data the widget displays
  2. OR the widget explicitly needs to display MULTIPLE records of user-generated/business data (not configuration)
  3. AND the data is NOT configuration (dates, colors, settings, display options are ALWAYS configuration)

Anti-Patterns

Don't create aggregated fields. If you have individual rating fields, calculate averages dynamically — don't store computed values like averageRating.

Don't duplicate configuration. If embedded script parameters already hold {headline, color}, don't also create a CMS collection with the same data.

Don't create single-value collections. A collection with one field like {theme: "dark"} should be an embedded script parameter or widget setting instead.

Initial Data Rules

Each item in initialData must match the collection schema exactly:

  • Field keys must be lowerCamelCase and match the schema
  • TEXT → string, NUMBER → number, BOOLEAN → boolean
  • DATE/DATETIME → use {"$date": "2024-01-15T10:30:00.000Z"} format
  • REFERENCE → provide the idSuffix of the referenced collection
  • Required fields must always have values

Examples

Simple Collection with Initial Data

Request: "Create a collection for handling fees with example data"

Generated file: src/extensions/data/extensions.ts

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

export const dataExtension = extensions.genericExtension({
  compId: "{{GENERATE_UUID}}",
  compName: "data-extension",
  compType: "DATA_COMPONENT",
  compData: {
    dataComponent: {
      collections: [
        {
          schemaUrl: "https://www.wix.com/",
          idSuffix: "additional-fees",
          displayName: "Additional Fees",
          displayField: "title",
          fields: [
            { key: "title", displayName: "Fee Title", type: "TEXT" },
            { key: "amount", displayName: "Fee Amount", type: "NUMBER" },
          ],
          dataPermissions: {
            itemRead: "ANYONE",
            itemInsert: "PRIVILEGED",
            itemUpdate: "PRIVILEGED",
            itemRemove: "PRIVILEGED",
          },
          initialData: [
            { title: "Handling Fee", amount: 5 },
            { title: "Gift Wrapping", amount: 3.5 },
          ],
        },
      ],
    },
  },
});

Collection with Reference Relationship

Request: "Create collections for products and categories with relationships"

Collections:

  • categories - Category definitions
  • products - Products that reference categories

Both collections are defined in the same src/extensions/data/extensions.ts file, with the products collection using a REFERENCE field to link to categories. See the extension template for a complete multi-collection example.

Common Patterns

Soft Delete: Add isDeleted (BOOLEAN, default: false)

Status/Workflow: Add status (TEXT) with values like draft/pending/published

URL Slug: Add slug (TEXT, unique) for SEO-friendly URLs

Owner Tracking: Add createdBy (REFERENCE → custom collection, not Members)

Note: For owner tracking, create a custom collection for users rather than referencing Wix Members directly.

Reference Documentation

Public Documentation

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

37.51%
按下载量换算853

Claude

31.04%
按下载量换算706

Cursor

17.33%
按下载量换算394

Gemini CLI

9.51%
按下载量换算216

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills