mta-mcp 3.5.0 → 3.5.1
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/mta.agent.md +48 -0
- package/package.json +1 -1
package/agents/mta.agent.md
CHANGED
|
@@ -111,7 +111,55 @@ MTA 不是传统的"编码规范管理器",而是一个**智能编码助手技
|
|
|
111
111
|
| `sequentialthinking` | 分步推理 | 复杂问题分解、多步规划 |
|
|
112
112
|
|
|
113
113
|
---
|
|
114
|
+
## 🎨 Sketch 设计稿还原规范
|
|
114
115
|
|
|
116
|
+
### 强制流程
|
|
117
|
+
|
|
118
|
+
**在还原任何 Sketch 设计稿前,必须先调用 SketchMeasureHD 插件测量:**
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
1. 用户提供 Sketch 文件 → 先提醒:"需要先在 Sketch 中选中目标图层"
|
|
122
|
+
2. 调用 @sketch mcp 工具
|
|
123
|
+
3. 使用脚本:mcp-server/ui/sketch/sketch_measure_hd.js
|
|
124
|
+
4. 获取完整测量数据(绝对坐标、内边距、布局意图)
|
|
125
|
+
5. 基于测量数据精准还原 UI
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 测量数据必备字段
|
|
129
|
+
|
|
130
|
+
调用 SketchMeasureHD 后,你会得到以下关键数据:
|
|
131
|
+
|
|
132
|
+
| 字段 | 用途 | 示例 |
|
|
133
|
+
|------|------|------|
|
|
134
|
+
| `absoluteRect` | 元素相对于画板的绝对位置 | `{ x: 16, y: 100, width: 361, height: 120 }` |
|
|
135
|
+
| `relativePosition` | 元素相对于父容器的内边距 | `{ paddingLeft: 16, paddingTop: 12 }` |
|
|
136
|
+
| `siblingGaps` | 兄弟元素间的间距 | `{ direction: "COLUMN", uniformVerticalGap: 12 }` |
|
|
137
|
+
| `layoutIntent` | 布局意图(居中、填充等) | `{ alignment: ["HORIZONTAL_CENTER"], sizing: { width: "FILL" } }` |
|
|
138
|
+
| `flutterHints` | 直接可用的 Flutter 代码 | `{ suggestedWidget: "Column", padding: "EdgeInsets.all(16)" }` |
|
|
139
|
+
|
|
140
|
+
### 还原检查清单
|
|
141
|
+
|
|
142
|
+
- [ ] 使用 `absoluteRect` 而非 `frame`(避免相对坐标错误)
|
|
143
|
+
- [ ] 使用 `relativePosition` 计算内边距(避免硬编码)
|
|
144
|
+
- [ ] 使用 `siblingGaps` 确定元素间距(而非猜测)
|
|
145
|
+
- [ ] 使用 `layoutIntent` 判断布局方式(Column/Row/Center)
|
|
146
|
+
- [ ] 参考 `flutterHints` 生成代码(提高准确度)
|
|
147
|
+
|
|
148
|
+
### 禁止事项
|
|
149
|
+
|
|
150
|
+
❌ **禁止**在未调用测量插件的情况下凭感觉还原设计稿
|
|
151
|
+
❌ **禁止**使用简单的 `Positioned` 绝对定位所有元素
|
|
152
|
+
❌ **禁止**硬编码内边距值(如 `padding: 16`)而不基于测量数据
|
|
153
|
+
❌ **禁止**忽略 `layoutIntent` 字段,导致嵌套层级错误
|
|
154
|
+
|
|
155
|
+
### 应用到其他 Agent
|
|
156
|
+
|
|
157
|
+
此规范应同步到以下 Agent:
|
|
158
|
+
- `agents/flutter.agent.md` - Flutter 开发
|
|
159
|
+
- `agents/vue3.agent.md` - Vue3 开发(参考 Sketch 设计稿时)
|
|
160
|
+
- `agents/wechat-miniprogram.agent.md` - 小程序开发
|
|
161
|
+
|
|
162
|
+
---
|
|
115
163
|
## 📁 知识库结构
|
|
116
164
|
|
|
117
165
|
MTA 的知识分为两类,明确区分:
|