claude-code-arcane 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +3 -2
- package/agents/ecommerce/ecommerce-architect.md +60 -0
- package/docs/SKILLS-CATALOG.md +20 -1
- package/docs/USER-GUIDE.md +2 -2
- package/package.json +1 -1
- package/profiles/ecommerce.yaml +48 -0
- package/skills/cart-checkout/SKILL.md +85 -0
- package/skills/cart-checkout/references/checkout-flow-spec.md +50 -0
- package/skills/commerce-analytics/SKILL.md +85 -0
- package/skills/commerce-analytics/references/ga4-ecommerce-events.md +63 -0
- package/skills/commerce-analytics/scripts/ga4_ecommerce_validate.py +134 -0
- package/skills/commerce-data-model/SKILL.md +84 -0
- package/skills/commerce-data-model/references/data-model-spec.md +79 -0
- package/skills/inventory-stock/SKILL.md +86 -0
- package/skills/inventory-stock/scripts/restock_forecast.py +173 -0
- package/skills/merchant-feed/SKILL.md +85 -0
- package/skills/merchant-feed/references/feed-attribute-map.md +47 -0
- package/skills/merchant-feed/scripts/feed_validate.py +140 -0
- package/skills/order-lifecycle/SKILL.md +86 -0
- package/skills/order-lifecycle/references/order-state-machine.md +53 -0
- package/skills/payments-architecture/SKILL.md +80 -0
- package/skills/product-listing/SKILL.md +84 -0
- package/skills/promotions-discounts/SKILL.md +80 -0
- package/skills/shipping-tax/SKILL.md +85 -0
- package/skills/storefront-architecture/SKILL.md +80 -0
- package/skills/subscription-billing/SKILL.md +81 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""
|
|
2
|
+
feed_validate.py — Validate a product feed CSV against Google Merchant /
|
|
3
|
+
Meta Catalog requirements (the shared required-attribute core).
|
|
4
|
+
|
|
5
|
+
Checks every row for required attributes, empty values, valid enums
|
|
6
|
+
(availability, condition), and price+currency formatting. Reports a per-row
|
|
7
|
+
and summary verdict. No external dependencies; cross-platform.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
python feed_validate.py # built-in demo feed
|
|
11
|
+
python feed_validate.py feed.csv # validate your feed
|
|
12
|
+
python feed_validate.py feed.csv --strict # treat recommended as required
|
|
13
|
+
|
|
14
|
+
CSV header (required attributes):
|
|
15
|
+
id,title,description,link,image_link,availability,price,brand,condition
|
|
16
|
+
Recommended columns (warn if absent/empty): gtin, mpn, item_group_id,
|
|
17
|
+
google_product_category, sale_price
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
import argparse
|
|
21
|
+
import csv
|
|
22
|
+
import re
|
|
23
|
+
import sys
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
REQUIRED = ["id", "title", "description", "link", "image_link",
|
|
27
|
+
"availability", "price", "brand", "condition"]
|
|
28
|
+
RECOMMENDED = ["gtin", "mpn", "item_group_id", "google_product_category"]
|
|
29
|
+
|
|
30
|
+
AVAILABILITY = {"in_stock", "out_of_stock", "preorder", "backorder"}
|
|
31
|
+
CONDITION = {"new", "refurbished", "used"}
|
|
32
|
+
# e.g. "21.00 USD" / "9.99 EUR"
|
|
33
|
+
PRICE_RE = re.compile(r"^\d+(\.\d{1,2})?\s+[A-Z]{3}$")
|
|
34
|
+
URL_RE = re.compile(r"^https?://", re.IGNORECASE)
|
|
35
|
+
TITLE_MAX = 150
|
|
36
|
+
DESC_MAX = 5000
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
DEMO_FEED = [
|
|
40
|
+
{"id": "ACME-TEE-RED-M", "title": "Acme Cotton Tee — Red, Medium",
|
|
41
|
+
"description": "Soft 100% cotton crew-neck tee.", "link": "https://shop.example.com/p/acme-tee-red-m",
|
|
42
|
+
"image_link": "https://shop.example.com/img/acme-tee-red-m.jpg", "availability": "in_stock",
|
|
43
|
+
"price": "21.00 USD", "brand": "Acme", "condition": "new",
|
|
44
|
+
"gtin": "0123456789012", "item_group_id": "ACME-TEE"},
|
|
45
|
+
# broken row: bad availability, bad price, missing brand, non-url image
|
|
46
|
+
{"id": "ACME-MUG-BLUE", "title": "Acme Mug", "description": "",
|
|
47
|
+
"link": "https://shop.example.com/p/acme-mug", "image_link": "acme-mug.jpg",
|
|
48
|
+
"availability": "available", "price": "9.99", "brand": "", "condition": "brand-new"},
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def validate_row(row, idx, strict):
|
|
53
|
+
errors = []
|
|
54
|
+
warnings = []
|
|
55
|
+
|
|
56
|
+
for attr in REQUIRED:
|
|
57
|
+
if not (row.get(attr) or "").strip():
|
|
58
|
+
errors.append(f"missing required '{attr}'")
|
|
59
|
+
|
|
60
|
+
avail = (row.get("availability") or "").strip().lower()
|
|
61
|
+
if avail and avail not in AVAILABILITY:
|
|
62
|
+
errors.append(f"availability '{avail}' not in {sorted(AVAILABILITY)}")
|
|
63
|
+
|
|
64
|
+
cond = (row.get("condition") or "").strip().lower()
|
|
65
|
+
if cond and cond not in CONDITION:
|
|
66
|
+
errors.append(f"condition '{cond}' not in {sorted(CONDITION)}")
|
|
67
|
+
|
|
68
|
+
price = (row.get("price") or "").strip()
|
|
69
|
+
if price and not PRICE_RE.match(price):
|
|
70
|
+
errors.append(f"price '{price}' must be like '21.00 USD' (amount + ISO currency)")
|
|
71
|
+
|
|
72
|
+
for url_attr in ("link", "image_link"):
|
|
73
|
+
val = (row.get(url_attr) or "").strip()
|
|
74
|
+
if val and not URL_RE.match(val):
|
|
75
|
+
errors.append(f"{url_attr} '{val}' must be an absolute http(s) URL")
|
|
76
|
+
|
|
77
|
+
title = (row.get("title") or "").strip()
|
|
78
|
+
if len(title) > TITLE_MAX:
|
|
79
|
+
warnings.append(f"title > {TITLE_MAX} chars ({len(title)})")
|
|
80
|
+
if len(row.get("description") or "") > DESC_MAX:
|
|
81
|
+
warnings.append(f"description > {DESC_MAX} chars")
|
|
82
|
+
|
|
83
|
+
has_id_link = bool((row.get("item_group_id") or "").strip())
|
|
84
|
+
if not has_id_link:
|
|
85
|
+
warnings.append("no item_group_id (variants won't cluster)")
|
|
86
|
+
if not (row.get("gtin") or "").strip() and not (row.get("mpn") or "").strip():
|
|
87
|
+
warnings.append("no gtin/mpn (weakens product matching)")
|
|
88
|
+
|
|
89
|
+
if strict:
|
|
90
|
+
errors.extend(f"(strict) {w}" for w in warnings)
|
|
91
|
+
warnings = []
|
|
92
|
+
return errors, warnings
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def main():
|
|
96
|
+
ap = argparse.ArgumentParser(description="Validate a Google/Meta product feed CSV.")
|
|
97
|
+
ap.add_argument("csv", nargs="?", help="feed CSV. Omit for demo data.")
|
|
98
|
+
ap.add_argument("--strict", action="store_true", help="treat recommended issues as failures")
|
|
99
|
+
args = ap.parse_args()
|
|
100
|
+
|
|
101
|
+
if args.csv:
|
|
102
|
+
try:
|
|
103
|
+
with open(args.csv, newline="", encoding="utf-8") as f:
|
|
104
|
+
rows = list(csv.DictReader(f))
|
|
105
|
+
except OSError as e:
|
|
106
|
+
print(f"[ERROR] cannot read {args.csv}: {e}")
|
|
107
|
+
sys.exit(1)
|
|
108
|
+
else:
|
|
109
|
+
print("[INFO] No CSV given - using built-in demo feed.\n")
|
|
110
|
+
rows = DEMO_FEED
|
|
111
|
+
|
|
112
|
+
if not rows:
|
|
113
|
+
print("[ERROR] feed is empty.")
|
|
114
|
+
sys.exit(1)
|
|
115
|
+
|
|
116
|
+
failed = 0
|
|
117
|
+
for idx, row in enumerate(rows):
|
|
118
|
+
errors, warnings = validate_row(row, idx, args.strict)
|
|
119
|
+
rid = row.get("id") or f"row{idx}"
|
|
120
|
+
if errors:
|
|
121
|
+
failed += 1
|
|
122
|
+
print(f"FAIL {rid}")
|
|
123
|
+
for e in errors:
|
|
124
|
+
print(f" - {e}")
|
|
125
|
+
for w in warnings:
|
|
126
|
+
print(f" ~ {w}")
|
|
127
|
+
else:
|
|
128
|
+
print(f"PASS {rid}")
|
|
129
|
+
for w in warnings:
|
|
130
|
+
print(f" ~ {w}")
|
|
131
|
+
|
|
132
|
+
print()
|
|
133
|
+
passed = len(rows) - failed
|
|
134
|
+
verdict = "READY" if failed == 0 else "NOT-READY"
|
|
135
|
+
print(f"{verdict}: {passed}/{len(rows)} items pass required-attribute checks.")
|
|
136
|
+
sys.exit(0 if failed == 0 else 1)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
if __name__ == "__main__":
|
|
140
|
+
main()
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: order-lifecycle
|
|
3
|
+
description: "Design the order lifecycle — order state machine, fulfillment workflow, returns/RMA, refunds, cancellations, and order events/webhooks. Platform-agnostic state and event modeling. Triggers: designing order states, modeling returns/refunds, defining order events."
|
|
4
|
+
argument-hint: "[design | states | returns]"
|
|
5
|
+
category: "ecommerce"
|
|
6
|
+
user-invocable: true
|
|
7
|
+
allowed-tools: Read, Glob, Grep, Write, Edit
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Order Lifecycle
|
|
11
|
+
|
|
12
|
+
An order is a long-lived state machine touched by payments, inventory, shipping, and support. Model its states, transitions, and events explicitly so nothing silently gets stuck — independent of platform.
|
|
13
|
+
|
|
14
|
+
> **Note:** This skill may create or modify files in your project (a state-machine spec). It will ask before writing.
|
|
15
|
+
|
|
16
|
+
## Before Starting
|
|
17
|
+
|
|
18
|
+
Gather: fulfillment model (single vs split/partial shipments), payment capture timing (auth-then-capture vs immediate), returns policy, and goal (design the full lifecycle, define the state machine, or model returns/refunds).
|
|
19
|
+
|
|
20
|
+
## How This Skill Works
|
|
21
|
+
|
|
22
|
+
| Mode | Trigger | Output |
|
|
23
|
+
|------|---------|--------|
|
|
24
|
+
| **Design** | `design` | End-to-end lifecycle + events |
|
|
25
|
+
| **States** | `states` | Formal state machine: states, transitions, guards |
|
|
26
|
+
| **Returns** | `returns` | RMA + refund flow and states |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Phase 1 — The State Machine
|
|
31
|
+
|
|
32
|
+
Separate **order status** from **payment status** and **fulfillment status** — collapsing them into one field is the most common modeling mistake.
|
|
33
|
+
|
|
34
|
+
| Dimension | States |
|
|
35
|
+
|-----------|--------|
|
|
36
|
+
| **Order** | pending → confirmed → in_progress → completed / cancelled |
|
|
37
|
+
| **Payment** | pending → authorized → paid → partially_refunded → refunded / failed |
|
|
38
|
+
| **Fulfillment** | unfulfilled → partially_fulfilled → fulfilled → returned |
|
|
39
|
+
|
|
40
|
+
Each transition has a **guard** (e.g. cannot fulfill before payment authorized) and emits an **event**.
|
|
41
|
+
|
|
42
|
+
For the full transition table, guards, and partial-shipment handling, see [references/order-state-machine.md](references/order-state-machine.md).
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Phase 2 — Events & Webhooks
|
|
47
|
+
|
|
48
|
+
Every transition emits a durable, ordered event: `order.created`, `order.paid`, `order.fulfilled`, `order.cancelled`, `order.refunded`, `return.requested`, `return.received`.
|
|
49
|
+
|
|
50
|
+
- Events are **append-only** — never mutate history; the current state is a projection.
|
|
51
|
+
- Outbound webhooks must be **idempotent and retried** with signatures (hand off to `payments-architecture` for the reliability pattern).
|
|
52
|
+
- Carry an idempotency key from order placement through fulfillment.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Phase 3 — Returns & Refunds
|
|
57
|
+
|
|
58
|
+
Flow: `return.requested → approved → label_sent → in_transit → received → inspected → refunded/rejected`.
|
|
59
|
+
|
|
60
|
+
| Concern | Rule |
|
|
61
|
+
|---------|------|
|
|
62
|
+
| Restock | Only on `received + inspected` pass, back to `available` |
|
|
63
|
+
| Refund | Full / partial / store-credit; never exceed captured amount |
|
|
64
|
+
| Window | Enforce return-window guard at request time |
|
|
65
|
+
| Partial | Per line-item, not whole-order, for split fulfillment |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Output Artifacts
|
|
70
|
+
|
|
71
|
+
| Request | Output |
|
|
72
|
+
|---------|--------|
|
|
73
|
+
| Design | Lifecycle diagram + event catalog |
|
|
74
|
+
| States | State/transition/guard table (the spec) |
|
|
75
|
+
| Returns | RMA flow + refund rules |
|
|
76
|
+
|
|
77
|
+
A lifecycle design is **COMPLETE** when order/payment/fulfillment statuses are independent, every transition has a guard and an event, and refunds/restocks are gated on inspection.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Related Skills
|
|
82
|
+
|
|
83
|
+
- **payments-architecture**: capture/refund and webhook reliability for order events.
|
|
84
|
+
- **inventory-stock**: reservations released and stock decremented per fulfillment.
|
|
85
|
+
- **cart-checkout**: hands the placed order into this lifecycle.
|
|
86
|
+
- **commerce-analytics**: order events feed funnel and revenue metrics.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Order State Machine — Transitions, Guards & Events
|
|
2
|
+
|
|
3
|
+
Three independent dimensions. Keep them separate; the overall order status is a projection, not a stored mega-enum.
|
|
4
|
+
|
|
5
|
+
## Order status
|
|
6
|
+
| From | To | Guard | Event |
|
|
7
|
+
|------|----|-------|-------|
|
|
8
|
+
| (start) | pending | order placed | `order.created` |
|
|
9
|
+
| pending | confirmed | payment authorized | `order.confirmed` |
|
|
10
|
+
| confirmed | in_progress | fulfillment started | `order.processing` |
|
|
11
|
+
| in_progress | completed | all items fulfilled | `order.completed` |
|
|
12
|
+
| pending/confirmed | cancelled | not yet shipped | `order.cancelled` |
|
|
13
|
+
|
|
14
|
+
## Payment status
|
|
15
|
+
| From | To | Guard | Event |
|
|
16
|
+
|------|----|-------|-------|
|
|
17
|
+
| pending | authorized | auth succeeded | `payment.authorized` |
|
|
18
|
+
| authorized | paid | captured | `payment.captured` |
|
|
19
|
+
| paid | partially_refunded | refund < captured | `payment.refunded` |
|
|
20
|
+
| paid | refunded | refund == captured | `payment.refunded` |
|
|
21
|
+
| pending/authorized | failed | gateway decline | `payment.failed` |
|
|
22
|
+
|
|
23
|
+
## Fulfillment status
|
|
24
|
+
| From | To | Guard | Event |
|
|
25
|
+
|------|----|-------|-------|
|
|
26
|
+
| unfulfilled | partially_fulfilled | some lines shipped | `fulfillment.partial` |
|
|
27
|
+
| partially_fulfilled | fulfilled | all lines shipped | `fulfillment.completed` |
|
|
28
|
+
| fulfilled | returned | RMA received | `return.received` |
|
|
29
|
+
|
|
30
|
+
## Cross-dimension guards (the important rules)
|
|
31
|
+
- Cannot transition fulfillment past `unfulfilled` until payment is `authorized` (or `paid`, per capture policy).
|
|
32
|
+
- Cannot `cancel` once any line is `fulfilled` — use returns instead.
|
|
33
|
+
- Capture timing: auth at placement, capture at first fulfillment (auth/capture model) OR capture immediately (decide once).
|
|
34
|
+
|
|
35
|
+
## Returns / RMA sub-flow
|
|
36
|
+
`return.requested → approved → label_sent → in_transit → received → inspected → (refunded | rejected)`
|
|
37
|
+
|
|
38
|
+
| Concern | Rule |
|
|
39
|
+
|---------|------|
|
|
40
|
+
| Window | Guard `requested` against return-window from delivery date |
|
|
41
|
+
| Restock | Only on `inspected` pass → quantity back to `available` |
|
|
42
|
+
| Refund | ≤ captured amount; full / partial / store-credit |
|
|
43
|
+
| Partial | Per line item for split fulfillment |
|
|
44
|
+
|
|
45
|
+
## Events are append-only
|
|
46
|
+
Persist every event with: id, order_id, type, payload, timestamp, idempotency_key. Current state = fold over events. Outbound webhooks must be signed, deduplicated, and retried (see `payments-architecture`).
|
|
47
|
+
|
|
48
|
+
## Verdict: COMPLETE when
|
|
49
|
+
- [ ] Order / payment / fulfillment statuses are independent fields
|
|
50
|
+
- [ ] Every transition has a guard and emits an event
|
|
51
|
+
- [ ] Cancel blocked after fulfillment; returns handle post-ship
|
|
52
|
+
- [ ] Restock gated on inspection; refunds capped at captured amount
|
|
53
|
+
- [ ] Events are append-only with idempotency keys
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: payments-architecture
|
|
3
|
+
description: "Design payment architecture independent of any single processor — gateway selection, payment intents, idempotency, webhook reliability, reconciliation, PCI scope, fraud, and refunds. Complements processor-specific skills. Triggers: choosing a PSP, designing webhook handling, reducing PCI scope, reconciling payments."
|
|
4
|
+
argument-hint: "[design | webhooks | audit]"
|
|
5
|
+
category: "ecommerce"
|
|
6
|
+
user-invocable: true
|
|
7
|
+
allowed-tools: Read, Glob, Grep
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Payments Architecture
|
|
11
|
+
|
|
12
|
+
The payment layer must never double-charge, never lose a webhook, and never widen PCI scope. This skill designs the processor-agnostic architecture; processor-specific implementation (e.g. Stripe) is a handoff.
|
|
13
|
+
|
|
14
|
+
## Before Starting
|
|
15
|
+
|
|
16
|
+
Gather: markets/currencies, payment methods (cards, wallets, local methods), capture model (immediate vs auth/capture), subscription needs, and goal (design the architecture, harden webhooks, or audit an existing integration).
|
|
17
|
+
|
|
18
|
+
## How This Skill Works
|
|
19
|
+
|
|
20
|
+
| Mode | Trigger | Output |
|
|
21
|
+
|------|---------|--------|
|
|
22
|
+
| **Design** | `design` | Gateway choice + payment flow + PCI strategy |
|
|
23
|
+
| **Webhooks** | `webhooks` | Reliable, idempotent webhook handling design |
|
|
24
|
+
| **Audit** | `audit` | Risk review of an existing integration |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Phase 1 — Flow & Idempotency
|
|
29
|
+
|
|
30
|
+
Use the **payment intent** model regardless of processor: create intent → confirm → succeeded/failed, with status mirrored onto the order.
|
|
31
|
+
|
|
32
|
+
| Principle | Why |
|
|
33
|
+
|-----------|-----|
|
|
34
|
+
| **Idempotency keys** on every create/charge | A retried request must not double-charge |
|
|
35
|
+
| **Server-authoritative amounts** | Never trust client-sent totals; re-price server-side |
|
|
36
|
+
| **Auth then capture** (where supported) | Capture at fulfillment, not at order placement |
|
|
37
|
+
| **Money as integer minor units** | No floats for currency, ever |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Phase 2 — Webhook Reliability
|
|
42
|
+
|
|
43
|
+
Webhooks are the source of truth for async payment outcomes — treat them as unreliable transport:
|
|
44
|
+
|
|
45
|
+
1. **Verify the signature** before doing anything.
|
|
46
|
+
2. **Deduplicate** by event id (idempotent processing) — providers redeliver.
|
|
47
|
+
3. **Persist then process** — store the raw event, ack fast (2xx), process out of band.
|
|
48
|
+
4. **Tolerate out-of-order** delivery; reconcile against current state, don't assume sequence.
|
|
49
|
+
5. **Reconcile** daily against the processor's ledger to catch missed events.
|
|
50
|
+
|
|
51
|
+
For the persist-ack-process pattern, retry/backoff, and reconciliation report design, apply the principles above and hand processor specifics to `stripe-integration-expert`.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Phase 3 — PCI Scope & Fraud
|
|
56
|
+
|
|
57
|
+
- **Minimize PCI scope:** use hosted fields / tokenization so raw PAN never touches your servers (SAQ A). Never log card data.
|
|
58
|
+
- **Fraud:** combine processor risk signals with velocity checks, AVS/CVV, and 3-D Secure for high-risk; balance friction vs chargebacks.
|
|
59
|
+
- **Refunds:** never exceed captured amount; support partial; emit `payment.refunded` to the order lifecycle.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Output Artifacts
|
|
64
|
+
|
|
65
|
+
| Request | Output |
|
|
66
|
+
|---------|--------|
|
|
67
|
+
| Design | Gateway selection + intent flow + PCI scope plan |
|
|
68
|
+
| Webhooks | Idempotent handler design + reconciliation plan |
|
|
69
|
+
| Audit | Findings: SECURE / CONCERNS / FAIL per area |
|
|
70
|
+
|
|
71
|
+
A payment architecture is **SECURE** when charges are idempotent, amounts are server-authoritative, webhooks are signature-verified and deduplicated, money is integer minor units, and PCI scope is minimized.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Related Skills
|
|
76
|
+
|
|
77
|
+
- **stripe-integration-expert**: processor-specific implementation once this architecture is set.
|
|
78
|
+
- **cart-checkout**: invokes the payment step.
|
|
79
|
+
- **order-lifecycle**: consumes payment events (paid, refunded).
|
|
80
|
+
- **subscription-billing**: recurring charges build on this layer.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: product-listing
|
|
3
|
+
description: "Optimize product detail pages and marketplace listings for discovery and conversion — titles, bullets, descriptions, imagery, A+ content, and marketplace algorithms (Amazon A10/COSMO/Rufus). Includes bulk-copy generation guidance. Triggers: writing/optimizing PDP copy, marketplace listings, bulk product descriptions."
|
|
4
|
+
argument-hint: "[pdp | marketplace | bulk]"
|
|
5
|
+
category: "ecommerce"
|
|
6
|
+
user-invocable: true
|
|
7
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Product Listing
|
|
11
|
+
|
|
12
|
+
A listing has two readers: the ranking algorithm and the buyer. Optimize for both — keyword-relevant enough to surface, persuasive enough to convert — across your own PDP and marketplaces.
|
|
13
|
+
|
|
14
|
+
## Before Starting
|
|
15
|
+
|
|
16
|
+
Gather: channel (own store vs Amazon/Meta/etc.), product category and key attributes, target keywords, and goal (optimize a PDP, write a marketplace listing, or generate bulk descriptions).
|
|
17
|
+
|
|
18
|
+
## How This Skill Works
|
|
19
|
+
|
|
20
|
+
| Mode | Trigger | Output |
|
|
21
|
+
|------|---------|--------|
|
|
22
|
+
| **PDP** | `pdp` | Optimized own-store product page copy |
|
|
23
|
+
| **Marketplace** | `marketplace` | Channel-specific listing (title/bullets/A+) |
|
|
24
|
+
| **Bulk** | `bulk` | Templated copy for many SKUs at scale |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Phase 1 — PDP Copy Anatomy
|
|
29
|
+
|
|
30
|
+
| Element | Rule |
|
|
31
|
+
|---------|------|
|
|
32
|
+
| **Title** | Brand + product + key differentiator; front-load the noun |
|
|
33
|
+
| **Bullets** | Benefit-led, scannable; feature → benefit translation |
|
|
34
|
+
| **Description** | Story + specs; answer objections; structured for skim |
|
|
35
|
+
| **Imagery** | Multiple angles, scale/context, zoom; alt text for SEO + a11y |
|
|
36
|
+
| **Trust** | Reviews, ratings, returns, shipping, stock signals near the CTA |
|
|
37
|
+
|
|
38
|
+
Map product attributes (from `commerce-data-model`) into structured spec tables — buyers filter on them and search engines index them.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Phase 2 — Marketplace Algorithms
|
|
43
|
+
|
|
44
|
+
Marketplace listings must satisfy ranking systems, not just shoppers:
|
|
45
|
+
|
|
46
|
+
- **Amazon A10** — keyword/relevance + sales velocity + conversion. Put core keywords in title and bullets naturally.
|
|
47
|
+
- **COSMO** — semantic/intent: write for *purchase intent and use-cases*, not just keyword stuffing.
|
|
48
|
+
- **Rufus / AI assistants** — Q&A-friendly content: cover comparisons, compatibility, use-cases the way a shopper would ask.
|
|
49
|
+
- Localize per marketplace (not just translate) — units, sizing, terminology.
|
|
50
|
+
|
|
51
|
+
Avoid keyword stuffing; modern algorithms penalize it and shoppers distrust it. Hand SEO structure to `ai-seo` / `seo-audit`.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Phase 3 — Bulk Generation
|
|
56
|
+
|
|
57
|
+
For large catalogs, template the copy:
|
|
58
|
+
|
|
59
|
+
1. Define a copy template per product category (slots: hook, benefits, specs, use-case).
|
|
60
|
+
2. Map structured attributes → slots.
|
|
61
|
+
3. Generate, then spot-QA for accuracy and duplicate-content risk (search engines penalize near-duplicates).
|
|
62
|
+
|
|
63
|
+
Pair with `merchant-feed` (the script there validates the structured attributes that feed both listings and ads).
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Output Artifacts
|
|
68
|
+
|
|
69
|
+
| Request | Output |
|
|
70
|
+
|---------|--------|
|
|
71
|
+
| PDP | Title + bullets + description + image/alt brief |
|
|
72
|
+
| Marketplace | Channel-tuned listing with keyword map |
|
|
73
|
+
| Bulk | Category templates + slot mapping |
|
|
74
|
+
|
|
75
|
+
A listing is **READY** when the title front-loads the product, bullets are benefit-led, intent/use-cases are covered for AI search, trust signals sit by the CTA, and there's no duplicate-content risk.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Related Skills
|
|
80
|
+
|
|
81
|
+
- **commerce-data-model**: source of the structured attributes copy draws on.
|
|
82
|
+
- **ai-seo** / **seo-audit** / **schema-markup**: organic discovery and markup.
|
|
83
|
+
- **merchant-feed**: same attributes power shopping ads.
|
|
84
|
+
- **copywriting** / **page-cro**: deeper persuasion and conversion testing.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: promotions-discounts
|
|
3
|
+
description: "Design a promotions and discount engine — coupon codes, automatic discounts, BOGO, tiered/volume pricing, stacking and exclusivity rules, and gift cards. Platform-agnostic rules modeling that avoids margin leaks. Triggers: designing discounts, defining stacking rules, modeling gift cards/coupons."
|
|
4
|
+
argument-hint: "[design | rules | audit]"
|
|
5
|
+
category: "ecommerce"
|
|
6
|
+
user-invocable: true
|
|
7
|
+
allowed-tools: Read, Glob, Grep
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Promotions & Discounts
|
|
11
|
+
|
|
12
|
+
Discounts are easy to add and hard to control. Model the rules so promotions stack predictably, can't be abused, and never quietly destroy margin — independent of platform.
|
|
13
|
+
|
|
14
|
+
## Before Starting
|
|
15
|
+
|
|
16
|
+
Gather: promotion types in use, who can stack with what, abuse history (code sharing, repeat redemption), and goal (design the engine, define stacking/exclusivity rules, or audit existing promos for leaks).
|
|
17
|
+
|
|
18
|
+
## How This Skill Works
|
|
19
|
+
|
|
20
|
+
| Mode | Trigger | Output |
|
|
21
|
+
|------|---------|--------|
|
|
22
|
+
| **Design** | `design` | Discount engine model + rule schema |
|
|
23
|
+
| **Rules** | `rules` | Stacking, exclusivity, and eligibility matrix |
|
|
24
|
+
| **Audit** | `audit` | Margin-leak and abuse-risk review |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Phase 1 — Discount Model
|
|
29
|
+
|
|
30
|
+
Model every promotion as **trigger → condition → effect → constraints**:
|
|
31
|
+
|
|
32
|
+
| Part | Examples |
|
|
33
|
+
|------|----------|
|
|
34
|
+
| **Trigger** | code entered, automatic, cart threshold |
|
|
35
|
+
| **Condition** | min subtotal, specific collection, customer segment, first order |
|
|
36
|
+
| **Effect** | % off, fixed off, free shipping, BOGO, fixed price |
|
|
37
|
+
| **Constraints** | usage cap (global/per-customer), date window, exclusivity |
|
|
38
|
+
|
|
39
|
+
**Rule:** Discounts apply to a defined scope (line / shipping / order) and are recomputed server-side at checkout — never client-trusted.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Phase 2 — Stacking & Exclusivity
|
|
44
|
+
|
|
45
|
+
The hard part. Define explicitly:
|
|
46
|
+
|
|
47
|
+
- **Stackable vs exclusive:** most stores allow one order-level code; auto-discounts may stack with codes. Decide and enforce.
|
|
48
|
+
- **Application order** matters for % vs fixed — define it (typically line discounts → order discounts → shipping).
|
|
49
|
+
- **Priority** when multiple eligible: best-for-customer vs best-for-merchant — pick a policy.
|
|
50
|
+
- **Caps:** max discount per order; floor on post-discount margin.
|
|
51
|
+
|
|
52
|
+
For the full eligibility matrix and worked stacking examples, model the matrix per the table above.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Phase 3 — Gift Cards & Abuse Prevention
|
|
57
|
+
|
|
58
|
+
- **Gift cards** are stored-value tender, not discounts — track balance, partial redemption, and never let balance go negative or expire silently where regulated.
|
|
59
|
+
- **Abuse defenses:** per-customer usage caps, one-time codes, segment gating, and minimum-order thresholds. Watch for code leaks to coupon sites.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Output Artifacts
|
|
64
|
+
|
|
65
|
+
| Request | Output |
|
|
66
|
+
|---------|--------|
|
|
67
|
+
| Design | Rule schema + effect/scope model |
|
|
68
|
+
| Rules | Stacking/exclusivity matrix + application order |
|
|
69
|
+
| Audit | Leak/abuse findings: PASS / CONCERNS / FAIL |
|
|
70
|
+
|
|
71
|
+
A promotion engine is **COMPLIANT** when discounts are server-computed, stacking and application order are explicit, usage caps are enforced, and a margin floor protects every order.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Related Skills
|
|
76
|
+
|
|
77
|
+
- **cart-checkout**: applies discounts at the cart/checkout.
|
|
78
|
+
- **pricing-strategy**: sets the base prices discounts modify.
|
|
79
|
+
- **commerce-analytics**: measures promo ROI and margin impact.
|
|
80
|
+
- **referral-program**: a specialized promotion type.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shipping-tax
|
|
3
|
+
description: "Design shipping and tax logic — shipping zones, rates and methods, carrier integration patterns, plus sales tax/VAT/GST, nexus, and duties. Platform-agnostic rules for correct totals at checkout. Triggers: designing shipping rates, modeling tax/VAT, handling cross-border duties."
|
|
4
|
+
argument-hint: "[shipping | tax | audit]"
|
|
5
|
+
category: "ecommerce"
|
|
6
|
+
user-invocable: true
|
|
7
|
+
allowed-tools: Read, Glob, Grep
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Shipping & Tax
|
|
11
|
+
|
|
12
|
+
The two line items most likely to be wrong at checkout — and the ones that cause chargebacks, abandoned carts, and compliance trouble. Model them correctly and computed server-side, independent of platform.
|
|
13
|
+
|
|
14
|
+
## Before Starting
|
|
15
|
+
|
|
16
|
+
Gather: markets shipped to/from, carriers, product attributes (weight/dims), tax obligations (countries, nexus, registrations), and goal (design shipping, design tax, or audit existing totals).
|
|
17
|
+
|
|
18
|
+
## How This Skill Works
|
|
19
|
+
|
|
20
|
+
| Mode | Trigger | Output |
|
|
21
|
+
|------|---------|--------|
|
|
22
|
+
| **Shipping** | `shipping` | Zones, methods, and rate model |
|
|
23
|
+
| **Tax** | `tax` | Tax determination and nexus model |
|
|
24
|
+
| **Audit** | `audit` | Correctness review of current totals |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Phase 1 — Shipping Model
|
|
29
|
+
|
|
30
|
+
Layer the model as **zones → methods → rates**:
|
|
31
|
+
|
|
32
|
+
| Layer | Definition |
|
|
33
|
+
|-------|-----------|
|
|
34
|
+
| **Zone** | Geographic grouping (country/region/postal ranges) |
|
|
35
|
+
| **Method** | Service level (standard, express, pickup) per zone |
|
|
36
|
+
| **Rate** | flat / weight-based / price-based / carrier-calculated / free-over-threshold |
|
|
37
|
+
|
|
38
|
+
- **Free-shipping thresholds** must be computed on the discounted subtotal.
|
|
39
|
+
- **Carrier-calculated** rates need weight + dimensions on the variant — falls back to flat if missing.
|
|
40
|
+
- Show shipping before the payment step; recompute when the address changes.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Phase 2 — Tax Determination
|
|
45
|
+
|
|
46
|
+
Tax is destination- and product-dependent — never a single flat rate:
|
|
47
|
+
|
|
48
|
+
| Concept | Rule |
|
|
49
|
+
|---------|------|
|
|
50
|
+
| **Nexus** | You only collect where you have an obligation — model registrations per jurisdiction |
|
|
51
|
+
| **Destination vs origin** | Most VAT/GST is destination-based; some US states origin-based |
|
|
52
|
+
| **Product taxability** | Categories differ (food, digital, apparel) — map products to tax categories |
|
|
53
|
+
| **Price display** | Tax-inclusive (EU/UK) vs tax-exclusive (US) — a presentation rule, get it right per market |
|
|
54
|
+
| **B2B** | Reverse-charge / VAT-ID validation for cross-border EU |
|
|
55
|
+
|
|
56
|
+
**Rule:** Compute tax at checkout against the shipping destination, using a tax category per product. Round per jurisdiction rules.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Phase 3 — Cross-Border & Duties
|
|
61
|
+
|
|
62
|
+
- **DDP vs DDU:** decide who pays import duties — DDP (you collect at checkout, best UX) vs DDU (customer pays on delivery, surprise fees → returns).
|
|
63
|
+
- **Landed cost** = item + shipping + duties + tax; show it for cross-border.
|
|
64
|
+
- Capture **HS codes** and country of origin on products for customs.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Output Artifacts
|
|
69
|
+
|
|
70
|
+
| Request | Output |
|
|
71
|
+
|---------|--------|
|
|
72
|
+
| Shipping | Zone/method/rate model |
|
|
73
|
+
| Tax | Nexus map + product tax-category mapping |
|
|
74
|
+
| Audit | Findings per market: PASS / FAIL with fixes |
|
|
75
|
+
|
|
76
|
+
Shipping and tax are **READY** when both are computed server-side against the destination, free-shipping uses discounted subtotals, tax categories are mapped, and cross-border shows landed cost.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Related Skills
|
|
81
|
+
|
|
82
|
+
- **cart-checkout**: displays and recomputes these at the shipping step.
|
|
83
|
+
- **order-lifecycle**: shipping method feeds fulfillment; tax recorded on the order.
|
|
84
|
+
- **commerce-data-model**: weight/dims/HS code/tax category live on the product.
|
|
85
|
+
- **merchant-feed**: shipping and tax attributes appear in product feeds.
|