mta-mcp 3.5.1 → 3.6.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/flutter.agent.md
CHANGED
|
@@ -105,9 +105,66 @@ get_standard_by_id({ ids: ['flutter', 'flutter-ui-system'] })
|
|
|
105
105
|
|
|
106
106
|
---
|
|
107
107
|
|
|
108
|
-
## 🎨
|
|
108
|
+
## 🎨 设计稿还原规范
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
### ⚠️ 强制流程(最高优先级)
|
|
111
|
+
|
|
112
|
+
**在还原任何 Sketch 设计稿前,必须先调用 SketchMeasureHD 插件测量:**
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
1. 用户提供 Sketch 文件 → 先提醒:"需要先在 Sketch 中选中目标图层"
|
|
116
|
+
2. 调用 @sketch mcp 工具
|
|
117
|
+
3. 使用脚本:mcp-server/ui/sketch/sketch_measure_hd.js
|
|
118
|
+
4. 获取完整测量数据(绝对坐标、内边距、布局意图)
|
|
119
|
+
5. 基于测量数据精准还原 Flutter UI
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 测量数据必备字段
|
|
123
|
+
|
|
124
|
+
调用 SketchMeasureHD 后,你会得到以下关键数据:
|
|
125
|
+
|
|
126
|
+
| 字段 | 用途 | Flutter 应用 |
|
|
127
|
+
|------|------|-------------|
|
|
128
|
+
| `absoluteRect` | 元素相对于画板的绝对位置 | 确定元素位置,计算相对布局 |
|
|
129
|
+
| `relativePosition` | 元素相对于父容器的内边距 | 转换为 `Padding`、`EdgeInsets` |
|
|
130
|
+
| `siblingGaps` | 兄弟元素间的间距 | 转换为 `Gap()`、`SizedBox(height:)` |
|
|
131
|
+
| `layoutIntent` | 布局意图(居中、填充等) | 选择 `Center`、`Column`、`Row` |
|
|
132
|
+
| `flutterHints` | 直接可用的 Flutter 代码 | 参考建议代码快速实现 |
|
|
133
|
+
|
|
134
|
+
### 还原检查清单
|
|
135
|
+
|
|
136
|
+
- [ ] 使用 `absoluteRect` 而非 `frame`(避免相对坐标错误)
|
|
137
|
+
- [ ] 使用 `relativePosition` 计算内边距(转换为 `EdgeInsets`)
|
|
138
|
+
- [ ] 使用 `siblingGaps` 确定元素间距(转换为 `Gap()`)
|
|
139
|
+
- [ ] 使用 `layoutIntent` 判断布局方式(Column/Row/Center)
|
|
140
|
+
- [ ] 参考 `flutterHints` 生成代码(提高准确度)
|
|
141
|
+
- [ ] 使用 Token 系统($c, $t, $s, $r)替代硬编码
|
|
142
|
+
- [ ] **计算内容总高度**,验证不超出容器(详见陷阱规范)
|
|
143
|
+
- [ ] **避免 EdgeInsets.symmetric**,精确布局用 EdgeInsets.only
|
|
144
|
+
|
|
145
|
+
### ⚠️ 常见陷阱(必读)
|
|
146
|
+
|
|
147
|
+
**在还原前必须调用陷阱规范:**
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
get_standard_by_id({ id: 'sketch-pitfalls' })
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
| 陷阱 | 现象 | 解决方案 |
|
|
154
|
+
|------|------|---------|
|
|
155
|
+
| 固定高度容器 | OVERFLOWED BY X PIXELS | 移除 height,用 MainAxisSize.min |
|
|
156
|
+
| EdgeInsets.symmetric | 溢出 1-5px | 用 EdgeInsets.only 精确控制 |
|
|
157
|
+
| 文本行高 | 容器高度不足 | 计算 fontSize × height 的实际占用 |
|
|
158
|
+
|
|
159
|
+
> 📖 **详细案例**:`mcp-server/troubleshooting/flutter/sketch-overflow-container.md`
|
|
160
|
+
|
|
161
|
+
### 禁止事项
|
|
162
|
+
|
|
163
|
+
❌ **禁止**在未调用测量插件的情况下凭感觉还原设计稿
|
|
164
|
+
❌ **禁止**使用简单的 `Positioned` 绝对定位所有元素
|
|
165
|
+
❌ **禁止**硬编码内边距值(如 `EdgeInsets.all(16)`)而不基于测量数据
|
|
166
|
+
❌ **禁止**忽略 `layoutIntent` 字段,导致嵌套层级错误
|
|
167
|
+
❌ **禁止**硬编码颜色/尺寸(必须使用 Token 系统)
|
|
111
168
|
|
|
112
169
|
### 🎯 深度还原模式(像素级)
|
|
113
170
|
|
package/agents/vue3.agent.md
CHANGED
|
@@ -136,9 +136,47 @@ get_standard_by_id({ ids: ['vue3-composition', 'element-plus', 'i18n'] })
|
|
|
136
136
|
|
|
137
137
|
---
|
|
138
138
|
|
|
139
|
-
## 🎨
|
|
139
|
+
## 🎨 设计稿还原规范
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
### ⚠️ 强制流程(最高优先级)
|
|
142
|
+
|
|
143
|
+
**在还原任何 Sketch 设计稿前,必须先调用 SketchMeasureHD 插件测量:**
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
1. 用户提供 Sketch 文件 → 先提醒:"需要先在 Sketch 中选中目标图层"
|
|
147
|
+
2. 调用 @sketch mcp 工具
|
|
148
|
+
3. 使用脚本:mcp-server/ui/sketch/sketch_measure_hd.js
|
|
149
|
+
4. 获取完整测量数据(绝对坐标、内边距、布局意图)
|
|
150
|
+
5. 基于测量数据精准还原 Vue UI
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 测量数据必备字段
|
|
154
|
+
|
|
155
|
+
调用 SketchMeasureHD 后,你会得到以下关键数据:
|
|
156
|
+
|
|
157
|
+
| 字段 | 用途 | Vue/CSS 应用 |
|
|
158
|
+
|------|------|-------------|
|
|
159
|
+
| `absoluteRect` | 元素相对于画板的绝对位置 | 确定元素位置,计算相对布局 |
|
|
160
|
+
| `relativePosition` | 元素相对于父容器的内边距 | 转换为 `padding`、`margin` |
|
|
161
|
+
| `siblingGaps` | 兄弟元素间的间距 | 转换为 `gap`、`margin-bottom` |
|
|
162
|
+
| `layoutIntent` | 布局意图(居中、填充等) | 选择 `flex`、`grid`、`margin: 0 auto` |
|
|
163
|
+
| `flutterHints` | Flutter 代码(可参考结构) | 参考布局思路转换为 CSS |
|
|
164
|
+
|
|
165
|
+
### 还原检查清单
|
|
166
|
+
|
|
167
|
+
- [ ] 使用 `absoluteRect` 而非 `frame`(避免相对坐标错误)
|
|
168
|
+
- [ ] 使用 `relativePosition` 计算内边距(转换为 `padding`)
|
|
169
|
+
- [ ] 使用 `siblingGaps` 确定元素间距(转换为 `gap` 或 `margin`)
|
|
170
|
+
- [ ] 使用 `layoutIntent` 判断布局方式(flex/grid)
|
|
171
|
+
- [ ] 使用 CSS 变量替代硬编码值(`var(--color-primary)`)
|
|
172
|
+
|
|
173
|
+
### 禁止事项
|
|
174
|
+
|
|
175
|
+
❌ **禁止**在未调用测量插件的情况下凭感觉还原设计稿
|
|
176
|
+
❌ **禁止**使用绝对定位 `position: absolute` 代替 flex 布局
|
|
177
|
+
❌ **禁止**硬编码内边距值(如 `padding: 16px`)而不基于测量数据
|
|
178
|
+
❌ **禁止**忽略 `layoutIntent` 字段,导致布局方式选择错误
|
|
179
|
+
❌ **禁止**硬编码颜色(必须使用 CSS 变量)
|
|
142
180
|
|
|
143
181
|
### 🎯 深度还原模式(像素级)
|
|
144
182
|
|
|
@@ -85,9 +85,48 @@ miniprogram/
|
|
|
85
85
|
|
|
86
86
|
---
|
|
87
87
|
|
|
88
|
-
## 🎨
|
|
88
|
+
## 🎨 设计稿还原规范
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
### ⚠️ 强制流程(最高优先级)
|
|
91
|
+
|
|
92
|
+
**在还原任何 Sketch 设计稿前,必须先调用 SketchMeasureHD 插件测量:**
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
1. 用户提供 Sketch 文件 → 先提醒:"需要先在 Sketch 中选中目标图层"
|
|
96
|
+
2. 调用 @sketch mcp 工具
|
|
97
|
+
3. 使用脚本:mcp-server/ui/sketch/sketch_measure_hd.js
|
|
98
|
+
4. 获取完整测量数据(绝对坐标、内边距、布局意图)
|
|
99
|
+
5. 基于测量数据精准还原小程序 UI(注意 rpx 换算)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 测量数据必备字段
|
|
103
|
+
|
|
104
|
+
调用 SketchMeasureHD 后,你会得到以下关键数据:
|
|
105
|
+
|
|
106
|
+
| 字段 | 用途 | 小程序应用 |
|
|
107
|
+
|------|------|----------|
|
|
108
|
+
| `absoluteRect` | 元素相对于画板的绝对位置 | 确定元素位置,计算相对布局 |
|
|
109
|
+
| `relativePosition` | 元素相对于父容器的内边距 | 转换为 `padding`(px → rpx) |
|
|
110
|
+
| `siblingGaps` | 兄弟元素间的间距 | 转换为 `margin-bottom`(不支持 gap) |
|
|
111
|
+
| `layoutIntent` | 布局意图(居中、填充等) | 选择 `flex`、`justify-content` |
|
|
112
|
+
| `flutterHints` | Flutter 代码(可参考结构) | 参考布局思路转换为 WXSS |
|
|
113
|
+
|
|
114
|
+
### 还原检查清单
|
|
115
|
+
|
|
116
|
+
- [ ] 使用 `absoluteRect` 而非 `frame`(避免相对坐标错误)
|
|
117
|
+
- [ ] 使用 `relativePosition` 计算内边距(px * 2 = rpx)
|
|
118
|
+
- [ ] 使用 `siblingGaps` 确定元素间距(转换为 `margin`)
|
|
119
|
+
- [ ] 使用 `layoutIntent` 判断布局方式(flex 居中/填充)
|
|
120
|
+
- [ ] 所有尺寸单位转换为 rpx(px * 2)
|
|
121
|
+
|
|
122
|
+
### 禁止事项
|
|
123
|
+
|
|
124
|
+
❌ **禁止**在未调用测量插件的情况下凭感觉还原设计稿
|
|
125
|
+
❌ **禁止**使用绝对定位 `position: absolute` 代替 flex 布局
|
|
126
|
+
❌ **禁止**硬编码内边距值(如 `padding: 32rpx`)而不基于测量数据
|
|
127
|
+
❌ **禁止**忽略 `layoutIntent` 字段,导致布局方式选择错误
|
|
128
|
+
❌ **禁止**使用 `gap` 属性(小程序不支持)
|
|
129
|
+
❌ **禁止**硬编码颜色(必须使用 CSS 变量)
|
|
91
130
|
|
|
92
131
|
### 🎯 深度还原模式(像素级)
|
|
93
132
|
|