--- name: brand-context-builder description: VOC工作坊建档技能,支持两种模式:品牌研究模式(采集品牌信息)和产品分析模式(采集产品列表+分析维度)。验证输入格式,生成并持久化上下文文件,供后续所有分析技能引用。 version: 2.0.0 author: nkkj-BrainHack --- # 品牌/产品上下文建档 (Brand & Product Context Builder) ## 技能名称 brand-context-builder ## 技能目的 作为 VOC 工作坊的**第一个环节**,通过结构化对话采集客户信息。支持两种模式: - **品牌研究模式 (brand-research)**:采集品牌核心信息,驱动完整5阶段工作坊 - **产品分析模式 (product-analysis)**:采集具体产品列表+分析维度,按产品生成VOC报告 后续所有分析技能从记忆文件读取上下文,避免重复询问。 ## 核心业务场景 - **工作坊开场建档**:新客户首次启动时,引导式采集信息 - **产品级VOC分析**:客户提供具体产品(Amazon/天猫链接),按产品跑分析 - **增量补充**:已有建档但进入新阶段需要补充信息 - **多客户管理**:为不同客户维护独立的上下文 ## 输入参数 ### 通用参数 | 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | analysisMode | string | 否 | `"brand-research"`(品牌模式) / `"product-analysis"`(产品模式) / `"auto"`(自动识别,默认) | | mode | string | 否 | `"full"`(完整建档,默认) / `"update"`(增量更新) | ### 品牌研究模式参数 | 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | brandName | string | 条件 | 品牌英文名,brand-research模式必填 | | categoryKeywords | string[] | 条件 | 品类核心关键词,brand-research模式必填,至少1个 | | amazonDomain | integer | 否 | Amazon站点 1=US 2=UK 3=DE 4=JP,默认1 | | brandAsins | string[] | 条件 | 品牌代表ASIN,brand-research模式必填,3-5个 | | knownCompetitors | string[] | 否 | 已知竞品品牌名 | | competitorAsins | string[] | 否 | 已知竞品ASIN | | tiktokKeywords | string[] | 否 | TikTok搜索关键词(Session 4 补充) | | douyinKeywords | string[] | 否 | 抖音搜索关键词(Session 4 补充) | | workshopGoal | string | 条件 | 分析目标,brand-research模式必填 | ### 产品分析模式参数 | 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | products | array | 条件 | 产品列表,product-analysis模式必填 | | products[].input | string | ✅ | 用户原始输入(URL/ASIN/产品名) | | products[].platform | string | 否 | 自动识别: `"amazon"` / `"tmall"` / `"taobao"` / `"name"` | | selectedDimensions | string[] | 否 | 选中的分析维度编号,默认["3"](评论VOC) | | vocSubDimensions | string[] | 否 | VOC子维度,默认全部 | ## 验证规则 ### ASIN 格式验证 - 必须以 `B0` 开头 - 长度为 10 个字符 - 仅含大写字母和数字 - 验证失败时提示:`"ASIN格式不正确,应为B0开头的10位字母数字组合,如 B0CJ5K1234"` ### 关键词验证 - 非空字符串 - 建议为英文(Amazon站点对应语言) - 去除首尾空格 ### 站点验证 - 必须是 1/2/3/4 之一 - 自动映射标签:1→"amazon.com" 2→"amazon.co.uk" 3→"amazon.de" 4→"amazon.co.jp" ## 执行流程 ### 品牌研究模式 (brand-research) — Full 建档 1. 检查是否已有 `brand-context.json`,如有则提示"已有建档,是否覆盖?" 2. 按顺序采集 7 个字段(分步对话,不要一次性要求全部) 3. 每个字段采集后立即验证 4. 验证失败则友好提示并要求重新输入 5. 全部采集完成后生成摘要请用户确认 6. 用户确认后写入 `memory/brand-context.json` 7. 设置 `memory/analysis-request.json` → `mode: "brand-research"`, 所有维度开启 8. 初始化 `memory/workshop-progress.json` 9. 初始化 `memory/calibration-notes.json` ### 产品分析模式 (product-analysis) 1. 接收用户提供的产品列表(URL/ASIN/产品名混合输入) 2. 逐个解析产品: - **Amazon URL/ASIN**:提取ASIN,调用 `product-detail-query` 获取标题和品类 - **天猫/淘宝 URL**:提取产品中文名,Agent翻译为英文关键词,调用 `product-search` 搜索Amazon对标产品,请用户确认选择 - **纯产品名**:同天猫逻辑 3. 自动按品类分组(相似产品归入同一组) 4. 展示产品清单+分组,请用户确认 5. 引导用户选择分析维度(1-6选择,默认推荐3=评论VOC) 6. 如选了维度3,询问VOC子维度偏好(默认全部) 7. 将全部信息写入 `memory/analysis-request.json` 8. 为每个品类组生成对应的 `memory/brand-context.json`(categoryKeywords = 组关键词) 9. 初始化 `memory/workshop-progress.json` ### Update 模式(增量更新) 1. 读取现有 `analysis-request.json` 或 `brand-context.json` 2. 仅更新传入的非空字段 3. 重新验证更新后的完整数据 4. 展示变更差异,请用户确认 5. 写入更新 ### 产品输入自动识别规则 | 输入格式 | 识别规则 | 处理方式 | |---------|---------|---------| | `https://www.amazon.com/dp/B0XXXXXXXX` | URL含 `amazon.com/dp/` | 提取ASIN,直接查询 | | `B0XXXXXXXX` | 正则 `^B0[A-Z0-9]{8}$` | 直接作为ASIN查询 | | `https://detail.tmall.com/item.htm?id=xxx` | URL含 `tmall.com` | 提取产品名→翻译→Amazon搜索桥接 | | `https://item.taobao.com/item.htm?id=xxx` | URL含 `taobao.com` | 同天猫逻辑 | | `https://detail.1688.com/offer/xxx.html` | URL含 `1688.com` | 同天猫逻辑 | | `全身气动按摩床垫` | 中文文本 | 翻译为英文→Amazon搜索桥接 | | `massage gun` | 英文文本 | 直接用于Amazon搜索 | ## 对话引导规范 ### 语气 - 自称"虾"或"AI情报实习生" - 称呼用户"老板" - 专业但亲切,不刻板 ### 分步采集原则 - **每次只问一个问题**,不要一次性列出所有需要的信息 - 收到回答后先确认,再问下一个 - 对可选字段明确告知"可以跳过" - 提供输入示例降低认知门槛 ### 错误处理 - ASIN 格式错误:给出正确格式示例,要求重新输入 - 关键词为空:解释为什么需要,给出品类示例 - 用户说"不知道"竞品:回复"没关系,后面虾会帮你发现竞品" ## 输出格式 ### 品牌研究模式输出 ```json { "success": true, "analysisMode": "brand-research", "brandContext": { "clientId": "自动生成UUID", "brandName": "COCORRINA", "categoryKeywords": ["reed diffuser", "aroma diffuser"], "amazonDomain": 1, "amazonDomainLabel": "amazon.com", "brandAsins": ["B0CJ5KXXXX", "B0DJ6LYYYY"], "knownCompetitors": ["NEST New York"], "competitorAsins": [], "confirmedCompetitors": [], "tiktokKeywords": [], "douyinKeywords": [], "workshopGoal": "想了解品类机会和用户真正在意什么", "createdAt": "2025-06-15T09:00:00Z", "updatedAt": "2025-06-15T09:00:00Z", "completeness": { "brandName": true, "categoryKeywords": true, "amazonDomain": true, "brandAsins": true, "workshopGoal": true } }, "readyForSession1": true, "missingFields": [] } ``` ### 产品分析模式输出 ```json { "success": true, "analysisMode": "product-analysis", "analysisRequest": { "clientId": "自动生成UUID", "clientName": "健衡康复", "mode": "product-analysis", "products": [ { "productId": "p1", "platform": "tmall", "originalName": "全身气动按摩床垫", "bridgedAsin": "B0DRYQTZNM", "bridgedSearchKeyword": "air pressure massage mattress", "title": "RENPHO Air Pressure Massage Mat...", "category": "Massage Equipment", "status": "ready" }, { "productId": "p2", "platform": "amazon", "asin": "B0DRYQTZNM", "title": "...", "category": "Massage Equipment", "status": "ready" } ], "productGroups": [ { "groupId": "g1", "categoryKeyword": "massage mattress", "categoryLabel": "按摩床垫", "productIds": ["p1", "p2"] } ], "selectedDimensions": { "categoryLandscape": false, "competitorComparison": true, "reviewVoc": true, "socialMedia": false, "userPersona": false, "fullReport": true }, "vocSubDimensions": { "voiceClassification": true, "painPointInsight": true, "featureSatisfaction": true, "scenarioDashboard": true } }, "readyForAnalysis": true, "totalProducts": 6, "totalGroups": 3 } ``` ## 与其他技能的关系 ### 品牌研究模式 ``` brand-context-builder (本技能) ↓ 输出 brand-context.json + analysis-request.json(mode=brand-research) ├→ category-landscape (读取 categoryKeywords, amazonDomain) ├→ brand-profile (读取 brandName, brandAsins, categoryKeywords) ├→ competitor-discovery (读取 brandName, brandAsins, knownCompetitors) ├→ review-batch-collection (读取 brandAsins + competitorAsins) ├→ tiktok-category-voc (读取 tiktokKeywords / categoryKeywords) ├→ user-persona (读取 categoryKeywords) ├→ voc-proposal (读取 brandName, categoryKeywords) └→ html-report-generator(读取 brandName) ``` ### 产品分析模式 ``` brand-context-builder (本技能) ↓ 输出 analysis-request.json(mode=product-analysis) + brand-context.json(per group) │ ├→ [per product] product-detail-query (获取产品详情, Amazon产品) ├→ [per tmall] product-search (跨平台桥接搜索, 天猫/淘宝产品) │ ├→ [per group, if dim1] category-landscape (读取 group.categoryKeyword) ├→ [per group, if dim2] competitor-discovery + comparison ├→ [per product, if dim3] review-batch-collection → VOC分析链 │ ├→ review-sentiment-analysis → Prompt 3A → voiceClassification │ ├→ review-pain-point-extraction → Prompt 3B → painPointInsight │ ├→ [Agent合成] Prompt 3C → featureSatisfaction │ └→ [Agent合成] Prompt 3D → scenarioDashboard ├→ [per group, if dim4] tiktok/instagram 社媒技能 ├→ [per group, if dim5] user-persona └→ [if dim6] voc-proposal + html-report-generator ``` ## 对应工作坊环节 阶段零「需求收集+建档」— 工作坊启动后的第一件事,在任何分析开始之前完成。 支持品牌研究和产品分析两种入口。