From wix-ecom-cowork
Guides discovery of Wix eCommerce APIs via Playwright UI automation, official docs, and user guidance to build commands/skills for wix-ecom-cowork plugin.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wix-ecom-cowork:plugin-development-guideThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Comprehensive guide for AI developers (Claude Code, Cursor, etc.) to systematically discover Wix APIs and build new commands/skills for the wix-ecom-cowork plugin using Playwright automation, API documentation, and user guidance.
Comprehensive guide for AI developers (Claude Code, Cursor, etc.) to systematically discover Wix APIs and build new commands/skills for the wix-ecom-cowork plugin using Playwright automation, API documentation, and user guidance.
Purpose: Capture actual API calls made by Wix Business Manager
Tools: /playwright/ directory with automation scripts
Process:
Example:
cd playwright
npm run capture:product # Discover product APIs
npm run capture:category # Discover category APIs
npm run capture:order # Discover order APIs
npm run capture:tax # Discover tax APIs
Output:
output/{workflow}-mapping.json - UI actions → API correlationsoutput/{workflow}-apis.json - All captured API callsscreenshots/ - Visual proof of interactionsPurpose: Understand complete API specifications
Tools: WebFetch tool to retrieve docs
Process:
Example:
WebFetch: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/tax/introduction
→ Extract: Tax Groups, Tax Regions, Tax Calculations endpoints
Purpose: Understand business requirements and workflows
Sources:
Example: User provides: "Campaign payload looks like {campaignId, emailDistributionOptions...}" → Build skill around this structure
Questions to answer:
Example:
Feature: Tax Management
Tasks: Query tax groups, create regions, assign to products
UI: https://manage.wix.com/.../ecom-platform/tax
Docs: https://dev.wix.com/docs/.../tax/introduction
Logic: Use /billing/v1/ endpoints (not /tax-groups/v1/)
Template: playwright/scripts/capture-{feature}.ts
// Key components:
- Load auth from /Users/itayhe/.yoshi/auth.json
- Navigate to Wix page
- Find and interact with elements
- Capture API calls with request/response
- Save to output/ directory
Add to package.json:
{
"scripts": {
"capture:{feature}": "ts-node scripts/capture-{feature}.ts"
}
}
npm run capture:{feature}
Watch for:
# Check what was captured
cat output/{feature}-apis.json | jq '[.[] | .endpoint] | unique'
# Find feature-specific APIs
cat output/{feature}-apis.json | jq '[.[] | select(.endpoint | contains("tax") or contains("segment"))]'
# Use WebFetch in Claude Code
WebFetch: https://dev.wix.com/docs/api-reference/.../[feature]
Create comparison:
Example Discovery:
Docs say: GET /tax-groups/v1/tax-groups
UI uses: POST /billing/v1/tax-groups/query
→ Use /billing/v1/ (what UI actually uses!)
Location: skills/{feature-name}/SKILL.md
Template:
# {Feature Name} - {Description}
## Overview
[What this skill covers]
## Configuration
- App ID, API Key, Site ID
## {Operation Name}
**Endpoint**: METHOD https://www.wixapis.com/path
**API Call**:
```bash
curl -X METHOD "https://www.wixapis.com/path" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{...}'
Response:
{...}
Use Cases:
[Recommendations, gotchas, tips]
**Critical Rules for Skills**:
1. ✅ Use `${API_KEY}` and `${SITE_ID}` variables (not hardcoded)
2. ✅ Show curl commands (Claude will execute them)
3. ✅ Include jq parsing examples
4. ✅ Document response structures
5. ✅ Add use cases and examples
6. ❌ NO hardcoded business values (discounts, amounts, thresholds)
7. ❌ NO "I recommend X" - only API-driven or user-specified
8. ✅ Use variables: `${DISCOUNT_AMOUNT}`, `${USER_THRESHOLD}`, etc.
### Phase 4: Build Commands
#### Command Structure
**Location**: `commands/{feature-name}.md`
**Template**:
```markdown
# {Feature Name} - {User-Friendly Description}
[Intro paragraph for non-technical users]
## Command Pattern
Show me [feature] Create [thing] Help me [task]
## Purpose
[What this command does in plain English]
## Skills Referenced
- skill-name-1: What it provides
- skill-name-2: What it provides
## Workflow
### Step 1: [First Action]
[bash script using skill patterns]
### Step 2: [Second Action]
[bash script]
## Output Format
[What user sees]
## Example Use Cases
1. [Real-world scenario]
2. [Another scenario]
## Related Commands
- Other relevant commands
Critical Rules for Commands:
Search for:
grep -r "15%" skills/ commands/
grep -r "20%" skills/ commands/
grep -r "\$100" skills/ commands/
grep -r "\$500" skills/ commands/
If found: Replace with ${VARIABLES} or API extractions
For discount/recommendations:
/recommendations/v1/recommendations/buildFor data-driven features:
User-specified values:
User: "Create 20% off"
→ Use exactly 20%
→ Don't call recommendations API
User asks for recommendation:
User: "Recommend a discount"
→ MUST call recommendations API
→ NEVER manually suggest
Verify:
Example:
❌ Docs: GET /v1/sites
✅ Reality: POST /site-list/v2/sites/query
Use what works, not what docs say!
## List {Resources}
```bash
curl -X POST "https://www.wixapis.com/{endpoint}/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{"query": {"paging": {"limit": 100}}}' | jq '[.{resources}[] | {
id,
name,
relevantField
}]'
### Pattern 2: AI-Powered Recommendation
```markdown
## Get AI Recommendation
**MANDATORY**: Call Wix AI API first!
```bash
recommendations=$(curl -X POST "https://www.wixapis.com/recommendations/v1/recommendations/build" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{"context": {...}}')
# Extract AI values
VALUE=$(echo "$recommendations" | jq -r '.recommendations[0].{value}')
# Use AI value (not hardcoded!)
### Pattern 3: Create with User Values
```markdown
## Create {Resource}
```bash
# Extract from user request
NAME="${USER_PROVIDED_NAME}"
AMOUNT=${USER_PROVIDED_AMOUNT} # From "create X% off"
curl -X POST "https://www.wixapis.com/{endpoint}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"{resource}\": {
\"name\": \"${NAME}\",
\"amount\": ${AMOUNT}
}
}"
### Pattern 4: Priority Waterfall
```markdown
## Smart Selection Logic
Priority 1: Check existing {resource}
Priority 2: Create new {resource} if needed
```bash
# Try to find existing
existing=$(curl GET .../query)
if [ -n "$existing" ]; then
echo "✅ Using existing {resource}"
ID=$(echo "$existing" | jq -r '.id')
else
echo "Creating new {resource}"
new=$(curl POST .../create)
ID=$(echo "$new" | jq -r '.id')
fi
## File Naming Conventions
**Skills**: `skills/{feature-domain}/SKILL.md`
- `product-management/` - Product operations
- `tax-groups-comprehensive/` - Tax group CRUD
- `email-segments/` - Segment management
- `smart-discount-recommendations/` - AI recommendations
**Commands**: `commands/{feature-action}.md`
- `product-advanced.md` - Advanced product ops
- `tax-complete.md` - Complete tax management
- `email-campaign-complete.md` - Full email workflow
- `create-performance-category.md` - Performance-based categories
**Playwright Scripts**: `playwright/scripts/capture-{feature}.ts`
- `capture-product-creation.ts`
- `capture-category-flow.ts`
- `capture-tax-settings.ts`
## Testing & Verification
### Test 1: API Call Verification
```bash
# Verify API is called when user asks for recommendation
echo "TEST: Discount recommendation"
# Should call:
curl POST /recommendations/v1/recommendations/build
# Should NOT:
# - Manually suggest percentages
# - Skip API call
# - Use "educated guesses"
# Verify user-specified values are honored
User: "Create 20% off Electronics"
# Extract:
DISCOUNT=20 # From "20% off"
CATEGORY="Electronics" # From user
# Verify used exactly, not changed
# Search for hardcoded values
grep -r "15%" commands/ skills/
grep -r "\$100" commands/ skills/
# All findings should be:
# - In API response examples (OK)
# - As ${VARIABLES} (OK)
# - NOT as actual suggestions (BAD)
WRONG:
User: "Recommend discount"
Claude: "I recommend 15% off"
RIGHT:
User: "Recommend discount"
Claude: [Calls API] "Wix AI recommends: 18% off"
WRONG:
curl query -d '{"filter": "{\"totalSpent\": {\"$gte\": 500}}"}'
RIGHT:
USER_THRESHOLD=${USER_THRESHOLD:-100} # From user intent
curl query -d "{\"filter\": \"{\\\"totalSpent\\\": {\\\"\\$gte\\\": ${USER_THRESHOLD}}}\"}"
WRONG:
Assume endpoint is /tax-groups/v1/tax-groups
RIGHT:
1. Check Playwright capture → Found /billing/v1/tax-groups/query
2. Use what UI actually uses!
WRONG (from docs):
GET /v1/sites → Returns 404
RIGHT (from Playwright):
POST /site-list/v2/sites/query → Works!
WRONG (from docs):
{"price": 29.99} → Returns "Expected an object"
RIGHT (from testing):
{"priceData": {"price": 29.99}} → Works!
| Feature | Documented Path | Actual Path (from UI) | Use This |
|---|---|---|---|
| Sites List | GET /v1/sites | POST /site-list/v2/sites/query | ✅ Actual |
| Tax Groups | GET /tax-groups/v1/... | POST /billing/v1/tax-groups/query | ✅ Actual |
| Product Price | "price": number | "priceData": {object} | ✅ Actual |
| Segments | Not in docs | POST /_api/contacts-segments-app/v1/segments/query | ✅ Actual |
| Recommendations | Not in public docs | POST /recommendations/v1/recommendations/build | ✅ Actual |
Always check for Wix AI first:
/recommendations/v1/recommendations/build - Discount recommendationsPattern:
inspection_idinspection_idNEVER:
| Issue | Wrong | Right |
|---|---|---|
| Sites endpoint | GET /v1/sites (404) | POST /site-list/v2/sites/query |
| Product price | "price": 29.99 | "priceData": {"price": 29.99} |
| Setup guide | Visit wix.to/Ri8ggW4 | Create API key at manage.wix.com/account/api-keys |
| Discount amounts | Hardcoded 15%, 20% | From Recommendations API or user |
// Navigate to products page
await page.goto('.../wix-stores/products');
// Click "+ New Product"
await page.locator('[data-hook="newProductBtn"]').click();
// Wait for form
await page.waitForTimeout(3000);
// Fill fields dynamically
const inputs = await page.locator('input:visible').all();
for (const input of inputs) {
await input.fill('test value');
// Capture APIs triggered
}
// Navigate to categories
await page.goto('.../store/categories/list');
// Click "+ New Category"
// Fill category name
// Click "+ Add Products"
// Explore product selection
// Capture all APIs
// Navigate to tax settings
await page.goto('.../ecom-platform/tax');
// Explore tabs (Groups, Regions, Settings)
// Click buttons
// Capture tax-related APIs
Commands (User-facing):
Skills (Technical):
One-Way Dependency:
Commands → Reference → Skills
(one-way)
Skills ✗ DO NOT reference Commands
Command: create-campaign.md
## Skills Referenced
- smart-discount-recommendations
- discount-strategy
- email-segments
Skill: smart-discount-recommendations/SKILL.md
# Contains only technical API patterns
# Does NOT reference any commands
Every change requires new version + zip:
Minor (2.3.x):
Major (2.x.0):
Process:
.claude-plugin/plugin.json and package.jsonwix-ecom-cowork-v{VERSION}.zipZip command:
zip -r wix-ecom-cowork-v{VERSION}.zip wix-ecom-cowork \
-x "wix-ecom-cowork/playwright/*" \
-x "wix-ecom-cowork/.git/*" \
-x "wix-ecom-cowork/node_modules/*" \
-x "wix-ecom-cowork/.DS_Store"
Playwright Framework (/playwright/):
scripts/capture-*.ts - Automation scriptsutils/wix-api-filter.ts - API detectionutils/element-finder.ts - Element discoveryoutput/ - Captured datapackage.json - Run scriptsWix Resources:
/Users/itayhe/.yoshi/auth.json (for Playwright)Claude Tools:
What we learned building this plugin:
/recommendations/ endpointsAPIs Discovered (70+ endpoints):
Priority List (based on user requests):
For each:
${API_KEY} and ${SITE_ID}${VARIABLES} not literal valuesThis guide contains the complete methodology used to build 23 commands and 26 skills over 700+ API discoveries!
npx claudepluginhub wix/wix-ecom-cowork --plugin wix-ecom-coworkBuilds and reviews all extensions for Wix CLI apps: dashboard pages, modals, plugins, widgets, backend APIs, data collections, and App Market readiness.
Provides curl command patterns for direct Wix REST API calls to Stores Catalog V1-V3, with authentication, site/account headers, queries, pagination, bulk updates, and PATCH operations.
Guides WooCommerce store setup, payment integration, shipping configuration, customization, and WordPress 7.0 features including AI connectors, DataViews, and collaboration tools.