{ "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": "SorftimeApiService.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": "SorftimeApiService.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", "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7", "resolutionOrder": [ "configFile", "currentToken" ], "apigId": "Vo3ROWEvDy", "paymentUrlResolution": { "description": "动态构建充值URL:通过当前token查出用户objectId,拼接到充值页面", "steps": [ "1. 从 voc-credentials.json 或 currentToken 获取当前 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://pwa.fmode.cn/apig-pay.html?user={objectId}&apigid=Vo3ROWEvDy&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://pwa.fmode.cn/apig-pay.html", "paymentParams": { "user": "{resolvedUserId}", "apigid": "Vo3ROWEvDy", "fun_id": "HOkkX72PMF" }, "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig" }, "onMissing": { "action": "resolveUserThenShowPayment", "title": "扫码开通 VOC-AI 数据服务", "message": "此 Skill 需要有效的 API Token。请按以下步骤操作:\n1. 如果你已有 Token,请告诉我,我会保存到 ~/.openclaw/voc-credentials.json\n2. 如果没有 Token,我会引导你扫码充值开通" }, "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": "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" } } }