Agent skill

Ecommerce Patterns

by softspark in softspark/ai-toolkit

E-commerce: cart, checkout, payments (Stripe/Adyen), order state, inventory, promos, tax.

Apache-2.0Auto-check passedSales & Support

Install Ecommerce Patterns

skills CLI
$ npx skills add softspark/ai-toolkit --skill ecommerce-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install softspark/ai-toolkit ecommerce-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/softspark/ai-toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/app/skills/ecommerce-patterns .claude/skills/ecommerce-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ecommerce-patterns
GitHub stars
179
Token cost
~1.8k tokens
SKILL.md length
458 words
Files
1
Skills in repo
112
Repo updated
First seen
Licence
Apache-2.0

At a glance

E-commerce: cart, checkout, payments (Stripe/Adyen), order state, inventory, promos, tax.

  • Tasks that involve E-commerce operations
  • SKILL.md covers Platform Selection, Magento 2 Patterns, Cart & Checkout Patterns and Inventory Patterns, plus 5 more sections
  • Reaches w3.org

What it does

Ecommerce Patterns is an agent skill from softspark/ai-toolkit. E-commerce: cart, checkout, payments (Stripe/Adyen), order state, inventory, promos, tax. Triggers: cart, checkout, SKU, payment, Stripe, Shopify, Medusa, Magento, coupon, refund.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Sales & Support, covering E-commerce operations. It works with Adobe Commerce, Stripe and Shopify. The repository describes itself as: Professional-grade AI coding toolkit: 94 skills, 44 agents, multi-platform (Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, Augment, Antigravity, Codex CLI… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve E-commerce operations

Example prompts

  • “/ecommerce-patterns”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read

What it can do on your machine

Read from SKILL.md and the folder at commit d64db2b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are xml, graphql, python, sql and json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • w3.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ecommerce Patterns loads about 1.8k tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 458 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from softspark/ai-toolkit at commit d64db2b, republished under its Apache-2.0 licence (© softspark). 458 words, ~1,753 tokens.

Download SKILL.mdSave it as .claude/skills/ecommerce-patterns/SKILL.md (or your agent's skills folder).
name
ecommerce-patterns
description
E-commerce: cart, checkout, payments (Stripe/Adyen), order state, inventory, promos, tax. Triggers: cart, checkout, SKU, payment, Stripe, Shopify, Medusa, Magento, coupon, refund.
allowed-tools
Read
effort
medium
user-invocable
false

E-commerce Patterns Skill

Platform Selection

ScenarioPlatform
Enterprise B2BOroCommerce
Enterprise B2CMagento 2
Mid-marketShopify Plus
Small businessWooCommerce, PrestaShop
Custom/HeadlessMedusa, Saleor

Magento 2 Patterns

Module Structure
app/code/Vendor/Module/
├── Api/
│   └── Data/
│       └── EntityInterface.php
├── Block/
├── Controller/
│   └── Index/
│       └── Index.php
├── etc/
│   ├── module.xml
│   ├── di.xml
│   ├── routes.xml
│   └── frontend/
├── Model/
│   └── ResourceModel/
├── Setup/
├── view/
│   └── frontend/
│       ├── layout/
│       └── templates/
├── registration.php
└── composer.json
Dependency Injection
xml
<!-- etc/di.xml -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Vendor\Module\Api\ServiceInterface" type="Vendor\Module\Model\Service"/>
    <type name="Vendor\Module\Model\Service">
        <arguments>
            <argument name="logger" xsi:type="object">Psr\Log\LoggerInterface</argument>
        </arguments>
    </type>
</config>
GraphQL
graphql
type Query {
    customProducts(
        search: String
        pageSize: Int = 20
        currentPage: Int = 1
    ): CustomProductOutput @resolver(class: "Vendor\\Module\\Model\\Resolver\\Products")
}

Cart & Checkout Patterns

Cart State Machine
Empty → Has Items → Checkout Started → Payment → Order Placed
                  ↑                    ↓
                  └──── Abandoned ←────┘
Checkout Flow
1. Cart Review
2. Shipping Address
3. Shipping Method
4. Payment Method
5. Order Review
6. Place Order
7. Confirmation
Price Calculation
Base Price
- Catalog Discounts
= Adjusted Price
× Quantity
= Line Total
+ Tax (if exclusive)
= Line Total with Tax
Σ All Lines
= Subtotal
+ Shipping
- Cart Discounts
= Grand Total

Inventory Patterns

Stock Management
python
class InventoryService:
    def reserve_stock(self, product_id: str, qty: int) -> bool:
        """Reserve stock during checkout."""
        with transaction.atomic():
            stock = Stock.select_for_update().get(product_id=product_id)
            if stock.available >= qty:
                stock.reserved += qty
                stock.available -= qty
                stock.save()
                return True
            return False

    def confirm_stock(self, reservation_id: str):
        """Confirm reservation after order placed."""
        reservation.status = 'confirmed'
        reservation.save()

    def release_stock(self, reservation_id: str):
        """Release stock if order cancelled."""
        # Return reserved qty to available
Multi-Warehouse
sql
-- Stock per warehouse
SELECT
    p.sku,
    w.name as warehouse,
    s.quantity,
    s.reserved
FROM stock s
JOIN products p ON s.product_id = p.id
JOIN warehouses w ON s.warehouse_id = w.id
WHERE p.sku = 'SKU-123';

Search & Catalog

Product Indexing
Product → Indexer → Search Index (Elasticsearch/OpenSearch)
                  → Price Index
                  → Category Index
                  → Stock Index
json
{
  "aggs": {
    "categories": {
      "terms": { "field": "category_ids" }
    },
    "price_ranges": {
      "range": {
        "field": "price",
        "ranges": [
          { "to": 50 },
          { "from": 50, "to": 100 },
          { "from": 100 }
        ]
      }
    },
    "brands": {
      "terms": { "field": "brand" }
    }
  }
}

Performance

Caching Layers
LayerCache
PageVarnish, CDN
BlockRedis
QueryMySQL Query Cache
Full PageRedis FPC
Optimization Checklist
  • Enable production mode
  • Enable full page cache
  • Optimize images (WebP)
  • Minify JS/CSS
  • Enable flat tables
  • Configure CDN
  • Index optimization

Rules

  • MUST model order lifecycle as an explicit state machine (pending → authorized → captured → fulfilled → refunded) — ad-hoc booleans produce inconsistent states on retry
  • MUST separate payment capture from inventory decrement — reserve stock on order placement, commit stock on payment success. Coupling them causes stuck-stock bugs during payment retries.
  • NEVER store CVV, full PAN, or track data — ever. PCI scope expands to any system that sees them, even "temporarily in memory".
  • NEVER use floating-point for money calculations. Use decimal.Decimal, BigDecimal, or integer minor units (cents). Float rounding produces $0.01 discrepancies that accumulate into angry customer emails.
  • CRITICAL: every cart mutation is idempotent via an Idempotency-Key or natural key — users double-click checkout buttons, networks retry, and duplicate orders are expensive to reconcile.
  • MANDATORY: tax and shipping calculations live in isolated services or modules. Inlining them into cart logic prevents caching and creates compliance drift.
Show full SKILL.md (225 more words)Show less

Gotchas

  • Promotion codes with stackable rules explode combinatorially — "20% off + free shipping + first-time buyer" can produce negative totals if the ordering of applications is not defined. Always normalize to a pipeline with a fixed evaluation order.
  • Tax jurisdictions change after the order is placed (shipping address edits). A cart that recalculates on every update but not on address change silently under-collects tax.
  • Inventory reservations must expire — otherwise abandoned carts hold stock forever. 15-30 minutes is typical; longer reservations need explicit business approval.
  • Currency rounding rules differ by locale. Japanese Yen has 0 decimal places, Kuwaiti Dinar has 3. Defaulting to 2 decimals produces off-by-one-unit bugs in non-USD markets.
  • Refunds are not negative orders. Payment processors treat them as separate resources with their own state machine and timing (Stripe refunds can take 5-10 business days to settle). Model accordingly.
  • Magento's flat-table option speeds reads but silently stops auto-syncing if a reindex fails — stale product data in production. Monitor reindex job success, not just page latency.

When NOT to Load

  • For payment provider protocol specifics (Stripe, Adyen, PayPal) — use the provider's SDK docs; this skill is pattern-level
  • For generic API design — use /api-patterns
  • For database schema of orders/inventory — use /database-patterns
  • For promotions and segmentation at scale — use /data-analyst agent
  • For PCI compliance audit — this skill flags the traps but is not a substitute for a QSA audit

© softspark, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in app/skills/ecommerce-patterns of softspark/ai-toolkit.

Open the folder on GitHubat commit d64db2b

Compare with similar skills

Ecommerce Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ecommerce Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ecommerce Patterns this skillsoftspark/ai-toolkit179—~1.8kAutomated safety check: PassApache-2.0
Ecommerce Product Detailbrowser-act/skills6.1k—~1.6kAutomated safety check: PassMIT
Ecommerce SEOnowork-studio/notfair-plugin3.9k—~919Automated safety check: PassMIT
Checkout Purchasekeypo-us/keypo-cli182—~880Automated safety check: NotesNone
Afaafadtc/afa-dtc-skills168—~2.6kAutomated safety check: PassCustom licence
Seedance Ecommerce Adbeshuaxian/higgsfield-seedance2-jineng882—~11kAutomated safety check: PassNone

Similar skills

  • Ecommerce Product Detail

    browser-act/skills

    Extract complete product information from any e-commerce product page.

    6.1k GitHub stars~1.6k tokensUpdated 1 mo ago
    Sales & SupportAuto-check passed
  • Ecommerce SEO

    nowork-studio/notfair-plugin

    E-commerce SEO audit for online stores (WooCommerce, Shopify, Magento, custom).

    3.9k GitHub stars~919 tokensUpdated 6 days ago
    Sales & SupportAuto-check passed
  • Checkout Purchase

    keypo-us/keypo-cli

    A skill your agent uses when the user asks to buy a product from the Shopify store.

    182 GitHub stars~880 tokensUpdated 6 mo ago
    Sales & SupportAuto-check: notes
  • Afa

    afadtc/afa-dtc-skills

    AFA DTC 全链路独立站操盘系统——系统入口、一级路由器、工作流编排器,统筹品牌基建、付费获客、有机增长、变现留存、运营扩张五大业务线。Use when user mentions: 独立站, DTC, 电商, ecommerce, Shopify, 品牌站, 独立站运营, DTC品牌, 全链路, 操盘, 独立站诊断, 独立站增长, 独立站策略.

    168 GitHub stars~2.6k tokensUpdated 9 days ago
    Sales & SupportAuto-check passed
  • Seedance Ecommerce Ad

    beshuaxian/higgsfield-seedance2-jineng

    Generate e-commerce product advertisement video prompts for Seedance 2.0 on Higgsfield.

    882 GitHub stars~11k tokensUpdated 6 mo ago
    Sales & SupportAuto-check passed
  • Ecommerce Listing

    browser-act/skills

    Extract product list from any e-commerce category page, search results page, or keyword search with filters.

    6.1k GitHub stars~1.7k tokensUpdated 1 mo ago
    Sales & SupportAuto-check passed

More from softspark/ai-toolkit

All 112 skills in this repo
  • Prepare Test Env

    softspark/ai-toolkit

    Prepare or verify a project QA environment with source identity, readiness, browser access, evidence paths and owned cleanup.

    179 GitHub stars~1.8k tokensUpdated today
    Auto-check: notes
  • A11y Validate

    softspark/ai-toolkit

    Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~3.8k tokensUpdated today
    Auto-check: notes
  • Analyze

    softspark/ai-toolkit

    Analyzes code quality, complexity, patterns across codebase.

    179 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Autonomous Dev

    softspark/ai-toolkit

    Drives a brief, specification, issue or existing PR through implementation, review, tests and QA to a ready PR.

    179 GitHub stars~2.6k tokensUpdated today
    Auto-check: notes
  • Brand Voice

    softspark/ai-toolkit

    Direct technical voice for docs, README, user-facing text. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • CI

    softspark/ai-toolkit

    Detect/generate/debug CI pipeline config (GitHub Actions, GitLab CI).

    179 GitHub stars~1.1k tokensUpdated today
    Auto-check: notes

Categories

Questions about Ecommerce Patterns

What does Ecommerce Patterns do?

E-commerce: cart, checkout, payments (Stripe/Adyen), order state, inventory, promos, tax. Ecommerce Patterns is an agent skill from softspark/ai-toolkit. E-commerce: cart, checkout, payments (Stripe/Adyen), order state, inventory, promos, tax.

When should I use Ecommerce Patterns?

Ecommerce Patterns fits situations like: tasks that involve E-commerce operations.

How do I install Ecommerce Patterns in Claude Code?

Run `npx skills add softspark/ai-toolkit --skill ecommerce-patterns -a claude-code`. Or copy the skill folder (app/skills/ecommerce-patterns in softspark/ai-toolkit) into .claude/skills/ecommerce-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Ecommerce Patterns in Codex?

Run `npx skills add softspark/ai-toolkit --skill ecommerce-patterns -a codex`. Or copy the skill folder (app/skills/ecommerce-patterns in softspark/ai-toolkit) into .agents/skills/ecommerce-patterns in your project. Codex loads it when a task matches its description.

Can I use Ecommerce Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add softspark/ai-toolkit --skill ecommerce-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ecommerce-patterns, .gemini/skills/ecommerce-patterns, .github/skills/ecommerce-patterns and .opencode/skills/ecommerce-patterns in your project.

What does Ecommerce Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Ecommerce Patterns is instructions for the agent only. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read.

Does Ecommerce Patterns access the network?

SKILL.md names 1 domain. In commands or code: w3.org; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Ecommerce Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ecommerce Patterns use?

Ecommerce Patterns is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ecommerce Patterns use?

About 1.8k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ecommerce Patterns?

Skills that share tags, products or a category with Ecommerce Patterns: Ecommerce Product Detail (browser-act/skills, 6.1k stars), Ecommerce SEO (nowork-studio/notfair-plugin, 3.9k stars), Checkout Purchase (keypo-us/keypo-cli, 182 stars) and Afa (afadtc/afa-dtc-skills, 168 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ecommerce Patterns?

softspark (a GitHub user) maintains it in softspark/ai-toolkit, which has 179 GitHub stars. The repository holds 112 skills in this directory. The repository was last updated on October 7, 2026.

Source: softspark/ai-toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.