vibe.commerce-patterns

Solid

E-commerce domain patterns — cart management, payment processing (Toss/Stripe/PG), inventory tracking, and order state machines with transaction safety. Use when implementing any shopping cart, checkout flow, payment integration, stock management, or order lifecycle. Covers idempotency keys, double-charge prevention, stock reservation, and refund flows. Must use this skill when the codebase involves e-commerce — even for seemingly simple 'add to cart' features.

AI & Automation 0 stars 1 forks Updated today MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
0
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Commerce Patterns ## Pre-check (K1) > Is this an e-commerce transaction flow? If building simple CRUD without payment/stock management, this skill is not needed. ## Gotchas & Traps These are the non-obvious failure modes LLMs typically miss: ### Payment | Trap | Consequence | Prevention | |------|-------------|------------| | No idempotency key | User double-clicks → charged twice | `idempotencyKey: order_${orderId}_${timestamp}` on every payment request | | Webhook not idempotent | Retry delivers duplicate events | Check `eventId` before processing, store processed events | | Missing webhook signature verification | Attacker forges payment confirmation | Always verify HMAC signature before processing | | No payment state machine | Order stuck in limbo | `PENDING → PROCESSING → AUTHORIZED → CAPTURED → COMPLETED` (+ FAILED, CANCELED, REFUNDED) | ### Inventory | Trap | Consequence | Prevention | |------|-------------|------------| | Non-atomic stock decrement | Race condition → negative stock | `UPDATE SET stock = stock - $1 WHERE stock >= $1` (atomic with check) | | No reservation TTL | Stock locked forever on abandoned checkout | 15-min reservation + scheduled cleanup job | | Commit without reservation | Stock sold twice | Two-phase: RESERVE (checkout start) → COMMIT (payment success) / RELEASE (failure) | | Optimistic lock without retry | Fails silently under contention | Use `version` column or `FOR UPDATE` for high-contention products | ### Cart & Pricing | Tra...

Details

Author
su-record
Repository
su-record/vibe
Created
8 months ago
Last Updated
today
Language
TypeScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

ecommerce-patterns

E-commerce: cart, checkout, payments (Stripe/Adyen), order state, inventory, promos, tax. Triggers: cart, checkout, SKU, payment, Stripe, Shopify, Medusa, Magento, coupon, refund.

161 Updated yesterday
softspark
Testing & QA Solid

vibe.e2e-commerce

E2E test scenarios for commerce checkout and payment flows. Provides ready-made Playwright test templates for cart→checkout→payment→confirmation flows, including PG sandbox testing (Toss/Stripe), error scenarios (payment failure, timeout, stock exhaustion), and idempotency verification. Use when writing E2E tests for any e-commerce feature — checkout, payment, order status, or refund flows.

0 Updated today
su-record
AI & Automation Listed

ecommerce-engineer

Use when building, reviewing, or operating online stores, storefronts, catalogs, carts, checkouts, inventory, order management, fulfillment, returns, and promotions. Covers product / variant / SKU modeling, PIM, external identifiers (GTIN, EAN, MPN), cart and checkout flows, pricing and promotion rule engines, tax (Avalara, TaxJar, Stripe Tax), shipping rates, OMS, ATP and reservations, RMA, fraud and chargeback workflows, peak readiness (Black Friday, drops, flash sales), and platform choice (Shopify, BigCommerce, commercetools, Magento, Adobe Commerce, headless on Next.js). Triggers: ecommerce, store, storefront, catalog, PIM, SKU, GTIN, cart, checkout, conversion, abandoned cart, shipping, fulfillment, OMS, inventory, ATP, returns, RMA, refund, promotion, discount, coupon, gift card, BNPL, Black Friday, fraud, chargeback, Shopify, BigCommerce, headless commerce. Produces catalog schemas, checkout sequences, order state machines. Not for regulated money movement or PCI scope, see fintech-engineer.

0 Updated 1 weeks ago
iamdemetris