All skills
wix avatar

/wix-app

@dc6f1fa official
by Wix.comwix/skills33 stars
33

Build and review Wix CLI app extensions — dashboard pages, modals, plugins, menu plugins, custom element widgets, Editor React components, site plugins, embedded scripts, backend APIs, backend events, service plugins, data collections, and App Market readiness. Use when building ANY feature or extension for a Wix CLI app or preparing a Wix app for App Market review. Triggers on: add, build, create, implement, help me, dashboard, widget, plugin, backend, API, event, collection, embedded script, service plugin, Editor React component, checkout, shipping, tax, discount, SPI, CMS, schema, tracking, popup, admin panel, menu item, modal, validate, test, verify, register extension, App Market, app review, submission readiness.

Use this Skill: https://skilld.dev/gh/wix/skills/wix-app

This session only. Nothing lands on disk.

referencesDATA_COLLECTION.md

≈2.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

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.

Scaffold

Use wix generate --params with extensionType: DATA_COLLECTION. The only other param is collectionName (1-36 chars: letters, numbers, underscores, hyphens) — fields, permissions, displayName overrides, etc. are all edited after scaffolding in the generated file.

The CLI manages a shared aggregator file (data-collections.extension.ts) that imports every collection file and registers them in one extensions.dataCollections({...}) builder. The aggregator and src/extensions.ts are updated automatically — don't edit them manually.

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". The CLI uses collectionName from the scaffold params as the idSuffix for the generated entry.
  • 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"

Collection File Shape

The CLI scaffolds <CollectionName>.ts as a satisfies DataCollection default export. The scaffolded fields and dataPermissions are placeholders — replace them with your real schema, and set permissions per Permissions before shipping.

Import DataCollection from the package this project actually uses. A standalone @wix/custom-extensions project — what wix generate scaffolds today — emits from '@wix/custom-extensions'; only an Astro project uses '@wix/astro/builders'. The scaffolded file already has the right one: keep the import the CLI wrote and replace the body around it.

import type { DataCollection } from '@wix/custom-extensions'; // or '@wix/astro/builders' in an Astro project

export const collectionIdSuffix = '<CollectionName>';

export default {
  idSuffix: collectionIdSuffix,
  displayName: '<CollectionName>',
  displayField: 'title',            // Field shown when referencing items
  fields: [ /* field definitions */ ],
  dataPermissions: { itemRead: 'ANYONE', itemInsert: 'PRIVILEGED', itemUpdate: 'PRIVILEGED', itemRemove: 'PRIVILEGED' },
  indexes: [],
  initialData: [],
} satisfies DataCollection;

The rest of this extension

Topic File
Field types, field properties, indexes, naming, system fields, relationships data-collection/SCHEMA.md
Releasing, updating the site, the CMS prerequisite, item vs. management access data-collection/LIFECYCLE.md
Reading and writing items at runtime (Wix Data SDK) data-collection/WIX_DATA.md

Permissions

The four contexts, what each admits, and the SITE_MEMBER_AUTHOR rule are in data-collection/PERMISSIONS.md. The scaffolded dataPermissions are placeholders — ANYONE to read, PRIVILEGED to write — so set them before shipping.

Wix CLI-Specific Constraints

When NOT to use a Collection

Collections are for data, not configuration:

  • Embedded script settings → use embeddedScriptParameters instead.
  • Custom element widget settings → use the widget's panel.tsx (settings panel) instead. A widget-only blueprint usually needs zero collections.
  • Single-value config (theme, mode, threshold) → put it in the host extension's settings, not a one-field collection.
  • Computed / aggregated values (averages, counts) → calculate dynamically, don't store.

Common values that do not belong in a collection: colors, fonts, sizes, headlines, labels, messages, dates/times, coupon codes, display positions, feature toggles, frequencies, numeric thresholds.

Collections are for: business data (products, orders, inventory), user-generated content (reviews, comments, submissions), event logs, and multi-record relational data.

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"

Scaffold:

wix generate --params '{"extensionType":"DATA_COLLECTION","collectionName":"additional-fees"}'

Edit the generated src/extensions/backend/data-collections/additional-fees.ts:

import type { DataCollection } from '@wix/astro/builders';

export const collectionIdSuffix = 'additional-fees';

export default {
  idSuffix: collectionIdSuffix,
  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',
  },
  indexes: [],
  initialData: [
    { title: 'Handling Fee', amount: 5 },
    { title: 'Gift Wrapping', amount: 3.5 },
  ],
} satisfies DataCollection;

Collection with Reference Relationship

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

Run wix generate --params twice — once with collectionName: "categories" and once with collectionName: "products". Then edit src/extensions/backend/data-collections/products.ts to add a REFERENCE field pointing at categories (referenceOptions: { referencedCollectionId: "categories" }). The aggregator data-collections.extension.ts is updated by the CLI automatically.

Common Patterns

Soft Delete: Add isDeleted (BOOLEAN), defaulted at the insert path

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

URL Slug: Add slug (TEXT) plus a { fields: [{ path: 'slug' }], unique: true } entry in indexes 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

Source: SKILL.md on GitHub

1 warningtoday4 checks · Risk SAFE
  • Gen Agent Trust Hubtoday

    This skill is a specialized development toolkit for building extensions on the Wix platform. It provides comprehensive instructions for creating dashboard pages, backend APIs, and site plugins using the Wix CLI and SDKs. No malicious patterns were detected; the skill's behaviors, such as dependency management, command execution for builds, and local script execution for code reviews, are entirely consistent with its purpose as a developer productivity tool for the Wix ecosystem.

  • Sockettoday

    1 alert: gptAnomaly

  • Snyktoday

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at dc6f1fa. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 days ago
compatibility
requires `@wix/cli` >= 1.1.192.

README badge

README badge for wix/skills/wix-app

Builds dashboard pages, modals, plugins, custom widgets, Editor React components, backend APIs, events, service plugins, and data collections for Wix CLI apps. Provides decision logic, API patterns, and validation workflows; scaffolding is owned by the Wix CLI via `wix generate --params`.

Generated from the current SKILL.md.

What extension types does this skill cover?
All Wix CLI app extension types: dashboard pages, modals, plugins, menu plugins, custom element widgets, Editor React components, site plugins, embedded scripts, backend APIs, backend events, service plugins, and data collections.
Does this skill scaffold the extension files for me?
The Wix CLI owns scaffolding via `wix generate --params` for all extension types except Backend API. This skill provides decision logic, API guidance, and business-logic patterns to fill in the generated stubs. Backend API files must be created manually.
What Wix CLI version is required?
The skill requires @wix/cli >= 1.1.192.
Do I need to create a Data Collection extension for app-specific data?
Yes, if you're saving or persisting app-specific data, managing domain entities in a dashboard, or running a service plugin that reads app-configured data. The skill infers this automatically—you don't need to explicitly request it.
Does this skill cover Wix Stores API usage?
Yes. When using any Wix Stores API (products, inventory, orders), the skill requires dual V1/V3 catalog support and references the Stores Versioning guide for module selection and field mapping.

Generated from the current SKILL.md. These answers refresh after source changes.