mta-mcp 3.16.3 → 3.16.4
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 +36 -2
- package/package.json +1 -1
package/agents/flutter.agent.md
CHANGED
|
@@ -29,6 +29,22 @@ user-invocable: true
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
+
## 🎨 设计稿还原直接路由
|
|
33
|
+
|
|
34
|
+
当用户请求包含以下任一意图时,直接按设计稿还原流程处理,不要先退化成普通 UI 实现:
|
|
35
|
+
|
|
36
|
+
- `设计稿`、`Sketch`、`还原`、`测量`
|
|
37
|
+
- `UI还原`、`界面还原`、`spacing`、`对齐`
|
|
38
|
+
- `图标不对`、`结构漂移`、`像素级`、`视觉不一致`
|
|
39
|
+
|
|
40
|
+
默认动作:
|
|
41
|
+
|
|
42
|
+
1. 先确认目标文件、目标页面和 Sketch 选区或测量结果
|
|
43
|
+
2. 首轮优先走 `compact` 测量,不要先凭截图或语义猜布局
|
|
44
|
+
3. 如果用户只给截图、没有 Sketch 选区或测量结果,明确说明需要先测量,不能直接承诺精准还原
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
32
48
|
## 🔴 问题诊断优先
|
|
33
49
|
|
|
34
50
|
当用户描述任何问题时,必须先走诊断流程,而不是直接猜修复方案:
|
|
@@ -100,11 +116,29 @@ Flutter 设计稿还原必须遵循 measure-first 流程,禁止直接凭截图
|
|
|
100
116
|
1. 先确认目标文件、目标页面、Sketch 选区或测量结果
|
|
101
117
|
2. 调用 mcp_mta_mta({ skill: "sketch_measure", params: { cmd: "compact" } })
|
|
102
118
|
3. 将返回脚本传给 mcp_sketch_run_code 执行
|
|
103
|
-
4.
|
|
104
|
-
5.
|
|
119
|
+
4. 首轮先读 restorationContract.pageTitle / blockOrder / bodyCopyLedger / navCopyLedger / hardRules
|
|
120
|
+
5. 先按 restorationContract 还原页面骨架和文案,再消费 flutter* / layoutIntent / siblingGaps / relativePosition
|
|
105
121
|
6. compact 不够解释局部样式时,再补 measure / style
|
|
106
122
|
```
|
|
107
123
|
|
|
124
|
+
### 详细规范补加载顺序
|
|
125
|
+
|
|
126
|
+
- 设计稿还原首轮:`get_standard_by_id({ id: 'design-restoration' })` + `get_standard_by_id({ id: 'sketch-mcp' })`
|
|
127
|
+
- 图标尺寸、位图复用、对齐异常:再补 `get_standard_by_id({ id: 'sketch-pitfalls' })`
|
|
128
|
+
- 跨端语法映射或代码落地不稳:再补 `get_standard_by_id({ id: 'syntax-mapping' })`
|
|
129
|
+
|
|
130
|
+
### 首轮硬边界
|
|
131
|
+
|
|
132
|
+
- `restorationContract` 优先于现有页面标题、业务分组、路由文案和常见 CTA 习惯
|
|
133
|
+
- 如果存在 `topPrimaryEntry`,禁止擅自迁移成底部固定按钮
|
|
134
|
+
- 如果 `bottomNavigation.present=true` 且 contract 未声明额外 bottom CTA,禁止再叠加一层底部固定操作条
|
|
135
|
+
- 搜索框、输入框、选择器、Tab、提交按钮必须至少具备最小可用交互,不能只还原成静态容器
|
|
136
|
+
- 先搜项目现有素材目录,再决定是否新增资产;`@2x/@3x/@4x` 是倍率后缀,不是新语义
|
|
137
|
+
- Sketch 测得是 `Image` 时,必须按位图处理,禁止伪造为 SVG
|
|
138
|
+
- 如果 `bitmapLookupCandidates` 与现有素材都未命中,必须明确说明“设计资产未确认”,不要回退到语义相近资源
|
|
139
|
+
- 如果测量结果给出 `iconContentBounds.containerSize` 与 `contentSize`,必须分离占位尺寸与图形渲染尺寸,不能直接用 `Group frame` 作为图标尺寸
|
|
140
|
+
- 如果 `iconSvgMeta.colorStrategy=preserve`,或 SVG 含多色/透明度/渐变路径,禁止再加 `ColorFilter`
|
|
141
|
+
|
|
108
142
|
### 高频硬边界
|
|
109
143
|
|
|
110
144
|
- 先搜项目现有素材目录,再决定是否新增资产
|