flowmind 1.0.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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +855 -0
  3. package/README_CN.md +854 -0
  4. package/bin/flowmind.js +464 -0
  5. package/core/adapters/api-doc-adapter.js +71 -0
  6. package/core/adapters/base-adapter.js +80 -0
  7. package/core/adapters/database-manager-adapter.js +60 -0
  8. package/core/adapters/database-query-adapter.js +51 -0
  9. package/core/adapters/knowledge-base-adapter.js +75 -0
  10. package/core/adapters/log-service-adapter.js +41 -0
  11. package/core/adapters/mcp-adapter.js +65 -0
  12. package/core/adapters/report-adapter.js +60 -0
  13. package/core/adapters/workflow-adapter.js +62 -0
  14. package/core/component-registry.js +281 -0
  15. package/core/component-types.js +63 -0
  16. package/core/config-manager.js +360 -0
  17. package/core/index.js +223 -0
  18. package/core/learning-engine.js +588 -0
  19. package/core/mcp-compatibility.js +150 -0
  20. package/core/providers/aliyun/dms-adapter.js +98 -0
  21. package/core/providers/aliyun/redis-adapter.js +88 -0
  22. package/core/providers/aliyun/sls-adapter.js +86 -0
  23. package/core/providers/friday/flow-adapter.js +85 -0
  24. package/core/providers/friday/report-adapter.js +83 -0
  25. package/core/providers/yapi/yapi-adapter.js +79 -0
  26. package/core/providers/yuque/yuque-adapter.js +90 -0
  27. package/core/scene-matcher.js +326 -0
  28. package/core/skill-loader.js +291 -0
  29. package/package.json +67 -0
  30. package/scripts/migrate-config.js +153 -0
  31. package/skills/api-sync/SKILL.md +203 -0
  32. package/skills/archive-change/SKILL.md +172 -0
  33. package/skills/auto-flow/SKILL.md +277 -0
  34. package/skills/code-review/SKILL.md +206 -0
  35. package/skills/code-review-audit/SKILL.md +150 -0
  36. package/skills/data-logic-validation/SKILL.md +162 -0
  37. package/skills/data-validation/SKILL.md +210 -0
  38. package/skills/git-review/SKILL.md +190 -0
  39. package/skills/learning-engine/SKILL.md +352 -0
  40. package/skills/learning-feedback/SKILL.md +174 -0
  41. package/skills/log-audit/SKILL.md +226 -0
  42. package/skills/project-review/SKILL.md +196 -0
  43. package/skills/requirement-analyst/SKILL.md +275 -0
  44. package/skills/resource-bind/SKILL.md +222 -0
  45. package/skills/sls-log-audit/SKILL.md +223 -0
  46. package/skills/yapi-sync-interface/SKILL.md +145 -0
  47. package/skills/yuque-sync-design/SKILL.md +157 -0
package/README.md ADDED
@@ -0,0 +1,855 @@
1
+ <div align="center">
2
+
3
+ # 🧠 FlowMind
4
+
5
+ ### **The AI Agent That Learns How You Work**
6
+
7
+ *Stop repeating yourself. FlowMind learns your workflows and applies them automatically.*
8
+
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
10
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
11
+ [![Version](https://img.shields.io/badge/version-1.1.0-blue)](CHANGELOG.md)
12
+
13
+ [中文](README_CN.md) | [Quick Start](#-quick-start) | [How It Works](#-how-it-works) | [Use Cases](#-use-cases) | [Architecture](#-architecture)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## 🎯 The Problem
20
+
21
+ Whether you're a developer, architect, product manager, or tech lead, you face these challenges:
22
+
23
+ ### 1. Repetitive Labor
24
+ ```
25
+ ❌ Same instructions every single time:
26
+ "Format output as table..."
27
+ "Use sequential list..."
28
+ "Check errors first then..."
29
+ "Connect using source_id..."
30
+ ```
31
+
32
+ ### 2. Scattered Tools
33
+ ```
34
+ ❌ Constantly switching between platforms:
35
+ SLS for logs → RDS for data → Code repo → YApi for APIs → Yuque for docs
36
+ ```
37
+
38
+ ### 3. Lost Experience
39
+ ```
40
+ ❌ Valuable experience cannot be preserved:
41
+ Architect's design thinking → Lost with project end
42
+ Debugging paths → Have to摸索 again next time
43
+ Best practices → Cannot be reused or传承
44
+ ```
45
+
46
+ ### 4. Low Efficiency
47
+ ```
48
+ ❌ Repetitive waiting and inefficient operations:
49
+ Configure database connection every time
50
+ Enter complete conditions for every log query
51
+ Manually execute multiple steps for each deployment
52
+ ```
53
+
54
+ ---
55
+
56
+ ## 💡 The Solution
57
+
58
+ **FlowMind learns once, applies forever.**
59
+
60
+ ### Core Philosophy
61
+
62
+ ```
63
+ ✅ First time: You teach FlowMind
64
+ ✅ Every time after: FlowMind remembers
65
+ ✅ Smarter with use: AI self-evolution
66
+ ```
67
+
68
+ ### One-Stop Solution
69
+
70
+ ```
71
+ Code Locate → Data Verify → Problem Analyze → One-Click Fix → Auto Deploy → Archive
72
+ ↓ ↓ ↓ ↓ ↓ ↓
73
+ Local+MCP RDS Read SLS Analysis Code Modify Pipeline OpenSpec+Yuque
74
+ ```
75
+
76
+ ### Smarter with Every Use
77
+
78
+ - 🧠 **Learning Accumulation** - Every use accumulates experience, understands your code and thinking better
79
+ - 🔄 **Scene Coordination** - Skills auto-coordinate across different scenarios, forming complete workflows
80
+ - 💰 **Token Optimization** - Reduce token consumption through mapping files, lower AI costs
81
+ - ⏱️ **Efficiency Boost** - Reduce repetitive waiting, 10x efficiency through automation
82
+ - 🎓 **Experience Retention** - Architect and senior developer design thinking, permanently preserved
83
+
84
+ ---
85
+
86
+ ## 🚀 Quick Start
87
+
88
+ ### Installation
89
+
90
+ ```bash
91
+ npm install -g flowmind
92
+ ```
93
+
94
+ ### Initialize
95
+
96
+ ```bash
97
+ flowmind init
98
+ ```
99
+
100
+ > One-time configuration, permanent effect. Configure resource connections, learning preferences, output formats - no need to repeat setup.
101
+
102
+ ### Start Using
103
+
104
+ ```bash
105
+ # First time - teach FlowMind your preference
106
+ flowmind "查询 traceId 日志,用顺序列表格式"
107
+ FlowMind: [Executes and learns your preference]
108
+
109
+ # Next time - FlowMind remembers!
110
+ flowmind "查询 traceId abc123 的日志"
111
+ FlowMind: [Automatically uses sequential list format] ✓
112
+ ```
113
+
114
+ ---
115
+
116
+ ## 🧠 How It Works
117
+
118
+ ### 1. Multi-Source Code Location
119
+
120
+ ```mermaid
121
+ graph LR
122
+ A[Your Request] --> B{Code Location}
123
+ B -->|Local| C[Local Codebase]
124
+ B -->|MCP| D[Remote Repository]
125
+ B -->|SSH| E[Server Code]
126
+ C --> F[Smart Matching]
127
+ D --> F
128
+ E --> F
129
+ F --> G[Precise Location]
130
+ ```
131
+
132
+ **Supported Modes:**
133
+ - 📁 **Local Mode** - Directly read local codebase
134
+ - 🔌 **MCP Mode** - Connect remote repositories via MCP protocol
135
+ - 🔐 **SSH Mode** - SSH connection to read server code
136
+
137
+ ### 2. RAG Intelligent Retrieval
138
+
139
+ ```mermaid
140
+ graph TD
141
+ A[Historical Data Collection] --> B[Knowledge Base Building]
142
+ B --> C[Intelligent Retrieval Matching]
143
+ C --> D[Context Generation]
144
+ D --> E[Auto Application]
145
+ E --> F[Continuous Optimization]
146
+ F --> A
147
+ ```
148
+
149
+ **RAG Process:**
150
+ - 📚 **Data Collection** - Collect historical learning records, workflows, best practices
151
+ - 🔍 **Smart Matching** - Based on scene similarity calculation, recommend best matching workflows
152
+ - 📝 **Context Generation** - Auto-generate context, reduce repetitive input
153
+ - 🔄 **Continuous Optimization** - Every use optimizes matching algorithms
154
+
155
+ ### 3. Learning Feedback Mechanism
156
+
157
+ ```mermaid
158
+ graph LR
159
+ A[Your Request] --> B[FlowMind Executes]
160
+ B --> C{You Correct?}
161
+ C -->|Yes| D[Record Learning]
162
+ C -->|No| E[Continue]
163
+ D --> F[Apply Next Time]
164
+ F --> G[Self Evolution]
165
+ ```
166
+
167
+ **Learning Types:**
168
+ - 📚 **Correction Learning** - "No, use table format" → Auto-remembered
169
+ - 🗺️ **Scene Learning** - "Check errors first then traces" → Workflow recorded
170
+ - ⚙️ **Preference Learning** - "Reply in Chinese" → Language preference saved
171
+ - 🔄 **Auto Application** - Automatically uses learned workflows next time
172
+
173
+ ### 4. Pluggable Component Architecture
174
+
175
+ FlowMind uses a **pluggable component architecture** that supports switching between cloud providers (Alibaba Cloud, Baidu Cloud, ELK, etc.) through configuration, without modifying skill code.
176
+
177
+ ```mermaid
178
+ graph TB
179
+ A[FlowMind Core] --> R[ComponentRegistry]
180
+ R --> LS[logService]
181
+ R --> DB[databaseManager]
182
+ R --> DQ[databaseQuery]
183
+ R --> RD[redisMonitor]
184
+ R --> AP[apiDoc]
185
+ R --> KB[knowledgeBase]
186
+ R --> WF[workflow]
187
+ R --> RP[report]
188
+
189
+ LS --> LS1[Alibaba Cloud SLS]
190
+ LS --> LS2[Baidu Cloud Log]
191
+ LS --> LS3[ELK]
192
+ DB --> DB1[Alibaba Cloud DMS]
193
+ KB --> KB1[Yuque]
194
+ KB --> KB2[Notion]
195
+ AP --> AP1[YApi]
196
+ ```
197
+
198
+ **8 Component Types:**
199
+
200
+ | Component Type | Default Provider | Description |
201
+ |----------------|------------------|-------------|
202
+ | `logService` | aliyun-sls | Cloud log querying and analysis |
203
+ | `databaseManager` | aliyun-dms | Database instance management |
204
+ | `databaseQuery` | aliyun-rds-query | Direct database SQL queries |
205
+ | `redisMonitor` | aliyun-redis | Redis monitoring via Prometheus |
206
+ | `apiDoc` | yapi | API documentation management |
207
+ | `knowledgeBase` | yuque | Knowledge base and documents |
208
+ | `workflow` | friday-flow | Automated workflow and pipelines |
209
+ | `report` | friday-report | Test and coverage reporting |
210
+
211
+ **Switching providers is config-only:**
212
+
213
+ ```json
214
+ {
215
+ "components": {
216
+ "logService": {
217
+ "default": "baidu-sls",
218
+ "providers": {
219
+ "baidu-sls": { "adapter": "baidu-sls-adapter", "enabled": true }
220
+ }
221
+ }
222
+ }
223
+ }
224
+ ```
225
+
226
+ ---
227
+
228
+ ## 📊 Use Cases
229
+
230
+ ### Scenario 1: Online Problem Investigation
231
+
232
+ ```bash
233
+ # Traditional way (10+ steps):
234
+ 1. Login to SLS console
235
+ 2. Enter query conditions
236
+ 3. Find traceId
237
+ 4. Copy traceId
238
+ 5. Search traces
239
+ 6. Locate error
240
+ 7. Connect RDS
241
+ 8. Query data
242
+ 9. Analyze cause
243
+ 10. Modify code
244
+ 11. Submit deployment
245
+ 12. Write documentation
246
+
247
+ # FlowMind way (1 command):
248
+ flowmind "排查线上问题 traceId abc123"
249
+ # → Auto complete: SLS query → Trace tracking → RDS data validation → Code location → Fix suggestion
250
+ ```
251
+
252
+ ### Scenario 2: Code Review
253
+
254
+ ```bash
255
+ # Set your standards (only once)
256
+ flowmind "代码审查先检查安全漏洞,再检查代码质量,最后检查性能"
257
+
258
+ # Every review follows your standards
259
+ flowmind "审查这个 PR"
260
+ # → Security first → Quality check → Performance analysis
261
+ ```
262
+
263
+ ### Scenario 3: API Documentation Sync
264
+
265
+ ```bash
266
+ # Generate docs from code
267
+ flowmind "从代码注释生成 API 文档"
268
+
269
+ # Sync to YApi
270
+ flowmind "同步接口到 YApi"
271
+
272
+ # Auto update Yuque
273
+ flowmind "同步 API 文档到语雀"
274
+ ```
275
+
276
+ ### Scenario 4: Data Validation
277
+
278
+ ```bash
279
+ # Connect RDS to validate data
280
+ flowmind "验证订单表数据完整性"
281
+
282
+ # Auto execute checks
283
+ # → Referential integrity → Data types → Business logic → State machine
284
+ ```
285
+
286
+ ### Scenario 5: Project Health Check
287
+
288
+ ```bash
289
+ # Full review
290
+ flowmind "审查项目整体状况"
291
+
292
+ # Auto execute:
293
+ # → Dependency analysis → Security audit → Code complexity → Test coverage → Technical debt
294
+ ```
295
+
296
+ ### Scenario 6: Project Onboarding
297
+
298
+ ```bash
299
+ # New to a project? FlowMind helps you understand fast
300
+ flowmind "帮我理解这个项目的整体架构"
301
+
302
+ # FlowMind learns from senior devs' patterns:
303
+ # → Project structure analysis → Core module explanation → Data flow mapping
304
+ # → Key design decisions → Development guidelines → Suggested learning path
305
+ ```
306
+
307
+ ### Scenario 7: Design & Architecture Guidance
308
+
309
+ ```bash
310
+ # Facing a design choice? FlowMind draws from accumulated experience
311
+ flowmind "这个功能应该用 Redis 还是 MongoDB?"
312
+
313
+ # FlowMind applies learned design thinking:
314
+ # → Your project context → Current tech stack → Performance requirements
315
+ # → Historical similar decisions → Trade-off analysis → Data-driven recommendation
316
+ ```
317
+
318
+ ---
319
+
320
+ ## 🏗️ Architecture
321
+
322
+ ### System Architecture
323
+
324
+ ```
325
+ ┌──────────────────────────────────────────────────────────────────┐
326
+ │ FlowMind Agent │
327
+ ├──────────────────────────────────────────────────────────────────┤
328
+ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
329
+ │ │ Scene Matcher│ │Learning Engine│ │ Skill Loader │ │
330
+ │ └──────────────┘ └──────────────┘ └──────────────┘ │
331
+ ├──────────────────────────────────────────────────────────────────┤
332
+ │ ┌──────────────────────────────────────────────────────────┐ │
333
+ │ │ ComponentRegistry (Pluggable) │ │
334
+ │ ├──────────┬──────────┬──────────┬──────────┬──────────────┤ │
335
+ │ │logService│database │apiDoc │knowledge │workflow/report│ │
336
+ │ │Adapter │Manager │Adapter │Base │Adapters │ │
337
+ │ └──────────┴──────────┴──────────┴──────────┴──────────────┘ │
338
+ ├──────────────────────────────────────────────────────────────────┤
339
+ │ ┌──────────────────────────────────────────────────────────┐ │
340
+ │ │ Skill System │ │
341
+ │ ├─────────────┬─────────────┬─────────────┬────────────────┤ │
342
+ │ │ Analysis │ Integration │ Quality │ Automation │ │
343
+ │ └─────────────┴─────────────┴─────────────┴────────────────┘ │
344
+ ├──────────────────────────────────────────────────────────────────┤
345
+ │ ┌──────────────────────────────────────────────────────────┐ │
346
+ │ │ Cloud Provider Adapters │ │
347
+ │ ├──────────┬──────────┬──────────┬──────────┬──────────────┤ │
348
+ │ │Aliyun SLS│Aliyun DMS│ YApi │ Yuque │Friday Flow │ │
349
+ │ │Baidu Log │Baidu DMS │ Swagger │ Notion │Friday Report │ │
350
+ │ │ELK │Custom DB │ │Confluence│ │ │
351
+ │ └──────────┴──────────┴──────────┴──────────┴──────────────┘ │
352
+ ├──────────────────────────────────────────────────────────────────┤
353
+ │ ┌──────────────────────────────────────────────────────────┐ │
354
+ │ │ Data Persistence Layer │ │
355
+ │ ├─────────────┬─────────────┬───────────────────────────────┤ │
356
+ │ │Learning │Scene │Component Config │ │
357
+ │ │Records │Mappings │& Settings │ │
358
+ │ └─────────────┴─────────────┴───────────────────────────────┘ │
359
+ └──────────────────────────────────────────────────────────────────┘
360
+ ```
361
+
362
+ ### Directory Structure
363
+
364
+ ```
365
+ flowmind/
366
+ ├── core/ # Core Engine
367
+ │ ├── index.js # Main entry
368
+ │ ├── learning-engine.js # Learning engine
369
+ │ ├── scene-matcher.js # Scene matching
370
+ │ ├── skill-loader.js # Skill loading
371
+ │ ├── config-manager.js # Config management
372
+ │ ├── component-types.js # Component type definitions
373
+ │ ├── component-registry.js # Pluggable component registry
374
+ │ ├── mcp-compatibility.js # MCP backward compatibility
375
+ │ ├── adapters/ # Adapter interfaces
376
+ │ │ ├── base-adapter.js # Abstract base adapter
377
+ │ │ ├── mcp-adapter.js # MCP adapter base
378
+ │ │ ├── log-service-adapter.js
379
+ │ │ ├── database-manager-adapter.js
380
+ │ │ ├── database-query-adapter.js
381
+ │ │ ├── knowledge-base-adapter.js
382
+ │ │ ├── api-doc-adapter.js
383
+ │ │ ├── workflow-adapter.js
384
+ │ │ └── report-adapter.js
385
+ │ └── providers/ # Provider implementations
386
+ │ ├── aliyun/ # Alibaba Cloud adapters
387
+ │ │ ├── sls-adapter.js
388
+ │ │ ├── dms-adapter.js
389
+ │ │ └── redis-adapter.js
390
+ │ ├── yapi/ # YApi adapter
391
+ │ │ └── yapi-adapter.js
392
+ │ ├── yuque/ # Yuque adapter
393
+ │ │ └── yuque-adapter.js
394
+ │ └── friday/ # Friday platform adapters
395
+ │ ├── flow-adapter.js
396
+ │ └── report-adapter.js
397
+ ├── scripts/ # Migration tools
398
+ │ └── migrate-config.js # Config migration tool
399
+ ├── skills/ # Skill Modules (17 core skills)
400
+ │ ├── log-audit/ # Log audit
401
+ │ ├── sls-log-audit/ # SLS log audit (chain tracing)
402
+ │ ├── resource-bind/ # Resource binding
403
+ │ ├── code-review/ # Code review
404
+ │ ├── code-review-audit/ # Code review audit (3D review)
405
+ │ ├── data-validation/ # Data validation
406
+ │ ├── data-logic-validation/ # Data logic validation
407
+ │ ├── api-sync/ # API sync
408
+ │ ├── yapi-sync-interface/ # YApi interface sync
409
+ │ ├── yuque-sync-design/ # Yuque design doc sync
410
+ │ ├── project-review/ # Project review
411
+ │ ├── git-review/ # Git review
412
+ │ ├── archive-change/ # Change archiving
413
+ │ ├── auto-flow/ # Workflow automation
414
+ │ ├── learning-engine/ # Learning engine
415
+ │ ├── learning-feedback/ # Learning feedback (global)
416
+ │ └── requirement-analyst/ # Requirement analyst (6D analysis)
417
+ ├── learning/ # Learning Storage
418
+ │ ├── records/ # Learning records
419
+ │ └── scenes.json # Scene mappings
420
+ ├── templates/ # Output templates
421
+ └── config/ # Configuration files
422
+ ```
423
+
424
+ ### Learning Flow
425
+
426
+ ```mermaid
427
+ sequenceDiagram
428
+ participant U as User
429
+ participant A as FlowMind Agent
430
+ participant M as Scene Matcher
431
+ participant L as Learning Engine
432
+ participant S as Skill System
433
+ participant MCP as MCP Integration
434
+ participant D as Data Persistence
435
+
436
+ U->>A: Send request
437
+ A->>M: Check scene mappings
438
+ M->>D: Read history records
439
+ D-->>M: Return matching workflows
440
+ M-->>A: Return recommended plan
441
+
442
+ A->>S: Execute skills
443
+ S->>MCP: Call external services
444
+ MCP-->>S: Return results
445
+ S-->>A: Return execution results
446
+
447
+ A->>U: Present results
448
+
449
+ U->>A: Provide feedback
450
+ A->>L: Record learning
451
+ L->>D: Persist storage
452
+ L->>L: Optimize matching algorithm
453
+ ```
454
+
455
+ ### One-Stop Problem Solving Flow
456
+
457
+ ```mermaid
458
+ graph TB
459
+ A[Problem Discovery] --> B[Code Location]
460
+ B --> C[Data Validation]
461
+ C --> D[Problem Analysis]
462
+ D --> E[One-Click Fix]
463
+ E --> F[Auto Deploy]
464
+ F --> G[Archive Record]
465
+
466
+ B --> B1[Local Code]
467
+ B --> B2[MCP Remote]
468
+ B --> B3[SSH Mode]
469
+
470
+ C --> C1[RDS Data Read]
471
+ C --> C2[Data Integrity Validation]
472
+
473
+ D --> D1[SLS Log Analysis]
474
+ D --> D2[TraceID Tracing]
475
+ D --> D3[Root Cause Location]
476
+
477
+ E --> E1[Code Modification]
478
+ E --> E2[Unit Tests]
479
+
480
+ F --> F1[Pipeline Execution]
481
+ F --> F2[Auto Deployment]
482
+
483
+ G --> G1[OpenSpec Archive]
484
+ G --> G2[Yuque Doc Sync]
485
+ G --> G3[RAG Data Building]
486
+ ```
487
+
488
+ ---
489
+
490
+ ## ✨ Features
491
+
492
+ ### 🏗️ Core Architecture
493
+
494
+ FlowMind is built on **enterprise-grade architecture design standards**, incorporating extensive experience from architects and senior developers:
495
+
496
+ - 📐 **OpenSpec Design Standards** - Standardized skill definitions and interface specifications
497
+ - 🧠 **RAG Business Logic** - Intelligent retrieval and generation based on historical data
498
+ - 💾 **Data Persistence** - All learning records and configurations stored locally
499
+ - ⚙️ **Global Config Initialization** - One-time setup, permanent effect, no repeated configuration
500
+ - 🔌 **Pluggable Components** - Switch cloud providers (Alibaba Cloud, Baidu Cloud, ELK, etc.) via config without code changes
501
+
502
+ ### 🔧 Skill System (17 Core Skills)
503
+
504
+ #### 📊 Analysis Skills
505
+
506
+ | Skill | Description |
507
+ |-------|-------------|
508
+ | 🔍 **log-audit** | Log Audit - Time filtering, service filtering, level filtering, keyword search, TraceID tracing, performance analysis |
509
+ | 🔗 **sls-log-audit** | SLS Log Audit - Alibaba Cloud SLS log query, TraceID chain analysis, Feign call chain extraction, response time analysis |
510
+ | 🔎 **project-review** | Project Review - Dependency analysis, security audit, license compliance, code complexity, test coverage, technical debt assessment |
511
+ | 📋 **git-review** | Git Review - Commit quality analysis, change size assessment, impact analysis, risk evaluation, dependency change detection |
512
+ | 📐 **requirement-analyst** | Requirement Analyst - Historical design principles, iteration rationale, extensibility, market roadmap, req-code deviation, upgrade vulnerabilities |
513
+
514
+ #### 🔌 Integration Skills
515
+
516
+ | Skill | Description |
517
+ |-------|-------------|
518
+ | 🔗 **resource-bind** | Resource Bind - MySQL/PostgreSQL connection management, Redis operations, REST API integration, authentication management |
519
+ | 📚 **api-sync** | API Sync - Generate docs from code annotations, OpenAPI/Swagger spec generation, client SDK generation, version management |
520
+ | 📋 **yapi-sync-interface** | YApi Interface Sync - Sync Controller interfaces to YApi, Swagger import/export, interface management |
521
+ | 📖 **yuque-sync-design** | Yuque Design Sync - Sync OpenSpec design docs to Yuque, knowledge base management, document archiving |
522
+ | ✅ **data-validation** | Data Validation - Referential integrity checks, data type validation, business logic verification, state machine validation, duplicate detection |
523
+ | 🔬 **data-logic-validation** | Data Logic Validation - Verify actual SQL queries and Redis logic via MCP database/Redis connections |
524
+
525
+ #### 🛠️ Quality Skills
526
+
527
+ | Skill | Description |
528
+ |-------|-------------|
529
+ | 🔒 **code-review** | Code Review - SQL injection detection, XSS vulnerability scanning, authentication issues, code style, complexity analysis, design pattern checks |
530
+ | 🛡️ **code-review-audit** | Code Review Audit - Three-dimensional review: security audit, design compliance, mandatory constraint validation before merge/test |
531
+ | 📝 **archive-change** | Archive Change - Archive completed changes, auto-generate change summary, update changelog, create knowledge base entries, link Issue/PR |
532
+
533
+ #### ⚡ Automation Skills
534
+
535
+ | Skill | Description |
536
+ |-------|-------------|
537
+ | 🔄 **auto-flow** | Auto Flow - Sequential execution, parallel execution, conditional branching, error handling, workflow templates, team sharing |
538
+
539
+ #### 🧠 Intelligence Skills
540
+
541
+ | Skill | Description |
542
+ |-------|-------------|
543
+ | 🎯 **learning-engine** | Learning Engine - Correction learning, scene learning, preference learning, auto-application, learning loop, knowledge graph construction |
544
+ | 📝 **learning-feedback** | Learning Feedback (Global) - Capture user corrections, scene mapping, auto-bind to relevant skills, continuous optimization |
545
+
546
+ ### 🎯 Core Capabilities Explained
547
+
548
+ #### 1️⃣ OpenSpec Design Standards
549
+ ```
550
+ Standardized skill definitions → Unified interface specifications → Plug and play
551
+ ```
552
+ - Each skill has a standard SKILL.md definition file
553
+ - Unified trigger conditions, feature descriptions, and examples
554
+ - Support for custom skill extensions
555
+
556
+ #### 2️⃣ RAG Business Logic
557
+ ```
558
+ Historical data collection → Intelligent retrieval matching → Context generation → Auto application
559
+ ```
560
+ - Intelligent matching based on historical learning records
561
+ - Scene similarity calculation and recommendations
562
+ - Context-aware workflow application
563
+
564
+ #### 3️⃣ Data Persistence
565
+ ```
566
+ Learning records → Local storage → Permanent retention → Cross-session reuse
567
+ ```
568
+ - All learning records stored locally and persistently
569
+ - Configuration information permanently retained
570
+ - Support import/export for team sharing
571
+
572
+ #### 4️⃣ Global Config Initialization
573
+ ```
574
+ flowmind init → One-time configuration → Permanent effect
575
+ ```
576
+ - Run `flowmind init` to complete initialization
577
+ - Configure resource connections, learning preferences, output formats
578
+ - No need to repeat setup each time
579
+
580
+ #### 5️⃣ Learning Feedback Mechanism (Self-Evolution)
581
+ ```
582
+ User correction → Record learning → Auto apply → Continuous optimization
583
+ ```
584
+ - **Correction Learning**: "No, use table format" → Auto-remembered
585
+ - **Scene Learning**: "Check errors first then traces" → Workflow recorded
586
+ - **Preference Learning**: "Reply in Chinese" → Language preference saved
587
+ - **Auto Application**: Automatically uses learned workflows next time
588
+
589
+ #### 6️⃣ Pluggable Component Architecture (Full Configuration)
590
+ ```
591
+ Component Type → Provider Interface → Cloud Service Adapter → Switch via Config
592
+ ```
593
+
594
+ **Key Design Principles:**
595
+ - 🔌 **Provider Abstraction** - Each component type defines a standard interface; providers implement the interface
596
+ - ⚙️ **Config-Driven Switching** - Switch cloud providers by modifying JSON config, zero code changes
597
+ - 🔗 **MCP Backward Compatibility** - Existing MCP server configurations continue to work seamlessly
598
+ - 🧩 **Custom Extensibility** - Register your own adapters for proprietary or third-party services
599
+
600
+ **Component Lifecycle:**
601
+ ```
602
+ flowmind init → Load component-config.json → Register adapters → Activate default providers
603
+
604
+ Skills call ComponentRegistry.getAdapter(type)
605
+
606
+ Adapter delegates to MCP server or custom implementation
607
+ ```
608
+
609
+ **MCP Server to Component Mapping:**
610
+
611
+ | MCP Server | Component Type | Provider |
612
+ |------------|----------------|----------|
613
+ | `friday-sls-logs` | `logService` | `aliyun-sls` |
614
+ | `aliyun-dms-mcp-server` | `databaseManager` | `aliyun-dms` |
615
+ | `friday-rds-redis-query` | `databaseQuery` | `aliyun-rds-query` |
616
+ | `friday-aliyun-sz-rds-redis` | `redisMonitor` | `aliyun-redis` |
617
+ | `aomi-yapi-mcp` | `apiDoc` | `yapi` |
618
+ | `aomi-yuque-mcp` | `knowledgeBase` | `yuque` |
619
+ | `friday-auto-flow` | `workflow` | `friday-flow` |
620
+ | `friday-auto-report` | `report` | `friday-report` |
621
+
622
+ ### 🛠️ Custom Adapter Development
623
+
624
+ Create your own adapter to integrate proprietary or third-party services.
625
+
626
+ **Step 1: Extend the Base Adapter**
627
+
628
+ ```javascript
629
+ // core/providers/custom/my-sls-adapter.js
630
+ const LogServiceAdapter = require('../../adapters/log-service-adapter');
631
+
632
+ class MyCustomSlsAdapter extends LogServiceAdapter {
633
+ constructor(config = {}) {
634
+ super('my-custom-sls', config);
635
+ // Register MCP tool name mappings
636
+ this.registerTool('queryLogs', 'myQueryLogsTool');
637
+ }
638
+
639
+ get mcpServer() {
640
+ return 'my-custom-mcp-server';
641
+ }
642
+
643
+ async queryLogs(params) {
644
+ // Custom implementation
645
+ return { mcpServer: this.mcpServer, tool: this.resolveTool('queryLogs'), params };
646
+ }
647
+ }
648
+
649
+ module.exports = MyCustomSlsAdapter;
650
+ ```
651
+
652
+ **Step 2: Register the Provider Factory**
653
+
654
+ ```javascript
655
+ // In your initialization code
656
+ const registry = new ComponentRegistry(config);
657
+
658
+ registry.registerFactory('my-custom-sls', () => {
659
+ const MyCustomSlsAdapter = require('./providers/custom/my-sls-adapter');
660
+ return new MyCustomSlsAdapter(config.get('components.logService.providers.my-custom-sls'));
661
+ });
662
+ ```
663
+
664
+ **Step 3: Configure the Provider**
665
+
666
+ ```json
667
+ {
668
+ "components": {
669
+ "logService": {
670
+ "default": "my-custom-sls",
671
+ "providers": {
672
+ "my-custom-sls": {
673
+ "adapter": "my-custom-sls-adapter",
674
+ "enabled": true,
675
+ "mcpServer": "my-custom-mcp-server",
676
+ "config": {
677
+ "endpoint": "my-sls.example.com"
678
+ }
679
+ }
680
+ }
681
+ }
682
+ }
683
+ }
684
+ ```
685
+
686
+ **Adapter Interface Requirements by Component Type:**
687
+
688
+ | Component Type | Required Methods | Required Capabilities |
689
+ |----------------|------------------|----------------------|
690
+ | `logService` | `queryLogs()`, `listProjects()` | Log querying and project listing |
691
+ | `databaseManager` | `listInstances()`, `executeScript()`, `searchDatabase()` | Instance management and SQL execution |
692
+ | `databaseQuery` | `queryExec()`, `fetchSource()`, `fetchTables()` | Direct SQL queries |
693
+ | `redisMonitor` | `query()`, `queryRange()`, `getLabelValues()` | Prometheus metric queries |
694
+ | `apiDoc` | `searchApis()`, `saveApi()`, `getCategories()` | API doc CRUD |
695
+ | `knowledgeBase` | `getRepos()`, `getDocs()`, `createDoc()`, `updateDoc()` | Knowledge base CRUD |
696
+ | `workflow` | `listPipelines()`, `startPipelineRun()` | Pipeline management |
697
+ | `report` | `listBuilds()`, `getBuildInfo()` | Build report retrieval |
698
+
699
+ ### 📦 Configuration Migration Tool
700
+
701
+ Migrate existing MCP server configurations to the new component architecture.
702
+
703
+ ```bash
704
+ # Preview migration (dry run)
705
+ node scripts/migrate-config.js --dry-run
706
+
707
+ # Generate migration config
708
+ node scripts/migrate-config.js
709
+
710
+ # Specify custom output path
711
+ node scripts/migrate-config.js --output ./my-config.json
712
+ ```
713
+
714
+ **What it does:**
715
+ 1. Reads existing MCP server configuration from `.claude/settings.local.json`
716
+ 2. Maps MCP servers to component types using the default mapping table
717
+ 3. Generates a `component-config.json` with proper structure
718
+
719
+ **Migration output example:**
720
+ ```json
721
+ {
722
+ "version": "1.0.0",
723
+ "components": {
724
+ "logService": {
725
+ "default": "aliyun-sls",
726
+ "providers": {
727
+ "aliyun-sls": {
728
+ "adapter": "aliyun-sls-adapter",
729
+ "enabled": true,
730
+ "mcpServer": "friday-sls-logs"
731
+ }
732
+ }
733
+ }
734
+ }
735
+ }
736
+ ```
737
+
738
+ ---
739
+
740
+ ## 📈 Impact & Metrics
741
+
742
+ | Metric | Before FlowMind | After FlowMind |
743
+ |--------|-----------------|----------------|
744
+ | Repetitive instructions | 100% | ~5% |
745
+ | Workflow consistency | Variable | 98%+ |
746
+ | Problem investigation time | 30+ min | 5 min |
747
+ | Onboarding new devs | 2 weeks | 2 days |
748
+ | Token consumption | High | Reduce 60%+ |
749
+ | Experience retention | Cannot preserve | Permanent reuse |
750
+ | Design decision quality | Trial and error | Experience-backed |
751
+
752
+ ---
753
+
754
+ ## 🌟 Community Building
755
+
756
+ **FlowMind's Core Philosophy: More Users, Smarter Together!**
757
+
758
+ ### Why We Need You?
759
+
760
+ ```
761
+ Everyone's work habits → Combined into intelligent knowledge base
762
+ Your every use → Makes FlowMind understand developers better
763
+ Your every correction → Helps everyone improve efficiency
764
+ ```
765
+
766
+ ### How to Participate?
767
+
768
+ 1. **Use & Feedback** - Use FlowMind daily, tell us what can be better
769
+ 2. **Share Workflows** - Share your workflows with team and community
770
+ 3. **Contribute Code** - Add skills, improve algorithms, optimize experience
771
+ 4. **Spread the Word** - Let more developers know about FlowMind
772
+
773
+ ### Benefits of Participation
774
+
775
+ - 🚀 **Personal Efficiency** - Let FlowMind handle repetitive work
776
+ - 🧠 **Collective Wisdom** - Combine experiences from millions of developers
777
+ - 🌍 **Open Source Sharing** - All learning成果 shared openly
778
+ - 🤝 **Community Recognition** - Contributors permanently recorded
779
+
780
+ **Let's build smarter developer tools together!**
781
+
782
+ ---
783
+
784
+ ## 🤝 Contributing
785
+
786
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
787
+
788
+ ### Ways to Contribute
789
+ - 🐛 Report bugs
790
+ - 💡 Suggest features
791
+ - 📝 Improve docs
792
+ - 🛠️ Add skills
793
+ - 🌍 Translations
794
+ - 🧪 Write tests
795
+
796
+ ---
797
+
798
+ ## 📄 License
799
+
800
+ MIT License - see [LICENSE](LICENSE) for details.
801
+
802
+ ---
803
+
804
+ ## 🎓 Your Team Mentor
805
+
806
+ FlowMind becomes a valuable assistant for every role through continuous learning from team experience:
807
+
808
+ ### 👨‍💻 For Developers: Quality Control & End-to-End Design
809
+
810
+ - **Full-Process Design Guidance** - From requirements analysis to architecture design, FlowMind learns team design patterns and provides experience-backed guidance at every step
811
+ - **Code Quality Control** - Absorbs team Code Review standards and best practices, providing real-time feedback during development
812
+ - **Technical Decision Support** - Based on historical project experience, provides data-backed support for tech stack and architecture decisions
813
+
814
+ ### 🧪 For Testers: Review-Driven Quality & Requirements Alignment
815
+
816
+ - **Code Review Quality Control** - Learns team review standards, helping testers identify potential issues at the code level
817
+ - **Requirements Tracing** - Automatically links requirements to code implementation, ensuring complete test coverage without missing edge cases
818
+ - **Historical Defect Learning** - Learns from past Bug patterns, identifies high-risk areas proactively for precise test resource allocation
819
+
820
+ ### 📦 For Product Managers: Learn from History, Plan for the Future
821
+
822
+ - **Historical Design Analysis** - Traces historical resources and design evolution, helping product understand "why it was designed this way"
823
+ - **Upgrade Path Planning** - Based on historical iteration patterns and technical architecture constraints, derives reasonable feature evolution directions
824
+ - **Feasibility Assessment** - Combines technical implementation costs with historical experience to inform product decisions
825
+
826
+ > *FlowMind doesn't replace anyone—it preserves and transmits team design wisdom, quality standards, and product experience across time and roles, enabling every role to make better decisions standing on the shoulders of those before them.*
827
+
828
+ ---
829
+
830
+ ## 🙏 Acknowledgments
831
+
832
+ Built with:
833
+ - Claude AI - Intelligence backbone
834
+ - MCP Protocol - Tool integration
835
+ - OpenSpec - Design standards
836
+ - Open source community - Inspiration and support
837
+
838
+ ---
839
+
840
+ ## 📞 Contact
841
+
842
+ - **GitHub**: [github.com/Eleven-M/flowmind](https://github.com/Eleven-M/flowmind)
843
+ - **Email**: 13060993305@163.com
844
+
845
+ ---
846
+
847
+ <div align="center">
848
+
849
+ **[⬆ back to top](#-flowmind)**
850
+
851
+ Made with ❤️ by the FlowMind team
852
+
853
+ *"Learn once, flow forever"*
854
+
855
+ </div>