| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 |
- {
- "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"
- }
- }
- }
|