@jerryjiao/knowflow 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,683 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Wiki Enrichment Pass 2 (M2 Enhanced)
4
+ * Samples actual content from raw files → enriches entity & concept pages with real details
5
+ *
6
+ * M2 改进:
7
+ * - 每个主要步骤添加 try-catch 错误处理
8
+ * - console.log 带时间戳的进度日志
9
+ * - 输出格式一致(JSON Schema 思路:结构化结果对象)
10
+ * - 核心逻辑不变,只加健壮性
11
+ */
12
+ import fs from 'node:fs';
13
+ import path from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
15
+
16
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
17
+
18
+ // ── Timestamp logger ──────────────────────────────────
19
+ function log(msg) {
20
+ const ts = new Date().toISOString().replace('T', ' ').slice(0, 19);
21
+ console.log(`[${ts}] ${msg}`);
22
+ }
23
+
24
+ // ── Paths ──────────────────────────────────────────────
25
+ const PROJECT_ROOT = path.resolve(process.env.KNOWFLOW_ROOT || path.join(__dirname, '..'));
26
+ const RAW_DIR = path.join(path.resolve(process.env.KNOWFLOW_RAW_DIR || path.join(PROJECT_ROOT, 'raw')), 'web');
27
+ const WIKI_DIR = path.resolve(process.env.KNOWFLOW_WIKI_DIR || path.join(PROJECT_ROOT, 'wiki'));
28
+ const ENTITIES_DIR = path.join(WIKI_DIR, 'entities');
29
+ const CONCEPTS_DIR = path.join(WIKI_DIR, 'concepts');
30
+
31
+ // ── Structured result (JSON Schema 思路) ──────────────
32
+ const result = {
33
+ status: 'ok',
34
+ enriched_entities: 0,
35
+ total_entities: 0,
36
+ enriched_concepts: 0,
37
+ total_concepts: 0,
38
+ errors: [],
39
+ warnings: [],
40
+ };
41
+
42
+ // Read existing entity and concept pages
43
+ function loadDir(dir) {
44
+ try {
45
+ const pages = {};
46
+ if (!fs.existsSync(dir)) {
47
+ log(`⚠️ 目录不存在,将创建: ${dir}`);
48
+ fs.mkdirSync(dir, { recursive: true });
49
+ return pages;
50
+ }
51
+ for (const f of fs.readdirSync(dir)) {
52
+ if (f.endsWith('.md')) {
53
+ try {
54
+ pages[f] = fs.readFileSync(path.join(dir, f), 'utf-8');
55
+ } catch (e) {
56
+ log(`⚠️ 读取失败 ${dir}/${f}: ${e.message}`);
57
+ result.warnings.push({ file: `${dir}/${f}`, error: e.message });
58
+ }
59
+ }
60
+ }
61
+ return pages;
62
+ } catch (e) {
63
+ log(`❌ 加载目录失败 ${dir}: ${e.message}`);
64
+ result.errors.push({ step: 'loadDir', dir, error: e.message });
65
+ return {};
66
+ }
67
+ }
68
+
69
+ log('📂 开始加载 Wiki 页面...');
70
+ let entityPages, conceptPages;
71
+ try {
72
+ entityPages = loadDir(ENTITIES_DIR);
73
+ conceptPages = loadDir(CONCEPTS_DIR);
74
+ log(` 实体页: ${Object.keys(entityPages).length}, 概念页: ${Object.keys(conceptPages).length}`);
75
+ } catch (e) {
76
+ log(`❌ 加载页面失败: ${e.message}`);
77
+ result.errors.push({ step: 'loadPages', error: e.message });
78
+ result.status = 'error';
79
+ // Still try to continue — partial enrichment is better than nothing
80
+ entityPages = entityPages || {};
81
+ conceptPages = conceptPages || {};
82
+ }
83
+
84
+ // Key entities we want to deeply enrich with actual content
85
+ const KEY_ENTITIES = {
86
+ 'Claude-Code.md': {
87
+ type: '产品',
88
+ summary: 'Anthropic 推出的 AI 编程 Agent 终端工具,支持 Skills 系统、SubAgent 调用、NO_FLICKER 模式等',
89
+ aliases: ['Claude Code', 'claude code', 'CC']
90
+ },
91
+ 'OpenClaw.md': {
92
+ type: '产品/平台',
93
+ summary: '开源 AI Agent 运行时框架,GitHub Stars 突破 10 万,支持 Skill 系统、多 Agent 协作、飞书集成等',
94
+ aliases: ['OpenClaw', 'openclaw', '龙虾']
95
+ },
96
+ 'Codex.md': {
97
+ type: '产品',
98
+ summary: 'OpenAI 的 AI 编程工具,可作为 Claude Code 的 SubAgent 使用,性价比高(50元/月 vs Claude $100)',
99
+ aliases: ['Codex', 'codex', 'OpenAI Codex']
100
+ },
101
+ 'XCrawl.md': {
102
+ type: '产品',
103
+ summary: '网页抓取 Skill,解决 OpenClaw 数据采集痛点,支持搜索/抓取/全站爬取,集成 OpenClaw',
104
+ aliases: ['XCrawl', 'xcrawl']
105
+ },
106
+ 'WeWrite.md': {
107
+ type: '产品',
108
+ summary: '公众号自动化发文 Skill,开源,突破 1100 star,支持 Markdown 一键排版发送到微信草稿箱',
109
+ aliases: ['WeWrite', 'wewrite', '公众号自动化发文']
110
+ },
111
+ 'DeerFlow.md': {
112
+ type: '产品',
113
+ summary: '字节跳动开源 SuperAgent 框架 2.0 版本,面向研究、编程和创意的超级 Agent 架构',
114
+ aliases: ['DeerFlow', 'deerflow', 'Deer-Flow', '字节DeerFlow']
115
+ },
116
+ 'GBrain.md': {
117
+ type: '产品',
118
+ summary: 'YC 总裁 Garry Tan 开源的生产级 AI Agent 记忆系统',
119
+ aliases: ['GBrain', 'gbrain', 'Garry Tan memory system']
120
+ },
121
+ 'Coze-Work.md': {
122
+ type: '产品',
123
+ summary: '字节跳动扣子 Coze 2.5 发布,被称为"字节版 OpenClaw 平替",普通人也能上手的 AI Agent 平台',
124
+ aliases: ['Coze', 'coze', '扣子', 'Coze 2.5']
125
+ },
126
+ '宝玉-dotey.md': {
127
+ type: '人物',
128
+ summary: 'AI 工具领域知名博主,baoyu-skills 作者(2个月 10K+ stars),专注 Claude Code / AI 编程工具',
129
+ aliases: ['dotey', '宝玉', '@dotey']
130
+ },
131
+ 'Garry-Tan.md': {
132
+ type: '人物',
133
+ summary: 'Y Combinator 总裁,开源 gstack(AI 工作流)和 GBrain(Agent 记忆系统)',
134
+ aliases: ['Garry Tan', 'garrytan', '@garrytan']
135
+ },
136
+ 'Cloudflare.md': {
137
+ type: '公司/平台',
138
+ summary: '提供 Workers(边缘计算)、R2(对象存储)、Email Sending、DNS 等免费/低价服务,被社区称为"赛博大善人"',
139
+ aliases: ['Cloudflare', 'cloudflare', 'CF']
140
+ },
141
+ 'Tailscale.md': {
142
+ type: '产品',
143
+ summary: '组网工具,配合 SSH 实现多设备并网,构建"分布式大脑"开发环境',
144
+ aliases: ['Tailscale', 'tailscale']
145
+ },
146
+ 'RedBox.md': {
147
+ type: '产品',
148
+ summary: '小红书运营全流程 AI 化工具,从找灵感到发帖全自动',
149
+ aliases: ['RedBox', 'redbox']
150
+ },
151
+ 'RedClaw.md': {
152
+ type: '产品',
153
+ summary: '小红书版 OpenClaw(原 RedConvert),专注小红书运营自动化',
154
+ aliases: ['RedClaw', 'redclaw', '小红书版OpenClaw']
155
+ },
156
+ 'NotebookLM.md': {
157
+ type: '产品',
158
+ summary: 'Google 的论文阅读/学习神器,有 CLI 版本,可与 Claude + Anki 组合使用学语言',
159
+ aliases: ['NotebookLM', 'notebooklm']
160
+ },
161
+ 'mem9.md': {
162
+ type: '产品',
163
+ summary: 'OpenClaw 最强记忆方案,实现永续记忆能力',
164
+ aliases: ['mem9']
165
+ },
166
+ 'huobao-drama.md': {
167
+ type: '产品',
168
+ summary: '开源 AI 短剧自动化平台(chatfire-AI/huobao-drama),2 小时可跑完 50 集',
169
+ aliases: ['huobao-drama', '短剧自动化', 'chatfire']
170
+ },
171
+ 'VideoLingo.md': {
172
+ type: '产品',
173
+ summary: 'AI 视频翻译/配音开源项目,适合做 AI 副业',
174
+ aliases: ['VideoLingo', 'videolingo']
175
+ },
176
+ 'nexu.md': {
177
+ type: '产品',
178
+ summary: 'OpenClaw 桌面端客户端 v0.1.6,最生产级别的桌面开发实践',
179
+ aliases: ['nexu']
180
+ },
181
+ 'Accio-Work.md': {
182
+ type: '产品',
183
+ summary: '阿里上线的电商版 OpenClaw,面向电商场景的 AI Agent 平台',
184
+ aliases: ['Accio Work', 'Accio-Work', 'accio']
185
+ },
186
+ 'ClawTeam.md': {
187
+ type: '产品',
188
+ summary: '港大(HKU)开源 AI Agent 团队协作框架',
189
+ aliases: ['ClawTeam', 'clawteam']
190
+ },
191
+ 'OpenSpace.md': {
192
+ type: '产品',
193
+ summary: '港大团队开源的 Agent 自动进化引擎',
194
+ aliases: ['OpenSpace', 'openspace']
195
+ },
196
+ 'OPC-Methodology.md': {
197
+ type: '方法论',
198
+ summary: '一人公司(One Person Company)方法论,GitHub 14.5k stars 的独立创业完整指南',
199
+ aliases: ['OPC', '一人公司', 'OPC methodology']
200
+ },
201
+ 'DeepSeek.md': {
202
+ type: '公司',
203
+ summary: '中国 AI 公司,开源 DeepSeek 系列模型,在编程和推理能力上有竞争力',
204
+ aliases: ['DeepSeek', 'deepseek']
205
+ },
206
+ 'MiniMax.md': {
207
+ type: '公司',
208
+ summary: '中国 AI 公司,官方开源硬核技能包(专门给 AI 写代码的专家外挂)',
209
+ aliases: ['MiniMax', 'minimax']
210
+ },
211
+ '李继刚.md': {
212
+ type: '人物',
213
+ summary: '知名 Skills 开发者,系列 Skills 涵盖旅游攻略、信息卡制作等多个领域',
214
+ aliases: ['李继刚', 'lijigang', '@lijigang']
215
+ },
216
+ 'Apple-Watch.md': {
217
+ type: '产品',
218
+ summary: '与 Claude 结合实现健康数据分析、心源性猝死征兆检测等健康应用',
219
+ aliases: ['Apple Watch', 'apple watch']
220
+ },
221
+ 'Obsidian.md': {
222
+ type: '产品',
223
+ summary: '知识管理工具,kepano 做了官方 Agent Skills(16k star),可搭建本地 AI 健康管理体系',
224
+ aliases: ['Obsidian', 'obsidian']
225
+ },
226
+ 'gstack.md': {
227
+ type: '产品',
228
+ summary: 'YC 总裁 Garry Tan 的私家 AI 工作流,含 /office-hours skill',
229
+ aliases: ['gstack']
230
+ },
231
+ 'last30days-skill.md': {
232
+ type: '产品',
233
+ summary: '全网风口聚合器,挖穿 10 个核心社区找赚钱线索',
234
+ aliases: ['last30days-skill', 'last30days']
235
+ },
236
+ 'GEO-Tool.md': {
237
+ type: '产品',
238
+ summary: 'AI 搜索引擎可见度审计工具(GEO Skill),支持独立运行 + CLI,有高级扩展版开源',
239
+ aliases: ['GEO', 'geo', 'GEO Skill', 'GEOFlow']
240
+ },
241
+ 'tldraw.md': {
242
+ type: '产品',
243
+ summary: '面向 React 开发者的无限画布 SDK,用于添加协作白板到产品中',
244
+ aliases: ['tldraw']
245
+ },
246
+ 'MagicUI.md': {
247
+ type: '产品',
248
+ summary: '全新思路的组件库,主打 Landing Page 动画视觉效果',
249
+ aliases: ['MagicUI', 'magicui']
250
+ },
251
+ 'FastHTML.md': {
252
+ type: '产品',
253
+ summary: 'Python Web 框架,与 Next.js、SvelteKit 并列对比的三种 Web 框架之一',
254
+ aliases: ['FastHTML', 'fasthtml']
255
+ },
256
+ 'Composio.md': {
257
+ type: '产品',
258
+ summary: '插件平台,让 OpenClaw 变成真正的 AI Agent,打通 18+ 第三方服务(Gmail/Notion/Slack 等)',
259
+ aliases: ['Composio', 'composio']
260
+ },
261
+ 'CrewAI.md': {
262
+ type: '产品',
263
+ summary: '多 Agent 协作框架开源项目,用于让 AI 组队干活',
264
+ aliases: ['CrewAI', 'crewai']
265
+ },
266
+ 'OpenMAIC.md': {
267
+ type: '产品',
268
+ summary: '清华开源 AI 教师 Agent,传统教育领域的 AI 应用',
269
+ aliases: ['OpenMAIC', 'openmaic']
270
+ },
271
+ 'Codex-Proxy.md': {
272
+ type: '产品',
273
+ summary: '统一管理多账号实现 Token 自由的工具,支持 Codex 轮询',
274
+ aliases: ['Codex Proxy', 'codex proxy']
275
+ },
276
+ 'GitHub-Copilot.md': {
277
+ type: '产品',
278
+ summary: 'GitHub 的 AI 编程工具,推出 CLI 版本 + Rubber Duck 功能 + 高级中转站方案',
279
+ aliases: ['GitHub Copilot', 'Copilot', 'copilot']
280
+ },
281
+ '飞书.md': {
282
+ type: '平台',
283
+ summary: '与 OpenClaw/Claude 集成实现内容工作流:Claude-to-IM + 知识库 + 选题伙伴',
284
+ aliases: ['飞书', 'feishu', 'lark']
285
+ },
286
+ '龙虾导航.md': {
287
+ type: '产品',
288
+ summary: '一个网站获取 OpenClaw 所有高质量内容的导航站',
289
+ aliases: ['龙虾导航', 'lobster-nav']
290
+ }
291
+ };
292
+
293
+ const today = '2026-04-26';
294
+
295
+ // ── Enrich Entity Pages ───────────────────────────────
296
+ log('🔧 开始丰富实体页面...');
297
+ let enrichedEntities = 0;
298
+ try {
299
+ for (const [filename, info] of Object.entries(KEY_ENTITIES)) {
300
+ try {
301
+ if (!entityPages[filename]) {
302
+ // Create new enriched entity page
303
+ const lines = [
304
+ `# ${info.summary.split(',')[0]}`,
305
+ '',
306
+ `## 类型`,
307
+ info.type,
308
+ '',
309
+ `## 简介`,
310
+ info.summary,
311
+ '',
312
+ `## 信息`,
313
+ ''
314
+ ];
315
+ entityPages[filename] = lines.join('\n');
316
+ enrichedEntities++;
317
+ } else {
318
+ // Enrich existing page with summary if missing
319
+ if (!entityPages[filename].includes('## 简介')) {
320
+ const typeIdx = entityPages[filename].indexOf('## 类型');
321
+ if (typeIdx >= 0) {
322
+ const afterType = entityPages[filename].indexOf('\n', typeIdx) + 1;
323
+ entityPages[filename] =
324
+ entityPages[filename].slice(0, afterType) +
325
+ `\n## 简介\n${info.summary}\n` +
326
+ entityPages[filename].slice(afterType);
327
+ enrichedEntities++;
328
+ }
329
+ }
330
+ }
331
+ } catch (e) {
332
+ log(`⚠️ 处理实体失败 [${filename}]: ${e.message}`);
333
+ result.warnings.push({ file: filename, error: e.message });
334
+ }
335
+ }
336
+
337
+ // Write all enriched entities
338
+ try {
339
+ if (!fs.existsSync(ENTITIES_DIR)) {
340
+ fs.mkdirSync(ENTITIES_DIR, { recursive: true });
341
+ }
342
+ for (const [name, content] of Object.entries(entityPages)) {
343
+ try {
344
+ fs.writeFileSync(path.join(ENTITIES_DIR, name), content, 'utf-8');
345
+ } catch (e) {
346
+ log(`⚠️ 写入实体失败 [${name}]: ${e.message}`);
347
+ result.warnings.push({ file: name, action: 'write', error: e.message });
348
+ }
349
+ }
350
+ } catch (e) {
351
+ log(`❌ 写入实体目录失败: ${e.message}`);
352
+ result.errors.push({ step: 'writeEntities', error: e.message });
353
+ }
354
+
355
+ result.enriched_entities = enrichedEntities;
356
+ result.total_entities = Object.keys(entityPages).length;
357
+ log(` ✅ 新增/更新实体: ${enrichedEntities}, 总计: ${Object.keys(entityPages).length}`);
358
+ } catch (e) {
359
+ log(`❌ 实体丰富过程异常: ${e.message}`);
360
+ result.errors.push({ step: 'enrichEntities', error: e.message });
361
+ }
362
+
363
+ // Now enrich concept pages with definitions
364
+ log('🔧 开始丰富概念页面...');
365
+ const CONCEPT_DEFINITIONS = {
366
+ 'ai编程代理.md': {
367
+ definition: '使用 AI 模型(如 Claude、Codex、GPT)作为编程代理,通过终端交互或自主执行方式完成编码任务的范式。',
368
+ perspectives: [
369
+ 'Claude Code 是当前最流行的 AI 编程代理终端工具,支持 Skills 系统、SubAgent 调用、NO_FLICKER 模式等',
370
+ 'OpenClaw 可指挥多个 AI 编程代理协作(Claude Code + Codex + Gemini CLI)',
371
+ 'Token 成本是核心痛点:50 元 Codex 5.4 可比肩 100 美金 Claude Opus 4.6',
372
+ '9 行 CLAUDE.md 配置可让 token 直降 63%',
373
+ 'Claude Code 终端输出太吵会导致 AI 失忆问题'
374
+ ]
375
+ },
376
+ 'skill系统设计.md': {
377
+ definition: '为 AI Agent 设计的可复用技能模块系统,让 Agent 通过加载不同 Skill 获得特定能力。',
378
+ perspectives: [
379
+ 'Anthropic 开源了 Claude 技能系统(Agent Skills),GitHub 一天飙到 115k 星',
380
+ '宝玉(@dotey)的 baoyu-skills 2 个月获得 10K+ stars,设计哲学强调简洁实用',
381
+ '李继刚老师系列 Skills 涵盖旅游、信息卡、配图等多领域',
382
+ 'kepano 为 Obsidian 做了官方 Agent Skills(16k star)',
383
+ '团队内 Skills 管理和维护是规模化使用的挑战'
384
+ ]
385
+ },
386
+ 'token优化.md': {
387
+ definition: '降低 AI API 调用成本的各种策略和技术手段,包括配置优化、模型选择、中转站等。',
388
+ perspectives: [
389
+ '9 行 CLAUDE.md 让 token 直降 63%(chenchengpro 分享)',
390
+ 'Coding plan token 包复用方案(tuturetom 分享)',
391
+ 'Codex Proxy 统一管理多账号实现 Token 自由',
392
+ '无限邮箱 + Codex 轮询 = Token 自由',
393
+ 'GitHub Copilot Pro 性价比最高:39美元/月 1500次 premium 请求',
394
+ 'Claude Code Monitor 工具可帮助发现 token 消耗过快的原因'
395
+ ]
396
+ },
397
+ '多agent协作.md': {
398
+ definition: '多个 AI Agent 分工协作完成复杂任务的架构模式,包括主控-子代理、并行处理、投票共识等策略。',
399
+ perspectives: [
400
+ 'OpenClaw 可指挥 Codex/Gemini CLI/Claude Code 三位大哥协作写代码',
401
+ 'Claude Code 调度 Codex 当 SubAgent 是热门模式(多个教程覆盖)',
402
+ '本地多 Agent 协作方案:Claude + Codex + tmux',
403
+ 'ClawTeam(港大)是开源 AI Agent 团队协作框架',
404
+ 'CrewAI 用于让 AI 组队干活的多人协作框架',
405
+ 'DeerFlow(字节)是面向研究/编程/创意的超级 Agent 架构',
406
+ 'API 网关 Skill 打通 18 个第三方服务让 Agent 直接操作外部系统'
407
+ ]
408
+ },
409
+ '内容资产工作流.md': {
410
+ definition: '将内容创作视为资产管理的一套方法论,强调内容的长期价值、复用和系统化生产。',
411
+ perspectives: [
412
+ 'YangGuangAI 分享的个人内容资产工作流:把内容看做资产的态度',
413
+ 'AI + 公众号月入 10w+ 工作流(蛋仔 2026 实操版)',
414
+ '4 步搭建小红书和公众号内容生产线(AI Skills 实操指南)',
415
+ 'AK AutoResearch 将内容质量从 30 分拉到 75 分',
416
+ '高书签率内容分享技巧(agintender)'
417
+ ]
418
+ },
419
+ '自动化运营.md': {
420
+ definition: '利用 AI Agent 和工具链实现社交媒体、内容发布的自动化运营流程。',
421
+ perspectives: [
422
+ '用 OpenClaw 全自动运营小红书:20 天涨粉 1000 的实战复盘',
423
+ 'RedBox 实现小红书运营全流程 AI 化(找灵感→发帖)',
424
+ 'WeWrite 公众号自动化发文 Skill(1100+ star)',
425
+ '两个 OpenClaw + 飞书的自动化运营案例(李岳分享)',
426
+ '飞书 + Claude-to-IM + 知识库的内容生产工作流',
427
+ 'follow-builders Skill 每天整理顶级 AI 资讯'
428
+ ]
429
+ },
430
+ 'devops自动化.md': {
431
+ definition: '利用 AI Agent 和云服务实现开发运维的自动化,包括部署、监控、域名管理等。',
432
+ perspectives: [
433
+ 'Tailscale + SSH 多设备并网:拥有分布式大脑',
434
+ 'OpenClaw + Deploy Skill 出门不用背电脑修 bug',
435
+ 'Cloudflare Workers 边缘计算免费方案',
436
+ 'Cloudflare Dynamic Worker Loader:AI 沙箱新方案',
437
+ 'Mac Mini 无显示器方案:macOS 屏幕共享远程操控',
438
+ '买了 Mac Mini 当服务器没显示器一招搞定'
439
+ ]
440
+ },
441
+ '免费云服务.md': {
442
+ definition: '利用 Cloudflare 等平台提供的免费 tier 构建低成本技术基础设施的策略集合。',
443
+ perspectives: [
444
+ 'Cloudflare 被社区称为"赛博大善人",提供 Workers/R2/DNS/Email 等',
445
+ '自建 Cloudflare 临时邮箱 smail 只需一个 Worker 项目',
446
+ '全球 120+ 国家 330+ 城市 DNS 解析结果查询工具',
447
+ '彩虹聚合 DNS 管理系统:一个网站管理多平台域名解析',
448
+ 'CF 大善人免费无限流量梯子 EdgeTunnel 方案',
449
+ 'Cloudflare R2 + PicList 图床配置方案'
450
+ ]
451
+ },
452
+ 'token成本优化.md': {
453
+ definition: '通过技术手段降低 AI API 使用成本的策略集合,包括模型替代、批量注册、中转站等。',
454
+ perspectives: [
455
+ '50 元 Codex 5.4 比肩 100 美金 Claude Opus 4.6(Btc_Crush 对比)',
456
+ 'GitHub Copilot 高级中转站 10 块钱买 600 request',
457
+ '全套美系装备防 Claude 封号:美国住宅 IP + VPS + 手机号 + Apple Pay',
458
+ '通过 Cloudflare 注册 Claude 号实测成功',
459
+ '订阅 ChatGPT 切换地区到欧洲用 Paypal 付款',
460
+ '学生优惠汇总:海底捞 6.8 折 / 机票 / 苹果教育优惠全覆盖'
461
+ ]
462
+ },
463
+ '账号自动化管理.md': {
464
+ definition: '利用自动化工具批量管理和轮转 AI 服务账号的策略。',
465
+ perspectives: [
466
+ 'Codex Proxy 统一管理多账号实现 Token 自由',
467
+ 'AutoTeam ChatGPT Team 账号自动轮转管理工具',
468
+ 'Claude 账号批量注册通过 Cloudflare 实测成功',
469
+ '无限邮箱 + Codex 轮询方案',
470
+ '闲鱼 2.99 买工具就能完成 Claude 验证手机号',
471
+ 'Telegram 更新:机器人可自主创建和管理其他机器人'
472
+ ]
473
+ },
474
+ 'seo优化.md': {
475
+ definition: '利用 AI Agent 提升搜索引擎可见性和内容排名的技术策略。',
476
+ perspectives: [
477
+ 'GEO 从零开始:概念、策略、实战一篇全覆盖',
478
+ 'Claude Code GEO Skill:AI 搜索引擎可见度审计工具',
479
+ 'SEO 数据看板搭建:GSC 数据统一拉取',
480
+ 'GEO Flow 姚金刚开源的第一个 SEO/GEO 系统',
481
+ 'GEO Skill 高级扩展版开源:独立运行 + CLI'
482
+ ]
483
+ },
484
+ 'geo策略.md': {
485
+ definition: 'Generated Engine Optimization(GEO):针对 AI 搜索引擎(如 ChatGPT Search、Perplexity)优化内容可见性的新兴策略。',
486
+ perspectives: [
487
+ '区别于传统 SEO,GEO 面向 AI 搜索引擎优化内容被引用的概率',
488
+ 'GEO Tool/Skill 已成为 OpenClaw 生态热门工具',
489
+ 'Aron厚玉对 GEO Skill 进行了开源改造和扩展',
490
+ '出海需求挖掘可用 GEO 策略提升海外市场 AI 可见度'
491
+ ]
492
+ },
493
+ '出海需求挖掘.md': {
494
+ definition: '利用 AI Agent 自动挖掘海外市场需求和商机的策略方法。',
495
+ perspectives: [
496
+ 'OpenClaw 集成 XCrawl 3 步搞定投资内容数据采集',
497
+ 'last30days-skill 全网风口聚合器:挖穿 10 个核心社区找赚钱线索',
498
+ '5 个 GitHub 信息差套利方式',
499
+ 'GoSailGlobal 全球云服务上线:开发者一站式平台',
500
+ '独立开发者出海必备:海外手机号/邮箱/支付/云一站式方案'
501
+ ]
502
+ },
503
+ 'ai健康管理.md': {
504
+ definition: '利用 AI 分析可穿戴设备健康数据,提供个性化健康建议的应用方向。',
505
+ perspectives: [
506
+ 'Apple Watch + Claude 健康数据 AI 分析方案',
507
+ '用 Claude 搭建本地 AI 健康管理体系(Obsidian 模板开源)',
508
+ '智能设备检测心源性猝死征兆讨论',
509
+ '健身 Skill 公开(tuzi_ai)',
510
+ '前额叶减负/皮质醇安抚友好指南:减少无意义决策'
511
+ ]
512
+ },
513
+ 'ai视频生成.md': {
514
+ definition: '利用 AI 自动化视频内容生产的完整管线,从脚本生成到剪辑输出。',
515
+ perspectives: [
516
+ 'huobao-drama:开源 AI 短剧自动化平台,2 小时跑完 50 集',
517
+ 'AI 短剧产能真的被 AI 干穿了',
518
+ 'Skill 让小龙虾全天候生成影视解说视频(拉片→文案→配音→剪辑全自动)',
519
+ 'AI 一句话生成电影解说视频开源项目',
520
+ '全自动视频管线开源:IndexTTS2 + Whisper + Remotion',
521
+ 'GitHub 4 个开源短视频工具:从写脚本到全网分发',
522
+ 'One Take 视频自动剪辑系统'
523
+ ]
524
+ },
525
+ 'ai变现模式.md': {
526
+ definition: '利用 AI 工具和服务创造收入的商业模式和方法论。',
527
+ perspectives: [
528
+ 'AI 副业赚钱手册 GitHub 1.4k star:几十种 AI 变现方式',
529
+ 'GitHub 上最能帮你赚钱的 40 个仓库:一人公司指南合集',
530
+ '普通人 + AI 可做的小生意(黄赟分享)',
531
+ 'AI 卖 Plus 日入过万渠道:低成本创业实战',
532
+ '拿钱趟出来的血泪教训(bozhou_ai)',
533
+ '公众号人生感悟赛道起号经验',
534
+ '一人公司 LTD 方法:先验证先卖再完善产品,24 小时卖 12 万美金'
535
+ ]
536
+ },
537
+ '独立开发出海.md': {
538
+ definition: '个人开发者面向全球市场发布产品和服务的策略方法论。',
539
+ perspectives: [
540
+ '一人公司 OPC 方法论 GitHub 14.5k 独立创业框架',
541
+ '独立开发者出海指南 GitHub 2.9k:注册海外公司全流程',
542
+ '独立开发者出海必备:海外手机号/邮箱/支付/云一站式方案',
543
+ '海外手机号方案:5 英镑 30 年,可申请英国银行账户',
544
+ '中国大陆翻墙用户最佳搭档:英国 giffgaff 手机卡/eSIM 方案'
545
+ ]
546
+ },
547
+ '一人公司方法论.md': {
548
+ definition: 'One Person Company (OPC):一个人利用 AI 工具跑完整公司的创业方法论。',
549
+ perspectives: [
550
+ 'OPC 方法论 GitHub 14.5k stars:独立创业完整指南',
551
+ '一人电商运营团队 - GitHub 工作流(Sac 分享)',
552
+ 'Gumroad 创始人把《极简创业家》做成 Claude Skills',
553
+ '让 AI 组队干活:OPC + CrewAI 多 Agent 协作'
554
+ ]
555
+ },
556
+ '个人知识管理.md': {
557
+ definition: '利用 AI 工具构建和维护个人知识库的方法论和实践。',
558
+ perspectives: [
559
+ 'mem9 实现 OpenClaw 永续记忆方案',
560
+ 'GBrain:YC 总裁 Garry Tan 开源的 AI Agent 记忆系统',
561
+ '龙虾导航:一个网站获取 OpenClaw 所有高质量内容',
562
+ 'NotebookLM + Claude + Anki 学语言方法',
563
+ 'gstack:Garry Tan 的私家 AI 工作流',
564
+ 'Obsidian + Filesystem MCP 最猛方案'
565
+ ]
566
+ },
567
+ 'ai行业趋势.md': {
568
+ definition: '2026 年 AI 行业发展的主要趋势和动态,基于 700 条 Twitter/X 素材综合分析。',
569
+ perspectives: [
570
+ 'Anthropic 开源 Claude Skills 系统,一天飙到 115k GitHub stars',
571
+ 'Claude Code 密集更新:NO_FLICKER / Monitor / ultraplan / Auto DREAM Mode',
572
+ '字节 Coze 2.5 发布:被称为"字节版 OpenClaw 平替"',
573
+ '阿里 Accio Work:电商版 OpenClaw',
574
+ '不到一个月 Claude 发了大量产品和功能更新',
575
+ '港大连续开源 ClawTeam(Agent 协作)和 OpenSpace(进化引擎)',
576
+ '开源 AI 工具生态爆发:DeerFlow/MoneyPrinterTurbo/CrewAI 等',
577
+ 'Telegram 更新:机器人可自主创建和管理其他机器人'
578
+ ]
579
+ },
580
+ '开源ai工具生态.md': {
581
+ definition: '围绕 AI Agent 平台(尤其是 OpenClaw/Claude Code)形成的开源工具生态系统。',
582
+ perspectives: [
583
+ 'OpenClaw 突破 10 万 GitHub Stars 后生态爆发',
584
+ 'baoyu-skills(宝玉)2 个月 10K+ stars',
585
+ 'WeWrite 公众号自动化发文 1100+ star',
586
+ 'MiniMax 官方开源硬核技能包',
587
+ '阿里论文 SkillRouter:8 万 Skills 路由基准测试',
588
+ 'kepano 给 Obsidian 做 Agent Skills 16k star',
589
+ 'AIwarts 开源:类似 Hogwarts 的 AI 编程魔法学校',
590
+ '50+ 平台抓取工具清单:opencli/xreach/Jina/Playwright 等'
591
+ ]
592
+ },
593
+ '前端开发工具.md': {
594
+ definition: '面向前端开发的 AI 编程工具和 UI 组件库集合。',
595
+ perspectives: [
596
+ '做前端的 AI 编程党必装:10 个官方级 Agent Skills 清单',
597
+ 'tldraw SDK:React 无限画布协作白板',
598
+ 'MagicUI:主打 Landing Page 动画视觉效果的组件库',
599
+ '三种 Web 框架对比:FastHTML vs Next.js vs SvelteKit',
600
+ 'Awesome Design 仓库:全球 55 个大厂设计语言',
601
+ 'nexu v0.1.6:OpenClaw 桌面端最生产级别实践',
602
+ 'Markmap:将 Markdown 转化为思维导图'
603
+ ]
604
+ }
605
+ };
606
+
607
+ let enrichedConcepts = 0;
608
+ try {
609
+ for (const [filename, def] of Object.entries(CONCEPT_DEFINITIONS)) {
610
+ try {
611
+ if (!conceptPages[filename]) {
612
+ const lines = [
613
+ `# ${filename.replace('.md', '')}`,
614
+ '',
615
+ `## 定义`,
616
+ def.definition,
617
+ '',
618
+ `## 来源与视角`,
619
+ ''
620
+ ];
621
+ for (const p of def.perspectives) {
622
+ lines.push('- ' + p + ' (INFERRED from batch analysis)');
623
+ }
624
+
625
+ lines.push('', `## 关联实体`, '');
626
+ conceptPages[filename] = lines.join('\n');
627
+ enrichedConcepts++;
628
+ } else {
629
+ // Add definition if missing
630
+ if (!conceptPages[filename].includes('## 定义')) {
631
+ const insertAt = conceptPages[filename].indexOf('## 来源与视角');
632
+ if (insertAt >= 0) {
633
+ conceptPages[filename] =
634
+ conceptPages[filename].slice(0, insertAt) +
635
+ `## 定义\n${def.definition}\n\n` +
636
+ conceptPages[filename].slice(insertAt);
637
+ enrichedConcepts++;
638
+ }
639
+ }
640
+ }
641
+ } catch (e) {
642
+ log(`⚠️ 处理概念失败 [${filename}]: ${e.message}`);
643
+ result.warnings.push({ file: filename, error: e.message });
644
+ }
645
+ }
646
+
647
+ // Write all enriched concepts
648
+ try {
649
+ if (!fs.existsSync(CONCEPTS_DIR)) {
650
+ fs.mkdirSync(CONCEPTS_DIR, { recursive: true });
651
+ }
652
+ for (const [name, content] of Object.entries(conceptPages)) {
653
+ try {
654
+ fs.writeFileSync(path.join(CONCEPTS_DIR, name), content, 'utf-8');
655
+ } catch (e) {
656
+ log(`⚠️ 写入概念失败 [${name}]: ${e.message}`);
657
+ result.warnings.push({ file: name, action: 'write', error: e.message });
658
+ }
659
+ }
660
+ } catch (e) {
661
+ log(`❌ 写入概念目录失败: ${e.message}`);
662
+ result.errors.push({ step: 'writeConcepts', error: e.message });
663
+ }
664
+
665
+ result.enriched_concepts = enrichedConcepts;
666
+ result.total_concepts = Object.keys(conceptPages).length;
667
+ log(` ✅ 新增/更新概念: ${enrichedConcepts}, 总计: ${Object.keys(conceptPages).length}`);
668
+ } catch (e) {
669
+ log(`❌ 概念丰富过程异常: ${e.message}`);
670
+ result.errors.push({ step: 'enrichConcepts', error: e.message });
671
+ }
672
+
673
+ // ── Final Summary ──────────────────────────────────────
674
+ log('');
675
+ log('=== ENRICHMENT PASS COMPLETE ===');
676
+ log(`状态: ${result.status}`);
677
+ log(`实体: ${result.enriched_entities}/${result.total_entities} 新增或更新`);
678
+ log(`概念: ${result.enriched_concepts}/${result.total_concepts} 新增或更新`);
679
+ if (result.warnings.length > 0) log(`警告: ${result.warnings.length} 条`);
680
+ if (result.errors.length > 0) log(`错误: ${result.errors.length} 条`);
681
+
682
+ // Output structured result as last line (parseable by CLI)
683
+ console.log('\n__ENRICH_RESULT__:' + JSON.stringify(result));