#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const { runXiaohongshuTrend } = require('../mcp/src/tools/xiaohongshu-trend-run'); const LEAK_TERMS = [ '家装', '全屋定制', '奶油风', '开放格', '厨房橱柜', '衣柜', '小户型' ]; const CASES = [ { name: 'pet-food', profile: { project: '行业趋势情报官', industry: '宠物食品', businessType: '品牌方/电商/门店', targetAudience: ['养宠用户', '第一次养猫养狗的新手'], keywords: ['猫粮', '狗粮', '配料表', '试吃', '复购'], trendQuestions: ['用户最近在意哪些成分和适口性?', '什么话术最容易带来复购?', '哪些风险点会影响下单?'], mustTrackSignals: ['成分', '适口性', '复购', '价格', '口碑'] } }, { name: 'beauty-skincare', profile: { project: '行业趋势情报官', industry: '美妆护肤', businessType: '品牌方/测评账号/门店', targetAudience: ['护肤消费者', '敏感肌用户'], keywords: ['面霜', '防晒', '粉底液', '成分党', '测评'], trendQuestions: ['哪些护肤成分被反复讨论?', '用户最担心哪些翻车点?', '什么测评角度更容易转化?'], mustTrackSignals: ['成分', '肤感', '持妆', '价格', '复购'] } }, { name: 'baby-maternal', profile: { project: '行业趋势情报官', industry: '母婴用品', businessType: '品牌方/门店/内容账号', targetAudience: ['宝妈', '新生儿家庭'], keywords: ['纸尿裤', '辅食', '奶瓶', '婴儿湿巾', '新手妈妈'], trendQuestions: ['家长更在意什么安全和使用细节?', '哪些场景会触发购买?', '什么内容最能降低顾虑?'], mustTrackSignals: ['安全', '舒适', '分龄', '口碑', '售后'] } }, { name: 'education-training', profile: { project: '行业趋势情报官', industry: '教育培训', businessType: '机构/老师/内容账号', targetAudience: ['学生家长', '学习者'], keywords: ['课程', '试听', '提分', '学习方法', '规划'], trendQuestions: ['家长更担心哪些效果问题?', '什么样的课程表达更容易被信任?', '用户最在意的决策阻力是什么?'], mustTrackSignals: ['效果', '师资', '时间', '价格', '退费'] } }, { name: 'fitness', profile: { project: '行业趋势情报官', industry: '运动健身', businessType: '健身房/私教/内容账号', targetAudience: ['健身新手', '想减脂增肌的用户'], keywords: ['私教课', '减脂', '增肌', '体验课', '怎么选'], trendQuestions: ['用户更在意效果还是价格?', '什么体验会影响续课?', '哪些负面点最容易被评论放大?'], mustTrackSignals: ['效果', '教练', '价格', '环境', '续课'] } } ]; async function smokeCrossIndustry({ root = path.resolve(__dirname, '..') } = {}) { const outputRoot = path.join(root, 'outputs', 'claude-code-cross-industry-smoke'); fs.mkdirSync(outputRoot, { recursive: true }); const results = []; for (const item of CASES) { const result = await runXiaohongshuTrend({ collectionMode: 'sample', output: path.join(outputRoot, item.name), cacheAssets: false, ...item.profile }); if (result.status !== 'ok') { throw new Error(`${item.name} sample failed: ${result.status}`); } const body = String(result.assistantMessage || ''); const leakHits = LEAK_TERMS.filter(term => body.includes(term)); if (leakHits.length) { throw new Error(`${item.name} leaked house-specific terms: ${leakHits.join(', ')}`); } results.push({ industry: item.profile.industry, preset: result.summary && result.summary.industryPreset, preview: body.split('\n').slice(0, 5).join('\n') }); } return { status: 'ok', cases: results }; } async function main() { const result = await smokeCrossIndustry(); console.log(JSON.stringify(result, null, 2)); } if (require.main === module) { main().catch(error => { console.error(JSON.stringify({ status: 'error', message: error.message }, null, 2)); process.exit(1); }); } module.exports = { smokeCrossIndustry };