Quick Reference
| Topic | File |
|---|
| Code traps that break production | INLINECODE0 |
| Platform comparison (costs, features) |
platforms.md |
| Operations (stock, shipping, returns) |
operations.md |
| Growth (CRO, upsells, LTV, benchmarks) |
growth.md |
Critical Code Traps
These break production and cost real money. See code-traps.md for full patterns.
- 1. Payment idempotency — Store
payment_intent_id, check before processing. Webhooks retry. - Inventory race conditions —
UPDATE ... WHERE stock > 0 with rowsAffected check, not read-then-write. - Frontend price trust — Backend recalculates everything. Never trust client totals.
- Webhook signatures — Verify
stripe-signature or equivalent. Reject unsigned requests. - Stock validation timing — Verify at payment moment, not just add-to-cart.
Core Rules
When Building Stores
- - Calculate ALL prices server-side — discounts, shipping, taxes, totals
- Queue transactional emails — never inline in checkout flow
- Add structured data (Schema.org Product) and canonical URLs from day one
- Implement webhook signature verification before going live
When Operating Stores
- - Monitor stock thresholds, not just zero — alert at reorder point
- Track orders stuck in "processing" >24h — detect before customer complains
- Log payment failures with context — card decline reasons matter for recovery
When Optimizing
- - Checkout recovery: 1h, 24h, 72h sequence — discount on email 3, not 1
- Free shipping threshold: current AOV + 20-30%
- Mobile: sticky add-to-cart, Apple Pay/Google Pay, LCP <2.5s
Platform Decision Tree
- - Budget <€500/mo, <100 SKUs: Shopify Basic or WooCommerce self-hosted
- Multi-marketplace: Dedicated sync tool (not manual updates)
- >1000 SKUs or ERP: WooCommerce/custom with PIM integration
For Spain-specific costs (IVA, OSS, carriers), see platforms.md.
Scope
This skill helps with:
- - Store architecture and payment integration
- Inventory and order management logic
- Marketplace listing optimization
- Conversion rate tactics with benchmarks
- Legal/fiscal guidance for EU/Spain ecommerce
This skill does NOT:
- - Connect to live store APIs (explain how, not execute)
- Store business data or credentials
- Make purchasing or pricing decisions autonomously
快速参考
| 主题 | 文件 |
|---|
| 导致生产环境崩溃的代码陷阱 | code-traps.md |
| 平台对比(成本、功能) |
platforms.md |
| 运营(库存、发货、退货) | operations.md |
| 增长(转化率优化、追加销售、客户生命周期价值、基准数据) | growth.md |
关键代码陷阱
这些陷阱会导致生产环境崩溃并造成实际经济损失。完整模式详见 code-traps.md。
- 1. 支付幂等性 — 存储 paymentintentid,处理前进行校验。Webhooks 会重试。
- 库存竞态条件 — 使用 UPDATE ... WHERE stock > 0 配合 rowsAffected 检查,而非先读取再写入。
- 前端价格信任 — 后端重新计算所有价格。绝不信任客户端的总金额。
- Webhook 签名 — 验证 stripe-signature 或等效签名。拒绝未签名的请求。
- 库存验证时机 — 在支付时刻验证,而非仅在加入购物车时。
核心规则
构建商店时
- - 在服务端计算所有价格 — 折扣、运费、税费、总金额
- 将事务性邮件加入队列 — 切勿在结账流程中内联发送
- 从第一天起添加结构化数据(Schema.org 产品)和规范链接
- 在上线前实现 Webhook 签名验证
运营商店时
- - 监控库存阈值,而非仅关注零库存 — 在补货点发出警报
- 跟踪超过24小时处于处理中状态的订单 — 在客户投诉前发现问题
- 记录带上下文的支付失败信息 — 卡片拒绝原因对后续恢复至关重要
优化时
- - 结账挽回:1小时、24小时、72小时序列 — 在第3封邮件提供折扣,而非第1封
- 免运费门槛:当前平均订单金额 + 20-30%
- 移动端:固定加购按钮、Apple Pay/Google Pay、最大内容绘制 <2.5秒
平台决策树
- - 预算 <€500/月,<100个SKU:Shopify Basic 或自托管 WooCommerce
- 多市场平台:专用同步工具(非手动更新)
- >1000个SKU或使用ERP:WooCommerce/自定义方案,集成产品信息管理
关于西班牙特定成本(增值税、一站式服务、承运商),请参见 platforms.md。
范围
本技能可协助:
- - 商店架构与支付集成
- 库存与订单管理逻辑
- 市场平台列表优化
- 基于基准数据的转化率策略
- 欧盟/西班牙电商的法律/税务指导
本技能不涉及:
- - 连接实时商店API(仅说明方法,不执行操作)
- 存储业务数据或凭证
- 自主做出购买或定价决策