figma-mcp-stdio 1.0.15 → 1.0.17
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/build/index.js +13 -13
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -40,28 +40,28 @@ const taskList = [
|
|
|
40
40
|
"5. 调用【获取组件库信息任务】,从知识库中获取组件库信息",
|
|
41
41
|
"6. 使用【获取图片详情工具】获取截图详情,并注入到上下文中,数据名称 imageDetails",
|
|
42
42
|
"【生成页面】:",
|
|
43
|
-
`
|
|
44
|
-
- ⚠️ 重要提示:样式生成时gap转换为margin、font-weight: 600转换为font-weight: bold
|
|
43
|
+
`7. 根据截图详情imageDetails内容生成页面,结合 figmaJson数据优化样式,截图为主,figmaJson 数据为辅。分段生成代码,例如template、script、scss,防止任务过大超时
|
|
45
44
|
`,
|
|
46
|
-
'
|
|
47
|
-
`
|
|
45
|
+
'【代码优化】:',
|
|
46
|
+
`8. 进行代码优化,调用【前端代码优化工具】优化页面`,
|
|
48
47
|
"【自检流程】:",
|
|
49
|
-
`
|
|
48
|
+
`9. 执行UI还原度对比流程,执行【还原度对比】工具自检
|
|
50
49
|
- ⚠️ 重要提示:不允许跳过,必须执行
|
|
51
50
|
`,
|
|
52
|
-
"
|
|
51
|
+
"10. 再次执行UI还原度对比流程,执行【还原度对比】工具自检",
|
|
53
52
|
];
|
|
54
53
|
// 问题修复工具
|
|
55
54
|
server.addTool({
|
|
56
|
-
name: "
|
|
57
|
-
description: "
|
|
55
|
+
name: "code_optimization",
|
|
56
|
+
description: "前端代码优化工具",
|
|
58
57
|
execute: async (args) => {
|
|
59
58
|
return String(`
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
你是一个专业的前端代码优化工程师,请严格执行以下步骤,每执行一步都输出执行结果
|
|
60
|
+
【规则】:
|
|
61
|
+
- Design-token转换:查看figmajson原始数据,进行Design-token样式转换,例:textStyle: Func/Body/B2/B2-R,直接使用Design-Token的原始值 font:Func/Body/B2/B2-R ,无需转换为变量和原始css值,打包工具会自动转换
|
|
62
|
+
注:由Func/xxx 格式的为Design-token,其他格式的不变
|
|
63
|
+
- 最外层容器不要设置为375px、1440px等固定宽度,响应式布局,宽度为100%
|
|
64
|
+
- 样式生成时gap转换为margin、font-weight: 600转换为font-weight: bold
|
|
65
65
|
`);
|
|
66
66
|
},
|
|
67
67
|
});
|