| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425 |
- {
- "name": "competitor-discovery",
- "displayName": "竞品发现与筛选",
- "description": "根据品类关键词和自身品牌信息,自动发现并筛选直接竞品",
- "category": "competitor-analysis",
- "version": "1.3.0",
- "type": "orchestration",
- "parameters": {
- "categoryKeyword": {
- "type": "string",
- "required": true,
- "description": "品类核心关键词"
- },
- "ownBrand": {
- "type": "string",
- "required": true,
- "description": "自身品牌名称"
- },
- "ownAsins": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "required": false,
- "description": "自身品牌核心ASIN列表"
- },
- "competitorCount": {
- "type": "integer",
- "required": false,
- "default": 5,
- "description": "需要筛选的竞品数量"
- },
- "domain": {
- "type": "integer",
- "required": false,
- "default": 1,
- "description": "Amazon站点(1=美国)"
- },
- "priceRange": {
- "type": "object",
- "required": false,
- "properties": {
- "min": {
- "type": "number"
- },
- "max": {
- "type": "number"
- }
- },
- "description": "价格带过滤范围,不传则自动按自身价格±30%"
- }
- },
- "pipeline": [
- {
- "step": 1,
- "name": "搜索品类产品",
- "api": {
- "service": "EcomDataService.searchProductsByQuery",
- "endpoint": "/api/ProductQuery",
- "method": "POST",
- "forwardUrl": "https://server.fmode.cn/api/voc-ecom/forward",
- "headers": {
- "Authorization": "Bearer {{vocToken}}"
- },
- "requestBody": {
- "Page": 1,
- "Query": "1",
- "QueryType": "7",
- "Pattern": "${categoryKeyword}"
- },
- "queryParams": {
- "domain": "${domain}"
- }
- },
- "output": "searchResults",
- "responseExtract": "extractProductList(resp) → Array<{ Asin, Title, Price, Rating, RatingsCount, MonthlySales, Brand, BSR, Photo }>"
- },
- {
- "step": 2,
- "name": "查找相似产品",
- "condition": "ownAsins.length > 0",
- "api": {
- "service": "EcomDataService.getSimilarProducts",
- "endpoint": "/api/SimilarProductRealtimeRequest",
- "method": "POST",
- "requestBody": {
- "ASIN": "${ownAsins[0]}"
- },
- "queryParams": {
- "domain": "${domain}"
- },
- "note": "异步任务:需后续调用 /api/SimilarProductRealtimeRequestStatusQuery 和 /api/SimilarProductRealtimeRequestCollection"
- },
- "output": "similarResults"
- },
- {
- "step": 3,
- "name": "关键词排名产品",
- "api": {
- "service": "EcomDataService.getKeywordProductRanking",
- "endpoint": "/api/KeywordProductRanking",
- "method": "POST",
- "requestBody": {
- "keyword": "${categoryKeyword}"
- },
- "queryParams": {
- "domain": "${domain}"
- }
- },
- "output": "rankingResults",
- "responseExtract": "Array<{ Asin, Title, Rank, Price, Rating, RatingsCount, IsSponsored }>"
- },
- {
- "step": 4,
- "name": "合并去重+竞品评分筛选",
- "type": "compute",
- "logic": "mergeAndScore(searchResults, similarResults, rankingResults, { ownBrand, priceRange, competitorCount })",
- "algorithm": {
- "merge": "按ASIN去重合并三个来源的产品",
- "exclude": "排除ownBrand的产品",
- "filter": "价格在ownPrice±30%范围内 && 评分>=3.5 && 同品类",
- "score": "matchScore = priceProximity*0.3 + ratingProximity*0.2 + salesProximity*0.2 + rankInKeyword*0.15 + isSimilar*0.15",
- "sort": "按matchScore降序,取top competitorCount个",
- "brandGrouping": "按Brand字段分组,统计每个品牌的SKU数和总销量,用于排除自有品牌和识别竞品品牌"
- },
- "output": "filteredCompetitors"
- },
- {
- "step": 5,
- "name": "批量获取竞品详情",
- "forEach": "filteredCompetitors",
- "api": {
- "service": "EcomDataService.getProductDetail",
- "endpoint": "/api/ProductRequest",
- "method": "POST",
- "requestBody": {
- "ASIN": "${competitor.asin}",
- "Trend": 1,
- "QueryTrendStartDt": "",
- "QueryTrendEndDt": ""
- },
- "queryParams": {
- "domain": "${domain}"
- }
- },
- "output": "competitorDetails",
- "responseExtract": "{ Title, Brand, SalesPrice, Ratings, RatingsCount, BSR, Category, Photo, Feature, Description, VariationASIN, MonthlySales }"
- },
- {
- "step": 6,
- "name": "竞争格局分析",
- "type": "compute",
- "logic": "analyzeCompetitiveLandscape(filteredCompetitors, competitorDetails)",
- "algorithm": {
- "cr5": {
- "method": "按品牌汇总销量 → top5品牌销量占比 = top5Sales/totalSales*100",
- "fallback": "品牌数据不足时默认CR5=30(中等)"
- },
- "monopolyLevel": {
- "low": "CR5<30 → '垄断度低,新卖家突围机会充足'",
- "medium": "CR5 30-60 → '中等垄断,需差异化策略'",
- "high": "CR5>60 → '垄断严重,不建议正面硬刚'"
- },
- "brandComparison": {
- "method": "按Brand分组 → 统计skus/totalSales/totalPrice/totalRating → 取top5品牌",
- "output": "Array<{ brand, skus, avgSales, avgPrice, avgRating }>"
- },
- "differentiationAdvice": {
- "highMonopoly": "切入细分人群赛道,避开头部正面竞争",
- "lowMonopoly": "新品有充足突围空间",
- "always": "打造独家设计款,注册外观专利,构建长期溢价能力"
- },
- "attackStrategy": "针对TOP竞品的核心差评痛点打造本店独家卖点; 在Listing/主图中做直接对标,抢夺竞品精准用户"
- },
- "output": "competitiveLandscape"
- }
- ],
- "response": {
- "type": "object",
- "properties": {
- "competitors": {
- "type": "array",
- "description": "筛选出的直接竞品列表",
- "items": {
- "type": "object",
- "properties": {
- "asin": {
- "type": "string"
- },
- "title": {
- "type": "string"
- },
- "brand": {
- "type": "string"
- },
- "price": {
- "type": "number"
- },
- "rating": {
- "type": "number"
- },
- "ratingsCount": {
- "type": "integer"
- },
- "monthlySales": {
- "type": "integer"
- },
- "bsr": {
- "type": "integer"
- },
- "category": {
- "type": "string"
- },
- "matchScore": {
- "type": "number"
- },
- "matchReasons": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- }
- },
- "searchMeta": {
- "type": "object",
- "properties": {
- "totalCandidates": {
- "type": "integer"
- },
- "filteredCount": {
- "type": "integer"
- },
- "filterCriteria": {
- "type": "object"
- }
- }
- },
- "competitiveLandscape": {
- "type": "object",
- "description": "竞争格局分析(来自computeCompetition算法)",
- "properties": {
- "cr5": {
- "type": "number",
- "description": "Top5品牌销量集中度(0-100)"
- },
- "monopolyLevel": {
- "type": "string",
- "enum": [
- "low",
- "medium",
- "high"
- ]
- },
- "monopolyLabel": {
- "type": "string"
- },
- "brandComparison": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "brand": {
- "type": "string"
- },
- "skus": {
- "type": "integer"
- },
- "avgSales": {
- "type": "integer"
- },
- "avgPrice": {
- "type": "number"
- },
- "avgRating": {
- "type": "number"
- }
- }
- }
- },
- "differentiationAdvice": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "attackStrategy": {
- "type": "array",
- "items": {
- "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"
- }
- }
- }
|