mta-mcp 2.14.0 → 2.16.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/agents/_TEMPLATE.md +153 -0
- package/agents/flutter.agent.md +118 -155
- package/agents/i18n.agent.md +50 -105
- package/agents/logicflow.agent.md +55 -1525
- package/agents/vue3.agent.md +84 -248
- package/agents/wechat-miniprogram.agent.md +48 -950
- package/dist/index.js +391 -443
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/standards/core/mandatory-rules.md +103 -0
- package/standards/frameworks/flutter.md +78 -0
- package/standards/libraries/logicflow.md +1007 -0
- package/standards/troubleshooting-cases/flutter/textfield-vertical-centering.md +107 -0
- package/standards/workflows/design-restoration-guide.md +164 -0
- package/standards/workflows/problem-diagnosis.md +68 -0
- package/standards/workflows/textfield-centering-guide.md +157 -0
- package/templates/config-templates/agents-section.md +9 -0
- package/templates/config-templates/custom-section.md +6 -0
- package/templates/config-templates/header.md +29 -0
- package/templates/config-templates/workflow-minimal.md +44 -0
package/agents/vue3.agent.md
CHANGED
|
@@ -1,303 +1,139 @@
|
|
|
1
|
-
# Vue 3 + TypeScript
|
|
1
|
+
# Vue 3 + TypeScript 开发代理
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
## 🔴 问题诊断优先(最高优先级)
|
|
6
|
-
|
|
7
|
-
**遇到任何问题时,必须首先调用 `troubleshoot` 工具!**
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
⚠️ AI 请注意:当用户描述了问题(错误、样式不对、效果不符预期等),
|
|
11
|
-
在尝试任何解决方案前,必须先调用:
|
|
12
|
-
|
|
13
|
-
mcp_mta_troubleshoot({ problem: "用户描述的问题" })
|
|
14
|
-
|
|
15
|
-
案例库包含经过验证的解决方案,可避免 6-10 轮无效尝试。
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### 已收录的问题类型
|
|
19
|
-
|
|
20
|
-
| 问题类型 | 案例ID | 关键词 |
|
|
21
|
-
|----------|--------|--------|
|
|
22
|
-
| 表格边框异常 | table-边框问题 | table, border, 边框 |
|
|
23
|
-
| 表单验证不生效 | form-验证问题 | form, validate, rules |
|
|
24
|
-
| 样式不生效 | style-优先级问题 | style, scoped, deep |
|
|
25
|
-
| Pinia 状态丢失 | pinia-状态丢失 | pinia, persist, state |
|
|
3
|
+
> 此 Agent 引导 AI 通过 MCP 工具获取 npm 包中的详细规范
|
|
4
|
+
> 版本: v3.0.0 | 最后更新: 2026-01-16
|
|
26
5
|
|
|
27
6
|
---
|
|
28
7
|
|
|
29
|
-
##
|
|
30
|
-
|
|
31
|
-
**这些规则在任何情况下都不能违反:**
|
|
32
|
-
|
|
33
|
-
### 1. Element Plus 组件单行书写
|
|
34
|
-
|
|
35
|
-
**检测到项目使用紧凑风格时(如 `.github/copilot-instructions.md` 要求),强制执行:**
|
|
8
|
+
## 🔴 问题诊断优先(最高优先级)
|
|
36
9
|
|
|
37
|
-
|
|
38
|
-
<!-- ✅ 正确:开始标签和所有属性必须在一行 -->
|
|
39
|
-
<el-table v-loading="loading" :data="list" border highlight-current-row>
|
|
40
|
-
<el-button type="primary" :loading="btnLoading" @click="submit">{{ $t('提交') }}</el-button>
|
|
10
|
+
**当用户描述任何问题时,必须首先调用:**
|
|
41
11
|
|
|
42
|
-
<!-- ❌ 严重错误:属性换行 -->
|
|
43
|
-
<el-table
|
|
44
|
-
v-loading="loading"
|
|
45
|
-
:data="list">
|
|
46
12
|
```
|
|
47
|
-
|
|
48
|
-
### 2. 完整的 HTML 标签配对
|
|
49
|
-
|
|
50
|
-
```vue
|
|
51
|
-
✅ <div>...</div>
|
|
52
|
-
✅ <el-table>...</el-table>
|
|
53
|
-
❌ <div>...<div> <!-- 缺少结束标签 -->
|
|
13
|
+
troubleshoot({ problem: "用户描述的问题" })
|
|
54
14
|
```
|
|
55
15
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```vue
|
|
59
|
-
✅ <el-button>{{ $t('提交') }}</el-button>
|
|
60
|
-
✅ :label="$t('名称')"
|
|
61
|
-
❌ <el-button>提交</el-button> <!-- 硬编码 -->
|
|
62
|
-
```
|
|
16
|
+
案例库包含经过验证的解决方案,可避免无效尝试。
|
|
63
17
|
|
|
64
18
|
---
|
|
65
19
|
|
|
66
|
-
##
|
|
20
|
+
## 📚 规范获取指引
|
|
67
21
|
|
|
68
|
-
|
|
22
|
+
**⚠️ 核心原则:写代码前,必须先通过 MCP 工具获取规范!**
|
|
69
23
|
|
|
70
|
-
|
|
71
|
-
# 用户描述了问题?立即调用:
|
|
72
|
-
troubleshoot({ problem: "表格边框显示异常,左边粗右边细" })
|
|
24
|
+
### 按文件类型获取
|
|
73
25
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
26
|
+
| 场景 | MCP 调用 |
|
|
27
|
+
|------|----------|
|
|
28
|
+
| Vue 组件 | `get_standard_by_id({ id: 'vue3-composition' })` |
|
|
29
|
+
| TypeScript | `get_standard_by_id({ id: 'typescript-base' })` |
|
|
30
|
+
| Dart/Flutter | `get_standard_by_id({ id: 'flutter' })` |
|
|
79
31
|
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
# Vue 文件
|
|
83
|
-
get_relevant_standards({ fileType: "vue" })
|
|
84
|
-
→ 加载: standards/frameworks/vue3-composition.md
|
|
32
|
+
### 按使用的库获取
|
|
85
33
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
34
|
+
| 库 | MCP 调用 |
|
|
35
|
+
|----|----------|
|
|
36
|
+
| Element Plus | `get_standard_by_id({ id: 'element-plus' })` |
|
|
37
|
+
| Pinia | `get_standard_by_id({ id: 'pinia' })` |
|
|
38
|
+
| Vue Router | `get_standard_by_id({ id: 'vue-router' })` |
|
|
39
|
+
| vue-i18n | `get_standard_by_id({ id: 'i18n' })` |
|
|
40
|
+
| LogicFlow | `get_standard_by_id({ id: 'logicflow' })` |
|
|
90
41
|
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
# Element Plus 组件
|
|
94
|
-
get_relevant_standards({ imports: ["element-plus"] })
|
|
95
|
-
→ 加载: standards/libraries/element-plus.md
|
|
42
|
+
### 按场景获取
|
|
96
43
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
44
|
+
| 场景 | MCP 调用 |
|
|
45
|
+
|------|----------|
|
|
46
|
+
| CSS 样式 | `get_standard_by_id({ id: 'vue-css-nesting' })` |
|
|
47
|
+
| API 调用 | `get_standard_by_id({ id: 'api-layer' })` |
|
|
48
|
+
| 代码风格 | `get_standard_by_id({ id: 'code-style' })` |
|
|
100
49
|
|
|
101
|
-
|
|
102
|
-
get_relevant_standards({ imports: ["vue-i18n"] })
|
|
103
|
-
→ 加载: standards/libraries/i18n.md
|
|
104
|
-
```
|
|
50
|
+
### 智能获取(推荐)
|
|
105
51
|
|
|
106
|
-
**按场景加载**:
|
|
107
52
|
```
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
→ 加载: standards/patterns/api-layer.md
|
|
53
|
+
// 根据当前文件自动匹配规范
|
|
54
|
+
get_compact_standards({ currentFile: "当前文件路径" })
|
|
111
55
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
→ 加载: standards/patterns/vue-css-nesting.md
|
|
56
|
+
// 获取多个规范
|
|
57
|
+
get_standard_by_id({ ids: ['vue3-composition', 'element-plus', 'i18n'] })
|
|
115
58
|
```
|
|
116
59
|
|
|
117
60
|
---
|
|
118
61
|
|
|
119
|
-
## 🎯
|
|
62
|
+
## 🎯 Vue 3 快速提示
|
|
120
63
|
|
|
121
|
-
|
|
64
|
+
> 以下是简要提示,**详细规范请通过上述 MCP 工具获取**
|
|
122
65
|
|
|
123
|
-
|
|
124
|
-
<script setup lang="ts">
|
|
125
|
-
import { ref, computed, onMounted } from 'vue'
|
|
126
|
-
|
|
127
|
-
// Props 定义
|
|
128
|
-
interface Props {
|
|
129
|
-
modelValue: string
|
|
130
|
-
disabled?: boolean
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
134
|
-
disabled: false
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
// Emits 定义
|
|
138
|
-
interface Emits {
|
|
139
|
-
(e: 'update:modelValue', value: string): void
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const emit = defineEmits<Emits>()
|
|
143
|
-
</script>
|
|
144
|
-
```
|
|
66
|
+
### 必须遵守
|
|
145
67
|
|
|
146
|
-
|
|
68
|
+
- ✅ 使用 Composition API (`<script setup lang="ts">`)
|
|
69
|
+
- ✅ Props/Emits 必须定义 TypeScript 类型
|
|
70
|
+
- ✅ 所有用户可见文本必须国际化 `$t('...')`
|
|
71
|
+
- ✅ 单文件组件只能有一个 `<style>` 标签
|
|
147
72
|
|
|
148
|
-
|
|
149
|
-
- ✅ 所有参数都有类型定义
|
|
150
|
-
- ✅ 使用 interface 定义 Props/Emits
|
|
73
|
+
### 禁止
|
|
151
74
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
| 修改只影响当前文件? | 继续修改 | **停止,重新评估** |
|
|
157
|
-
| 存在类似模式? | **复用现有模式** | 可新建 |
|
|
158
|
-
| 需要改组件类型? | **先确认用户意图** | 继续 |
|
|
159
|
-
|
|
160
|
-
---
|
|
75
|
+
- ❌ 使用 `any` 类型
|
|
76
|
+
- ❌ 使用 Options API
|
|
77
|
+
- ❌ 硬编码文本(必须用 `$t()`)
|
|
78
|
+
- ❌ 多个 `<style>` 标签
|
|
161
79
|
|
|
162
|
-
|
|
80
|
+
### Element Plus 单行书写(如项目要求)
|
|
163
81
|
|
|
164
82
|
```vue
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
import { ref, computed, onMounted } from 'vue'
|
|
168
|
-
|
|
169
|
-
// 2. Props/Emits
|
|
170
|
-
interface Props { ... }
|
|
171
|
-
interface Emits { ... }
|
|
172
|
-
const props = defineProps<Props>()
|
|
173
|
-
const emit = defineEmits<Emits>()
|
|
174
|
-
|
|
175
|
-
// 3. 状态
|
|
176
|
-
const loading = ref(false)
|
|
177
|
-
const data = ref<DataType[]>([])
|
|
178
|
-
|
|
179
|
-
// 4. 计算属性
|
|
180
|
-
const displayData = computed(() => ...)
|
|
181
|
-
|
|
182
|
-
// 5. 方法
|
|
183
|
-
const handleSubmit = async () => { ... }
|
|
184
|
-
|
|
185
|
-
// 6. 生命周期
|
|
186
|
-
onMounted(() => { ... })
|
|
187
|
-
</script>
|
|
188
|
-
|
|
189
|
-
<template>
|
|
190
|
-
<!-- 模板内容 -->
|
|
191
|
-
</template>
|
|
83
|
+
<!-- ✅ 正确 -->
|
|
84
|
+
<el-table v-loading="loading" :data="list" border highlight-current-row>
|
|
192
85
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
86
|
+
<!-- ❌ 错误 -->
|
|
87
|
+
<el-table
|
|
88
|
+
v-loading="loading"
|
|
89
|
+
:data="list">
|
|
196
90
|
```
|
|
197
91
|
|
|
198
92
|
---
|
|
199
93
|
|
|
200
|
-
##
|
|
201
|
-
|
|
202
|
-
- ❌ `any` 类型
|
|
203
|
-
- ❌ Options API
|
|
204
|
-
- ❌ 不定义 Props/Emits 类型
|
|
205
|
-
- ❌ 直接修改 Props
|
|
206
|
-
- ❌ `<script>` 中使用 `this`
|
|
207
|
-
- ❌ 擅自更换组件类型(el-cascader → el-select)
|
|
208
|
-
- ❌ 多个 `<style>` 标签
|
|
94
|
+
## 🔧 标准工作流
|
|
209
95
|
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## 🔧 常用模式
|
|
213
|
-
|
|
214
|
-
### 表单处理
|
|
215
|
-
|
|
216
|
-
```typescript
|
|
217
|
-
const form = reactive({
|
|
218
|
-
name: '',
|
|
219
|
-
email: ''
|
|
220
|
-
})
|
|
221
|
-
|
|
222
|
-
const rules = {
|
|
223
|
-
name: [{ required: true, message: $t('请输入名称') }]
|
|
224
|
-
}
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### 表格编辑取消
|
|
228
|
-
|
|
229
|
-
```typescript
|
|
230
|
-
// 备份数据用于取消恢复
|
|
231
|
-
const list = ref<any[]>([])
|
|
232
|
-
const subList = ref<any[]>([]) // 备份
|
|
233
|
-
|
|
234
|
-
// 取消方法
|
|
235
|
-
const cancelEdit = () => {
|
|
236
|
-
list.value = JSON.parse(JSON.stringify(subList.value))
|
|
237
|
-
}
|
|
238
96
|
```
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
data.value = res.data
|
|
251
|
-
} finally {
|
|
252
|
-
loading.value = false
|
|
253
|
-
}
|
|
254
|
-
}
|
|
97
|
+
1. 用户提出需求
|
|
98
|
+
↓
|
|
99
|
+
2. 检查是否是问题描述 → 是 → 调用 troubleshoot()
|
|
100
|
+
↓ 否
|
|
101
|
+
3. 识别需要的规范类型(Vue/Element Plus/Pinia 等)
|
|
102
|
+
↓
|
|
103
|
+
4. 调用对应的 get_standard_by_id() 获取详细规范
|
|
104
|
+
↓
|
|
105
|
+
5. 根据获取的规范编写代码
|
|
106
|
+
↓
|
|
107
|
+
6. 验证代码符合规范
|
|
255
108
|
```
|
|
256
109
|
|
|
257
110
|
---
|
|
258
111
|
|
|
259
|
-
##
|
|
260
|
-
|
|
261
|
-
**每次编辑后必检:**
|
|
262
|
-
|
|
263
|
-
- [ ] 所有 HTML 标签正确闭合
|
|
264
|
-
- [ ] 只有一个 `<style>` 标签
|
|
265
|
-
- [ ] 所有文本已国际化
|
|
266
|
-
- [ ] 单行书写(如项目要求)
|
|
267
|
-
- [ ] 无 `any` 类型
|
|
268
|
-
- [ ] Props/Emits 有类型定义
|
|
269
|
-
|
|
270
|
-
---
|
|
112
|
+
## 📋 可用规范列表
|
|
271
113
|
|
|
272
|
-
|
|
114
|
+
通过 `get_standard_by_id({ id: 'xxx' })` 获取:
|
|
273
115
|
|
|
274
|
-
|
|
116
|
+
**核心规范**
|
|
117
|
+
- `mandatory-rules` - 底层必须规则(自动注入)
|
|
118
|
+
- `code-style` - 代码风格规范
|
|
119
|
+
- `typescript-base` - TypeScript 基础规范
|
|
120
|
+
- `code-generation` - 代码生成规范
|
|
275
121
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
<div class="vs-right">...</div>
|
|
281
|
-
</div>
|
|
282
|
-
|
|
283
|
-
<!-- ❌ 禁止:重复定义已存在的样式 -->
|
|
284
|
-
<style>
|
|
285
|
-
.split-container { display: flex; } /* 已存在于公共样式 */
|
|
286
|
-
</style>
|
|
287
|
-
```
|
|
122
|
+
**框架规范**
|
|
123
|
+
- `vue3-composition` - Vue 3 Composition API
|
|
124
|
+
- `pinia` - Pinia 状态管理
|
|
125
|
+
- `flutter` - Flutter 开发规范
|
|
288
126
|
|
|
289
|
-
|
|
127
|
+
**库规范**
|
|
128
|
+
- `element-plus` - Element Plus 组件库
|
|
129
|
+
- `i18n` - 国际化规范
|
|
130
|
+
- `logicflow` - LogicFlow 流程图
|
|
290
131
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
background-color: var(--el-fill-color-blank) !important;
|
|
295
|
-
box-shadow: 0 0 0 1px var(--el-border-color) inset !important;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
```
|
|
132
|
+
**模式规范**
|
|
133
|
+
- `vue-css-nesting` - Vue CSS 嵌套写法
|
|
134
|
+
- `api-layer` - API 层封装模式
|
|
299
135
|
|
|
300
136
|
---
|
|
301
137
|
|
|
302
138
|
**维护团队**: MTA工作室
|
|
303
|
-
|
|
139
|
+
**设计理念**: Agent 只提供获取指引,详细规范由 MCP 工具从 npm 包动态获取
|