@sadrmanesh/commerce-agent-skills 0.3.2 → 0.3.3

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +20 -0
  3. package/package.json +1 -1
  4. package/skills/b2b-pricing/SKILL.md +1 -1
  5. package/skills/catalog-import-and-migration/SKILL.md +1 -1
  6. package/skills/checkout-ux-and-conversion/SKILL.md +1 -1
  7. package/skills/conversion-event-tracking/SKILL.md +1 -1
  8. package/skills/ecommerce-seo-structured-data/SKILL.md +1 -1
  9. package/skills/fraud-and-risk-basics/SKILL.md +1 -1
  10. package/skills/google-merchant-product-feeds/SKILL.md +1 -1
  11. package/skills/headless-nextjs-storefront/SKILL.md +1 -1
  12. package/skills/inventory-and-multi-warehouse/SKILL.md +1 -1
  13. package/skills/inventory-and-multi-warehouse/scripts/allocate-stock.mjs +16 -2
  14. package/skills/iranian-payment-gateways/SKILL.md +1 -1
  15. package/skills/marketplace-search-and-ranking/SKILL.md +1 -1
  16. package/skills/mcp-store-tooling/SKILL.md +1 -1
  17. package/skills/multi-vendor-payouts/SKILL.md +1 -1
  18. package/skills/order-and-webhook-reliability/SKILL.md +1 -1
  19. package/skills/payment-gateway-integration/SKILL.md +1 -1
  20. package/skills/product-catalog-modeling/SKILL.md +1 -1
  21. package/skills/product-description-guardrails/SKILL.md +1 -1
  22. package/skills/returns-and-refunds/SKILL.md +1 -1
  23. package/skills/rtl-and-persian-localization/SKILL.md +1 -1
  24. package/skills/shopify-app-development/SKILL.md +1 -1
  25. package/skills/storefront-accessibility/SKILL.md +1 -1
  26. package/skills/storefront-performance/SKILL.md +1 -1
  27. package/skills/stripe-payments/SKILL.md +1 -1
  28. package/skills/subscription-billing/SKILL.md +1 -1
  29. package/skills/tax-and-shipping/SKILL.md +1 -1
  30. package/skills/vector-product-search/SKILL.md +1 -1
  31. package/skills/woocommerce-plugin-development/SKILL.md +1 -1
  32. package/skills/woocommerce-rest-api/SKILL.md +1 -1
  33. package/skills/wordpress-plugin-security/SKILL.md +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.3.3] - 2026-11-04
6
+
7
+ ### Fixed
8
+
9
+ - `allocate-stock.mjs` could oversell when an order had two lines for the same SKU. The one-location check looked at each line alone, so two lines of 3 both fit a location with 4 free. It now sums quantities per SKU first.
10
+
11
+ ### Added
12
+
13
+ - `reserve()` in `allocate-stock.mjs`, a check-and-set step that reserves stock only when enough is free. The allocator uses it.
14
+ - Tests for two concurrent checkouts racing for the last unit, plus a test that runs the same race against a read-then-write reserve and expects it to oversell, so the race test shows it can fail. Removing the stock decrement, the availability check, or the per-SKU sum now fails the suite; before this change, removing the decrement still passed.
15
+
16
+ ### Changed
17
+
18
+ - The package and every skill are now version 0.3.3.
19
+
5
20
  ## [0.3.2] - 2026-10-31
6
21
 
7
22
  ### Added
package/README.md CHANGED
@@ -4,6 +4,8 @@ Skills and rules for AI coding agents that build e-commerce and marketplace prod
4
4
 
5
5
  **Documentation:** <https://sadrmanesh.github.io/commerce-agent-skills/> · **Dataset:** [Hugging Face](https://huggingface.co/datasets/sadrmanesh/commerce-agent-skills)
6
6
 
7
+ **Read more:** [Treat agent skills like code: evals, a strict validator, and an npx installer for commerce skills](https://dev.to/sadrmanesh/treat-agent-skills-like-code-evals-a-strict-validator-and-an-npx-installer-for-commerce-skills-13dk) on Dev.to · [The knowledge your senior engineers carry, packaged for coding agents](https://www.linkedin.com/pulse/knowledge-your-senior-engineers-carry-packaged-coding-sadrmanesh-xtenf/) on LinkedIn
8
+
7
9
  The skills follow the [Agent Skills](https://agentskills.io/specification) format: a folder, a `SKILL.md` file with `name` and `description`, and optional reference files and scripts. An agent that supports that format can load them. The format does not name an install path. [Installation](docs/installation.md) explains how to point your agent at these folders.
8
10
 
9
11
  Version 0.3.0 adds store operations to the library. It keeps the twenty skills from 0.1.0 and 0.2.0 and adds Stripe payments, Iranian payment gateways such as Zarinpal, inventory across warehouses, returns and refunds, B2B pricing, catalog import and migration, storefront accessibility, storefront performance, and MCP store tooling. It also adds a stricter validator and an eval runner that scores answers against the fixtures.
@@ -132,6 +134,24 @@ Later releases can add:
132
134
 
133
135
  See [CONTRIBUTING.md](CONTRIBUTING.md). Run the validator before opening a pull request. New skills need a matching rule, a row in `skills/catalog-order.txt`, and a place in `website/categories.json`.
134
136
 
137
+ ## Technical report
138
+
139
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.23883598.svg)](https://doi.org/10.5281/zenodo.23883598)
140
+
141
+ commerce-agent-skills: Architectural Specification, Domain Constraints, and Evaluation Framework for E-Commerce AI Coding Agents. M. N. Sadrmanesh, Zenodo, 2026. <https://doi.org/10.5281/zenodo.23883598>
142
+
143
+ ```bibtex
144
+ @techreport{sadrmanesh2026commerceagentskills,
145
+ author = {Sadrmanesh, Mohammad Naser},
146
+ title = {commerce-agent-skills: Architectural Specification, Domain Constraints, and Evaluation Framework for E-Commerce AI Coding Agents},
147
+ institution = {Zenodo},
148
+ year = {2026},
149
+ version = {1.0},
150
+ doi = {10.5281/zenodo.23883598},
151
+ url = {https://doi.org/10.5281/zenodo.23883598}
152
+ }
153
+ ```
154
+
135
155
  ## License
136
156
 
137
157
  [MIT](LICENSE). Copyright (c) 2026 Naser Sadrmanesh.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sadrmanesh/commerce-agent-skills",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Tool-agnostic skills and rules for AI coding agents that build e-commerce and marketplace products.",
5
5
  "keywords": [
6
6
  "agent-skills",
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The price resolver needs Node.js 20 or newer and no packages."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # B2B pricing
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The row checker needs Node.js 20 or newer and no packages."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Catalog import and migration
@@ -4,7 +4,7 @@ description: "Design checkout so the full cost is visible before payment, guest
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Checkout UX and conversion
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The event checker requires Node.js 20 or newer. No network access."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Conversion event tracking
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The JSON-LD checker requires Node.js 20 or newer. No network access."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Ecommerce SEO structured data
@@ -4,7 +4,7 @@ description: "Hold or review risky payments using provider signals, velocity, an
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Fraud and risk basics
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The feed item checker requires Node.js 20 or newer. No network access."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Google Merchant product feeds
@@ -4,7 +4,7 @@ description: "Build a Next.js storefront that loads catalog data on the server,
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Headless Next.js storefront
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The allocation checker needs Node.js 20 or newer and no packages."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Inventory and multi-warehouse
@@ -13,6 +13,17 @@ export function availableAt(location, sku) {
13
13
  return Math.max(0, (level.onHand ?? 0) - (level.reserved ?? 0) - (level.safetyStock ?? 0));
14
14
  }
15
15
 
16
+ /**
17
+ * Reserves quantity units of sku in levels as one check-and-set step, so nothing can run
18
+ * between reading what is free and writing the new reserved count. Returns false and
19
+ * changes nothing when fewer units are free. A database version is one conditional UPDATE.
20
+ */
21
+ export function reserve(levels, sku, quantity) {
22
+ if (availableAt({ levels }, sku) < quantity) return false;
23
+ levels[sku] = { ...levels[sku], reserved: (levels[sku].reserved ?? 0) + quantity };
24
+ return true;
25
+ }
26
+
16
27
  /**
17
28
  * Returns { allocations: [{ sku, location, quantity }], shortfalls: [{ sku, quantity }], locations }.
18
29
  * Never allocates more than a location has available.
@@ -27,7 +38,10 @@ export function allocateOrder(order, stock) {
27
38
  if (!Number.isInteger(line.quantity) || line.quantity <= 0) throw new Error(`${line.sku}: quantity must be a positive whole number`);
28
39
  }
29
40
 
30
- const single = eligible.find((location) => lines.every((line) => availableAt(location, line.sku) >= line.quantity));
41
+ // Sum repeated SKUs so two lines for the same item cannot each pass the check alone.
42
+ const totals = new Map();
43
+ for (const line of lines) totals.set(line.sku, (totals.get(line.sku) ?? 0) + line.quantity);
44
+ const single = eligible.find((location) => [...totals].every(([sku, quantity]) => availableAt(location, sku) >= quantity));
31
45
  if (single) {
32
46
  const allocations = lines.map((line) => ({ sku: line.sku, location: single.location, quantity: line.quantity }));
33
47
  return { allocations, shortfalls: [], locations: [single.location] };
@@ -48,7 +62,7 @@ export function allocateOrder(order, stock) {
48
62
  if (free === 0) continue;
49
63
  const take = Math.min(free, needed);
50
64
  allocations.push({ sku: line.sku, location: location.location, quantity: take });
51
- levels[line.sku] = { ...levels[line.sku], reserved: (levels[line.sku].reserved ?? 0) + take };
65
+ reserve(levels, line.sku, take);
52
66
  used.add(location.location);
53
67
  needed -= take;
54
68
  }
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The verify checker needs Node.js 20 or newer and no packages."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Iranian payment gateways
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The search-text normalizer requires Node.js 20 or newer. No network access."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Marketplace search and ranking
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The tool definition checker needs Node.js 20 or newer and no packages."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # MCP store tooling
@@ -4,7 +4,7 @@ description: "Split a marketplace order by vendor, record commission as ledger e
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Multi-vendor payouts
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The signature checker requires Node.js 20 or newer. No network access."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Order and webhook reliability
@@ -4,7 +4,7 @@ description: "Integrate a payment provider with idempotent charges, signature-ch
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Payment gateway integration
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The catalog checker requires Node.js 20 or newer. No network access."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Product catalog modeling
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The description checker requires Node.js 20 or newer. No network access."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Product description guardrails
@@ -4,7 +4,7 @@ description: "Run returns as a tracked RMA from request to inspection, refund on
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Returns and refunds
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The Persian normalizer requires Node.js 20 or newer. No network access."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # RTL and Persian localization
@@ -4,7 +4,7 @@ description: "Build a Shopify app with the configured Admin API version, session
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Shopify app development
@@ -4,7 +4,7 @@ description: "Build product, cart, and checkout pages that meet WCAG 2.2 AA: key
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Storefront accessibility
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The Web Vitals checker needs Node.js 20 or newer and no packages."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Storefront performance
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: "The signature checker needs Node.js 20 or newer and no packages."
6
6
  metadata:
7
7
  author: Naser Sadrmanesh
8
- version: "0.3.2"
8
+ version: "0.3.3"
9
9
  ---
10
10
 
11
11
  # Stripe payments
@@ -4,7 +4,7 @@ description: "Model subscription state, renewal charges, proration, and dunning
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Subscription billing
@@ -4,7 +4,7 @@ description: "Calculate tax and shipping from the destination and the store's co
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Tax and shipping
@@ -4,7 +4,7 @@ description: "Add vector retrieval beside lexical product search, with one embed
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # Vector product search
@@ -4,7 +4,7 @@ description: "Build and change WooCommerce plugins with hooks, CRUD data stores,
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # WooCommerce plugin development
@@ -4,7 +4,7 @@ description: "Call the WooCommerce REST API at wc/v3, including authentication,
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # WooCommerce REST API
@@ -4,7 +4,7 @@ description: "Review and implement WordPress plugin security: capabilities, nonc
4
4
  license: MIT
5
5
  metadata:
6
6
  author: Naser Sadrmanesh
7
- version: "0.3.2"
7
+ version: "0.3.3"
8
8
  ---
9
9
 
10
10
  # WordPress plugin security