| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483 |
- {
- "name": "brand-profile",
- "displayName": "品牌六维画像",
- "description": "生成品牌六维量化画像,标注机会/风险标签、识别核心短板、输出竞争定位建议和《品牌认知校准卡》",
- "category": "synthesis",
- "version": "1.3.0",
- "type": "orchestration",
- "parameters": {
- "brandName": {
- "type": "string",
- "required": true,
- "description": "品牌名称"
- },
- "brandAsins": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "required": true,
- "description": "品牌核心ASIN列表"
- },
- "categoryKeyword": {
- "type": "string",
- "required": true,
- "description": "品类关键词(用于品类基准对比)"
- },
- "categoryLandscape": {
- "type": "object",
- "required": false,
- "description": "category-landscape 输出(如有则跳过重复查询)"
- },
- "domain": {
- "type": "integer",
- "required": false,
- "default": 1,
- "description": "Amazon站点(1=美国)"
- }
- },
- "pipeline": [
- {
- "step": 1,
- "name": "批量获取品牌产品详情",
- "forEach": "brandAsins",
- "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": "productDetails",
- "responseExtract": "{ Title, Brand, SalesPrice, Ratings, RatingsCount, BSR, Category, MonthlySales, fiveStartRatings, fourStartRatings, threeStartRatings, twoStartRatings, oneStartRatings }"
- },
- {
- "step": 2,
- "name": "批量获取销量数据",
- "forEach": "brandAsins",
- "api": {
- "service": "SorftimeApiService.getAsinSalesVolume",
- "endpoint": "/api/AsinSalesVolume",
- "method": "POST",
- "requestBody": {
- "ASIN": "${asin}"
- },
- "queryParams": {
- "domain": "${domain}"
- }
- },
- "output": "salesData"
- },
- {
- "step": 3,
- "name": "采样获取评论概况",
- "forEach": "brandAsins",
- "api": {
- "service": "SorftimeApiService.getProductReviews",
- "endpoint": "/api/ProductReviewsQuery",
- "method": "POST",
- "forwardUrl": "https://server.fmode.cn/api/voc-ecom/forward",
- "headers": {
- "Authorization": "Bearer {{vocToken}}"
- },
- "requestBody": {
- "ASIN": "${asin}",
- "PageIndex": "1"
- },
- "queryParams": {
- "domain": "${domain}"
- }
- },
- "output": "reviewSamples"
- },
- {
- "step": 4,
- "name": "获取品类基准数据(如未传入categoryLandscape)",
- "condition": "!categoryLandscape",
- "api": {
- "service": "SorftimeApiService.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": "categoryBaseline"
- },
- {
- "step": 5,
- "name": "六维评分计算",
- "type": "compute",
- "logic": "calcSixDimensions(productDetails, salesData, reviewSamples, categoryBaseline || categoryLandscape)",
- "algorithm": {
- "pricing": {
- "weight": 0.2,
- "method": "品牌均价 vs 品类中位价的偏离度"
- },
- "rating": {
- "weight": 0.2,
- "method": "平均评分 + 差评率(1-2星占比)"
- },
- "traffic": {
- "weight": 0.15,
- "method": "BSR中位数在品类中的百分位"
- },
- "salesEfficiency": {
- "weight": 0.15,
- "method": "品牌月销量 vs 品类均值"
- },
- "growthPotential": {
- "weight": 0.15,
- "method": "新品比例 + 销量趋势 + 品类CR5位置"
- },
- "vocReputation": {
- "weight": 0.15,
- "method": "好评率 + 评论增速 + Helpful比例"
- }
- },
- "output": "dimensions"
- },
- {
- "step": 6,
- "name": "竞争定位+标签+建议",
- "type": "compute",
- "logic": "generatePositioning(dimensions, productDetails, brandName)",
- "algorithm": {
- "quadrant": "四象限图坐标(价格-评分)",
- "opportunityTags": "从每个维度评分提取优势机会",
- "riskTags": "识别低分维度作为风险点",
- "coreShortcoming": "最低分维度的具体诊断和改进建议",
- "priorityActions": "按紧迫度排序的改进任务"
- },
- "output": "positioning"
- }
- ],
- "response": {
- "type": "object",
- "properties": {
- "brandName": {
- "type": "string"
- },
- "dimensions": {
- "type": "object",
- "description": "六维评分",
- "properties": {
- "pricing": {
- "type": "object",
- "properties": {
- "score": {
- "type": "integer"
- },
- "label": {
- "type": "string"
- },
- "detail": {
- "type": "string"
- }
- }
- },
- "rating": {
- "type": "object",
- "properties": {
- "score": {
- "type": "integer"
- },
- "label": {
- "type": "string"
- },
- "detail": {
- "type": "string"
- }
- }
- },
- "traffic": {
- "type": "object",
- "properties": {
- "score": {
- "type": "integer"
- },
- "label": {
- "type": "string"
- },
- "detail": {
- "type": "string"
- }
- }
- },
- "salesEfficiency": {
- "type": "object",
- "properties": {
- "score": {
- "type": "integer"
- },
- "label": {
- "type": "string"
- },
- "detail": {
- "type": "string"
- }
- }
- },
- "growthPotential": {
- "type": "object",
- "properties": {
- "score": {
- "type": "integer"
- },
- "label": {
- "type": "string"
- },
- "detail": {
- "type": "string"
- }
- }
- },
- "vocReputation": {
- "type": "object",
- "properties": {
- "score": {
- "type": "integer"
- },
- "label": {
- "type": "string"
- },
- "detail": {
- "type": "string"
- }
- }
- }
- }
- },
- "overallScore": {
- "type": "number"
- },
- "positioning": {
- "type": "object",
- "properties": {
- "quadrant": {
- "type": "string"
- },
- "x": {
- "type": "number"
- },
- "y": {
- "type": "number"
- },
- "xLabel": {
- "type": "string"
- },
- "yLabel": {
- "type": "string"
- }
- }
- },
- "strengths": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "weaknesses": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "opportunityTags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "riskTags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "coreShortcoming": {
- "type": "object",
- "properties": {
- "dimension": {
- "type": "string"
- },
- "score": {
- "type": "integer"
- },
- "diagnosis": {
- "type": "string"
- },
- "advice": {
- "type": "string"
- }
- }
- },
- "priorityActions": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "action": {
- "type": "string"
- },
- "priority": {
- "type": "integer"
- }
- }
- }
- },
- "calibrationCard": {
- "type": "string",
- "description": "品牌认知校准卡(Markdown格式)"
- }
- }
- },
- "timeout": 300000,
- "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"
- }
- }
- }
|