@optima-chat/commerce-cli 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/.claude/skills/commerce-i18n/SKILL.md +342 -138
- package/.claude/skills/commerce-inventory/SKILL.md +193 -66
- package/.claude/skills/commerce-order/SKILL.md +100 -91
- package/.claude/skills/commerce-product/SKILL.md +201 -58
- package/.claude/skills/commerce-storefront/SKILL.md +269 -87
- package/package.json +1 -1
|
@@ -5,11 +5,247 @@ description: Storefront and homepage configuration. Manage homepage sections, pr
|
|
|
5
5
|
|
|
6
6
|
# Commerce CLI - Storefront Configuration
|
|
7
7
|
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
8
|
店铺前台配置模块,用于首页设置、商品集合管理和商户信息维护。
|
|
11
9
|
|
|
12
|
-
##
|
|
10
|
+
## 典型场景
|
|
11
|
+
|
|
12
|
+
### 场景决策表
|
|
13
|
+
|
|
14
|
+
| 用户需求 | 推荐命令 | 关键注意点 |
|
|
15
|
+
|---------|---------|-----------|
|
|
16
|
+
| 创建轮播图 | `commerce homepage module create --type banner` | 图片尺寸1920x600px,≤5张,配置跳转链接 |
|
|
17
|
+
| 显示精选商品 | `commerce homepage module create --type featured` | 选择高转化商品,数量8-12个 |
|
|
18
|
+
| 创建促销集合 | `collection create --slug sale` | slug 简短有意义,添加10-30个商品 |
|
|
19
|
+
| 调整模块顺序 | `homepage module reorder --position X` | 重要模块靠前(轮播图position=1) |
|
|
20
|
+
| 更新店铺信息 | `merchant update --name/description` | 名称简洁,描述突出差异化优势 |
|
|
21
|
+
|
|
22
|
+
### 场景 1:首页配置
|
|
23
|
+
|
|
24
|
+
**标准首页布局**(position顺序):
|
|
25
|
+
1. **轮播图** (position=1) - 展示促销、新品、品牌故事
|
|
26
|
+
2. **分类导航** (position=2) - 快速引导到商品分类
|
|
27
|
+
3. **精选商品** (position=3) - 展示高转化或高利润商品
|
|
28
|
+
4. **热门集合** (position=4) - 展示2-3个核心集合
|
|
29
|
+
5. **品牌故事** (position=5) - 建立信任和品牌认知
|
|
30
|
+
|
|
31
|
+
**标准流程**:
|
|
32
|
+
1. **规划布局** - 确定首页模块顺序(轮播图 → 分类 → 精选商品 → 集合)
|
|
33
|
+
2. **创建模块** - 依次 `commerce homepage module create` 创建各模块
|
|
34
|
+
3. **配置顺序** - 使用 position 1, 2, 3... 排序
|
|
35
|
+
4. **设置参数** - `commerce homepage settings update` 配置搜索、精选数量
|
|
36
|
+
5. **验证效果** - `commerce homepage module list` 检查配置
|
|
37
|
+
6. **定期优化** - 根据数据调整模块顺序和内容
|
|
38
|
+
|
|
39
|
+
### 场景 2:创建轮播图
|
|
40
|
+
|
|
41
|
+
**配置要点**:
|
|
42
|
+
- 图片尺寸:1920x600px(桌面端)
|
|
43
|
+
- 数量限制:≤ 5张(避免影响加载速度)
|
|
44
|
+
- 格式支持:WebP(优先)、JPG、PNG
|
|
45
|
+
- 跳转链接:配置促销页面或集合页面
|
|
46
|
+
- 懒加载:启用图片懒加载优化性能
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
commerce homepage module create \
|
|
50
|
+
--slug hero-banner \
|
|
51
|
+
--type banner \
|
|
52
|
+
--position 1 \
|
|
53
|
+
--enabled true \
|
|
54
|
+
--config '{"images":[{"url":"https://example.com/banner1.jpg","link":"/collections/summer-sale"}]}'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 场景 3:创建商品集合
|
|
58
|
+
|
|
59
|
+
**推荐集合类型**:
|
|
60
|
+
- **时令集合** - 春夏秋冬、节日促销(如"Christmas Sale")
|
|
61
|
+
- **品类集合** - 按商品类型分组(如"T-Shirts", "Dresses")
|
|
62
|
+
- **主题集合** - 按场景分组(如"Office Wear", "Casual Style")
|
|
63
|
+
- **促销集合** - 新品、热卖、折扣(如"New Arrivals", "Best Sellers")
|
|
64
|
+
|
|
65
|
+
**创建流程**:
|
|
66
|
+
```bash
|
|
67
|
+
# 1. 创建集合
|
|
68
|
+
commerce collection create \
|
|
69
|
+
--name "Summer Sale 2024" \
|
|
70
|
+
--slug "summer-sale-2024" \
|
|
71
|
+
--description "Hot deals for summer"
|
|
72
|
+
|
|
73
|
+
# 2. 添加商品到集合
|
|
74
|
+
commerce collection add-products \
|
|
75
|
+
--slug summer-sale-2024 \
|
|
76
|
+
--product-ids prod_123,prod_456,prod_789
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 场景 4:调整模块顺序
|
|
80
|
+
|
|
81
|
+
**重新排序原则**:
|
|
82
|
+
- 重要模块靠前(轮播图 position=1)
|
|
83
|
+
- 高转化模块优先级高
|
|
84
|
+
- 移动端体验优先
|
|
85
|
+
- 定期根据数据优化
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# 调整精选商品模块到第2位
|
|
89
|
+
commerce homepage module reorder \
|
|
90
|
+
--module-id module_123 \
|
|
91
|
+
--position 2
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 场景 5:优化转化率
|
|
95
|
+
|
|
96
|
+
**数据驱动优化**:
|
|
97
|
+
- 分析首页点击热图,调整模块顺序
|
|
98
|
+
- A/B测试不同轮播图和精选商品
|
|
99
|
+
- 根据转化率隐藏低效集合
|
|
100
|
+
- 精选商品选择高利润或高评分商品
|
|
101
|
+
|
|
102
|
+
**性能优化建议**:
|
|
103
|
+
- 轮播图:懒加载,压缩图片,支持WebP格式
|
|
104
|
+
- 精选商品:限制8-12个,缓存1小时
|
|
105
|
+
- 集合:按点击率排序,隐藏低转化集合
|
|
106
|
+
|
|
107
|
+
### 场景 6:店铺信息维护
|
|
108
|
+
|
|
109
|
+
**更新要点**:
|
|
110
|
+
- 店铺名称:简洁有辨识度
|
|
111
|
+
- 描述:突出差异化优势和核心品类
|
|
112
|
+
- Logo:清晰、支持透明背景
|
|
113
|
+
- 联系方式:完整准确
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
commerce merchant update \
|
|
117
|
+
--name "My Fashion Store" \
|
|
118
|
+
--description "Premium fashion for everyone" \
|
|
119
|
+
--logo-url "https://example.com/logo.png"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## 卓越标准
|
|
123
|
+
|
|
124
|
+
### 店铺配置质量指标
|
|
125
|
+
- **页面加载速度**: 首页加载 < 3秒,移动端 < 5秒
|
|
126
|
+
- **视觉设计**: 轮播图尺寸统一(1920x600px),图片清晰无水印
|
|
127
|
+
- **导航体验**: 分类层级 ≤ 3层,集合数量 5-15个最佳
|
|
128
|
+
- **内容更新频率**: 轮播图每周更新,精选商品每3天更新
|
|
129
|
+
- **转化率**: 首页访客转化率 > 3%,集合页转化率 > 5%
|
|
130
|
+
|
|
131
|
+
### 店铺配置原则
|
|
132
|
+
- **移动优先**: 所有配置考虑移动端体验,图片支持响应式
|
|
133
|
+
- **性能优化**: 轮播图 ≤ 5张,精选商品 ≤ 12个,减少加载负担
|
|
134
|
+
- **SEO友好**: 集合slug使用英文,标题包含关键词
|
|
135
|
+
- **一致性**: 风格统一(色彩、字体、间距),提升品牌辨识度
|
|
136
|
+
- **数据驱动**: 根据点击率和转化率优化首页布局和集合内容
|
|
137
|
+
|
|
138
|
+
### 首页配置检查清单
|
|
139
|
+
|
|
140
|
+
**上线前必查**:
|
|
141
|
+
- [ ] 轮播图尺寸统一,图片清晰
|
|
142
|
+
- [ ] 所有链接可点击,无404
|
|
143
|
+
- [ ] 移动端显示正常
|
|
144
|
+
- [ ] 加载速度 < 3秒
|
|
145
|
+
- [ ] SEO信息完整(标题、描述、关键词)
|
|
146
|
+
- [ ] 精选商品有库存
|
|
147
|
+
- [ ] 集合至少包含5个商品
|
|
148
|
+
- [ ] 店铺信息准确(名称、Logo、联系方式)
|
|
149
|
+
|
|
150
|
+
## 常见问题
|
|
151
|
+
|
|
152
|
+
### ❌ 问题 1:集合命名随意,无规划
|
|
153
|
+
|
|
154
|
+
**错误做法**:
|
|
155
|
+
```bash
|
|
156
|
+
# 命名不规范,slug 无意义
|
|
157
|
+
commerce collection create --name "aaa" --slug "test123"
|
|
158
|
+
commerce collection create --name "商品111" --slug "product-collection"
|
|
159
|
+
commerce collection create --name "Sale!!!" --slug "promotion"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**✅ 正确做法**:
|
|
163
|
+
```bash
|
|
164
|
+
# 命名清晰,slug 符合 SEO 规范
|
|
165
|
+
commerce collection create --name "Summer Sale 2024" --slug "summer-sale-2024"
|
|
166
|
+
commerce collection create --name "Men's T-Shirts" --slug "mens-tshirts"
|
|
167
|
+
commerce collection create --name "New Arrivals" --slug "new-arrivals"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### ❌ 问题 2:轮播图过多影响性能
|
|
171
|
+
|
|
172
|
+
**错误做法**:
|
|
173
|
+
```bash
|
|
174
|
+
# 创建10张轮播图,导致首页加载缓慢
|
|
175
|
+
commerce homepage module create --type banner --config '{"images":[...10张图片...]}'
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**✅ 正确做法**:
|
|
179
|
+
```bash
|
|
180
|
+
# 限制≤5张,压缩图片,启用懒加载
|
|
181
|
+
commerce homepage module create --type banner --config '{"images":[...3-5张图片...]}'
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### ❌ 问题 3:精选商品数量过多
|
|
185
|
+
|
|
186
|
+
**错误做法**:
|
|
187
|
+
```bash
|
|
188
|
+
# 显示30个精选商品,影响用户决策
|
|
189
|
+
commerce homepage settings update --featured-limit 30
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**✅ 正确做法**:
|
|
193
|
+
```bash
|
|
194
|
+
# 限制8-12个,选择高转化商品
|
|
195
|
+
commerce homepage settings update --featured-limit 10
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### ❌ 问题 4:集合缺少商品
|
|
199
|
+
|
|
200
|
+
**错误做法**:
|
|
201
|
+
```bash
|
|
202
|
+
# 创建集合后忘记添加商品
|
|
203
|
+
commerce collection create --name "New Arrivals" --slug "new-arrivals"
|
|
204
|
+
# 集合页面显示空白
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**✅ 正确做法**:
|
|
208
|
+
```bash
|
|
209
|
+
# 创建集合后立即添加商品(至少5个)
|
|
210
|
+
commerce collection create --name "New Arrivals" --slug "new-arrivals"
|
|
211
|
+
commerce collection add-products --slug new-arrivals --product-ids prod_1,prod_2,prod_3,prod_4,prod_5
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### ❌ 问题 5:首页模块顺序混乱
|
|
215
|
+
|
|
216
|
+
**错误做法**:
|
|
217
|
+
```bash
|
|
218
|
+
# position 随意设置,导致布局混乱
|
|
219
|
+
commerce homepage module create --type banner --position 10
|
|
220
|
+
commerce homepage module create --type featured --position 2
|
|
221
|
+
commerce homepage module create --type categories --position 50
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**✅ 正确做法**:
|
|
225
|
+
```bash
|
|
226
|
+
# 按重要性依次设置 position 1, 2, 3...
|
|
227
|
+
commerce homepage module create --type banner --position 1
|
|
228
|
+
commerce homepage module create --type categories --position 2
|
|
229
|
+
commerce homepage module create --type featured --position 3
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### ❌ 问题 6:slug 使用中文或特殊字符
|
|
233
|
+
|
|
234
|
+
**错误做法**:
|
|
235
|
+
```bash
|
|
236
|
+
# slug 包含中文或特殊字符,影响 SEO 和 URL 可读性
|
|
237
|
+
commerce collection create --name "夏季促销" --slug "夏季促销"
|
|
238
|
+
commerce collection create --name "Sale!!!" --slug "sale!!!"
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**✅ 正确做法**:
|
|
242
|
+
```bash
|
|
243
|
+
# slug 使用英文、数字、连字符
|
|
244
|
+
commerce collection create --name "夏季促销" --slug "summer-sale"
|
|
245
|
+
commerce collection create --name "Sale!!!" --slug "sale"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## 命令参考
|
|
13
249
|
|
|
14
250
|
### 自然语言映射
|
|
15
251
|
|
|
@@ -46,7 +282,7 @@ description: Storefront and homepage configuration. Manage homepage sections, pr
|
|
|
46
282
|
- `commerce merchant update` - 更新商户信息
|
|
47
283
|
- `commerce merchant init` - 初始化商户设置
|
|
48
284
|
|
|
49
|
-
##
|
|
285
|
+
## 详细示例
|
|
50
286
|
|
|
51
287
|
### 创建首页轮播图
|
|
52
288
|
```bash
|
|
@@ -100,95 +336,39 @@ commerce homepage module reorder \
|
|
|
100
336
|
--position 2
|
|
101
337
|
```
|
|
102
338
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
### 店铺配置质量指标
|
|
106
|
-
- **页面加载速度**: 首页加载 < 3秒,移动端 < 5秒
|
|
107
|
-
- **视觉设计**: 轮播图尺寸统一(1920x600px),图片清晰无水印
|
|
108
|
-
- **导航体验**: 分类层级 ≤ 3层,集合数量 5-15个最佳
|
|
109
|
-
- **内容更新频率**: 轮播图每周更新,精选商品每3天更新
|
|
110
|
-
- **转化率**: 首页访客转化率 > 3%,集合页转化率 > 5%
|
|
111
|
-
|
|
112
|
-
### 店铺配置原则
|
|
113
|
-
- **移动优先**: 所有配置考虑移动端体验,图片支持响应式
|
|
114
|
-
- **性能优化**: 轮播图 ≤ 5张,精选商品 ≤ 12个,减少加载负担
|
|
115
|
-
- **SEO友好**: 集合slug使用英文,标题包含关键词
|
|
116
|
-
- **一致性**: 风格统一(色彩、字体、间距),提升品牌辨识度
|
|
117
|
-
- **数据驱动**: 根据点击率和转化率优化首页布局和集合内容
|
|
118
|
-
|
|
119
|
-
## 工作流推荐
|
|
120
|
-
|
|
121
|
-
### 首页配置标准流程
|
|
122
|
-
1. **规划布局** - 确定首页模块顺序(轮播图 → 分类 → 精选商品 → 集合)
|
|
123
|
-
2. **创建模块** - 依次 `commerce homepage module create` 创建各模块
|
|
124
|
-
3. **配置顺序** - 使用 position 1, 2, 3... 排序
|
|
125
|
-
4. **设置参数** - `commerce homepage settings update` 配置搜索、精选数量
|
|
126
|
-
5. **验证效果** - `commerce homepage module list` 检查配置
|
|
127
|
-
6. **定期优化** - 根据数据调整模块顺序和内容
|
|
128
|
-
|
|
129
|
-
### 商品集合策略
|
|
130
|
-
|
|
131
|
-
**推荐集合类型**:
|
|
132
|
-
- **时令集合** - 春夏秋冬、节日促销(如"Christmas Sale")
|
|
133
|
-
- **品类集合** - 按商品类型分组(如"T-Shirts", "Dresses")
|
|
134
|
-
- **主题集合** - 按场景分组(如"Office Wear", "Casual Style")
|
|
135
|
-
- **促销集合** - 新品、热卖、折扣(如"New Arrivals", "Best Sellers")
|
|
136
|
-
|
|
137
|
-
### 集合管理最佳实践
|
|
138
|
-
|
|
139
|
-
**❌ 混乱做法**:
|
|
140
|
-
```bash
|
|
141
|
-
# 集合命名随意,无规划
|
|
142
|
-
commerce collection create --name "aaa" --slug "test123"
|
|
143
|
-
commerce collection create --name "商品111" --slug "product-collection"
|
|
144
|
-
commerce collection create --name "Sale!!!" --slug "promotion"
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
**✅ 规范做法**:
|
|
339
|
+
### 完整首页配置示例
|
|
148
340
|
```bash
|
|
149
|
-
#
|
|
150
|
-
commerce
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
### 常见场景决策
|
|
156
|
-
|
|
157
|
-
| 用户需求 | 推荐命令 | 关键注意点 |
|
|
158
|
-
|---------|---------|-----------|
|
|
159
|
-
| 创建轮播图 | `homepage module create --type banner` | 图片尺寸1920x600px,≤5张,配置跳转链接 |
|
|
160
|
-
| 显示精选商品 | `homepage module create --type featured` | 选择高转化商品,数量8-12个 |
|
|
161
|
-
| 创建促销集合 | `collection create --slug sale` | slug 简短有意义,添加10-30个商品 |
|
|
162
|
-
| 调整模块顺序 | `homepage module reorder --position X` | 重要模块靠前(轮播图position=1) |
|
|
163
|
-
| 更新店铺信息 | `merchant update --name/description` | 名称简洁,描述突出差异化优势 |
|
|
164
|
-
|
|
165
|
-
### 首页模块推荐配置
|
|
341
|
+
# 1. 创建轮播图模块
|
|
342
|
+
commerce homepage module create \
|
|
343
|
+
--slug hero-banner \
|
|
344
|
+
--type banner \
|
|
345
|
+
--position 1 \
|
|
346
|
+
--config '{"images":[{"url":"https://example.com/banner1.jpg","link":"/collections/summer-sale"},{"url":"https://example.com/banner2.jpg","link":"/collections/new-arrivals"}]}'
|
|
166
347
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
348
|
+
# 2. 创建分类导航模块
|
|
349
|
+
commerce homepage module create \
|
|
350
|
+
--slug category-nav \
|
|
351
|
+
--type categories \
|
|
352
|
+
--position 2 \
|
|
353
|
+
--config '{"columns":4}'
|
|
173
354
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
-
|
|
177
|
-
|
|
355
|
+
# 3. 创建精选商品模块
|
|
356
|
+
commerce homepage module create \
|
|
357
|
+
--slug featured-products \
|
|
358
|
+
--type featured \
|
|
359
|
+
--position 3 \
|
|
360
|
+
--config '{"limit":10}'
|
|
178
361
|
|
|
179
|
-
|
|
362
|
+
# 4. 更新首页设置
|
|
363
|
+
commerce homepage settings update \
|
|
364
|
+
--show-search true \
|
|
365
|
+
--featured-limit 10
|
|
180
366
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
- [ ] 移动端显示正常
|
|
185
|
-
- [ ] 加载速度 < 3秒
|
|
186
|
-
- [ ] SEO信息完整(标题、描述、关键词)
|
|
187
|
-
- [ ] 精选商品有库存
|
|
188
|
-
- [ ] 集合至少包含5个商品
|
|
189
|
-
- [ ] 店铺信息准确(名称、Logo、联系方式)
|
|
367
|
+
# 5. 验证配置
|
|
368
|
+
commerce homepage module list
|
|
369
|
+
```
|
|
190
370
|
|
|
191
|
-
##
|
|
371
|
+
## 重要提示
|
|
192
372
|
|
|
193
373
|
- 首页模块支持类型:banner(轮播图)、featured(精选商品)、categories(分类)
|
|
194
374
|
- 集合 slug 必须唯一,用于 URL
|
|
@@ -196,3 +376,5 @@ commerce collection create --name "New Arrivals" --slug "new-arrivals"
|
|
|
196
376
|
- config 字段使用 JSON 格式
|
|
197
377
|
- 集合可以手动管理商品,也可以设置自动规则
|
|
198
378
|
- 使用 `--help` 查看命令详细参数
|
|
379
|
+
- 所有模块和集合创建后需要验证配置是否正确
|
|
380
|
+
- 定期根据数据分析优化首页布局和内容
|