@logictan/dsh-stitch-designer 2.1.3 → 2.1.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/README.md +2 -1
- package/lib/guidance.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,7 +90,8 @@ Commissioning:
|
|
|
90
90
|
| Ask for nothing that cannot be built | The screen is going to be reproduced pixel for pixel, so a wish for an impossible interaction or unavailable data is a defect in the brief. |
|
|
91
91
|
| Describe a design language only when the implementation must match one — and describe it, don't name it | The one exception to "no style limits": when a screen has to fit an existing visual system (here, `@logictan/dsh-macos-theme`), the brief must say what that system actually looks like — colour values, radii, borders, type weights and sizes, spacing density, light/dark relationships. Stitch does not know our package or theme names; pass the theme's own design-system text verbatim when the project has one. With no such constraint, specify no design language at all. |
|
|
92
92
|
| Compose it from components the project already has | Host components and the shared component layer exist; a redrawn lookalike is work spent twice. |
|
|
93
|
-
|
|
|
93
|
+
| Revise with `edit_screens`, and keep exactly one copy of each screen | An edit produces a new screen id instead of overwriting the old one, so the design is changed in place and the id it superseded is removed with `remove_screens_from_canvas`. A canvas holding abandoned drafts and tried variants hides which screen is current — and the removal is irreversible, so which ids were superseded is settled before it is called. |
|
|
94
|
+
| Commission the light screen first, and one dedicated dark screen for the tokens | Dark is the same design language's dark values, not an inversion, so the tokens have to be decided somewhere the model can see them: one extra screen settles background, surface, border, foreground and accent values. Every other screen then exists only in light, and is implemented in both modes from those tokens. Later adds, edits and deletes touch the light screens only. |
|
|
94
95
|
|
|
95
96
|
Implementation:
|
|
96
97
|
|
package/lib/guidance.js
CHANGED
|
@@ -52,5 +52,6 @@ export const STITCH_GUIDANCE = [
|
|
|
52
52
|
'5. 唯一例外:当实现必须与某个既有设计语言保持一致时(例如要求按 `@logictan/dsh-macos-theme` 出稿),才需要交代样式——但只报名字没用,Stitch 不认识你的包名和主题名。要把那套语言实际长什么样告诉它:颜色取值、圆角、描边、字重与字号层级、间距密度、明暗关系。项目里已有设计系统说明(如主题包的设计系统文档或 Stitch 的 design system)就直接给原文,不要只给一个标识符。没有这种一致性要求时,不要指定任何设计语言。',
|
|
53
53
|
'6. 设计稿最终要被像素级还原,所以稿子里不得出现无法实现的功能和元素。写提示词时就假定它会被逐像素实现:不要许愿一个做不到的交互、一个实现不了的效果,或一份拿不到的数据。',
|
|
54
54
|
'7. 尽可能复用已有组件。出稿前先看项目里已经有什么(宿主组件、共享组件层),让稿子由这些组件拼出来,而不是重画一套长得像的。',
|
|
55
|
-
'8.
|
|
55
|
+
'8. 先出明色(亮色)版。暗色只另外出一页,用来确定暗色下的配色 token(背景、表面、描边、文字、强调色各自的取值与层级);不要为每一页都出暗色稿——那一页就够,其余页面靠它定的 token 在实现时一并给出。此后新增、修改、删除设计稿一律只针对明色版,不要再给暗色出稿。暗色不是把明色反相,而是同一套设计语言在暗色下的取值:颜色、描边、层级都要按暗色重新给,实现时两边共用同一套 token。',
|
|
56
|
+
'9. 改设计稿尽量用 `edit_screens` 在原稿上改,不要重新 `generate_screen_from_text` 出一张新稿来替代它。同一份设计稿在项目里只保留一份:`edit_screens` 会生成新的 screen id 而不是原地覆盖,所以改完要把被取代的旧 id 用 `mcp__stitch__remove_screens_from_canvas` 从画布移除(传一个 id 就是删一张)。画布上只该有当前有效的那一稿,废弃的旧稿、试出来的变体稿都按这条清掉。移除不可撤销,删之前先确认哪些 id 已被取代。',
|
|
56
57
|
].join('\n');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logictan/dsh-stitch-designer",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "DSH Stitch designer: Google Stitch AI UI generation as native mcp__stitch__* tools, plus the design conventions that keep one code project bound to one Stitch project. DSH Stitch 界面设计子插件。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|