| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- #!/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: 'local-dining',
- 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
- };
|