{ "name": "competitor-product-comparison", "displayName": "竞品产品对比", "description": "对自身产品与竞品进行多维度横向对比,生成5维健康度仪表盘并标注机会/风险标签", "category": "competitor-analysis", "version": "1.3.0", "type": "orchestration", "parameters": { "ownAsins": { "type": "array", "items": { "type": "string" }, "required": true, "description": "自身品牌ASIN列表" }, "competitorAsins": { "type": "array", "items": { "type": "string" }, "required": true, "description": "竞品ASIN列表(来自 competitor-discovery 输出)" }, "domain": { "type": "integer", "required": false, "default": 1, "description": "Amazon站点(1=美国)" }, "dimensions": { "type": "array", "items": { "type": "string" }, "required": false, "description": "对比维度,默认全部" } }, "pipeline": [ { "step": 1, "name": "批量获取所有ASIN产品详情", "forEach": "ownAsins + competitorAsins", "api": { "service": "EcomDataService.getProductDetail", "endpoint": "/api/ProductRequest", "method": "POST", "forwardUrl": "https://server.fmode.cn/api/voc-ecom/forward", "headers": { "Authorization": "Bearer {{vocToken}}" }, "requestBody": { "ASIN": "${asin}", "Trend": 1, "QueryTrendStartDt": "", "QueryTrendEndDt": "" }, "queryParams": { "domain": "${domain}" } }, "output": "allProductDetails", "responseExtract": "{ Title, Brand, SalesPrice, Ratings, RatingsCount, BSR, Category, Photo, Feature, Description, VariationASIN, MonthlySales }" }, { "step": 2, "name": "批量获取销量数据", "forEach": "ownAsins + competitorAsins", "api": { "service": "EcomDataService.getAsinSalesVolume", "endpoint": "/api/AsinSalesVolume", "method": "POST", "requestBody": { "ASIN": "${asin}" }, "queryParams": { "domain": "${domain}" } }, "output": "salesData" }, { "step": 3, "name": "多维度对比矩阵计算", "type": "compute", "logic": "buildComparisonMatrix(allProductDetails, salesData, ownAsins)", "algorithm": { "dimensions": { "price": "售价、历史价格趋势、折扣力度", "rating": "平均分、评论数、星级分布(1-5星占比)", "sales": "月销量、日销量趋势、BSR排名", "product": "标题关键词、卖点Feature、图片数量、A+页面", "brand": "品牌店铺、FBA/FBM、发货地", "variant": "变体数量、尺寸/颜色选项" }, "scoring": "各维度竞争力得分(0-100)" }, "output": "comparisonMatrix" }, { "step": 4, "name": "5维健康度评估", "type": "compute", "logic": "calcHealthDashboard(comparisonMatrix, ownAsins)", "algorithm": { "weights": { "pricingCompetitiveness": 0.2, "ratingHealth": 0.25, "trafficRank": 0.2, "salesEfficiency": 0.15, "growthPotential": 0.2 }, "tags": "每个产品生成机会标签 + 风险标签", "coreShortcoming": "识别最低分维度作为核心短板" }, "output": "healthDashboard" } ], "response": { "type": "object", "properties": { "comparisonMatrix": { "type": "array", "description": "对比矩阵", "items": { "type": "object", "properties": { "asin": { "type": "string" }, "brand": { "type": "string" }, "isOwn": { "type": "boolean" }, "metrics": { "type": "object", "properties": { "price": { "type": "object", "properties": { "value": { "type": "number" }, "score": { "type": "integer" } } }, "rating": { "type": "object", "properties": { "value": { "type": "number" }, "score": { "type": "integer" } } }, "monthlySales": { "type": "object", "properties": { "value": { "type": "integer" }, "score": { "type": "integer" } } }, "reviewCount": { "type": "object", "properties": { "value": { "type": "integer" }, "score": { "type": "integer" } } }, "bsr": { "type": "object", "properties": { "value": { "type": "integer" }, "score": { "type": "integer" } } }, "featureCount": { "type": "object", "properties": { "value": { "type": "integer" }, "score": { "type": "integer" } } }, "variantCount": { "type": "object", "properties": { "value": { "type": "integer" }, "score": { "type": "integer" } } } } }, "overallScore": { "type": "number" } } } }, "advantages": { "type": "array", "items": { "type": "string" } }, "gaps": { "type": "array", "items": { "type": "string" } }, "recommendation": { "type": "string" }, "healthDashboard": { "type": "object", "description": "5维健康度仪表盘,key为ASIN", "additionalProperties": { "type": "object", "properties": { "overallScore": { "type": "number" }, "dimensions": { "type": "object", "properties": { "pricingCompetitiveness": { "type": "integer" }, "ratingHealth": { "type": "integer" }, "trafficRank": { "type": "integer" }, "salesEfficiency": { "type": "integer" }, "growthPotential": { "type": "integer" } } }, "opportunityTags": { "type": "array", "items": { "type": "string" } }, "riskTags": { "type": "array", "items": { "type": "string" } }, "coreShortcoming": { "type": "string" } } } } } }, "timeout": 120000, "retry": { "maxAttempts": 2, "delay": 2000, "backoffMultiplier": 2 }, "tokenConfig": { "type": "bearer", "configFile": "~/.openclaw/voc-credentials.json", "tokenField": "vocToken", "resolutionOrder": [ "configFile" ], "apigId": "7HwdQZk55B", "paymentUrlResolution": { "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面", "steps": [ "1. 从 voc-credentials.json 获取当前 session token", "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId", "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=7HwdQZk55B&fun_id=HOkkX72PMF", "4. 将该URL展示给用户,引导扫码支付" ], "userResolveEndpoint": "https://server.fmode.cn/parse/users/me", "userResolveHeaders": { "X-Parse-Application-Id": "ncloudmaster", "X-Parse-Session-Token": "{vocToken}" }, "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/", "paymentParams": { "user": "{resolvedUserId}", "apigid": "7HwdQZk55B", "fun_id": "HOkkX72PMF" }, "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig" }, "onMissing": { "action": "showPaymentQR", "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=7HwdQZk55B&fun_id=HOkkX72PMF", "title": "扫码开通 VOC-AI 数据服务", "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。", "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}", "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。" }, "onBalanceInsufficient": { "action": "resolveUserThenShowPayment", "title": "VOC-AI Token 余额不足,请扫码充值", "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。" } }, "errorHandling": { "balanceInsufficient": { "conditions": [ { "responseField": "code", "operator": "in", "value": [ -2, -3, -10, 402, 429 ] }, { "responseField": "msg", "operator": "contains", "value": [ "余额不足", "insufficient", "balance", "quota", "没有开通", "权限或余额" ] }, { "responseField": "mess", "operator": "contains", "value": [ "余额不足", "insufficient", "balance", "quota", "没有开通", "权限或余额" ] }, { "responseField": "message", "operator": "contains", "value": [ "余额不足", "insufficient", "balance", "没有开通", "权限或余额" ] } ], "matchMode": "any", "trigger": "tokenConfig.onBalanceInsufficient" }, "unauthorized": { "conditions": [ { "responseField": "code", "operator": "in", "value": [ 401, 403 ] }, { "responseField": "msg", "operator": "contains", "value": [ "unauthorized", "token", "invalid", "auth" ] } ], "matchMode": "any", "trigger": "tokenConfig.onMissing" } } }