api-config.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. {
  2. "name": "voc-proposal",
  3. "displayName": "VOC产品优化提案生成",
  4. "description": "整合所有VOC分析成果,AI生成11章节产品优化提案(含ROI估算+30天行动线)",
  5. "category": "synthesis",
  6. "version": "2.1.0",
  7. "type": "analysis",
  8. "parameters": {
  9. "categoryLandscape": {
  10. "type": "object",
  11. "required": true,
  12. "description": "synthesis/category-landscape 输出"
  13. },
  14. "brandProfile": {
  15. "type": "object",
  16. "required": true,
  17. "description": "synthesis/brand-profile 输出"
  18. },
  19. "competitorData": {
  20. "type": "object",
  21. "required": true,
  22. "description": "competitor-analysis 相关输出汇总"
  23. },
  24. "reviewAnalysis": {
  25. "type": "object",
  26. "required": true,
  27. "description": "review-analysis 相关输出汇总"
  28. },
  29. "socialVocData": {
  30. "type": "object",
  31. "required": false,
  32. "description": "social-voc 相关输出汇总"
  33. },
  34. "userPersona": {
  35. "type": "object",
  36. "required": true,
  37. "description": "synthesis/user-persona 输出"
  38. },
  39. "brandName": {
  40. "type": "string",
  41. "required": true,
  42. "description": "品牌名称"
  43. },
  44. "categoryKeyword": {
  45. "type": "string",
  46. "required": true,
  47. "description": "品类关键词"
  48. }
  49. },
  50. "pipeline": [
  51. {
  52. "step": 1,
  53. "name": "构建数据索引",
  54. "type": "compute",
  55. "logic": "buildDataIndex(categoryLandscape, brandProfile, competitorData, reviewAnalysis, socialVocData, userPersona)",
  56. "algorithm": {
  57. "index": "将所有上游技能输出按章节主题分类索引",
  58. "chapters": {
  59. "ch1_market": "categoryLandscape → 市场总览/CR5/价格带/搜索趋势",
  60. "ch2_competitor": "competitorData → 竞品发现/对比矩阵/定价分析/BSR追踪",
  61. "ch3_voc": "reviewAnalysis → 情感分布/痛点TOP/亮点TOP/关键词云",
  62. "ch4_social": "socialVocData → TikTok热度/IG策略/趋势话题",
  63. "ch5_user": "userPersona → 用户画像/场景分布/决策因素",
  64. "ch6_action": "综合所有数据 → 产品优化行动计划"
  65. },
  66. "completeness": "检查各数据源是否完整,缺失的标记为data_missing"
  67. },
  68. "output": "dataIndex"
  69. },
  70. {
  71. "step": 2,
  72. "name": "AI生成提案",
  73. "type": "ai",
  74. "logic": "generateProposal(dataIndex, { brandName, categoryKeyword, template: '6-chapter' })",
  75. "aiConfig": {
  76. "systemPrompt": "你是跨境电商VOC分析专家。请基于数据生成结构化的产品优化提案。只输出JSON。",
  77. "userPromptTemplate": "品牌: ${brandName}\n品类: ${categoryKeyword}\n\n请生成6章节提案:\n1. 市场总览与机会 (${ch1_data})\n2. 竞争格局与定位 (${ch2_data})\n3. VOC洞察与产品优化 (${ch3_data})\n4. 社媒趋势与营销策略 (${ch4_data})\n5. 用户画像与场景策略 (${ch5_data})\n6. 行动计划与优先级 (${all_data})",
  78. "outputFormat": "{\"chapters\":[{\"title\":\"市场总览与机会\",\"sections\":[{\"heading\":\"\",\"content\":\"\",\"dataRef\":\"\"}],\"keyFindings\":[\"\"],\"recommendations\":[\"\"]}]}",
  79. "temperature": 0.3,
  80. "maxTokens": 8000,
  81. "promptPattern": "system约束JSON输出 + user按章节注入数据摘要 + outputFormat示例引导结构"
  82. },
  83. "output": "proposal"
  84. },
  85. {
  86. "step": 3,
  87. "name": "添加数据引用+生成Markdown",
  88. "type": "compute",
  89. "logic": "addDataReferences(proposal, dataIndex)",
  90. "algorithm": {
  91. "dataRef": "为每个章节的每个结论添加数据来源引用",
  92. "markdown": "将JSON提案转化为完整Markdown文档,包含目录/执行摘要/6章节/附录",
  93. "executiveSummary": "从各章keyFindings和recommendations中提取核心要点生成执行摘要",
  94. "completenessReport": "标注数据完整度: 哪些章节有完整数据支撑,哪些基于AI推断"
  95. },
  96. "output": "finalProposal"
  97. },
  98. {
  99. "step": 4,
  100. "name": "ROI估算与风险整合",
  101. "type": "compute",
  102. "logic": "computeRoiAndRisks(proposal, dataIndex, categoryLandscape, competitorData)",
  103. "algorithm": {
  104. "roiEstimation": {
  105. "perRecommendation": "为每条建议估算: 投入成本/预期收益/回本周期",
  106. "listingOptimization": "$0成本, 预计提升转化率10-20%, 回本0天",
  107. "ppcCampaign": "日预算$30-50, ACOS目标<30%, 14天见效",
  108. "productIteration": "模具/包装改良成本估算, 60-90天回本",
  109. "socialMarketing": "KOL合作费用估算, 30-45天见效"
  110. },
  111. "riskIntegration": {
  112. "method": "从哄类格局/竞品分析中汇总风险预警",
  113. "mitigation": "每个风险配套缓解策略"
  114. }
  115. },
  116. "output": "roiAndRisks"
  117. },
  118. {
  119. "step": 5,
  120. "name": "30天行动时间线",
  121. "type": "compute",
  122. "logic": "build30DayTimeline(proposal, roiAndRisks, dataIndex)",
  123. "algorithm": {
  124. "weeklyBreakdown": {
  125. "week1": [
  126. "Listing优化(标题/五点/ST植入核心词)",
  127. "差评快速响应机制启动",
  128. "广告活动搭建(Auto+手动精准)"
  129. ],
  130. "week2": [
  131. "A+页面优化",
  132. "广告Bid调优基于第一周数据",
  133. "社媒内容发布启动"
  134. ],
  135. "week3": [
  136. "主图/视频迭代优化",
  137. "广告否词清理+新词扩展",
  138. "促销活动启动(Coupon/Deal)"
  139. ],
  140. "week4": [
  141. "效果复盘+数据分析",
  142. "下月计划制定",
  143. "库存补货决策"
  144. ]
  145. },
  146. "milestones": [
  147. {
  148. "day": 7,
  149. "target": "Listing优化完成,广告开始积累数据"
  150. },
  151. {
  152. "day": 14,
  153. "target": "广告ACOS降至目标值,有机流量开始提升"
  154. },
  155. {
  156. "day": 21,
  157. "target": "转化率提升可见,社媒引流开始起效"
  158. },
  159. {
  160. "day": 30,
  161. "target": "全面复盘,确认下一阶段重点"
  162. }
  163. ]
  164. },
  165. "output": "actionTimeline"
  166. }
  167. ],
  168. "response": {
  169. "type": "object",
  170. "properties": {
  171. "proposal": {
  172. "type": "object",
  173. "description": "完整提案结构",
  174. "properties": {
  175. "title": {
  176. "type": "string"
  177. },
  178. "date": {
  179. "type": "string"
  180. },
  181. "executiveSummary": {
  182. "type": "string"
  183. },
  184. "chapters": {
  185. "type": "array",
  186. "items": {
  187. "type": "object",
  188. "properties": {
  189. "title": {
  190. "type": "string"
  191. },
  192. "sections": {
  193. "type": "array"
  194. },
  195. "keyFindings": {
  196. "type": "array",
  197. "items": {
  198. "type": "string"
  199. }
  200. },
  201. "recommendations": {
  202. "type": "array",
  203. "items": {
  204. "type": "string"
  205. }
  206. }
  207. }
  208. }
  209. },
  210. "fullMarkdown": {
  211. "type": "string",
  212. "description": "完整Markdown文档"
  213. }
  214. }
  215. },
  216. "dataReferences": {
  217. "type": "object",
  218. "description": "数据引用和完整度",
  219. "properties": {
  220. "completeness": {
  221. "type": "number",
  222. "description": "0-100数据完整度"
  223. },
  224. "availableSources": {
  225. "type": "array",
  226. "items": {
  227. "type": "string"
  228. }
  229. },
  230. "missingSources": {
  231. "type": "array",
  232. "items": {
  233. "type": "string"
  234. }
  235. }
  236. }
  237. },
  238. "roiEstimation": {
  239. "type": "array",
  240. "description": "每条建议的ROI估算",
  241. "items": {
  242. "type": "object",
  243. "properties": {
  244. "recommendation": {
  245. "type": "string"
  246. },
  247. "investmentCost": {
  248. "type": "string"
  249. },
  250. "expectedReturn": {
  251. "type": "string"
  252. },
  253. "paybackPeriod": {
  254. "type": "string"
  255. },
  256. "priority": {
  257. "type": "string",
  258. "enum": [
  259. "high",
  260. "medium",
  261. "low"
  262. ]
  263. }
  264. }
  265. }
  266. },
  267. "riskAlerts": {
  268. "type": "array",
  269. "description": "整合风险预警+缓解策略",
  270. "items": {
  271. "type": "object",
  272. "properties": {
  273. "title": {
  274. "type": "string"
  275. },
  276. "level": {
  277. "type": "string",
  278. "enum": [
  279. "high",
  280. "medium",
  281. "low"
  282. ]
  283. },
  284. "description": {
  285. "type": "string"
  286. },
  287. "mitigation": {
  288. "type": "string"
  289. }
  290. }
  291. }
  292. },
  293. "actionTimeline": {
  294. "type": "object",
  295. "description": "30天行动时间线",
  296. "properties": {
  297. "weeks": {
  298. "type": "array",
  299. "items": {
  300. "type": "object",
  301. "properties": {
  302. "week": {
  303. "type": "integer"
  304. },
  305. "tasks": {
  306. "type": "array",
  307. "items": {
  308. "type": "string"
  309. }
  310. }
  311. }
  312. }
  313. },
  314. "milestones": {
  315. "type": "array",
  316. "items": {
  317. "type": "object",
  318. "properties": {
  319. "day": {
  320. "type": "integer"
  321. },
  322. "target": {
  323. "type": "string"
  324. }
  325. }
  326. }
  327. }
  328. }
  329. }
  330. }
  331. },
  332. "timeout": 300000,
  333. "retry": {
  334. "maxAttempts": 2,
  335. "delay": 3000,
  336. "backoffMultiplier": 2
  337. },
  338. "tokenConfig": {
  339. "type": "bearer",
  340. "configFile": "~/.openclaw/voc-credentials.json",
  341. "tokenField": "vocToken",
  342. "resolutionOrder": [
  343. "configFile"
  344. ],
  345. "apigId": "7HwdQZk55B",
  346. "paymentUrlResolution": {
  347. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  348. "steps": [
  349. "1. 从 voc-credentials.json 获取当前 session token",
  350. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  351. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=7HwdQZk55B&fun_id=HOkkX72PMF",
  352. "4. 将该URL展示给用户,引导扫码支付"
  353. ],
  354. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  355. "userResolveHeaders": {
  356. "X-Parse-Application-Id": "ncloudmaster",
  357. "X-Parse-Session-Token": "{vocToken}"
  358. },
  359. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  360. "paymentParams": {
  361. "user": "{resolvedUserId}",
  362. "apigid": "7HwdQZk55B",
  363. "fun_id": "HOkkX72PMF"
  364. },
  365. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  366. },
  367. "onMissing": {
  368. "action": "showPaymentQR",
  369. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=7HwdQZk55B&fun_id=HOkkX72PMF",
  370. "title": "扫码开通 VOC-AI 数据服务",
  371. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  372. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  373. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  374. },
  375. "onBalanceInsufficient": {
  376. "action": "resolveUserThenShowPayment",
  377. "title": "VOC-AI Token 余额不足,请扫码充值",
  378. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  379. }
  380. },
  381. "errorHandling": {
  382. "balanceInsufficient": {
  383. "conditions": [
  384. {
  385. "responseField": "code",
  386. "operator": "in",
  387. "value": [
  388. -2,
  389. -3,
  390. -10,
  391. 402,
  392. 429
  393. ]
  394. },
  395. {
  396. "responseField": "msg",
  397. "operator": "contains",
  398. "value": [
  399. "余额不足",
  400. "insufficient",
  401. "balance",
  402. "quota",
  403. "没有开通",
  404. "权限或余额"
  405. ]
  406. },
  407. {
  408. "responseField": "mess",
  409. "operator": "contains",
  410. "value": [
  411. "余额不足",
  412. "insufficient",
  413. "balance",
  414. "quota",
  415. "没有开通",
  416. "权限或余额"
  417. ]
  418. },
  419. {
  420. "responseField": "message",
  421. "operator": "contains",
  422. "value": [
  423. "余额不足",
  424. "insufficient",
  425. "balance",
  426. "没有开通",
  427. "权限或余额"
  428. ]
  429. }
  430. ],
  431. "matchMode": "any",
  432. "trigger": "tokenConfig.onBalanceInsufficient"
  433. },
  434. "unauthorized": {
  435. "conditions": [
  436. {
  437. "responseField": "code",
  438. "operator": "in",
  439. "value": [
  440. 401,
  441. 403
  442. ]
  443. },
  444. {
  445. "responseField": "msg",
  446. "operator": "contains",
  447. "value": [
  448. "unauthorized",
  449. "token",
  450. "invalid",
  451. "auth"
  452. ]
  453. }
  454. ],
  455. "matchMode": "any",
  456. "trigger": "tokenConfig.onMissing"
  457. }
  458. }
  459. }