@optima-chat/optima-agent 0.4.9 → 0.4.11

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 (140) hide show
  1. package/.claude/settings.local.json +46 -0
  2. package/.claude/skills/ads/SKILL.md +0 -0
  3. package/.claude/skills/bi/SKILL.md +0 -0
  4. package/.claude/skills/comfy/SKILL.md +3 -3
  5. package/.claude/skills/i18n/SKILL.md +0 -0
  6. package/.claude/skills/inventory/SKILL.md +0 -0
  7. package/.claude/skills/merchant/SKILL.md +0 -0
  8. package/.claude/skills/order/SKILL.md +0 -0
  9. package/.claude/skills/product/SKILL.md +140 -3
  10. package/.claude/skills/review/SKILL.md +0 -0
  11. package/.claude/skills/scout/SKILL.md +0 -0
  12. package/.claude/skills/storefront/SKILL.md +12 -118
  13. package/README.md +0 -0
  14. package/dist/bin/bi-cli.d.ts +0 -0
  15. package/dist/bin/bi-cli.d.ts.map +0 -0
  16. package/dist/bin/bi-cli.js.map +0 -0
  17. package/dist/bin/comfy.d.ts +0 -0
  18. package/dist/bin/comfy.d.ts.map +0 -0
  19. package/dist/bin/comfy.js.map +0 -0
  20. package/dist/bin/commerce.d.ts +0 -0
  21. package/dist/bin/commerce.d.ts.map +0 -0
  22. package/dist/bin/commerce.js.map +0 -0
  23. package/dist/bin/google-ads.d.ts +0 -0
  24. package/dist/bin/google-ads.d.ts.map +0 -0
  25. package/dist/bin/google-ads.js.map +0 -0
  26. package/dist/bin/optima.d.ts +0 -0
  27. package/dist/bin/optima.d.ts.map +0 -0
  28. package/dist/bin/optima.js.map +0 -0
  29. package/dist/bin/scout.d.ts +0 -0
  30. package/dist/bin/scout.d.ts.map +0 -0
  31. package/dist/bin/scout.js.map +0 -0
  32. package/dist/bin/serve.d.ts +0 -0
  33. package/dist/bin/serve.d.ts.map +0 -0
  34. package/dist/bin/serve.js +0 -0
  35. package/dist/bin/serve.js.map +0 -0
  36. package/dist/src/agent.d.ts +0 -0
  37. package/dist/src/agent.d.ts.map +0 -0
  38. package/dist/src/agent.js +0 -0
  39. package/dist/src/agent.js.map +0 -0
  40. package/dist/src/auth/device-flow.d.ts +0 -0
  41. package/dist/src/auth/device-flow.d.ts.map +0 -0
  42. package/dist/src/auth/device-flow.js +0 -0
  43. package/dist/src/auth/device-flow.js.map +0 -0
  44. package/dist/src/auth/index.d.ts +0 -0
  45. package/dist/src/auth/index.d.ts.map +0 -0
  46. package/dist/src/auth/index.js +0 -0
  47. package/dist/src/auth/index.js.map +0 -0
  48. package/dist/src/auth/token.d.ts +0 -0
  49. package/dist/src/auth/token.d.ts.map +0 -0
  50. package/dist/src/auth/token.js +0 -0
  51. package/dist/src/auth/token.js.map +0 -0
  52. package/dist/src/auth/types.d.ts +0 -0
  53. package/dist/src/auth/types.d.ts.map +0 -0
  54. package/dist/src/auth/types.js +0 -0
  55. package/dist/src/auth/types.js.map +0 -0
  56. package/dist/src/config.d.ts +0 -0
  57. package/dist/src/config.d.ts.map +0 -0
  58. package/dist/src/config.js +0 -0
  59. package/dist/src/config.js.map +0 -0
  60. package/dist/src/index.d.ts +0 -0
  61. package/dist/src/index.d.ts.map +0 -0
  62. package/dist/src/index.js +0 -0
  63. package/dist/src/index.js.map +0 -0
  64. package/dist/src/server/index.d.ts +0 -0
  65. package/dist/src/server/index.d.ts.map +0 -0
  66. package/dist/src/server/index.js +0 -0
  67. package/dist/src/server/index.js.map +0 -0
  68. package/dist/src/server/types.d.ts +0 -0
  69. package/dist/src/server/types.d.ts.map +0 -0
  70. package/dist/src/server/types.js +0 -0
  71. package/dist/src/server/types.js.map +0 -0
  72. package/dist/src/system-prompt.d.ts +0 -0
  73. package/dist/src/system-prompt.d.ts.map +0 -0
  74. package/dist/src/system-prompt.js +0 -0
  75. package/dist/src/system-prompt.js.map +0 -0
  76. package/dist/src/tools/memory.d.ts +0 -0
  77. package/dist/src/tools/memory.d.ts.map +0 -0
  78. package/dist/src/tools/memory.js +0 -0
  79. package/dist/src/tools/memory.js.map +0 -0
  80. package/dist/src/types.d.ts +0 -0
  81. package/dist/src/types.d.ts.map +0 -0
  82. package/dist/src/types.js +0 -0
  83. package/dist/src/types.js.map +0 -0
  84. package/dist/src/ui/App.d.ts +6 -0
  85. package/dist/src/ui/App.d.ts.map +1 -0
  86. package/dist/src/ui/App.js +164 -0
  87. package/dist/src/ui/App.js.map +1 -0
  88. package/dist/src/ui/components/Composer.d.ts +10 -0
  89. package/dist/src/ui/components/Composer.d.ts.map +1 -0
  90. package/dist/src/ui/components/Composer.js +13 -0
  91. package/dist/src/ui/components/Composer.js.map +1 -0
  92. package/dist/src/ui/components/Header.d.ts +7 -0
  93. package/dist/src/ui/components/Header.d.ts.map +1 -0
  94. package/dist/src/ui/components/Header.js +7 -0
  95. package/dist/src/ui/components/Header.js.map +1 -0
  96. package/dist/src/ui/components/Message.d.ts +12 -0
  97. package/dist/src/ui/components/Message.d.ts.map +1 -0
  98. package/dist/src/ui/components/Message.js +21 -0
  99. package/dist/src/ui/components/Message.js.map +1 -0
  100. package/dist/src/ui/components/MessageList.d.ts +9 -0
  101. package/dist/src/ui/components/MessageList.d.ts.map +1 -0
  102. package/dist/src/ui/components/MessageList.js +18 -0
  103. package/dist/src/ui/components/MessageList.js.map +1 -0
  104. package/dist/src/ui/components/Spinner.d.ts +6 -0
  105. package/dist/src/ui/components/Spinner.d.ts.map +1 -0
  106. package/dist/src/ui/components/Spinner.js +7 -0
  107. package/dist/src/ui/components/Spinner.js.map +1 -0
  108. package/dist/src/ui/components/StatusBar.d.ts +11 -0
  109. package/dist/src/ui/components/StatusBar.d.ts.map +1 -0
  110. package/dist/src/ui/components/StatusBar.js +7 -0
  111. package/dist/src/ui/components/StatusBar.js.map +1 -0
  112. package/dist/src/ui/components/index.d.ts +7 -0
  113. package/dist/src/ui/components/index.d.ts.map +1 -0
  114. package/dist/src/ui/components/index.js +7 -0
  115. package/dist/src/ui/components/index.js.map +1 -0
  116. package/dist/src/ui/conversation-manager.d.ts +0 -0
  117. package/dist/src/ui/conversation-manager.d.ts.map +0 -0
  118. package/dist/src/ui/conversation-manager.js +0 -0
  119. package/dist/src/ui/conversation-manager.js.map +0 -0
  120. package/dist/src/ui/headless-types.d.ts +0 -0
  121. package/dist/src/ui/headless-types.d.ts.map +0 -0
  122. package/dist/src/ui/headless-types.js +0 -0
  123. package/dist/src/ui/headless-types.js.map +0 -0
  124. package/dist/src/ui/headless.d.ts +0 -0
  125. package/dist/src/ui/headless.d.ts.map +0 -0
  126. package/dist/src/ui/headless.js +0 -0
  127. package/dist/src/ui/headless.js.map +0 -0
  128. package/dist/src/ui/index.d.ts +0 -0
  129. package/dist/src/ui/index.d.ts.map +0 -0
  130. package/dist/src/ui/index.js +0 -0
  131. package/dist/src/ui/index.js.map +0 -0
  132. package/dist/src/ui/stream.d.ts +0 -0
  133. package/dist/src/ui/stream.d.ts.map +0 -0
  134. package/dist/src/ui/stream.js +0 -0
  135. package/dist/src/ui/stream.js.map +0 -0
  136. package/dist/src/version.d.ts +0 -0
  137. package/dist/src/version.d.ts.map +0 -0
  138. package/dist/src/version.js +0 -0
  139. package/dist/src/version.js.map +0 -0
  140. package/package.json +1 -1
@@ -0,0 +1,46 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(gh api:*)",
5
+ "WebFetch(domain:platform.claude.com)",
6
+ "Bash(git init:*)",
7
+ "Bash(mkdir:*)",
8
+ "Bash(npm run typecheck:*)",
9
+ "Bash(npm view:*)",
10
+ "WebSearch",
11
+ "Bash(commerce --help)",
12
+ "Bash(done)",
13
+ "Bash(commerce product:*)",
14
+ "Bash(commerce order:*)",
15
+ "Bash(commerce i18n:*)",
16
+ "Bash(google-ads:*)",
17
+ "Bash(scout --help:*)",
18
+ "Bash(tree:*)",
19
+ "Bash(cloc:*)",
20
+ "Bash(npm run build:*)",
21
+ "Bash(git restore:*)",
22
+ "Bash(gh repo view:*)",
23
+ "Bash(mv:*)",
24
+ "Bash(rmdir:*)",
25
+ "Bash(git add:*)",
26
+ "Bash(git commit:*)",
27
+ "Bash(git push)",
28
+ "Bash(timeout 5 npm run optima:*)",
29
+ "Bash(npm install:*)",
30
+ "Bash(cat:*)",
31
+ "Bash(gh issue create:*)",
32
+ "Bash(npx tsx:*)",
33
+ "Bash(timeout 30 npx tsx:*)",
34
+ "Bash(git push origin feature/ask-user-question)",
35
+ "Bash(node:*)",
36
+ "Bash(npm version:*)",
37
+ "Bash(git push:*)",
38
+ "Bash(npm publish:*)",
39
+ "Bash(pkill:*)",
40
+ "Bash(git -C /Users/verypro/optima-agent log --oneline --all -- \".claude/\")",
41
+ "Bash(wc:*)"
42
+ ],
43
+ "deny": [],
44
+ "ask": []
45
+ }
46
+ }
File without changes
File without changes
@@ -33,8 +33,8 @@ comfy image <prompt> [options]
33
33
  | 参数 | 说明 |
34
34
  |------|------|
35
35
  | `-i, --input <path>` | 输入图像(可多次使用,最多 8 张) |
36
- | `-w, --width <px>` | 输出宽度(默认 1024,必须是 16 的倍数) |
37
- | `-h, --height <px>` | 输出高度(默认 1024,必须是 16 的倍数) |
36
+ | `-W, --width <px>` | 输出宽度(默认 1024,必须是 16 的倍数) |
37
+ | `-H, --height <px>` | 输出高度(默认 1024,必须是 16 的倍数) |
38
38
  | `-o, --output <path>` | 输出目录或完整路径 |
39
39
  | `-s, --seed <number>` | 随机种子(可复现结果) |
40
40
  | `-f, --format <fmt>` | 输出格式:jpeg \| png |
@@ -83,7 +83,7 @@ comfy image "a modern logo with brand color #02eb3c as the primary accent" -o /U
83
83
  #### 产品海报
84
84
 
85
85
  ```bash
86
- comfy image "Disney Pixar style 3D poster, [产品描述], cute character, vibrant gradient background, professional studio lighting" -w 1024 -h 1024 -o /Users/john/project/poster.png
86
+ comfy image "Disney Pixar style 3D poster, [产品描述], cute character, vibrant gradient background, professional studio lighting" -W 1024 -H 1024 -o /Users/john/project/poster.png
87
87
  ```
88
88
 
89
89
  ### 提示词指南(FLUX.2)
File without changes
File without changes
File without changes
File without changes
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: product
3
- description: Product catalog management for e-commerce stores. Create and update products, manage variants/SKUs, upload product images, organize tags. Use when user needs to add new products, update pricing, manage product inventory, upload photos, or organize product catalog.
3
+ description: Product catalog management for e-commerce stores. Create and update products, manage variants/SKUs, upload product images, organize tags, manage collections. Use when user needs to add new products, update pricing, manage product inventory, upload photos, organize product catalog, or manage product collections.
4
4
  ---
5
5
 
6
6
  # Commerce CLI - Product Management
7
7
 
8
- 商品管理模块,用于电商商品目录的创建、编辑和组织。
8
+ 商品管理模块,用于电商商品目录的创建、编辑、组织和集合管理。
9
9
 
10
10
  ## 典型场景
11
11
 
@@ -73,6 +73,45 @@ commerce upload image --path ./new-photo.jpg # 获得 media_new
73
73
  commerce product add-images --id prod_123 --media-id media_new
74
74
  ```
75
75
 
76
+ ### 场景6:创建商品集合
77
+
78
+ **推荐集合类型**:
79
+ - **时令集合** - 春夏秋冬、节日促销(如"Christmas Sale")
80
+ - **品类集合** - 按商品类型分组(如"T-Shirts", "Dresses")
81
+ - **主题集合** - 按场景分组(如"Office Wear", "Casual Style")
82
+ - **促销集合** - 新品、热卖、折扣(如"New Arrivals", "Best Sellers")
83
+
84
+ **创建流程**:
85
+ ```bash
86
+ # 1. 创建集合
87
+ commerce collection create \
88
+ --name "Summer Sale 2024" \
89
+ --slug "summer-sale-2024" \
90
+ --description "Hot deals for summer"
91
+
92
+ # 2. 添加商品到集合
93
+ commerce collection add-products \
94
+ --slug summer-sale-2024 \
95
+ --product-ids prod_123,prod_456,prod_789
96
+ ```
97
+
98
+ ### 场景7:设置集合封面图
99
+
100
+ **三种方式**:
101
+
102
+ ```bash
103
+ # 方式 1:使用 Media ID(推荐,可复用已上传图片)
104
+ commerce upload image --path ./cover.jpg
105
+ # 获取 media_id: media_456
106
+ commerce collection set-cover --id coll-123 --media-id media_456
107
+
108
+ # 方式 2:使用 URL
109
+ commerce collection set-cover --id coll-123 --url "https://example.com/cover.jpg"
110
+
111
+ # 方式 3:上传本地文件
112
+ commerce collection set-cover --id coll-123 --path ./cover.jpg
113
+ ```
114
+
76
115
  ### 场景决策表
77
116
 
78
117
  | 用户需求 | 推荐命令 | 关键注意点 |
@@ -83,6 +122,8 @@ commerce product add-images --id prod_123 --media-id media_new
83
122
  | 更新价格 | `product update --price` | 如有变体,需逐个更新变体价格 |
84
123
  | 促销标签 | `product update --tags` | 用逗号分隔,保留原有标签 |
85
124
  | 图片更新 | `upload` + `add-images` | 先上传再关联,不要直接删除旧图 |
125
+ | 创建促销集合 | `collection create --slug sale` | slug 简短有意义,添加10-30个商品 |
126
+ | 设置集合封面 | `collection set-cover --id XX` | 支持 media-id/url/path 三种方式 |
86
127
 
87
128
  ## 卓越标准
88
129
 
@@ -178,6 +219,54 @@ commerce product update --id prod_123 --tags "featured,new,sale"
178
219
  commerce product create --title "T恤" --price 99 --stock 50 # 确保真实有50件
179
220
  ```
180
221
 
222
+ ### ❌ 问题6:集合命名随意,无规划
223
+
224
+ **错误做法**:
225
+ ```bash
226
+ # 命名不规范,slug 无意义
227
+ commerce collection create --name "aaa" --slug "test123"
228
+ commerce collection create --name "商品111" --slug "product-collection"
229
+ ```
230
+
231
+ **正确做法**:
232
+ ```bash
233
+ # 命名清晰,slug 符合 SEO 规范
234
+ commerce collection create --name "Summer Sale 2024" --slug "summer-sale-2024"
235
+ commerce collection create --name "Men's T-Shirts" --slug "mens-tshirts"
236
+ ```
237
+
238
+ ### ❌ 问题7:集合缺少商品
239
+
240
+ **错误做法**:
241
+ ```bash
242
+ # 创建集合后忘记添加商品
243
+ commerce collection create --name "New Arrivals" --slug "new-arrivals"
244
+ # 集合页面显示空白
245
+ ```
246
+
247
+ **正确做法**:
248
+ ```bash
249
+ # 创建集合后立即添加商品(至少5个)
250
+ commerce collection create --name "New Arrivals" --slug "new-arrivals"
251
+ commerce collection add-products --slug new-arrivals --product-ids prod_1,prod_2,prod_3,prod_4,prod_5
252
+ ```
253
+
254
+ ### ❌ 问题8:slug 使用中文或特殊字符
255
+
256
+ **错误做法**:
257
+ ```bash
258
+ # slug 包含中文或特殊字符,影响 SEO 和 URL 可读性
259
+ commerce collection create --name "夏季促销" --slug "夏季促销"
260
+ commerce collection create --name "Sale!!!" --slug "sale!!!"
261
+ ```
262
+
263
+ **正确做法**:
264
+ ```bash
265
+ # slug 使用英文、数字、连字符
266
+ commerce collection create --name "夏季促销" --slug "summer-sale"
267
+ commerce collection create --name "Sale!!!" --slug "sale"
268
+ ```
269
+
181
270
  ## 命令参考
182
271
 
183
272
  ### 自然语言映射
@@ -189,6 +278,11 @@ commerce product create --title "T恤" --price 99 --stock 50 # 确保真实有5
189
278
  - "更新商品价格" → `commerce product update --id XX --price YY`
190
279
  - "给商品打标签" → `commerce product update --id XX --tags "featured,new"`
191
280
  - "查看所有商品" → `commerce product list`
281
+ - "创建商品集合" → `commerce collection create --name XX --slug YY`
282
+ - "把商品添加到集合" → `commerce collection add-products --slug XX --product-ids YY`
283
+ - "设置集合封面图" → `commerce collection set-cover --id XX --media-id YY`
284
+ - "上传集合封面" → `commerce collection set-cover --id XX --path ./cover.jpg`
285
+ - "集合封面图 URL 是 https://..." → `commerce collection set-cover --id XX --url "https://..."`
192
286
 
193
287
  ### 核心功能
194
288
 
@@ -210,6 +304,15 @@ commerce product create --title "T恤" --price 99 --stock 50 # 确保真实有5
210
304
  - `commerce product add-images` - 关联图片到商品
211
305
  - `commerce product remove-images` - 移除商品图片
212
306
 
307
+ **商品集合**:
308
+ - `commerce collection create` - 创建集合
309
+ - `commerce collection list` - 查看集合列表
310
+ - `commerce collection update` - 更新集合
311
+ - `commerce collection delete` - 删除集合
312
+ - `commerce collection add-products` - 添加商品到集合
313
+ - `commerce collection remove-products` - 从集合移除商品
314
+ - `commerce collection set-cover` - 设置集合封面图(支持 media-id/url/path)
315
+
213
316
  ## 详细示例
214
317
 
215
318
  ### 示例1:创建单个商品
@@ -295,13 +398,47 @@ commerce product add-images --id prod_123 --media-id media_red,media_blue
295
398
  commerce product get --id prod_123
296
399
  ```
297
400
 
401
+ ### 示例7:创建商品集合
402
+ ```bash
403
+ # 用户说:"创建夏季促销集合"
404
+ commerce collection create \
405
+ --name "Summer Sale" \
406
+ --slug summer-sale \
407
+ --description "Hot deals for summer"
408
+ ```
409
+
410
+ ### 示例8:添加商品到集合
411
+ ```bash
412
+ # 用户说:"把商品prod_123和prod_456添加到summer-sale集合"
413
+ commerce collection add-products \
414
+ --slug summer-sale \
415
+ --product-ids prod_123,prod_456
416
+ ```
417
+
418
+ ### 示例9:设置集合封面图
419
+ ```bash
420
+ # 用户说:"给集合设置封面图"
421
+
422
+ # 方式 1:使用 Media ID(推荐)
423
+ commerce upload image --path ./cover.jpg # 获得 media_456
424
+ commerce collection set-cover --id coll-123 --media-id media_456
425
+
426
+ # 方式 2:使用 URL
427
+ commerce collection set-cover --id coll-123 --url "https://example.com/cover.jpg"
428
+
429
+ # 方式 3:上传本地文件
430
+ commerce collection set-cover --id coll-123 --path ./cover.jpg
431
+ ```
432
+
298
433
  ## 重要提示
299
434
 
300
435
  - 所有命令默认 JSON 输出,便于 AI 解析
301
436
  - 图片需要先上传获取 `media_id`,再关联到商品
302
437
  - 变体的 `attributes` 使用 JSON 格式
303
438
  - 标签使用逗号分隔的字符串
304
- - 支持的图片格式:JPG, PNG, WebP
439
+ - 支持的图片格式:JPG, PNG, WebP(最大 10MB)
305
440
  - 使用 `--help` 查看命令详细参数
306
441
  - 删除商品会同时删除所有变体和图片关联
307
442
  - 价格单位默认为美元(USD),可通过后台配置修改
443
+ - 集合 slug 必须唯一,用于 URL,使用英文和连字符
444
+ - 集合封面支持三种方式:`--media-id`(推荐)、`--url`、`--path`
File without changes
File without changes
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: storefront
3
- description: "店铺前台配置管理。使用场景:配置首页(homepage/首页)、管理商品集合(collections/集合)、商品详情页区块(sections/区块)、调整模块顺序和布局。使用 commerce homepage/collection/section 命令。"
3
+ description: "店铺前台配置管理。使用场景:配置首页(homepage/首页)、商品详情页区块(sections/区块)、调整模块顺序和布局。使用 commerce homepage/section 命令。"
4
4
  ---
5
5
 
6
6
  # Commerce CLI - Storefront Configuration
7
7
 
8
- 店铺前台配置模块,用于首页设置、商品集合管理和商品详情页区块配置。
8
+ 店铺前台配置模块,用于首页设置和商品详情页区块配置。
9
9
 
10
10
  ## 典型场景
11
11
 
@@ -15,7 +15,6 @@ description: "店铺前台配置管理。使用场景:配置首页(homepage/
15
15
  |---------|---------|-----------|
16
16
  | 创建轮播图 | `commerce homepage module create --type banner` | 图片尺寸1920x600px,≤5张,配置跳转链接 |
17
17
  | 显示精选商品 | `commerce homepage module create --type featured` | 选择高转化商品,数量8-12个 |
18
- | 创建促销集合 | `commerce collection create --slug sale` | slug 简短有意义,添加10-30个商品 |
19
18
  | 调整模块顺序 | `commerce homepage module reorder --position X` | 重要模块靠前(轮播图position=1) |
20
19
 
21
20
  ### 场景 1:首页配置
@@ -53,29 +52,7 @@ commerce homepage module create \
53
52
  --config '{"images":[{"url":"https://example.com/banner1.jpg","link":"/collections/summer-sale"}]}'
54
53
  ```
55
54
 
56
- ### 场景 3:创建商品集合
57
-
58
- **推荐集合类型**:
59
- - **时令集合** - 春夏秋冬、节日促销(如"Christmas Sale")
60
- - **品类集合** - 按商品类型分组(如"T-Shirts", "Dresses")
61
- - **主题集合** - 按场景分组(如"Office Wear", "Casual Style")
62
- - **促销集合** - 新品、热卖、折扣(如"New Arrivals", "Best Sellers")
63
-
64
- **创建流程**:
65
- ```bash
66
- # 1. 创建集合
67
- commerce collection create \
68
- --name "Summer Sale 2024" \
69
- --slug "summer-sale-2024" \
70
- --description "Hot deals for summer"
71
-
72
- # 2. 添加商品到集合
73
- commerce collection add-products \
74
- --slug summer-sale-2024 \
75
- --product-ids prod_123,prod_456,prod_789
76
- ```
77
-
78
- ### 场景 4:调整模块顺序
55
+ ### 场景 3:调整模块顺序
79
56
 
80
57
  **重新排序原则**:
81
58
  - 重要模块靠前(轮播图 position=1)
@@ -90,18 +67,16 @@ commerce homepage module reorder \
90
67
  --position 2
91
68
  ```
92
69
 
93
- ### 场景 5:优化转化率
70
+ ### 场景 4:优化转化率
94
71
 
95
72
  **数据驱动优化**:
96
73
  - 分析首页点击热图,调整模块顺序
97
74
  - A/B测试不同轮播图和精选商品
98
- - 根据转化率隐藏低效集合
99
75
  - 精选商品选择高利润或高评分商品
100
76
 
101
77
  **性能优化建议**:
102
78
  - 轮播图:懒加载,压缩图片,支持WebP格式
103
79
  - 精选商品:限制8-12个,缓存1小时
104
- - 集合:按点击率排序,隐藏低转化集合
105
80
 
106
81
 
107
82
  ## 卓越标准
@@ -109,16 +84,16 @@ commerce homepage module reorder \
109
84
  ### 店铺配置质量指标
110
85
  - **页面加载速度**: 首页加载 < 3秒,移动端 < 5秒
111
86
  - **视觉设计**: 轮播图尺寸统一(1920x600px),图片清晰无水印
112
- - **导航体验**: 分类层级 ≤ 3层,集合数量 5-15个最佳
87
+ - **导航体验**: 分类层级 ≤ 3层,模块数量适中
113
88
  - **内容更新频率**: 轮播图每周更新,精选商品每3天更新
114
- - **转化率**: 首页访客转化率 > 3%,集合页转化率 > 5%
89
+ - **转化率**: 首页访客转化率 > 3%
115
90
 
116
91
  ### 店铺配置原则
117
92
  - **移动优先**: 所有配置考虑移动端体验,图片支持响应式
118
93
  - **性能优化**: 轮播图 ≤ 5张,精选商品 ≤ 12个,减少加载负担
119
- - **SEO友好**: 集合slug使用英文,标题包含关键词
94
+ - **SEO友好**: 模块标题包含关键词
120
95
  - **一致性**: 风格统一(色彩、字体、间距),提升品牌辨识度
121
- - **数据驱动**: 根据点击率和转化率优化首页布局和集合内容
96
+ - **数据驱动**: 根据点击率和转化率优化首页布局
122
97
 
123
98
  ### 首页配置检查清单
124
99
 
@@ -129,30 +104,11 @@ commerce homepage module reorder \
129
104
  - [ ] 加载速度 < 3秒
130
105
  - [ ] SEO信息完整(标题、描述、关键词)
131
106
  - [ ] 精选商品有库存
132
- - [ ] 集合至少包含5个商品
133
107
  - [ ] 首页模块顺序合理
134
108
 
135
109
  ## 常见问题
136
110
 
137
- ### ❌ 问题 1:集合命名随意,无规划
138
-
139
- **错误做法**:
140
- ```bash
141
- # 命名不规范,slug 无意义
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
- **✅ 正确做法**:
148
- ```bash
149
- # 命名清晰,slug 符合 SEO 规范
150
- commerce collection create --name "Summer Sale 2024" --slug "summer-sale-2024"
151
- commerce collection create --name "Men's T-Shirts" --slug "mens-tshirts"
152
- commerce collection create --name "New Arrivals" --slug "new-arrivals"
153
- ```
154
-
155
- ### ❌ 问题 2:轮播图过多影响性能
111
+ ### ❌ 问题 1:轮播图过多影响性能
156
112
 
157
113
  **错误做法**:
158
114
  ```bash
@@ -166,7 +122,7 @@ commerce homepage module create --type banner --config '{"images":[...10张图
166
122
  commerce homepage module create --type banner --config '{"images":[...3-5张图片...]}'
167
123
  ```
168
124
 
169
- ### ❌ 问题 3:精选商品数量过多
125
+ ### ❌ 问题 2:精选商品数量过多
170
126
 
171
127
  **错误做法**:
172
128
  ```bash
@@ -180,23 +136,7 @@ commerce homepage settings update --featured-limit 30
180
136
  commerce homepage settings update --featured-limit 10
181
137
  ```
182
138
 
183
- ### ❌ 问题 4:集合缺少商品
184
-
185
- **错误做法**:
186
- ```bash
187
- # 创建集合后忘记添加商品
188
- commerce collection create --name "New Arrivals" --slug "new-arrivals"
189
- # 集合页面显示空白
190
- ```
191
-
192
- **✅ 正确做法**:
193
- ```bash
194
- # 创建集合后立即添加商品(至少5个)
195
- commerce collection create --name "New Arrivals" --slug "new-arrivals"
196
- commerce collection add-products --slug new-arrivals --product-ids prod_1,prod_2,prod_3,prod_4,prod_5
197
- ```
198
-
199
- ### ❌ 问题 5:首页模块顺序混乱
139
+ ### ❌ 问题 3:首页模块顺序混乱
200
140
 
201
141
  **错误做法**:
202
142
  ```bash
@@ -214,22 +154,6 @@ commerce homepage module create --type categories --position 2
214
154
  commerce homepage module create --type featured --position 3
215
155
  ```
216
156
 
217
- ### ❌ 问题 6:slug 使用中文或特殊字符
218
-
219
- **错误做法**:
220
- ```bash
221
- # slug 包含中文或特殊字符,影响 SEO 和 URL 可读性
222
- commerce collection create --name "夏季促销" --slug "夏季促销"
223
- commerce collection create --name "Sale!!!" --slug "sale!!!"
224
- ```
225
-
226
- **✅ 正确做法**:
227
- ```bash
228
- # slug 使用英文、数字、连字符
229
- commerce collection create --name "夏季促销" --slug "summer-sale"
230
- commerce collection create --name "Sale!!!" --slug "sale"
231
- ```
232
-
233
157
  ## 命令参考
234
158
 
235
159
  ### 自然语言映射
@@ -237,8 +161,6 @@ commerce collection create --name "Sale!!!" --slug "sale"
237
161
  当用户说:
238
162
  - "创建首页轮播图" → `commerce homepage module create --type banner ...`
239
163
  - "更新首页设置" → `commerce homepage settings update --show-search true`
240
- - "创建商品集合" → `commerce collection create --name XX --slug YY`
241
- - "把商品添加到集合" → `commerce collection add-products --slug XX --product-ids YY`
242
164
 
243
165
  ### 核心功能
244
166
 
@@ -253,14 +175,6 @@ commerce collection create --name "Sale!!!" --slug "sale"
253
175
  - `commerce homepage settings get` - 查看首页设置
254
176
  - `commerce homepage settings update` - 更新首页设置
255
177
 
256
- **商品集合**:
257
- - `commerce collection create` - 创建集合
258
- - `commerce collection list` - 查看集合列表
259
- - `commerce collection update` - 更新集合
260
- - `commerce collection delete` - 删除集合
261
- - `commerce collection add-products` - 添加商品到集合
262
- - `commerce collection remove-products` - 从集合移除商品
263
-
264
178
  ## 详细示例
265
179
 
266
180
  ### 创建首页轮播图
@@ -282,24 +196,6 @@ commerce homepage settings update \
282
196
  --featured-limit 8
283
197
  ```
284
198
 
285
- ### 创建商品集合
286
- ```bash
287
- # 用户说:"创建夏季促销集合"
288
- commerce collection create \
289
- --name "Summer Sale" \
290
- --slug summer-sale \
291
- --description "Hot deals for summer"
292
- ```
293
-
294
- ### 添加商品到集合
295
- ```bash
296
- # 用户说:"把商品prod_123和prod_456添加到summer-sale集合"
297
- commerce collection add-products \
298
- --slug summer-sale \
299
- --product-ids prod_123,prod_456
300
- ```
301
-
302
-
303
199
  ### 重新排序首页模块
304
200
  ```bash
305
201
  # 用户说:"调整首页模块顺序"
@@ -340,7 +236,7 @@ commerce homepage settings update \
340
236
  commerce homepage module list
341
237
  ```
342
238
 
343
- ## 场景 7:商品详情页区块管理
239
+ ## 场景 5:商品详情页区块管理
344
240
 
345
241
  ### 三层继承模型
346
242
 
@@ -515,10 +411,8 @@ commerce section list --resolved
515
411
 
516
412
  ### 首页配置
517
413
  - 首页模块支持类型:banner(轮播图)、featured(精选商品)、categories(分类)
518
- - 集合 slug 必须唯一,用于 URL
519
414
  - 模块的 position 决定显示顺序(从小到大)
520
415
  - config 字段使用 JSON 格式
521
- - 集合可以手动管理商品,也可以设置自动规则
522
416
 
523
417
  ### 商品页区块
524
418
  - 系统默认区块:highlights, details, guarantee, care, shipping-policies, return, eco-friendly
package/README.md CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/bin/serve.js CHANGED
File without changes
File without changes
File without changes
File without changes
package/dist/src/agent.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/src/index.js CHANGED
File without changes
File without changes
File without changes