| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398 |
- {
- "name": "competitor-bsr-tracking",
- "displayName": "竞品BSR排名追踪",
- "description": "追踪竞品BSR/销量/价格变化趋势,生成增长路径分析和风险预警汇总",
- "category": "competitor-analysis",
- "version": "1.3.0",
- "type": "orchestration",
- "parameters": {
- "competitorAsins": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "required": true,
- "description": "竞品ASIN列表"
- },
- "domain": {
- "type": "integer",
- "required": false,
- "default": 1,
- "description": "Amazon站点(1=美国)"
- }
- },
- "pipeline": [
- {
- "step": 1,
- "name": "批量获取竞品监控数据",
- "forEach": "competitorAsins",
- "api": {
- "service": "EcomDataService.getMonitorData",
- "endpoint": "/api/MonitorQuery",
- "method": "POST",
- "forwardUrl": "https://server.fmode.cn/api/voc-ecom/forward",
- "headers": {
- "Authorization": "Bearer {{vocToken}}"
- },
- "requestBody": {
- "ASIN": "${asin}"
- },
- "queryParams": {
- "domain": "${domain}"
- }
- },
- "output": "monitorData",
- "responseExtract": "{ PriceHistory, RankHistory, RatingHistory, ReviewCountHistory, SellerCount }"
- },
- {
- "step": 2,
- "name": "批量获取竞品当前状态",
- "forEach": "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": "competitorDetails",
- "responseExtract": "{ Title, Brand, SalesPrice, Ratings, RatingsCount, BSR, MonthlySales, Category }"
- },
- {
- "step": 3,
- "name": "BSR/销量/价格趋势分析",
- "type": "compute",
- "logic": "analyzeTrends(monitorData, competitorDetails)",
- "algorithm": {
- "bsrTrend": "近7/14/30天BSR变化方向和幅度百分比",
- "salesTrend": "日销量/月销量趋势,环比增减百分比",
- "priceChange": "价格调整记录,是否在做促销",
- "ratingChange": "评分和评论数的变化趋势",
- "alerts": "识别异常变化: BSR大幅下降=销量暴涨, 突然降价=促销战"
- },
- "output": "tracking"
- },
- {
- "step": 4,
- "name": "增长路径分析",
- "type": "compute",
- "logic": "analyzeGrowthPath(tracking, competitorDetails)",
- "algorithm": {
- "tierClassification": "头部(Top10%)/腰部(10-40%)/尾部(40%+)",
- "dailySalesGap": "距上一层级门槛还差多少日销",
- "skuAdvice": "聚焦核心SKU打爆款建议",
- "keywordAdvice": "主攻长尾词提升排名建议"
- },
- "output": "growthPath"
- },
- {
- "step": 5,
- "name": "风险预警汇总",
- "type": "compute",
- "logic": "generateRiskAlerts(tracking, competitorDetails)",
- "algorithm": {
- "bsrRisk": "BSR连续下降检测",
- "ratingRisk": "评分下滑检测",
- "priceWarRisk": "价格战风险检测",
- "inventoryRisk": "库存风险推断",
- "complianceRisk": "合规风险检测"
- },
- "output": "riskAlerts"
- }
- ],
- "response": {
- "type": "object",
- "properties": {
- "tracking": {
- "type": "array",
- "description": "竞品追踪数据列表",
- "items": {
- "type": "object",
- "properties": {
- "asin": {
- "type": "string"
- },
- "brand": {
- "type": "string"
- },
- "currentBsr": {
- "type": "integer"
- },
- "bsrTrend": {
- "type": "object",
- "properties": {
- "7d": {
- "type": "number"
- },
- "14d": {
- "type": "number"
- },
- "30d": {
- "type": "number"
- }
- }
- },
- "salesTrend": {
- "type": "object",
- "properties": {
- "7d": {
- "type": "number"
- },
- "14d": {
- "type": "number"
- },
- "30d": {
- "type": "number"
- }
- }
- },
- "priceChange": {
- "type": "object",
- "properties": {
- "current": {
- "type": "number"
- },
- "previous": {
- "type": "number"
- },
- "changePercent": {
- "type": "number"
- }
- }
- },
- "ratingChange": {
- "type": "object",
- "properties": {
- "current": {
- "type": "number"
- },
- "previous": {
- "type": "number"
- },
- "newReviews": {
- "type": "integer"
- }
- }
- },
- "alerts": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "type": {
- "type": "string"
- },
- "severity": {
- "type": "string"
- },
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- },
- "summary": {
- "type": "object",
- "properties": {
- "mostActive": {
- "type": "string"
- },
- "biggestThreat": {
- "type": "string"
- },
- "opportunityWindow": {
- "type": "string"
- }
- }
- },
- "growthPath": {
- "type": "object",
- "properties": {
- "currentTier": {
- "type": "string"
- },
- "nextTierThreshold": {
- "type": "object",
- "properties": {
- "dailySales": {
- "type": "integer"
- },
- "gap": {
- "type": "integer"
- }
- }
- },
- "skuAdvice": {
- "type": "string"
- },
- "keywordAdvice": {
- "type": "string"
- }
- }
- },
- "riskAlerts": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "level": {
- "type": "string",
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "title": {
- "type": "string"
- },
- "description": {
- "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 <session-token> 写入 ~/.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 <session-token> 写入 ~/.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"
- }
- }
- }
|