@optima-chat/optima-agent 0.4.31 → 0.4.32

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 (178) hide show
  1. package/.claude/settings.local.json +79 -0
  2. package/.claude/skills/ads/SKILL.md +0 -0
  3. package/.claude/skills/bi/SKILL.md +0 -0
  4. package/.claude/skills/collection/SKILL.md +0 -0
  5. package/.claude/skills/comfy/SKILL.md +0 -0
  6. package/.claude/skills/ffmpeg/SKILL.md +0 -0
  7. package/.claude/skills/homepage/SKILL.md +0 -0
  8. package/.claude/skills/i18n/SKILL.md +0 -0
  9. package/.claude/skills/inventory/SKILL.md +0 -0
  10. package/.claude/skills/markdown-pdf/SKILL.md +0 -0
  11. package/.claude/skills/merchant/SKILL.md +71 -68
  12. package/.claude/skills/order/SKILL.md +11 -19
  13. package/.claude/skills/product/SKILL.md +34 -3
  14. package/.claude/skills/product-page/SKILL.md +0 -0
  15. package/.claude/skills/review/SKILL.md +0 -0
  16. package/.claude/skills/scout/SKILL.md +116 -1
  17. package/.claude/skills/shipping/SKILL.md +193 -0
  18. package/README.md +0 -0
  19. package/dist/bin/bi-cli.d.ts +0 -0
  20. package/dist/bin/bi-cli.d.ts.map +0 -0
  21. package/dist/bin/bi-cli.js.map +0 -0
  22. package/dist/bin/comfy.d.ts +0 -0
  23. package/dist/bin/comfy.d.ts.map +0 -0
  24. package/dist/bin/comfy.js.map +0 -0
  25. package/dist/bin/commerce.d.ts +0 -0
  26. package/dist/bin/commerce.d.ts.map +0 -0
  27. package/dist/bin/commerce.js.map +0 -0
  28. package/dist/bin/google-ads.d.ts +0 -0
  29. package/dist/bin/google-ads.d.ts.map +0 -0
  30. package/dist/bin/google-ads.js.map +0 -0
  31. package/dist/bin/optima.d.ts +0 -0
  32. package/dist/bin/optima.d.ts.map +0 -0
  33. package/dist/bin/optima.js +3 -3
  34. package/dist/bin/optima.js.map +1 -1
  35. package/dist/bin/scout.d.ts +0 -0
  36. package/dist/bin/scout.d.ts.map +0 -0
  37. package/dist/bin/scout.js.map +0 -0
  38. package/dist/bin/serve.d.ts +0 -0
  39. package/dist/bin/serve.d.ts.map +0 -0
  40. package/dist/bin/serve.js +0 -0
  41. package/dist/bin/serve.js.map +0 -0
  42. package/dist/src/agent.d.ts +0 -0
  43. package/dist/src/agent.d.ts.map +0 -0
  44. package/dist/src/agent.js +0 -0
  45. package/dist/src/agent.js.map +0 -0
  46. package/dist/src/auth/device-flow.d.ts +0 -0
  47. package/dist/src/auth/device-flow.d.ts.map +0 -0
  48. package/dist/src/auth/device-flow.js +0 -0
  49. package/dist/src/auth/device-flow.js.map +0 -0
  50. package/dist/src/auth/index.d.ts +0 -0
  51. package/dist/src/auth/index.d.ts.map +0 -0
  52. package/dist/src/auth/index.js +0 -0
  53. package/dist/src/auth/index.js.map +0 -0
  54. package/dist/src/auth/token.d.ts +0 -0
  55. package/dist/src/auth/token.d.ts.map +0 -0
  56. package/dist/src/auth/token.js +0 -0
  57. package/dist/src/auth/token.js.map +0 -0
  58. package/dist/src/auth/types.d.ts +0 -0
  59. package/dist/src/auth/types.d.ts.map +0 -0
  60. package/dist/src/auth/types.js +0 -0
  61. package/dist/src/auth/types.js.map +0 -0
  62. package/dist/src/config.d.ts +0 -0
  63. package/dist/src/config.d.ts.map +0 -0
  64. package/dist/src/config.js +0 -0
  65. package/dist/src/config.js.map +0 -0
  66. package/dist/src/hooks-loader.d.ts +6 -0
  67. package/dist/src/hooks-loader.d.ts.map +1 -0
  68. package/dist/src/hooks-loader.js +215 -0
  69. package/dist/src/hooks-loader.js.map +1 -0
  70. package/dist/src/index.d.ts +2 -3
  71. package/dist/src/index.d.ts.map +1 -1
  72. package/dist/src/index.js +1 -1
  73. package/dist/src/index.js.map +1 -1
  74. package/dist/src/server/index.d.ts +0 -0
  75. package/dist/src/server/index.d.ts.map +0 -0
  76. package/dist/src/server/index.js +0 -0
  77. package/dist/src/server/index.js.map +0 -0
  78. package/dist/src/server/types.d.ts +0 -0
  79. package/dist/src/server/types.d.ts.map +0 -0
  80. package/dist/src/server/types.js +0 -0
  81. package/dist/src/server/types.js.map +0 -0
  82. package/dist/src/system-prompt.d.ts +0 -0
  83. package/dist/src/system-prompt.d.ts.map +0 -0
  84. package/dist/src/system-prompt.js +0 -0
  85. package/dist/src/system-prompt.js.map +0 -0
  86. package/dist/src/tools/memory.d.ts +0 -0
  87. package/dist/src/tools/memory.d.ts.map +0 -0
  88. package/dist/src/tools/memory.js +0 -0
  89. package/dist/src/tools/memory.js.map +0 -0
  90. package/dist/src/types.d.ts +0 -0
  91. package/dist/src/types.d.ts.map +0 -0
  92. package/dist/src/types.js +0 -0
  93. package/dist/src/types.js.map +0 -0
  94. package/dist/src/ui/App.d.ts +6 -0
  95. package/dist/src/ui/App.d.ts.map +1 -0
  96. package/dist/src/ui/App.js +164 -0
  97. package/dist/src/ui/App.js.map +1 -0
  98. package/dist/src/ui/components/Composer.d.ts +10 -0
  99. package/dist/src/ui/components/Composer.d.ts.map +1 -0
  100. package/dist/src/ui/components/Composer.js +13 -0
  101. package/dist/src/ui/components/Composer.js.map +1 -0
  102. package/dist/src/ui/components/Header.d.ts +7 -0
  103. package/dist/src/ui/components/Header.d.ts.map +1 -0
  104. package/dist/src/ui/components/Header.js +7 -0
  105. package/dist/src/ui/components/Header.js.map +1 -0
  106. package/dist/src/ui/components/Message.d.ts +12 -0
  107. package/dist/src/ui/components/Message.d.ts.map +1 -0
  108. package/dist/src/ui/components/Message.js +21 -0
  109. package/dist/src/ui/components/Message.js.map +1 -0
  110. package/dist/src/ui/components/MessageList.d.ts +9 -0
  111. package/dist/src/ui/components/MessageList.d.ts.map +1 -0
  112. package/dist/src/ui/components/MessageList.js +18 -0
  113. package/dist/src/ui/components/MessageList.js.map +1 -0
  114. package/dist/src/ui/components/Spinner.d.ts +6 -0
  115. package/dist/src/ui/components/Spinner.d.ts.map +1 -0
  116. package/dist/src/ui/components/Spinner.js +7 -0
  117. package/dist/src/ui/components/Spinner.js.map +1 -0
  118. package/dist/src/ui/components/StatusBar.d.ts +11 -0
  119. package/dist/src/ui/components/StatusBar.d.ts.map +1 -0
  120. package/dist/src/ui/components/StatusBar.js +7 -0
  121. package/dist/src/ui/components/StatusBar.js.map +1 -0
  122. package/dist/src/ui/components/index.d.ts +7 -0
  123. package/dist/src/ui/components/index.d.ts.map +1 -0
  124. package/dist/src/ui/components/index.js +7 -0
  125. package/dist/src/ui/components/index.js.map +1 -0
  126. package/dist/src/ui/conversation-manager.d.ts +0 -0
  127. package/dist/src/ui/conversation-manager.d.ts.map +0 -0
  128. package/dist/src/ui/conversation-manager.js +0 -0
  129. package/dist/src/ui/conversation-manager.js.map +0 -0
  130. package/dist/src/ui/headless-types.d.ts +59 -0
  131. package/dist/src/ui/headless-types.d.ts.map +1 -1
  132. package/dist/src/ui/headless-types.js +0 -1
  133. package/dist/src/ui/headless-types.js.map +1 -1
  134. package/dist/src/ui/headless.d.ts +15 -16
  135. package/dist/src/ui/headless.d.ts.map +1 -1
  136. package/dist/src/ui/headless.js +192 -121
  137. package/dist/src/ui/headless.js.map +1 -1
  138. package/dist/src/ui/index.d.ts +0 -0
  139. package/dist/src/ui/index.d.ts.map +0 -0
  140. package/dist/src/ui/index.js +0 -0
  141. package/dist/src/ui/index.js.map +0 -0
  142. package/dist/src/ui/stream.d.ts +0 -0
  143. package/dist/src/ui/stream.d.ts.map +0 -0
  144. package/dist/src/ui/stream.js +0 -0
  145. package/dist/src/ui/stream.js.map +0 -0
  146. package/dist/src/validation/error-formatter.d.ts +21 -0
  147. package/dist/src/validation/error-formatter.d.ts.map +1 -0
  148. package/dist/src/validation/error-formatter.js +98 -0
  149. package/dist/src/validation/error-formatter.js.map +1 -0
  150. package/dist/src/validation/index.d.ts +10 -0
  151. package/dist/src/validation/index.d.ts.map +1 -0
  152. package/dist/src/validation/index.js +10 -0
  153. package/dist/src/validation/index.js.map +1 -0
  154. package/dist/src/validation/json-validator.d.ts +25 -0
  155. package/dist/src/validation/json-validator.d.ts.map +1 -0
  156. package/dist/src/validation/json-validator.js +173 -0
  157. package/dist/src/validation/json-validator.js.map +1 -0
  158. package/dist/src/validation/schema.d.ts +353 -0
  159. package/dist/src/validation/schema.d.ts.map +1 -0
  160. package/dist/src/validation/schema.js +57 -0
  161. package/dist/src/validation/schema.js.map +1 -0
  162. package/dist/src/validation/suggestions.d.ts +25 -0
  163. package/dist/src/validation/suggestions.d.ts.map +1 -0
  164. package/dist/src/validation/suggestions.js +144 -0
  165. package/dist/src/validation/suggestions.js.map +1 -0
  166. package/dist/src/validation/types.d.ts +40 -0
  167. package/dist/src/validation/types.d.ts.map +1 -0
  168. package/dist/src/validation/types.js +5 -0
  169. package/dist/src/validation/types.js.map +1 -0
  170. package/dist/src/validation/yaml-validator.d.ts +25 -0
  171. package/dist/src/validation/yaml-validator.d.ts.map +1 -0
  172. package/dist/src/validation/yaml-validator.js +177 -0
  173. package/dist/src/validation/yaml-validator.js.map +1 -0
  174. package/dist/src/version.d.ts +0 -0
  175. package/dist/src/version.d.ts.map +0 -0
  176. package/dist/src/version.js +0 -0
  177. package/dist/src/version.js.map +0 -0
  178. package/package.json +9 -9
@@ -0,0 +1,79 @@
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
+ "Bash(grep:*)",
43
+ "Bash(find:*)",
44
+ "Bash(commerce collection --help:*)",
45
+ "Bash(commerce collection update --help:*)",
46
+ "Bash(commerce collection set-cover:*)",
47
+ "Bash(commerce collection get --help:*)",
48
+ "Bash(commerce collection list --help:*)",
49
+ "Bash(commerce collection create --help:*)",
50
+ "Bash(commerce collection remove-products:*)",
51
+ "Bash(commerce collection list-products:*)",
52
+ "Bash(commerce --version:*)",
53
+ "Bash(bi-cli --version:*)",
54
+ "Bash(commerce homepage create --help:*)",
55
+ "Bash(commerce homepage reorder --help:*)",
56
+ "Bash(commerce homepage delete --help:*)",
57
+ "Bash(commerce homepage update-images:*)",
58
+ "Bash(commerce homepage update-collections:*)",
59
+ "Bash(commerce homepage update-target:*)",
60
+ "Bash(commerce homepage switch-template:*)",
61
+ "Bash(commerce inventory:*)",
62
+ "Bash(commerce merchant:*)",
63
+ "Bash(commerce review:*)",
64
+ "Bash(commerce product-page:*)",
65
+ "Bash(bi-cli:*)",
66
+ "Bash(comfy:*)",
67
+ "Bash(scout search:*)",
68
+ "Bash(scout product:*)",
69
+ "Bash(commerce homepage create-collections:*)",
70
+ "Bash(commerce homepage create-featured:*)",
71
+ "Bash(commerce homepage create-collection-products:*)",
72
+ "Bash(commerce homepage create-banner:*)",
73
+ "Bash(xargs -I {} sh -c 'echo \"\"\"\"=== {} ===\"\"\"\"; head -3 /Users/verypro/optima-agent/.claude/skills/{}/SKILL.md | grep \"\"\"\"name:\"\"\"\"')",
74
+ "Bash(ls:*)"
75
+ ],
76
+ "deny": [],
77
+ "ask": []
78
+ }
79
+ }
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
@@ -1,101 +1,104 @@
1
1
  ---
2
2
  name: merchant
3
- description: "店铺管理和信息查询。使用场景:查看店铺信息(merchant info/店铺信息/商户信息)、更新店铺配置(update merchant/更新店铺)、查看店铺设置。使用 commerce merchant 命令。"
3
+ description: "店铺基础信息管理。使用场景:查看店铺信息、更新店铺名称/描述/联系方式/发货地址。注意:运费设置用 shipping skill。"
4
4
  ---
5
5
 
6
6
  # 店铺管理
7
7
 
8
- ## 标准操作
8
+ ## 典型场景
9
9
 
10
- ### 查看店铺信息
11
- ```bash
12
- commerce merchant info
13
- ```
14
- 返回店铺的完整信息:
15
- - 店铺名称、标识、描述
16
- - 默认货币、状态
17
- - 联系信息、发货地址
18
- - 创建和更新时间
10
+ | 用户说 | 命令 |
11
+ |--------|------|
12
+ | "查看店铺信息" / "我的店铺" | `commerce merchant info` |
13
+ | "修改店铺名称" / "更新店铺描述" | `commerce merchant update --name/--description` |
14
+ | "设置联系方式" | `commerce merchant update --contact-*` |
15
+ | "更新发货地址" | `commerce merchant update --origin-*` |
19
16
 
20
- ### 更新店铺信息
21
- ```bash
22
- commerce merchant update --name "新店铺名" --description "描述" --default-currency USD
23
- ```
17
+ ## 不在此模块(重要)
18
+
19
+ | 用户说 | 正确位置 |
20
+ |--------|----------|
21
+ | "运费设置" / "运费模式" / "运费区域" | **shipping skill**:`commerce shipping get-mode` |
22
+ | "Easyship" / "快递公司" | **shipping skill**:`commerce easyship couriers` |
23
+ | "Stripe/支付设置" | `commerce stripe status` |
24
+ | "首页设置" | **homepage skill** |
24
25
 
25
- 可更新的字段:
26
- - `--name`: 店铺名称
27
- - `--slug`: 店铺标识(URL 友好)
28
- - `--description`: 店铺描述
29
- - `--default-currency`: 默认货币(USD, CNY, EUR 等)
30
- - `--contact-name`: 联系人姓名
31
- - `--contact-phone`: 联系电话
32
- - `--contact-email`: 联系邮箱
33
- - `--company-name`: 公司名称
34
- - `--origin-*`: 发货地址字段(origin-country-alpha2, origin-city, origin-postal-code 等)
26
+ ---
35
27
 
36
- ## 完整命令列表
28
+ ## 查看店铺信息
37
29
 
38
30
  ```bash
39
- # 查看店铺信息
40
31
  commerce merchant info
32
+ ```
41
33
 
42
- # 更新基本信息
43
- commerce merchant update --name "我的店铺" --description "这是一个很棒的店铺"
44
-
45
- # 更新联系信息
46
- commerce merchant update --contact-name "张三" --contact-phone "1234567890" --contact-email "contact@example.com"
47
-
48
- # 更新发货地址
49
- commerce merchant update --origin-country-alpha2 "CN" --origin-city "深圳" --origin-postal-code "518000"
34
+ 返回:店铺名称、描述、Logo、货币、联系信息、发货地址
50
35
 
51
- # 更新多个字段
52
- commerce merchant update --name "新店铺" --default-currency "CNY" --company-name "我的公司"
53
- ```
36
+ **注意**:此命令不返回运费设置,运费相关请用 `commerce shipping get-mode`
54
37
 
55
- ## 工作流示例
38
+ ---
56
39
 
57
- ### 示例 1:查看店铺基本信息
58
- 用户:"查看我的店铺信息"
40
+ ## 更新店铺信息
59
41
 
60
42
  ```bash
61
- commerce merchant info
43
+ commerce merchant update [选项]
62
44
  ```
63
45
 
64
- 展示表格格式的店铺信息,包括:
65
- - 店铺名称、标识、描述
66
- - 货币、状态、创建时间
67
- - 联系信息(如有)
68
- - 发货地址(如有)
46
+ ### 基础信息
47
+ | 选项 | 说明 |
48
+ |------|------|
49
+ | `--name` | 店铺名称 |
50
+ | `--slug` | 店铺标识(影响 URL) |
51
+ | `--description` | 店铺描述 |
52
+ | `--default-currency` | 默认货币(USD, CNY 等) |
53
+
54
+ ### 联系方式
55
+ | 选项 | 说明 |
56
+ |------|------|
57
+ | `--contact-name` | 联系人 |
58
+ | `--contact-phone` | 联系电话 |
59
+ | `--contact-email` | 联系邮箱 |
60
+ | `--company-name` | 公司名称 |
61
+
62
+ ### 发货地址
63
+ | 选项 | 说明 |
64
+ |------|------|
65
+ | `--origin-country-alpha2` | 国家代码(CN, US 等) |
66
+ | `--origin-city` | 城市 |
67
+ | `--origin-postal-code` | 邮编 |
68
+ | `--origin-line-1` | 地址行1 |
69
+ | `--origin-line-2` | 地址行2 |
70
+ | `--origin-state` | 省/州 |
71
+
72
+ ---
69
73
 
70
- ### 示例 2:完善店铺信息
71
- 用户:"帮我设置店铺的联系方式和地址"
74
+ ## 示例
72
75
 
73
76
  ```bash
77
+ # 更新名称和描述
78
+ commerce merchant update --name "我的小店" --description "精选好物"
79
+
80
+ # 更新联系方式
74
81
  commerce merchant update \
75
82
  --contact-name "张三" \
76
83
  --contact-phone "13800138000" \
77
- --contact-email "shop@example.com" \
78
- --origin-country-alpha2 "CN" \
79
- --origin-city "深圳" \
80
- --origin-postal-code "518000"
81
- ```
84
+ --contact-email "shop@example.com"
82
85
 
83
- ### 示例 3:修改店铺名称
84
- 用户:"把店铺名改成'全球精品小店'"
85
-
86
- ```bash
87
- commerce merchant update --name "全球精品小店"
86
+ # 更新发货地址
87
+ commerce merchant update \
88
+ --origin-country-alpha2 CN \
89
+ --origin-city 深圳 \
90
+ --origin-postal-code 518000 \
91
+ --origin-line-1 "科技园路1号" \
92
+ --origin-state 广东
88
93
  ```
89
94
 
90
- ## 注意事项
95
+ ---
96
+
97
+ ## 命令参考
91
98
 
92
- - 店铺标识(slug)修改后会影响店铺 URL
93
- - 货币修改不会影响已创建的商品价格
94
- - 联系信息和发货地址建议完整填写
95
- - 更新后建议用 `commerce merchant info` 验证
99
+ - `commerce merchant info` - 查看店铺信息
100
+ - `commerce merchant update` - 更新店铺信息
96
101
 
97
- ## 相关命令
102
+ ## 不确定用什么命令?
98
103
 
99
- - 查看商品:`commerce product list`
100
- - 查看订单:`commerce order list`
101
- - 查看集合:`commerce collection list`
104
+ 运行 `commerce --help` 查看所有模块,或 `commerce merchant --help` 查看子命令。
@@ -15,7 +15,6 @@ description: Order fulfillment and shipping management. Process orders, ship pac
15
15
  - "查询订单物流" / "运单标签好了吗" → `commerce order tracking --id XX`
16
16
  - "取消订单XX" → `commerce order cancel --id XX --yes`
17
17
  - "标记订单已送达" → `commerce order mark-delivered --id XX`
18
- - "查询运费" → `commerce shipping calculate --country XX --weight YY`
19
18
  - "处理退款" → `commerce refund create --order-id XX --amount YY`
20
19
 
21
20
  ### 场景决策表
@@ -26,15 +25,14 @@ description: Order fulfillment and shipping management. Process orders, ship pac
26
25
  | 批量发货 | 循环 `order ship` | 必须有真实tracking号,避免虚假发货 |
27
26
  | 取消订单 | `order cancel --yes` | 检查是否已发货,避免错误取消 |
28
27
  | 处理退款 | `refund create` → `refund approve` | 先创建后审批,保留审计记录 |
29
- | 运费查询 | `shipping calculate` | 提供准确重量和邮编,避免运费纠纷 |
30
- | 物流异常 | `shipping track` → `shipping update-status` | 主动更新状态,及时通知客户 |
28
+ | 物流异常 | `order tracking` → `order update-shipping-status` | 主动更新状态,及时通知客户 |
31
29
 
32
30
  ### 标准订单履行流程
33
31
  1. **查看待发货** - `commerce order list --status paid` 按时间升序
34
32
  2. **验证订单** - 检查库存、地址、特殊要求
35
33
  3. **批量打包** - 准备商品、包装材料、打印面单
36
34
  4. **标记发货** - 循环 `commerce order ship --id XX --tracking YY --carrier ZZ`
37
- 5. **物流跟踪** - 定期 `commerce shipping track` 监控异常
35
+ 5. **物流跟踪** - 定期 `commerce order tracking` 或 `commerce easyship track` 监控异常
38
36
  6. **确认送达** - 签收后 `commerce order mark-delivered --id XX`
39
37
 
40
38
  ### 发货流程详解(重要)
@@ -295,10 +293,10 @@ commerce order ship --id order_789 --tracking DHL123458 --carrier DHL
295
293
  - `commerce refund approve` - 批准退款
296
294
  - `commerce refund reject` - 拒绝退款
297
295
 
298
- ### 物流管理
299
- - `commerce shipping calculate` - 计算运费
300
- - `commerce shipping track` - 物流追踪
301
- - `commerce shipping update-status` - 更新物流状态
296
+ ### 物流状态
297
+ - `commerce order tracking` - 查询物流跟踪和标签状态
298
+ - `commerce order update-shipping-status` - 更新物流状态
299
+ - `commerce easyship track` - 查询 Easyship 详细物流轨迹
302
300
 
303
301
  ### Easyship 集成
304
302
  - `commerce easyship couriers` - 查看可用快递公司
@@ -344,15 +342,6 @@ commerce order cancel \
344
342
  commerce order mark-delivered --id order_789
345
343
  ```
346
344
 
347
- ### 计算运费
348
- ```bash
349
- # 用户说:"计算寄到美国纽约10001的运费,重量0.5kg"
350
- commerce shipping calculate \
351
- --country US \
352
- --postal-code 10001 \
353
- --weight 0.5
354
- ```
355
-
356
345
  ### 处理退款
357
346
  ```bash
358
347
  # 用户说:"订单order_123要退款150美元"
@@ -367,8 +356,11 @@ commerce refund approve --id refund_456
367
356
 
368
357
  ### 物流追踪
369
358
  ```bash
370
- # 用户说:"查询快递单号DHL123456的物流信息"
371
- commerce shipping track --tracking-number DHL123456
359
+ # 用户说:"查询订单order_123的物流信息"
360
+ commerce order tracking --id order_123
361
+
362
+ # 或查询 Easyship 详细轨迹
363
+ commerce easyship track --order-id order_123
372
364
  ```
373
365
 
374
366
  ## 重要提示
@@ -58,9 +58,9 @@ done
58
58
  # 1. 查找目标商品
59
59
  commerce product list --query "T恤" --limit 50
60
60
 
61
- # 2. 批量更新价格和促销标签
62
- commerce product update --id prod_123 --price 79 --tags "featured,sale"
63
- commerce product update --id prod_456 --price 79 --tags "featured,sale"
61
+ # 2. 批量更新价格和促销标签(设置原价显示折扣)
62
+ commerce product update --id prod_123 --price 79 --original-price 99 --tags "featured,sale"
63
+ commerce product update --id prod_456 --price 79 --original-price 99 --tags "featured,sale"
64
64
  ```
65
65
 
66
66
  ### 场景5:商品图片更新
@@ -73,6 +73,18 @@ 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
+ ```bash
79
+ # 创建促销商品:售价79,原价99(显示划线价)
80
+ commerce product create \
81
+ --title "夏日特惠T恤" \
82
+ --price 79 \
83
+ --original-price 99 \
84
+ --stock 100 \
85
+ --tags "sale"
86
+ ```
87
+
76
88
  ### 场景决策表
77
89
 
78
90
  | 用户需求 | 推荐命令 | 关键注意点 |
@@ -81,8 +93,24 @@ commerce product add-images --id prod_123 --media-id media_new
81
93
  | 多规格商品 | `product create` + `variant create` | 主商品设置基础价格,变体设置差异价 |
82
94
  | 批量上架 | 脚本循环 `product create` | 复用共享图片的media_id,避免重复上传 |
83
95
  | 更新价格 | `product update --price` | 如有变体,需逐个更新变体价格 |
96
+ | 促销商品 | `product create --original-price` | `--original-price` 必须大于 `--price` |
84
97
  | 促销标签 | `product update --tags` | 用逗号分隔,保留原有标签 |
85
98
  | 图片更新 | `upload` + `add-images` | 先上传再关联,不要直接删除旧图 |
99
+ | 删除商品 | `product delete` | **软删除**,商品状态变为 archived |
100
+ | 下架商品 | `product update --status inactive` | 暂时隐藏,可随时恢复 |
101
+
102
+ ## 商品状态说明(重要)
103
+
104
+ | 状态 | 含义 | 用户可能说 |
105
+ |------|------|-----------|
106
+ | `active` | 正常上架,买家可见 | "上架"、"发布" |
107
+ | `inactive` | 暂时下架,买家不可见 | "下架"、"隐藏" |
108
+ | `draft` | 草稿,未发布 | "草稿"、"暂存" |
109
+ | `archived` | **已删除(软删除)**,数据保留 | "删除"、"移除" |
110
+
111
+ **`product delete` = 软删除**:删除商品会将状态设为 `archived`,数据保留但不再显示。
112
+
113
+ **已归档商品不需要再删除**:如果商品状态已经是 `archived`,告诉用户"商品已删除"。
86
114
 
87
115
  ## 卓越标准
88
116
 
@@ -184,9 +212,12 @@ commerce product create --title "T恤" --price 99 --stock 50 # 确保真实有5
184
212
 
185
213
  当用户说:
186
214
  - "创建XX商品,价格YY" → `commerce product create --title XX --price YY`
215
+ - "创建XX商品,售价YY,原价ZZ" → `commerce product create --title XX --price YY --original-price ZZ`
216
+ - "创建促销商品,价格79,划线价99" → `commerce product create --title XX --price 79 --original-price 99`
187
217
  - "上传商品图片" → `commerce upload image --path ./photo.jpg`
188
218
  - "添加商品变体" → `commerce variant create --product-id XX --sku YY`
189
219
  - "更新商品价格" → `commerce product update --id XX --price YY`
220
+ - "设置商品原价/划线价" → `commerce product update --id XX --original-price YY`
190
221
  - "给商品打标签" → `commerce product update --id XX --tags "featured,new"`
191
222
  - "设置商品重量和尺寸" → `commerce product update --id XX --weight 0.5 --length 10 --width 8 --height 5`
192
223
  - "查看所有商品" → `commerce product list`
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: scout
3
- description: "Interactive Amazon product research consultant. Search products, analyze markets, and generate professional reports. ALWAYS use when user asks about: selling products (卖/开店), product ideas (产品/商品), market research (市场/竞品), evaluating business opportunities (生意/创业). Start with conversational exploration, then suggest comprehensive report generation. Uses 'scout search' and 'scout product' commands."
3
+ description: "Interactive Amazon product research consultant with 1688 supplier sourcing. Search products, analyze markets, find suppliers, and generate professional reports. ALWAYS use when user asks about: selling products (卖/开店), product ideas (产品/商品), market research (市场/竞品), suppliers (供应商/厂家), sourcing (采购/进货/货源), evaluating business opportunities (生意/创业). Start with conversational exploration, then suggest comprehensive report generation. Uses 'scout search', 'scout product', and 'scout supplier-search' commands."
4
4
  ---
5
5
 
6
6
  # Optima Scout - AI Product Research
@@ -13,6 +13,9 @@ Use this skill when:
13
13
  - User asks about product pricing, ratings, sales data, or market trends
14
14
  - User wants to evaluate business opportunities or find products to sell
15
15
  - User needs detailed competitor analysis or listing quality assessment
16
+ - User needs to find suppliers or manufacturers (e.g., "帮我找咖啡机供应商", "哪里进货")
17
+ - User wants to source products from 1688/Alibaba China
18
+ - User asks about wholesale prices, bulk purchasing costs, or profit margins (e.g., "成本多少", "批发价", "利润空间")
16
19
 
17
20
  ## Interaction Style: Conversational → Report
18
21
 
@@ -115,6 +118,38 @@ scout product ASIN
115
118
  - Images count - Assess listing quality (7 images is standard)
116
119
  - Specifications - May include BSR in multiple categories
117
120
 
121
+ ### 3. Search 1688 Suppliers: `scout supplier-search`
122
+
123
+ Search for suppliers on 1688.com to find wholesale sources and manufacturing partners.
124
+
125
+ **Syntax:**
126
+ ```bash
127
+ scout supplier-search "KEYWORD" --limit NUMBER --format FORMAT
128
+ ```
129
+
130
+ **Parameters:**
131
+ - `KEYWORD`: Product keywords in Chinese (e.g., "咖啡机", "蓝牙耳机", "钛合金杯子")
132
+ - `--limit`: Number of results (1-100, default: 20)
133
+ - `--format`: Output format - `text` (human-readable) or `json` (for data processing)
134
+
135
+ **Returns:**
136
+ - Supplier list with product info, pricing, MOQ (minimum order quantity), supplier ratings
137
+ - Price tiers for bulk ordering (e.g., "2~49台: ¥599", "≥100台: ¥429")
138
+ - Supplier details: name, location, years in business, seller type (manufacturer vs. trader)
139
+ - Tags: shipping policies (退货包运费), payment terms (先采后付), certifications (实力商家)
140
+
141
+ **When to use:**
142
+ - After Amazon market research - find potential suppliers for cost analysis
143
+ - User asks about costs, margins, or sourcing
144
+ - Calculating profit margins (Amazon price - 1688 wholesale cost)
145
+ - Identifying manufacturing vs. trading suppliers
146
+ - Before generating final report - include supplier data for complete analysis
147
+
148
+ **Example:**
149
+ ```bash
150
+ scout supplier-search "咖啡机" --limit 10
151
+ ```
152
+
118
153
  ## Research Workflow
119
154
 
120
155
  ### Interactive Research Flow (Recommended):
@@ -135,6 +170,22 @@ scout product ASIN
135
170
  - Specific competitor analysis
136
171
  - Alternative product categories
137
172
 
173
+ **Phase 2.5: Supplier Sourcing (Optional but Recommended)**
174
+ 7. **Trigger**: User shows interest in profit margins, costs, or sourcing:
175
+ - "成本大概多少?" "批发价怎么样?" "利润空间大吗?"
176
+ - "哪里进货?" "供应商怎么找?"
177
+ - Or proactively suggest after market analysis: "要不要我帮你查一下供应商成本?"
178
+ 8. **Search 1688 Suppliers**:
179
+ ```bash
180
+ scout supplier-search "咖啡机" --limit 10
181
+ ```
182
+ 9. **Share Findings**:
183
+ - Wholesale price range (e.g., ¥429-599)
184
+ - MOQ (minimum order quantity)
185
+ - Profit margin calculation: Amazon price ($60-80) - 1688 cost (¥429 ≈ $60) - shipping ($10-15)
186
+ - Supplier quality indicators (years in business, certifications)
187
+ 10. **Ask**: "要不要我详细分析几个供应商?" or proceed to report
188
+
138
189
  **Phase 3: Report Generation (Proactive Suggestion)**
139
190
  7. **Gauge Completion** → After sufficient data gathering, **proactively suggest**:
140
191
  - "我已经收集了足够的数据,要不要我整理成一份完整的市场分析报告?"
@@ -347,6 +398,45 @@ scout product B0788F3R8X
347
398
  - Price positioning
348
399
  - Brand strength
349
400
 
401
+ ### Example 5: Complete Market Research + Supplier Sourcing
402
+ **User**: "我想卖咖啡机,帮我做市场调研"
403
+
404
+ **Phase 1 - Amazon Market Research:**
405
+ ```bash
406
+ scout search "coffee maker" --limit 15
407
+ scout product B08BHXG144 # Top seller analysis
408
+ ```
409
+
410
+ **Assistant**: "咖啡机市场很活跃:
411
+ - 价格区间:$30-150,主流在 $60-80
412
+ - 头部产品月销 1000+ 件,需求强劲
413
+ - 竞争激烈但市场容量大
414
+
415
+ **现在帮你查一下 1688 供应商成本,看看利润空间**"
416
+
417
+ **Phase 2 - Supplier Sourcing:**
418
+ ```bash
419
+ scout supplier-search "咖啡机" --limit 10
420
+ ```
421
+
422
+ **Assistant**: "找到供应商数据:
423
+ - 批发价区间:¥120-580(约 $17-80)
424
+ - 起订量:多数 2-10 台
425
+ - 头部供应商:容凯严选工厂,¥429-599,起订 2 台
426
+
427
+ **利润空间分析:**
428
+ - Amazon 售价:$60-80
429
+ - 1688 批发价:¥429(约 $60)
430
+ - 运费+关税:约 $10-15
431
+ - 毛利率:约 15-25%(扣除平台费用后)
432
+
433
+ 市场有需求,成本可控,利润空间合理。要详细分析吗?"
434
+
435
+ **User**: "好的,生成报告吧"
436
+
437
+ **Phase 3 - Generate Report with Supplier Data:**
438
+ [Creates comprehensive report including both Amazon market analysis AND 1688 supplier costs]
439
+
350
440
  ## Output Format
351
441
 
352
442
  Commands return structured JSON with product data and metadata. Key fields:
@@ -446,6 +536,31 @@ Commands return structured JSON with product data and metadata. Key fields:
446
536
  - Offer follow-up analysis: "要不要看看相关品类?"
447
537
  - Point out data limitations honestly
448
538
 
539
+ ### 8. Amazon + 1688 Integrated Analysis
540
+ **Principle:** Complete market research includes both demand analysis (Amazon) and supply chain research (1688).
541
+
542
+ **When to search 1688:**
543
+ - ✅ After identifying promising products on Amazon
544
+ - ✅ User asks about costs, margins, or sourcing
545
+ - ✅ Before generating final report (include supplier data for complete picture)
546
+ - ✅ User explicitly asks about suppliers or wholesale prices
547
+
548
+ **How to present:**
549
+ - Compare Amazon prices vs. 1688 wholesale costs
550
+ - Calculate rough profit margins (consider shipping, tariffs, platform fees)
551
+ - Highlight MOQ constraints (minimum order quantity)
552
+ - Identify manufacturing vs. trading suppliers (生产加工 vs. 贸易商)
553
+
554
+ **Example flow:**
555
+ 1. Search Amazon → Identify $60-80 price point for coffee makers
556
+ 2. Search 1688 → Find ¥429 ($60) wholesale price, MOQ 2 units
557
+ 3. Calculate margin → ~20% after fees and shipping
558
+ 4. Recommendation → Feasible opportunity with reasonable margins
559
+
560
+ **Proactive suggestion:**
561
+ After sufficient Amazon research, proactively offer:
562
+ "我已经分析了 Amazon 市场,要不要我帮你查一下 1688 供应商成本,看看利润空间?"
563
+
449
564
  ## Tips
450
565
 
451
566
  **Sales & Demand:**