{ "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"], "onMissing": { "action": "showPaymentQR", "qrCodeUrl": "https://payment.brainhack.cn/apig-pay.html?authid=T0iOotHcDX", "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig", "pollingIntervalMs": 3000, "pollingTimeoutMs": 300000, "onPaymentSuccess": "retrySkillWithNewToken", "title": "扫码开通 VOC-AI 数据服务", "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。" }, "onBalanceInsufficient": { "action": "showPaymentQR", "qrCodeUrl": "https://payment.brainhack.cn/apig-pay.html?authid=T0iOotHcDX", "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig", "pollingIntervalMs": 3000, "pollingTimeoutMs": 300000, "onPaymentSuccess": "retrySkillWithNewToken", "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" } } }