flowmind 1.4.6 → 1.4.7

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,424 @@
1
+ # FlowMind 集成指南
2
+
3
+ ## 把 FlowMind 作为 Agent/Skill 安装到 AI CLI 工具
4
+
5
+ ---
6
+
7
+ ## 目录
8
+
9
+ - [Claude Code 集成](#claude-code-集成)
10
+ - [Cursor 集成](#cursor-集成)
11
+ - [Windsurf 集成](#windsurf-集成)
12
+ - [Cline 集成](#cline-集成)
13
+ - [Codex 集成](#codex-集成)
14
+ - [通用 MCP 客户端](#通用-mcp-客户端)
15
+
16
+ ---
17
+
18
+ ## Claude Code 集成
19
+
20
+ ### 方式 1:作为 MCP Server(推荐)
21
+
22
+ 这是最完整的集成方式,让 Claude Code 可以直接调用 FlowMind 的所有技能。
23
+
24
+ #### 步骤 1:安装 FlowMind
25
+
26
+ ```bash
27
+ npm install -g flowmind
28
+ ```
29
+
30
+ #### 步骤 2:配置 MCP Server
31
+
32
+ 在项目根目录创建或编辑 `.claude/settings.local.json`:
33
+
34
+ ```json
35
+ {
36
+ "mcpServers": {
37
+ "flowmind": {
38
+ "command": "flowmind-mcp",
39
+ "args": [],
40
+ "env": {
41
+ "OPENAI_API_KEY": "${OPENAI_API_KEY}"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ #### 步骤 3:重启 Claude Code
49
+
50
+ 配置完成后,重启 Claude Code 即可生效。
51
+
52
+ #### 步骤 4:使用
53
+
54
+ 在 Claude Code 中直接使用自然语言:
55
+
56
+ ```
57
+ 你:帮我查询最近1小时的错误日志
58
+ Claude:我来调用 FlowMind 帮你查询...
59
+
60
+ 你:审查一下这个项目的代码质量
61
+ Claude:我来使用 FlowMind 的代码审查技能...
62
+ ```
63
+
64
+ ### 方式 2:作为 Slash Command(技能)
65
+
66
+ 把 FlowMind 的技能注册为 Claude Code 的 Slash Command。
67
+
68
+ #### 步骤 1:创建技能目录
69
+
70
+ ```bash
71
+ mkdir -p ~/.claude/skills
72
+ ```
73
+
74
+ #### 步骤 2:创建 FlowMind 技能文件
75
+
76
+ 创建 `~/.claude/skills/flowmind.md`:
77
+
78
+ ```markdown
79
+ ---
80
+ name: flowmind
81
+ description: FlowMind - AI Agent for development workflows
82
+ ---
83
+
84
+ # FlowMind Agent
85
+
86
+ FlowMind is an intelligent development workflow automation agent.
87
+
88
+ ## Available Skills
89
+
90
+ ### Log Audit
91
+ - Trigger: "日志", "traceId", "排查"
92
+ - Usage: `flowmind "查询 traceId abc123 的日志"`
93
+
94
+ ### Code Review
95
+ - Trigger: "代码审查", "review", "PR"
96
+ - Usage: `flowmind "审查代码质量"`
97
+
98
+ ### Data Validation
99
+ - Trigger: "数据验证", "逻辑检查"
100
+ - Usage: `flowmind "验证订单数据"`
101
+
102
+ ## How to Use
103
+
104
+ When the user asks about:
105
+ 1. Log analysis or debugging → Use flowmind log-audit skill
106
+ 2. Code review or quality check → Use flowmind code-review skill
107
+ 3. Data validation → Use flowmind data-validation skill
108
+ 4. API documentation → Use flowmind api-sync skill
109
+
110
+ Execute: `flowmind "user's request"`
111
+ ```
112
+
113
+ #### 步骤 3:使用
114
+
115
+ 在 Claude Code 中输入 `/flowmind` 即可调用。
116
+
117
+ ### 方式 3:作为 Tool(工具)
118
+
119
+ 在 Claude Code 的 `settings.json` 中注册 FlowMind 为自定义工具。
120
+
121
+ ```json
122
+ {
123
+ "tools": {
124
+ "flowmind": {
125
+ "command": "flowmind",
126
+ "args": ["process", "--json", "{{input}}"],
127
+ "description": "FlowMind AI Agent for development workflows"
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Cursor 集成
136
+
137
+ Cursor 支持 MCP 协议,可以像 Claude Code 一样集成 FlowMind。
138
+
139
+ ### 步骤 1:配置 MCP Server
140
+
141
+ 在 Cursor 的设置中,找到 MCP Server 配置,添加:
142
+
143
+ ```json
144
+ {
145
+ "flowmind": {
146
+ "command": "flowmind-mcp",
147
+ "args": []
148
+ }
149
+ }
150
+ ```
151
+
152
+ ### 步骤 2:使用
153
+
154
+ 在 Cursor 的 AI 对话中直接使用:
155
+
156
+ ```
157
+ @flowmind 查询最近1小时的错误日志
158
+ @flowmind 审查代码质量
159
+ ```
160
+
161
+ ---
162
+
163
+ ## Windsurf 集成
164
+
165
+ Windsurf 是 Codeium 的 AI IDE,支持 MCP 协议。
166
+
167
+ ### 步骤 1:配置 MCP Server
168
+
169
+ 在 Windsurf 的设置中,找到 MCP 配置,添加:
170
+
171
+ ```json
172
+ {
173
+ "mcpServers": {
174
+ "flowmind": {
175
+ "command": "flowmind-mcp",
176
+ "args": []
177
+ }
178
+ }
179
+ }
180
+ ```
181
+
182
+ ### 步骤 2:使用
183
+
184
+ 在 Windsurf 的 AI 聊天中使用 FlowMind。
185
+
186
+ ---
187
+
188
+ ## Cline 集成
189
+
190
+ Cline 是 VS Code 的 AI 编程助手,支持 MCP 协议。
191
+
192
+ ### 步骤 1:安装 Cline
193
+
194
+ 在 VS Code 中安装 Cline 扩展。
195
+
196
+ ### 步骤 2:配置 MCP Server
197
+
198
+ 在 Cline 的设置中,找到 MCP Servers 配置,添加:
199
+
200
+ ```json
201
+ {
202
+ "flowmind": {
203
+ "command": "flowmind-mcp",
204
+ "args": []
205
+ }
206
+ }
207
+ ```
208
+
209
+ ### 步骤 3:使用
210
+
211
+ 在 Cline 的聊天中直接使用 FlowMind。
212
+
213
+ ---
214
+
215
+ ## Codex 集成
216
+
217
+ Codex 是 OpenAI 的 CLI 工具,通过 JSON 输出集成 FlowMind。
218
+
219
+ ### 方式 1:使用 `flowmind-codex`(推荐)
220
+
221
+ 安装后直接使用专门的 Codex 包装命令:
222
+
223
+ ```bash
224
+ # 处理请求
225
+ flowmind-codex "查询最近1小时的错误日志"
226
+
227
+ # 强制指定技能
228
+ flowmind-codex --skill log-audit "查询 traceId abc123 的完整链路"
229
+
230
+ # 列出技能
231
+ flowmind-codex skills
232
+
233
+ # 查看单个技能
234
+ flowmind-codex skill log-audit
235
+
236
+ # 健康检查
237
+ flowmind-codex doctor
238
+ ```
239
+
240
+ 这个命令固定输出 JSON,适合 Codex、脚本和 CI 直接消费。
241
+ 默认会把配置、缓存和学习数据写到当前工作区的 `.flowmind-codex/`。
242
+ 如需改路径,可设置 `FLOWMIND_CODEX_HOME=/your/path`。
243
+
244
+ ### 方式 2:直接调用 `flowmind --json`
245
+
246
+ ```bash
247
+ # 获取技能列表
248
+ flowmind skills --json
249
+
250
+ # 执行任务
251
+ flowmind process --json "查询日志"
252
+ ```
253
+
254
+ ### 方式 3:创建 Wrapper 脚本
255
+
256
+ 创建 `flowmind-codex.sh`:
257
+
258
+ ```bash
259
+ #!/bin/bash
260
+ # FlowMind Codex Integration Wrapper
261
+
262
+ INPUT="$1"
263
+ RESULT=$(flowmind process --json "$INPUT")
264
+
265
+ # 提取结果
266
+ echo "$RESULT" | jq -r '.data // .message // .error'
267
+ ```
268
+
269
+ ### 方式 4:Python 集成
270
+
271
+ ```python
272
+ import subprocess
273
+ import json
274
+
275
+ class FlowMindAgent:
276
+ def __init__(self):
277
+ self.name = "flowmind"
278
+
279
+ def run(self, query: str) -> dict:
280
+ result = subprocess.run(
281
+ ['flowmind', 'process', '--json', query],
282
+ capture_output=True,
283
+ text=True
284
+ )
285
+ return json.loads(result.stdout)
286
+
287
+ def list_skills(self) -> list:
288
+ result = subprocess.run(
289
+ ['flowmind', 'skills', '--json'],
290
+ capture_output=True,
291
+ text=True
292
+ )
293
+ return json.loads(result.stdout)['skills']
294
+
295
+ # 使用
296
+ agent = FlowMindAgent()
297
+ result = agent.run("查询 traceId abc123 的日志")
298
+ print(result)
299
+ ```
300
+
301
+ ---
302
+
303
+ ## 通用 MCP 客户端
304
+
305
+ 任何支持 MCP 协议的客户端都可以集成 FlowMind。
306
+
307
+ ### MCP Server 配置
308
+
309
+ ```json
310
+ {
311
+ "name": "flowmind",
312
+ "transport": {
313
+ "type": "stdio",
314
+ "command": "flowmind-mcp",
315
+ "args": []
316
+ }
317
+ }
318
+ ```
319
+
320
+ ### MCP 工具列表
321
+
322
+ | 工具名称 | 描述 | 参数 |
323
+ |---------|------|------|
324
+ | `flowmind_process` | 处理请求 | `{input: string, context?: object}` |
325
+ | `flowmind_list_skills` | 列出技能 | `{}` |
326
+ | `flowmind_get_skill` | 技能详情 | `{name: string}` |
327
+ | `flowmind_ai_status` | AI 状态 | `{}` |
328
+ | `flowmind_learning_stats` | 学习统计 | `{}` |
329
+ | `flowmind_skill_<name>` | 执行技能 | `{input: string, context?: object}` |
330
+
331
+ ---
332
+
333
+ ## 集成架构图
334
+
335
+ ```
336
+ ┌─────────────────────────────────────────────────────────────┐
337
+ │ AI CLI 工具 │
338
+ │ (Claude Code / Cursor / Windsurf / Cline) │
339
+ └───────────────────────────┬─────────────────────────────────┘
340
+
341
+ │ MCP Protocol
342
+
343
+ ┌───────────────────────────v─────────────────────────────────┐
344
+ │ FlowMind MCP Server │
345
+ │ (mcp/server.js) │
346
+ ├─────────────────────────────────────────────────────────────┤
347
+ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
348
+ │ │ Intent │ │ Skill │ │ Learning │ │
349
+ │ │ Understanding│ │ Selection │ │ Engine │ │
350
+ │ └─────────────┘ └─────────────┘ └─────────────┘ │
351
+ ├─────────────────────────────────────────────────────────────┤
352
+ │ ┌─────────────────────────────────────────────────────┐ │
353
+ │ │ FlowMind Skills │ │
354
+ │ │ log-audit │ code-review │ data-validation │ ... │ │
355
+ │ └─────────────────────────────────────────────────────┘ │
356
+ ├─────────────────────────────────────────────────────────────┤
357
+ │ ┌─────────────────────────────────────────────────────┐ │
358
+ │ │ External Services (MCP) │ │
359
+ │ │ SLS │ DMS │ Redis │ YApi │ Yuque │ Friday │ ... │ │
360
+ │ └─────────────────────────────────────────────────────┘ │
361
+ └─────────────────────────────────────────────────────────────┘
362
+ ```
363
+
364
+ ---
365
+
366
+ ## 常见问题
367
+
368
+ ### Q1: Claude Code 无法识别 FlowMind MCP Server?
369
+
370
+ 1. 检查 `.claude/settings.local.json` 配置是否正确
371
+ 2. 确认 `flowmind-mcp` 命令可用:`which flowmind-mcp`
372
+ 3. 重启 Claude Code
373
+
374
+ ### Q2: 如何让 FlowMind 在所有项目中可用?
375
+
376
+ 在用户级别配置 MCP Server:
377
+
378
+ ```bash
379
+ # 编辑全局配置
380
+ vim ~/.claude/settings.json
381
+ ```
382
+
383
+ 添加:
384
+ ```json
385
+ {
386
+ "mcpServers": {
387
+ "flowmind": {
388
+ "command": "flowmind-mcp",
389
+ "args": []
390
+ }
391
+ }
392
+ }
393
+ ```
394
+
395
+ ### Q3: 如何同时使用多个 AI CLI 工具?
396
+
397
+ FlowMind 支持同时被多个客户端调用,学习数据会自动同步。
398
+
399
+ ### Q4: 如何自定义 FlowMind 技能?
400
+
401
+ 1. 在 `skills/` 目录创建新技能
402
+ 2. 创建 `SKILL.md` 定义触发词
403
+ 3. 创建 `index.js` 实现逻辑
404
+ 4. 重启 MCP Server
405
+
406
+ ---
407
+
408
+ ## 快速开始
409
+
410
+ ```bash
411
+ # 1. 安装 FlowMind
412
+ npm install -g flowmind
413
+
414
+ # 2. 初始化
415
+ flowmind init --ai openai
416
+
417
+ # 3. 配置 Claude Code
418
+ echo '{"mcpServers":{"flowmind":{"command":"flowmind-mcp"}}}' > .claude/settings.local.json
419
+
420
+ # 4. 重启 Claude Code
421
+
422
+ # 5. 使用
423
+ # 在 Claude Code 中直接说:帮我查询日志
424
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "flowmind",
3
- "version": "1.4.6",
4
- "description": "The AI Agent That Learns How You Work - Stop repeating yourself, FlowMind learns your workflows and applies them automatically.",
3
+ "version": "1.4.7",
4
+ "description": "Memory and workflow automation for MCP, Codex, and Claude Code. Reuse repeatable developer operations through skills and explicit feedback.",
5
5
  "main": "core/index.js",
6
6
  "bin": {
7
7
  "flowmind": "./bin/flowmind.js",
@@ -18,16 +18,21 @@
18
18
  "dev": "nodemon core/index.js"
19
19
  },
20
20
  "keywords": [
21
+ "mcp",
22
+ "model-context-protocol",
23
+ "codex",
24
+ "claude-code",
21
25
  "ai-agent",
22
- "workflow-automation",
23
26
  "developer-tools",
24
- "learning-system",
25
- "code-review",
27
+ "cli",
28
+ "workflow-automation",
29
+ "developer-productivity",
30
+ "memory-layer",
31
+ "skill-routing",
26
32
  "log-analysis",
33
+ "code-review",
27
34
  "devops",
28
- "mcp-server",
29
- "claude-integration",
30
- "codex-integration"
35
+ "mcp-server"
31
36
  ],
32
37
  "author": "FlowMind Technologies",
33
38
  "license": "MIT",
@@ -50,8 +55,11 @@
50
55
  "templates/",
51
56
  "config/",
52
57
  "learning/",
58
+ "demo/",
59
+ "docs/integration-guide.md",
53
60
  "README.md",
54
61
  "README_CN.md",
62
+ "CONTRIBUTING.md",
55
63
  "LICENSE",
56
64
  "CHANGELOG.md"
57
65
  ],