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.
- package/LICENSE +21 -0
- package/README.md +855 -0
- package/README_CN.md +854 -0
- package/bin/flowmind.js +464 -0
- package/core/adapters/api-doc-adapter.js +71 -0
- package/core/adapters/base-adapter.js +80 -0
- package/core/adapters/database-manager-adapter.js +60 -0
- package/core/adapters/database-query-adapter.js +51 -0
- package/core/adapters/knowledge-base-adapter.js +75 -0
- package/core/adapters/log-service-adapter.js +41 -0
- package/core/adapters/mcp-adapter.js +65 -0
- package/core/adapters/report-adapter.js +60 -0
- package/core/adapters/workflow-adapter.js +62 -0
- package/core/component-registry.js +281 -0
- package/core/component-types.js +63 -0
- package/core/config-manager.js +360 -0
- package/core/index.js +223 -0
- package/core/learning-engine.js +588 -0
- package/core/mcp-compatibility.js +150 -0
- package/core/providers/aliyun/dms-adapter.js +98 -0
- package/core/providers/aliyun/redis-adapter.js +88 -0
- package/core/providers/aliyun/sls-adapter.js +86 -0
- package/core/providers/friday/flow-adapter.js +85 -0
- package/core/providers/friday/report-adapter.js +83 -0
- package/core/providers/yapi/yapi-adapter.js +79 -0
- package/core/providers/yuque/yuque-adapter.js +90 -0
- package/core/scene-matcher.js +326 -0
- package/core/skill-loader.js +291 -0
- package/package.json +67 -0
- package/scripts/migrate-config.js +153 -0
- package/skills/api-sync/SKILL.md +203 -0
- package/skills/archive-change/SKILL.md +172 -0
- package/skills/auto-flow/SKILL.md +277 -0
- package/skills/code-review/SKILL.md +206 -0
- package/skills/code-review-audit/SKILL.md +150 -0
- package/skills/data-logic-validation/SKILL.md +162 -0
- package/skills/data-validation/SKILL.md +210 -0
- package/skills/git-review/SKILL.md +190 -0
- package/skills/learning-engine/SKILL.md +352 -0
- package/skills/learning-feedback/SKILL.md +174 -0
- package/skills/log-audit/SKILL.md +226 -0
- package/skills/project-review/SKILL.md +196 -0
- package/skills/requirement-analyst/SKILL.md +275 -0
- package/skills/resource-bind/SKILL.md +222 -0
- package/skills/sls-log-audit/SKILL.md +223 -0
- package/skills/yapi-sync-interface/SKILL.md +145 -0
- package/skills/yuque-sync-design/SKILL.md +157 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: resource-bind
|
|
3
|
+
description: Resource binding and connection management skill for FlowMind. Manage database, Redis, API, and other external resource connections.
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0.0"
|
|
6
|
+
author: flowmind
|
|
7
|
+
category: infrastructure
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Resource Bind Skill
|
|
11
|
+
|
|
12
|
+
Manage database, Redis, API, and other external resource connections.
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
### ๐๏ธ Database Management
|
|
17
|
+
- MySQL/PostgreSQL connections
|
|
18
|
+
- Connection pooling
|
|
19
|
+
- Query execution
|
|
20
|
+
- Schema inspection
|
|
21
|
+
|
|
22
|
+
### ๐ฆ Redis Management
|
|
23
|
+
- Redis connections
|
|
24
|
+
- Key operations
|
|
25
|
+
- Cache management
|
|
26
|
+
|
|
27
|
+
### ๐ API Integration
|
|
28
|
+
- REST API connections
|
|
29
|
+
- Authentication management
|
|
30
|
+
- Request/response handling
|
|
31
|
+
|
|
32
|
+
## Trigger Patterns
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
"ๆฐๆฎๅบ", "database", "DB", "SQL"
|
|
36
|
+
"redis", "็ผๅญ", "cache"
|
|
37
|
+
"API", "ๆฅๅฃ", "่ฟๆฅ"
|
|
38
|
+
"่ตๆบ", "resource"
|
|
39
|
+
"่ฟๆฅ้
็ฝฎ", "connection"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Resource Types
|
|
43
|
+
|
|
44
|
+
### Database
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"type": "mysql",
|
|
49
|
+
"host": "localhost",
|
|
50
|
+
"port": 3306,
|
|
51
|
+
"database": "mydb",
|
|
52
|
+
"username": "user",
|
|
53
|
+
"password": "pass"
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Redis
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"type": "redis",
|
|
62
|
+
"host": "localhost",
|
|
63
|
+
"port": 6379,
|
|
64
|
+
"password": "",
|
|
65
|
+
"db": 0
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### API
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"type": "rest",
|
|
74
|
+
"baseUrl": "https://api.example.com",
|
|
75
|
+
"auth": {
|
|
76
|
+
"type": "bearer",
|
|
77
|
+
"token": "xxx"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Output Format
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
86
|
+
โ Resource Connection โ
|
|
87
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
88
|
+
โ Type: {resource_type} โ
|
|
89
|
+
โ Status: Connected โ โ
|
|
90
|
+
โ Host: {host}:{port} โ
|
|
91
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
92
|
+
โ Available: โ
|
|
93
|
+
โ โข {database1} โ
|
|
94
|
+
โ โข {database2} โ
|
|
95
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Learning Integration
|
|
99
|
+
|
|
100
|
+
This skill supports FlowMind learning:
|
|
101
|
+
|
|
102
|
+
- **Connection Method**: Learns preferred connection method
|
|
103
|
+
- **Default Database**: Learns frequently used databases
|
|
104
|
+
- **Query Style**: Learns query formatting preferences
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
User: "็จ source_id ่ฟๆฅ"
|
|
108
|
+
FlowMind: โ Learned: Use source_id for connections
|
|
109
|
+
|
|
110
|
+
User: [Next connection]
|
|
111
|
+
FlowMind: [Uses source_id automatically]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Examples
|
|
115
|
+
|
|
116
|
+
### Example 1: Database Connection
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
User: ่ฟๆฅๆฐๆฎๅบๆฅ่ฏข็จๆท่กจ
|
|
120
|
+
|
|
121
|
+
FlowMind:
|
|
122
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
123
|
+
โ Database Connection โ
|
|
124
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
125
|
+
โ Type: MySQL โ
|
|
126
|
+
โ Host: localhost:3306 โ
|
|
127
|
+
โ Database: mydb โ
|
|
128
|
+
โ Status: Connected โ โ
|
|
129
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
130
|
+
โ Tables: โ
|
|
131
|
+
โ โข users (1000 rows) โ
|
|
132
|
+
โ โข orders (5000 rows) โ
|
|
133
|
+
โ โข products (200 rows) โ
|
|
134
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Example 2: Redis Operations
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
User: ๆฅ็ Redis ็ผๅญ็ถๆ
|
|
141
|
+
|
|
142
|
+
FlowMind:
|
|
143
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
144
|
+
โ Redis Status โ
|
|
145
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
146
|
+
โ Host: localhost:6379 โ
|
|
147
|
+
โ Status: Connected โ โ
|
|
148
|
+
โ Keys: 1,234 โ
|
|
149
|
+
โ Memory: 45.2 MB โ
|
|
150
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
151
|
+
โ Recent Keys: โ
|
|
152
|
+
โ โข user:123 (TTL: 3600s) โ
|
|
153
|
+
โ โข session:abc (TTL: 1800s) โ
|
|
154
|
+
โ โข cache:products (TTL: 300s) โ
|
|
155
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Configuration
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"resources": {
|
|
163
|
+
"database": {
|
|
164
|
+
"enabled": true,
|
|
165
|
+
"type": "mysql",
|
|
166
|
+
"connection": {
|
|
167
|
+
"host": "localhost",
|
|
168
|
+
"port": 3306,
|
|
169
|
+
"database": "mydb"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"redis": {
|
|
173
|
+
"enabled": true,
|
|
174
|
+
"connection": {
|
|
175
|
+
"host": "localhost",
|
|
176
|
+
"port": 6379
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"api": {
|
|
180
|
+
"enabled": true,
|
|
181
|
+
"baseUrl": "https://api.example.com"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Connection Methods
|
|
188
|
+
|
|
189
|
+
### Direct Connection
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"method": "direct",
|
|
194
|
+
"host": "localhost",
|
|
195
|
+
"port": 3306
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Source ID Connection
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"method": "source_id",
|
|
204
|
+
"sourceId": "your-source-id"
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Connection String
|
|
209
|
+
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"method": "connection_string",
|
|
213
|
+
"url": "mysql://user:pass@host:3306/db"
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Security
|
|
218
|
+
|
|
219
|
+
- Passwords are encrypted at rest
|
|
220
|
+
- Connections use TLS when available
|
|
221
|
+
- Credentials are never logged
|
|
222
|
+
- Connection pooling prevents exhaustion
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sls-log-audit
|
|
3
|
+
description: SLS log audit skill for FlowMind. Query cloud log service (SLS, ELK, etc.), trace ID chain analysis, Feign call chain extraction, response time analysis, and error log investigation.
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.1.0"
|
|
6
|
+
author: flowmind
|
|
7
|
+
category: monitoring
|
|
8
|
+
componentDependencies:
|
|
9
|
+
- logService
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SLS Log Audit Skill
|
|
13
|
+
|
|
14
|
+
Query and analyze Alibaba Cloud SLS (Simple Log Service) logs for troubleshooting, performance analysis, and chain tracing.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
### Log Query
|
|
19
|
+
- Time-range based log search
|
|
20
|
+
- Service-level filtering
|
|
21
|
+
- Log level filtering (ERROR, WARN, INFO, DEBUG)
|
|
22
|
+
- Keyword and pattern search
|
|
23
|
+
|
|
24
|
+
### TraceID Chain Analysis
|
|
25
|
+
- Full call chain extraction by TraceID
|
|
26
|
+
- Request/Response data capture
|
|
27
|
+
- Timing analysis per span
|
|
28
|
+
- Error location pinpointing
|
|
29
|
+
|
|
30
|
+
### Feign Call Chain
|
|
31
|
+
- Remote call chain extraction
|
|
32
|
+
- Upstream/downstream service mapping
|
|
33
|
+
- Call latency analysis
|
|
34
|
+
- Failure point identification
|
|
35
|
+
|
|
36
|
+
### Performance Analysis
|
|
37
|
+
- Response time analysis
|
|
38
|
+
- Slow endpoint detection
|
|
39
|
+
- Timeout investigation
|
|
40
|
+
- Bottleneck identification
|
|
41
|
+
|
|
42
|
+
## Trigger Patterns
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
"SLSๆฅๅฟ", "sls", "ๆฅๅฟๅฎกๆฅ", "ๆฅๅฟๆๆฅ"
|
|
46
|
+
"็บฟไธๆฅๅฟ", "้่ฏฏๆฅๅฟ", "ๅผๅธธๆฅๅฟ", "ๅ่ญฆๆฅๅฟ"
|
|
47
|
+
"traceId", "้พ่ทฏ่ฟฝ่ธช", "่ฐ็จ้พ", "้พ่ทฏๅๆ"
|
|
48
|
+
"Feign้พ่ทฏ", "feign่ฐ็จ", "่ฟ็จ่ฐ็จ", "RPC้พ่ทฏ"
|
|
49
|
+
"ๅๅบ่ๆถ", "ๆฅๅฃ่ๆถ", "่ๆถๅๆ", "ๆ
ขๆฅๅฃ"
|
|
50
|
+
"ๆง่ฝๅๆ", "่ถ
ๆถๆๆฅ", "RTๅๆ", "ๅๅบๆถ้ด"
|
|
51
|
+
"็บฟไธ้ฎ้ข", "ๆๆฅ้ฎ้ข", "ๅฎไฝ้ฎ้ข", "้ฎ้ขๅๆ"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Output Format
|
|
55
|
+
|
|
56
|
+
### TraceID Chain Output
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
60
|
+
โ TraceID Chain Analysis โ
|
|
61
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
62
|
+
โ TraceID: {traceId} โ
|
|
63
|
+
โ Total Duration: {ms}ms โ
|
|
64
|
+
โ Spans: {count} โ
|
|
65
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
66
|
+
โ 1. {service} - {method} โ
|
|
67
|
+
โ URL: {url} โ
|
|
68
|
+
โ Duration: {ms}ms โ
|
|
69
|
+
โ Status: {status} โ
|
|
70
|
+
โ Request: {params} โ
|
|
71
|
+
โ Response: {result} โ
|
|
72
|
+
โ โ
|
|
73
|
+
โ 2. {sub-service} - {method} โ
|
|
74
|
+
โ Duration: {ms}ms โ
|
|
75
|
+
โ Status: {status} โ
|
|
76
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
77
|
+
โ Errors: {error_count} โ
|
|
78
|
+
โ โข {error_message} at {service}:{line} โ
|
|
79
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Log Query Output
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
86
|
+
โ SLS Log Query Results โ
|
|
87
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
88
|
+
โ Query: {query} โ
|
|
89
|
+
โ Time Range: {start} ~ {end} โ
|
|
90
|
+
โ Results: {count} logs โ
|
|
91
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
92
|
+
โ [{timestamp}] [{level}] {service} - {message} โ
|
|
93
|
+
โ [{timestamp}] [{level}] {service} - {message} โ
|
|
94
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Component Integration
|
|
98
|
+
|
|
99
|
+
This skill uses the **logService** component. The actual log service provider is determined by configuration.
|
|
100
|
+
|
|
101
|
+
| Provider | MCP Server | Description |
|
|
102
|
+
|----------|------------|-------------|
|
|
103
|
+
| aliyun-sls | friday-sls-logs | Alibaba Cloud SLS |
|
|
104
|
+
| baidu-sls | baidu-sls-logs | Baidu Cloud Log Service |
|
|
105
|
+
| elk | (direct) | Elasticsearch |
|
|
106
|
+
|
|
107
|
+
Configuration is managed in `flowmind.config.json` under `components.logService`.
|
|
108
|
+
|
|
109
|
+
**Default endpoints** (aliyun-sls provider):
|
|
110
|
+
|
|
111
|
+
| Environment | Endpoint | Region |
|
|
112
|
+
|-------------|----------|--------|
|
|
113
|
+
| test/uat | cn-shenzhen.log.aliyuncs.com | ๆทฑๅณ |
|
|
114
|
+
| gray/prod | cn-hongkong.log.aliyuncs.com | ้ฆๆธฏ |
|
|
115
|
+
|
|
116
|
+
## Learning Integration
|
|
117
|
+
|
|
118
|
+
This skill supports FlowMind learning:
|
|
119
|
+
|
|
120
|
+
- **Query Patterns**: Learns common query patterns
|
|
121
|
+
- **Output Format**: Learns preferred display format (sequential list, tree, etc.)
|
|
122
|
+
- **Service Mapping**: Learns service-to-project mappings
|
|
123
|
+
|
|
124
|
+
## Examples
|
|
125
|
+
|
|
126
|
+
### Example 1: TraceID Analysis
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
User: ๆฅ่ฏข traceId abc123 ็ๆฅๅฟ
|
|
130
|
+
|
|
131
|
+
FlowMind:
|
|
132
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
133
|
+
โ TraceID Chain Analysis โ
|
|
134
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
135
|
+
โ TraceID: abc123 โ
|
|
136
|
+
โ Total Duration: 256ms โ
|
|
137
|
+
โ Spans: 5 โ
|
|
138
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
139
|
+
โ 1. order-service - createOrder โ
|
|
140
|
+
โ URL: /api/orders โ
|
|
141
|
+
โ Duration: 256ms โ
|
|
142
|
+
โ Status: 200 โ
|
|
143
|
+
โ โ
|
|
144
|
+
โ 2. user-service - getUserInfo โ
|
|
145
|
+
โ Duration: 45ms โ
|
|
146
|
+
โ Status: 200 โ
|
|
147
|
+
โ โ
|
|
148
|
+
โ 3. inventory-service - checkStock โ
|
|
149
|
+
โ Duration: 120ms โ
|
|
150
|
+
โ Status: 200 โ
|
|
151
|
+
โ โ
|
|
152
|
+
โ 4. payment-service - createPayment โ
|
|
153
|
+
โ Duration: 89ms โ
|
|
154
|
+
โ Status: 200 โ
|
|
155
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Example 2: Error Investigation
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
User: ๆๆฅ็บฟไธ้่ฏฏๆฅๅฟ
|
|
162
|
+
|
|
163
|
+
FlowMind:
|
|
164
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
165
|
+
โ Error Log Investigation โ
|
|
166
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
167
|
+
โ Service: order-service โ
|
|
168
|
+
โ Time: Last 1 hour โ
|
|
169
|
+
โ Errors Found: 3 โ
|
|
170
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
171
|
+
โ ๐ด NullPointerException at OrderService.java:128 โ
|
|
172
|
+
โ TraceID: xyz789 โ
|
|
173
|
+
โ Context: user_id=12345, order_id=67890 โ
|
|
174
|
+
โ โ
|
|
175
|
+
โ ๐ก TimeoutException at FeignClient.java:45 โ
|
|
176
|
+
โ TraceID: def456 โ
|
|
177
|
+
โ Service: inventory-service โ
|
|
178
|
+
โ Duration: 5001ms (timeout: 5000ms) โ
|
|
179
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Configuration
|
|
183
|
+
|
|
184
|
+
Skill-specific configuration:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"sls-log-audit": {
|
|
189
|
+
"defaultProject": "your-project",
|
|
190
|
+
"defaultLogstore": "your-logstore",
|
|
191
|
+
"queryLimit": 100,
|
|
192
|
+
"timeRange": {
|
|
193
|
+
"default": "1h",
|
|
194
|
+
"max": "24h"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Component provider configuration (in `flowmind.config.json`):
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
{
|
|
204
|
+
"components": {
|
|
205
|
+
"logService": {
|
|
206
|
+
"default": "aliyun-sls",
|
|
207
|
+
"providers": {
|
|
208
|
+
"aliyun-sls": {
|
|
209
|
+
"adapter": "aliyun-sls-adapter",
|
|
210
|
+
"enabled": true,
|
|
211
|
+
"mcpServer": "friday-sls-logs",
|
|
212
|
+
"config": {
|
|
213
|
+
"endpoints": {
|
|
214
|
+
"test": "cn-shenzhen.log.aliyuncs.com",
|
|
215
|
+
"prod": "cn-hongkong.log.aliyuncs.com"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: yapi-sync-interface
|
|
3
|
+
description: YApi interface sync skill for FlowMind. Sync Controller interfaces to YApi, import/export Swagger, manage API documentation lifecycle.
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.1.0"
|
|
6
|
+
author: flowmind
|
|
7
|
+
category: documentation
|
|
8
|
+
componentDependencies:
|
|
9
|
+
- apiDoc
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# YApi Interface Sync Skill
|
|
13
|
+
|
|
14
|
+
Synchronize API interfaces between code and YApi platform for consistent API documentation management.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
### Interface Sync
|
|
19
|
+
- Extract Controller interfaces from code
|
|
20
|
+
- Sync to YApi project
|
|
21
|
+
- Update existing interfaces
|
|
22
|
+
- Create new interface categories
|
|
23
|
+
|
|
24
|
+
### Swagger Import/Export
|
|
25
|
+
- Generate Swagger/OpenAPI from code
|
|
26
|
+
- Import Swagger to YApi
|
|
27
|
+
- Export YApi interfaces to Swagger
|
|
28
|
+
|
|
29
|
+
### Interface Management
|
|
30
|
+
- Search interfaces by keyword
|
|
31
|
+
- Manage interface categories
|
|
32
|
+
- Interface version tracking
|
|
33
|
+
- Test collection management
|
|
34
|
+
|
|
35
|
+
## Trigger Patterns
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
"ๅๆญฅๆฅๅฃ", "sync interfaces"
|
|
39
|
+
"YApiๅๆญฅ", "yapi sync"
|
|
40
|
+
"ๆฅๅฃๆๆกฃ", "API documentation"
|
|
41
|
+
"Swaggerๅฏผๅ
ฅ", "swagger import"
|
|
42
|
+
"ๆฅๅฃ็ฎก็", "interface management"
|
|
43
|
+
"ๆดๆฐYApi", "update yapi"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Output Format
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
50
|
+
โ YApi Interface Sync Report โ
|
|
51
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
52
|
+
โ Project: {project_name} (ID: {id}) โ
|
|
53
|
+
โ Category: {category} โ
|
|
54
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
55
|
+
โ Interfaces Found: {count} โ
|
|
56
|
+
โ โข New: {new_count} โ
|
|
57
|
+
โ โข Updated: {update_count} โ
|
|
58
|
+
โ โข Unchanged: {unchanged_count} โ
|
|
59
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
60
|
+
โ Sync Status: โ
Success / โ Failed โ
|
|
61
|
+
โ YApi URL: {url} โ
|
|
62
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Component Integration
|
|
66
|
+
|
|
67
|
+
This skill uses the **apiDoc** component. The actual API documentation provider is determined by configuration.
|
|
68
|
+
|
|
69
|
+
| Provider | MCP Server | Description |
|
|
70
|
+
|----------|------------|-------------|
|
|
71
|
+
| yapi | aomi-yapi-mcp | YApi API documentation platform |
|
|
72
|
+
|
|
73
|
+
Configuration is managed in `flowmind.config.json` under `components.apiDoc`.
|
|
74
|
+
|
|
75
|
+
**Available MCP tools** (yapi provider):
|
|
76
|
+
|
|
77
|
+
| Tool | Description |
|
|
78
|
+
|------|-------------|
|
|
79
|
+
| `yapi_search_apis` | Search interfaces by keyword |
|
|
80
|
+
| `yapi_get_categories` | Get project categories |
|
|
81
|
+
| `yapi_save_api` | Create/update interface |
|
|
82
|
+
| `yapi_import_swagger` | Import Swagger data |
|
|
83
|
+
| `yapi_export_project` | Export project data |
|
|
84
|
+
|
|
85
|
+
## Learning Integration
|
|
86
|
+
|
|
87
|
+
This skill supports FlowMind learning:
|
|
88
|
+
|
|
89
|
+
- **Project Mapping**: Learns which code maps to which YApi project
|
|
90
|
+
- **Category Mapping**: Learns package-to-category mappings
|
|
91
|
+
- **Sync Preferences**: Learns sync preferences (overwrite, merge, etc.)
|
|
92
|
+
|
|
93
|
+
## Examples
|
|
94
|
+
|
|
95
|
+
### Example 1: Sync Controller to YApi
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
User: ๅๆญฅ OrderController ็ๆฅๅฃๅฐ YApi
|
|
99
|
+
|
|
100
|
+
FlowMind:
|
|
101
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
102
|
+
โ YApi Interface Sync Report โ
|
|
103
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
104
|
+
โ Project: order-service (ID: 28) โ
|
|
105
|
+
โ Category: ่ฎขๅ็ฎก็ โ
|
|
106
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
107
|
+
โ Interfaces Found: 5 โ
|
|
108
|
+
โ โข New: 2 (createOrder, cancelOrder) โ
|
|
109
|
+
โ โข Updated: 3 (getOrder, listOrders, updateOrder) โ
|
|
110
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
111
|
+
โ Sync Status: โ
Success โ
|
|
112
|
+
โ YApi URL: https://yapi.example.com/project/28 โ
|
|
113
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Example 2: Search Interfaces
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
User: ๆ็ดข YApi ไธ็่ฎขๅ็ธๅ
ณๆฅๅฃ
|
|
120
|
+
|
|
121
|
+
FlowMind:
|
|
122
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
123
|
+
โ YApi Interface Search โ
|
|
124
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
125
|
+
โ Keyword: ่ฎขๅ โ
|
|
126
|
+
โ Results: 8 interfaces โ
|
|
127
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
128
|
+
โ 1. ๅๅปบ่ฎขๅ - POST /api/orders (project: order-svc) โ
|
|
129
|
+
โ 2. ๆฅ่ฏข่ฎขๅ - GET /api/orders/{id} (project: order) โ
|
|
130
|
+
โ 3. ๅๆถ่ฎขๅ - PUT /api/orders/{id}/cancel โ
|
|
131
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Configuration
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"yapi-sync-interface": {
|
|
139
|
+
"defaultProjectId": "28",
|
|
140
|
+
"syncMode": "merge",
|
|
141
|
+
"autoCreateCategory": true,
|
|
142
|
+
"excludePatterns": ["**/internal/**"]
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|