@xenonbyte/da-vinci-workflow 0.1.13 → 0.1.15

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/README.md +23 -1
  3. package/README.zh-CN.md +23 -1
  4. package/SKILL.md +15 -0
  5. package/commands/claude/dv/design.md +2 -0
  6. package/commands/claude/dv/verify.md +2 -0
  7. package/commands/codex/prompts/dv-design.md +2 -0
  8. package/commands/codex/prompts/dv-verify.md +1 -0
  9. package/commands/gemini/dv/design.toml +2 -0
  10. package/commands/gemini/dv/verify.toml +1 -0
  11. package/docs/mcp-aware-gate-implementation.md +291 -0
  12. package/docs/mcp-aware-gate-tests.md +244 -0
  13. package/docs/mcp-aware-gate.md +246 -0
  14. package/docs/mode-use-cases.md +2 -0
  15. package/docs/prompt-presets/README.md +1 -0
  16. package/docs/prompt-presets/desktop-app.md +4 -0
  17. package/docs/prompt-presets/mobile-app.md +4 -0
  18. package/docs/prompt-presets/tablet-app.md +4 -0
  19. package/docs/prompt-presets/web-app.md +4 -0
  20. package/docs/visual-adapters.md +9 -0
  21. package/docs/visual-assist-presets/README.md +4 -2
  22. package/docs/visual-assist-presets/desktop-app.md +2 -0
  23. package/docs/visual-assist-presets/mobile-app.md +2 -0
  24. package/docs/visual-assist-presets/tablet-app.md +2 -0
  25. package/docs/visual-assist-presets/web-app.md +2 -0
  26. package/docs/workflow-examples.md +9 -4
  27. package/docs/zh-CN/mcp-aware-gate-implementation.md +290 -0
  28. package/docs/zh-CN/mcp-aware-gate-tests.md +244 -0
  29. package/docs/zh-CN/mcp-aware-gate.md +249 -0
  30. package/docs/zh-CN/mode-use-cases.md +3 -0
  31. package/docs/zh-CN/prompt-presets/README.md +1 -0
  32. package/docs/zh-CN/prompt-presets/desktop-app.md +4 -0
  33. package/docs/zh-CN/prompt-presets/mobile-app.md +4 -0
  34. package/docs/zh-CN/prompt-presets/tablet-app.md +4 -0
  35. package/docs/zh-CN/prompt-presets/web-app.md +4 -0
  36. package/docs/zh-CN/visual-adapters.md +9 -0
  37. package/docs/zh-CN/visual-assist-presets/README.md +5 -3
  38. package/docs/zh-CN/visual-assist-presets/desktop-app.md +2 -0
  39. package/docs/zh-CN/visual-assist-presets/mobile-app.md +2 -0
  40. package/docs/zh-CN/visual-assist-presets/tablet-app.md +2 -0
  41. package/docs/zh-CN/visual-assist-presets/web-app.md +2 -0
  42. package/docs/zh-CN/workflow-examples.md +9 -4
  43. package/examples/greenfield-spec-markupflow/DA-VINCI.md +1 -0
  44. package/examples/greenfield-spec-markupflow/README.md +3 -0
  45. package/examples/greenfield-spec-markupflow/design-registry.md +3 -0
  46. package/examples/greenfield-spec-markupflow/pencil-design.md +4 -0
  47. package/lib/audit.js +348 -0
  48. package/lib/cli.js +47 -1
  49. package/lib/mcp-runtime-gate.js +342 -0
  50. package/package.json +3 -2
  51. package/references/artifact-templates.md +35 -3
  52. package/references/checkpoints.md +69 -1
  53. package/references/design-inputs.md +9 -1
  54. package/references/layout-hygiene.md +117 -0
  55. package/references/pencil-design-to-code.md +8 -0
  56. package/scripts/test-mcp-runtime-gate.js +199 -0
@@ -0,0 +1,249 @@
1
+ # MCP-Aware Gate 设计提案
2
+
3
+ 这份文档定义 Da Vinci 的 MCP-aware runtime gate 设计方向。
4
+
5
+ 它只是一份设计文档,不代表已经开始实现。
6
+
7
+ ## 当前状态
8
+
9
+ - 设计状态:提案中
10
+ - 可行性状态:已基于真实运行时行为做过部分验证
11
+ - 实现状态:未开始
12
+
13
+ ## 为什么需要它
14
+
15
+ 当前文件系统 `audit` 已经补上了一层重要兜底:
16
+
17
+ - 能证明项目内 `.pen` 是否真实落盘
18
+ - 能证明 `.da-vinci/designs/` 是否被污染
19
+ - 能证明截图导出是否写错目录
20
+
21
+ 但它证明不了这些 live 运行时事实:
22
+
23
+ - 当前 active Pencil editor 是否仍然是 `new`
24
+ - 声称完成的 anchor surface 是否真的存在于当前 editor
25
+ - 当前 active editor 和登记的项目内 `.pen` 是否已经收敛
26
+
27
+ 这些事实只存在于 MCP 驱动的设计会话里。
28
+
29
+ ## 已验证的可行性
30
+
31
+ 下面这些事实已经被验证为“当前可读”:
32
+
33
+ 1. 可以通过 MCP 读取 active Pencil editor。
34
+ 2. 可以通过 MCP 读取 live 顶层节点。
35
+ 3. 可以通过 MCP 读取具体 screen node id。
36
+ 4. 可以通过 shell 单独读取项目文件系统状态。
37
+
38
+ 这意味着 Da Vinci 已经可以对比:
39
+
40
+ - live editor truth
41
+ - live screen truth
42
+ - filesystem truth
43
+
44
+ 这个对比已经足够支持第一版 MCP-aware runtime gate。
45
+
46
+ ## 非目标
47
+
48
+ 这份提案不打算:
49
+
50
+ - 取代文件系统 `da-vinci audit`
51
+ - 直接把 MCP 状态暴露给 CLI
52
+ - 自动把 live editor 修复成持久化 `.pen`
53
+ - 让实现依赖未验证的 Pencil session 行为
54
+
55
+ ## 设计原则
56
+
57
+ 1. MCP-aware gate 只处理 runtime 真相。
58
+ 2. 文件系统 audit 继续作为终态持久化兜底。
59
+ 3. runtime gate 只负责阻断假进度,不负责自动修复。
60
+ 4. 设计只依赖已经验证过“当前可读”的事实。
61
+ 5. 当 Pencil MCP 不可用时,必须能优雅降级。
62
+
63
+ ## 在工作流里的位置
64
+
65
+ MCP-aware gate 应该插在两个时点:
66
+
67
+ 1. 第一次成功写入 Pencil 之后。
68
+ 2. 任何 `design complete` 或 `workflow complete` 声明之前。
69
+
70
+ 它不应该在每一个小操作后都运行。
71
+
72
+ ## 建议的 Gate 分层
73
+
74
+ ### 1. Source Convergence Gate
75
+
76
+ 目的:
77
+
78
+ - 判断 live editor、登记的 `.pen` 路径和 shell 可见 `.pen` 文件,是否已经足够收敛,可以把设计源视为可追踪
79
+
80
+ 输入:
81
+
82
+ - MCP 返回的 active Pencil editor 状态
83
+ - `design-registry.md` 中登记的 `.pen` 路径
84
+ - `.da-vinci/designs/` 下 shell 可见的 `.pen` 文件
85
+
86
+ 直接阻断条件:
87
+
88
+ - active editor 仍然是 `new` 这类未命名 live editor
89
+ - active editor 与登记的项目内设计源不一致,且没有显式记录 reconciliation
90
+ - live Pencil 工作已经发生,但 shell 上仍然没有 `.pen`
91
+ - runtime 会话明显在使用另一个设计源,而不是登记的项目级 `.pen`
92
+
93
+ 结果:
94
+
95
+ - `PASS`:设计源已收敛
96
+ - `WARN`:设计源暂时延后处理,但仍然可追踪
97
+ - `BLOCK`:设计源不稳定,不能继续
98
+
99
+ ### 2. Screen Presence Gate
100
+
101
+ 目的:
102
+
103
+ - 确认声称完成的 anchor surface 是否真的存在于当前 live editor 中
104
+
105
+ 输入:
106
+
107
+ - `pencil-design.md` 中记录的 node id 或 screen id
108
+ - 当前 MCP editor 中的顶层节点或目标节点读取结果
109
+
110
+ 直接阻断条件:
111
+
112
+ - 声称完成的 anchor screen 在当前 editor 中找不到
113
+ - 截图使用的 node id 在当前 live 文档里不存在
114
+ - 工作流声称完成的 anchor 数量已经超过当前 editor 能解释的范围
115
+
116
+ 结果:
117
+
118
+ - `PASS`:声称完成的 screen 确实存在
119
+ - `WARN`:命名有漂移,但仍能恢复映射
120
+ - `BLOCK`:设计输出无法追溯到当前 live 文档
121
+
122
+ ### 3. Review Execution Gate
123
+
124
+ 目的:
125
+
126
+ - 确认 screenshot review 真的是针对当前 live surface 做的,而不是形式化走流程
127
+
128
+ 输入:
129
+
130
+ - `pencil-design.md` 里记录的 review surface
131
+ - 当前设计会话里实际 review 的 screen id
132
+ - 当前 form factor 对应的 layout hygiene profile
133
+
134
+ 直接阻断条件:
135
+
136
+ - 一个 surface 被视为已批准,但没有任何 live screenshot review
137
+ - screenshot review 明确出现 blocker 级 layout hygiene 问题,但仍然被标成通过
138
+ - review 记录指向的 screen 在当前 active editor 里根本不存在
139
+
140
+ 结果:
141
+
142
+ - `PASS`:review 与 live 设计状态一致
143
+ - `WARN`:review 存在,但继续扩张前需要回改
144
+ - `BLOCK`:当前批准结论不可信
145
+
146
+ ## Runtime 输出格式
147
+
148
+ 这层 gate 不应该引入全新的工件类型。
149
+
150
+ 更合理的做法,是把结果追加到 `pencil-design.md` 或同类合法工件里:
151
+
152
+ ```md
153
+ ## MCP Runtime Gate
154
+ - Time:
155
+ - Active editor:
156
+ - Registered `.pen` path:
157
+ - Shell-visible `.pen` path:
158
+ - Reviewed screen ids:
159
+ - Source convergence: PASS | WARN | BLOCK
160
+ - Screen presence: PASS | WARN | BLOCK
161
+ - Review execution: PASS | WARN | BLOCK
162
+ - Notes:
163
+ ```
164
+
165
+ 这样 runtime 证据仍然附着在当前设计稿,而不是散落成新的临时文件。
166
+
167
+ ## 和 Filesystem Audit 的关系
168
+
169
+ 两者职责不同。
170
+
171
+ ### MCP-aware runtime gate
172
+
173
+ - 检查 live editor 真相
174
+ - 检查 live screen 真相
175
+ - 在假进度扩散前发现 runtime/source 不收敛
176
+
177
+ ### Filesystem audit
178
+
179
+ - 检查磁盘上的项目真相
180
+ - 检查目录卫生
181
+ - 检查完成态完整性
182
+
183
+ 建议的终态规则:
184
+
185
+ - 只有 MCP-aware runtime gate 通过,同时 filesystem completion audit 也通过,才能声明完成
186
+
187
+ ## 为什么不该先做成 CLI 功能
188
+
189
+ 当前 CLI 只能读文件系统。
190
+
191
+ 它没有 MCP transport、没有 session identity,也读不到当前 live Pencil editor。
192
+
193
+ 所以如果一上来把 MCP-aware gate 做成 CLI 功能,会在结构上不可靠。
194
+
195
+ 当前更合理的定位是:
196
+
197
+ - 作为 agent 执行的 runtime checkpoint
198
+ - 而不是独立 CLI audit mode
199
+
200
+ ## 需要避免的失败方式
201
+
202
+ 1. 把 `new` 当成已经持久化的 `.pen`
203
+ 2. 把 PNG 导出当成设计源证据
204
+ 3. 把旧 live document 的 node id 继续当成当前 editor 的事实
205
+ 4. runtime/source 不一致时静默自我“和解”
206
+ 5. 未经明确规则,就把 live editor 自动写回 `.pen`
207
+
208
+ ## 第一版最小实现范围
209
+
210
+ 第一版实现应该非常收敛。
211
+
212
+ 只做:
213
+
214
+ 1. 读取 active editor 状态
215
+ 2. 读取声称完成的 anchor screen id
216
+ 3. 和 `design-registry.md` 以及 shell-visible `.pen` 做对照
217
+ 4. 记录结构化 PASS/WARN/BLOCK 结果
218
+ 5. runtime truth 和 filesystem truth 不一致时阻断完成态
219
+
220
+ 不做:
221
+
222
+ - 自动重建 `.pen`
223
+ - 除 checkpoint 记录外的自动文件修改
224
+ - 新增面向 live runtime 的 CLI 命令
225
+
226
+ ## 仍待解答的问题
227
+
228
+ 这些问题应该在实现设计阶段解决,而不是在当前提案阶段拍板:
229
+
230
+ 1. 由哪个现有命令路由负责调用 runtime gate?
231
+ 2. runtime 证据只写进 `pencil-design.md`,还是也同步到 `design-registry.md`?
232
+ 3. editor-path mismatch 被 reconciliation 后,应如何记录才不会鼓励漂移?
233
+ 4. gate 应该按每个 approved anchor 运行,还是按每轮 design phase 运行?
234
+
235
+ ## 建议
236
+
237
+ 如果继续推进,只建议做一版收敛的 agent 执行型 MCP-aware runtime gate。
238
+
239
+ 不要顺手扩成:
240
+
241
+ - CLI transport 工程
242
+ - 自动持久化修复
243
+ - 通用 MCP session 管理
244
+
245
+ 当前已经验证过的稳妥路径是:
246
+
247
+ 1. 保留 filesystem `audit` 作为持久化和终态兜底
248
+ 2. 增加 runtime MCP-aware gate,专门处理 source convergence 和 live screen presence
249
+ 3. 只有两层都通过,才允许终态完成
@@ -140,6 +140,7 @@ Da Vinci 应该:
140
140
  - 首轮设计由解析出来的主 visual adapter 主导
141
141
  - 把新的 Pencil 基线真正落到登记好的 `.da-vinci/designs/` 路径
142
142
  - 在第一次成功写入 Pencil 后,立即验证登记的 `.pen` 路径已经成为 shell 可见文件
143
+ - 截图导出必须写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`
143
144
  9. 生成 `pencil-bindings.md`
144
145
  10. 生成 `tasks.md`
145
146
  11. 进入实现
@@ -165,6 +166,8 @@ Da Vinci 应该:
165
166
  - 不要因为当前 Pencil 里正好打开了一个文档,就直接在那个文档上继续做重设计
166
167
  - 如果 Pencil MCP 没有自动把登记路径的 `.pen` 文件落到磁盘,就应该先补写这个项目内文件,再把 mapping 或 implementation 视为完成
167
168
  - `.da-vinci/designs/` 应该只作为 `.pen` 目录使用,不应该混入 inventory、proposal 之类的 markdown
169
+ - 截图 PNG 只是审查产物,不能替代登记好的 `.pen` 设计源
170
+ - 如果当前 Pencil editor 仍然是 `new` 或其他未命名 live document,就不能宣布工作流完成
168
171
 
169
172
  ## 4. `feature-change`
170
173
 
@@ -25,6 +25,7 @@
25
25
 
26
26
  - 提示词模板负责定义工作流意图、拆分规则和真相源处理方式
27
27
  - `Visual Assist` 模板负责定义 UI 设计增强偏好
28
+ - form factor 专用的 layout hygiene 仍然是独立硬闸门,screen 在通过 screenshot review 前必须应用对应规则
28
29
  - 两者一起使用,结果通常更稳
29
30
 
30
31
  现在每个场景模板里都固定包含:
@@ -41,11 +41,15 @@ Existing code is the behavior source of truth, not the layout truth.
41
41
  Preserve current behavior, flows, integrations, and validation rules unless explicitly required otherwise.
42
42
  Inventory primary workspaces, side panels, inspectors, dialogs, settings flows, overlays, and materially different states before broad Pencil work.
43
43
  Decompose complex screens into primary surfaces, secondary surfaces, overlays, and implementation surfaces.
44
+ 在开始第一个 anchor surface 之前,先把 discovery 和 design-source 工件写到标准路径。
44
45
  Use the Visual Assist preferences declared in DA-VINCI.md.
45
46
  Treat the resolved primary visual adapter as the first-pass design lead.
46
47
  Use Pencil guides only as workspace constraints, not as the design direction.
47
48
  Do not start with broad multi-screen scaffolding.
48
49
  Design 1-3 anchor surfaces first, review screenshots, then expand.
50
+ 在通过 screenshot review 之前,先应用桌面端专用的 form-factor layout hygiene 规则。
51
+ 截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
52
+ 如果登记的 `.pen` 设计源只存在于内存中,或只剩下导出的 PNG,就不能宣布完成。
49
53
  Do not pass design checkpoint if the result is a repeated placeholder scaffold, flat panel soup, or a recolor of the old desktop shell.
50
54
  Persist project-local Pencil files under .da-vinci/designs/.
51
55
  ```
@@ -41,6 +41,7 @@ Existing code is the behavior source of truth, not the layout truth.
41
41
  Preserve business logic, navigation, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
42
42
  Inventory activities, fragments, tabs, dialogs, bottom sheets, nested flows, overlays, and materially different states before broad Pencil work.
43
43
  Decompose complex screens into subpages, overlays, materially different states, and implementation surfaces.
44
+ 在开始第一个 anchor surface 之前,先把 discovery 和 design-source 工件写到标准路径。
44
45
  Use the Visual Assist preferences declared in DA-VINCI.md.
45
46
  Treat the resolved primary visual adapter as the first-pass design lead.
46
47
  State the resolved primary visual adapter explicitly in the log and name any requested adapters that are unavailable.
@@ -50,9 +51,12 @@ Do not start with broad multi-screen scaffolding.
50
51
  Design 1-3 anchor surfaces first, review screenshots, then expand.
51
52
  For each anchor surface, explain how the new composition differs structurally from the current layout.
52
53
  Do not treat screenshot analysis as an automatic pass if it reports hierarchy, spacing, clarity, or inconsistency issues.
54
+ 在通过 screenshot review 之前,先应用移动端专用的 form-factor layout hygiene 规则。
53
55
  Use only Pencil-supported properties; do not use web-only props like flex or margin.
54
56
  Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
55
57
  Keep non-`.pen` workflow artifacts out of `.da-vinci/designs/`.
58
+ 截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
59
+ 如果登记的 `.pen` 设计源只存在于内存中,或只剩下导出的 PNG,就不能宣布完成。
56
60
  Define shared primitives from the approved anchor surfaces before broad page expansion.
57
61
  Do not pass design checkpoint if the result is a skin-swap of the old UI, a generic card grid, repeated placeholder templates, or weak visual anchors.
58
62
  Persist project-local Pencil files under .da-vinci/designs/.
@@ -41,11 +41,15 @@ Existing code is the behavior source of truth, not the layout truth.
41
41
  Preserve current behavior, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
42
42
  Inventory split-pane regions, sidebars, expanded canvases, dialogs, sheets, orientation-driven changes, and materially different states before broad Pencil work.
43
43
  Decompose complex pages into multi-region surfaces, overlays, materially different states, and implementation surfaces.
44
+ 在开始第一个 anchor surface 之前,先把 discovery 和 design-source 工件写到标准路径。
44
45
  Use the Visual Assist preferences declared in DA-VINCI.md.
45
46
  Treat the resolved primary visual adapter as the first-pass design lead.
46
47
  Use Pencil guides only as tablet-layout constraints, not as the design direction.
47
48
  Do not start with broad multi-screen scaffolding.
48
49
  Design 1-3 anchor surfaces first, review screenshots, then expand.
50
+ 在通过 screenshot review 之前,先应用平板端专用的 form-factor layout hygiene 规则。
51
+ 截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
52
+ 如果登记的 `.pen` 设计源只存在于内存中,或只剩下导出的 PNG,就不能宣布完成。
49
53
  Do not pass design checkpoint if the result collapses into a stretched phone layout, repeated placeholders, or weak multi-region hierarchy.
50
54
  Persist project-local Pencil files under .da-vinci/designs/.
51
55
  ```
@@ -42,11 +42,15 @@ Preserve current business logic, routes, permissions, integrations, validations,
42
42
  Inventory responsive product surfaces, marketing surfaces, authenticated areas, settings pages, dialogs, drawers, overlays, and materially different states before broad Pencil work.
43
43
  Separate marketing-style surfaces from product-workflow surfaces when they require different visual treatment.
44
44
  Decompose complex pages into subpages, overlays, materially different states, and implementation surfaces.
45
+ 在开始第一个 anchor surface 之前,先把 discovery 和 design-source 工件写到标准路径。
45
46
  Use the Visual Assist preferences declared in DA-VINCI.md.
46
47
  Treat the resolved primary visual adapter as the first-pass design lead.
47
48
  Use Pencil guides only as responsive layout constraints, not as the design direction.
48
49
  Do not start with broad multi-screen scaffolding.
49
50
  Design 1-3 anchor surfaces first, review screenshots, then expand.
51
+ 在通过 screenshot review 之前,先应用 Web 专用的 form-factor layout hygiene 规则。
52
+ 截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
53
+ 如果登记的 `.pen` 设计源只存在于内存中,或只剩下导出的 PNG,就不能宣布完成。
50
54
  Do not pass design checkpoint if the result is a generic SaaS card grid, repeated placeholder scaffolds, or a recolor of the old interface.
51
55
  Persist project-local Pencil files under .da-vinci/designs/.
52
56
  ```
@@ -26,6 +26,11 @@ visual adapter 是可选的 presentation 质量增强层。
26
26
 
27
27
  这些仍然由 requirements、existing code、`page-map.md` 和 `pencil-bindings.md` 决定。
28
28
 
29
+ visual adapter 也不能替代按 form factor 执行的 layout hygiene 规则。
30
+
31
+ - adapter 负责 art direction
32
+ - layout hygiene 负责判断当前 screen 对于其 form factor 是否结构上合格
33
+
29
34
  ## 应该配置在哪里
30
35
 
31
36
  把 visual adapter 偏好写在 `DA-VINCI.md` 里。
@@ -51,6 +56,7 @@ visual adapter 是可选的 presentation 质量增强层。
51
56
  - page composition
52
57
  - hierarchy and spacing
53
58
  - motion guidance
59
+ - anchor-surface composition
54
60
  - Pencil design refinement
55
61
  - Fallback:
56
62
  - native-da-vinci
@@ -73,6 +79,7 @@ visual adapter 是可选的 presentation 质量增强层。
73
79
  - visual contract refinement
74
80
  - page composition
75
81
  - hierarchy and spacing
82
+ - anchor-surface composition
76
83
  - Pencil design refinement
77
84
  - Fallback:
78
85
  - native-da-vinci
@@ -97,6 +104,7 @@ visual adapter 是可选的 presentation 质量增强层。
97
104
  - page composition
98
105
  - hierarchy and spacing
99
106
  - motion guidance
107
+ - anchor-surface composition
100
108
  - Pencil design refinement
101
109
  - Fallback:
102
110
  - native-da-vinci
@@ -122,6 +130,7 @@ visual adapter 是可选的 presentation 质量增强层。
122
130
  - `Scope`
123
131
  - adapter 被允许影响的范围
124
132
  - 应该限制在构图、层级、spacing、Pencil refinement 这类 presentation 质量问题
133
+ - 当重设计高度依赖首轮视觉质量时,也应该把 anchor-surface composition 明确写进 `Scope`
125
134
  - 不要把 behavior、route、state truth 交给它
126
135
  - `Fallback`
127
136
  - 当本地没有可用 adapter 时应该怎么处理
@@ -20,6 +20,7 @@
20
20
  - 视情况把 `Require Adapter` 改成 `true`
21
21
  - 在大规模 Pencil 设计前先把 design checkpoint 门槛抬高
22
22
  - 改成 anchor-first:先做 1 到 3 个 anchor surface,截图审查通过后再扩展
23
+ - 把 `Preferred adapters` 改成当前环境里真实存在的 adapter 名,不要默认沿用跨平台别名
23
24
 
24
25
  可用模板:
25
26
 
@@ -32,6 +33,7 @@
32
33
 
33
34
  1. 先选最接近当前产品形态的模板
34
35
  2. 把其中的 `## Visual Assist` 片段复制到 `DA-VINCI.md`
35
- 3. 只有在项目真的有不同视觉偏向时才调整 adapter 顺序
36
- 4. 除非确实“没有某个本地 skill 就不能继续”,否则保持 `Require Adapter: false`
37
- 5. 如果是复杂重设计,不要只复制 preset 就开画;还要配合 anchor-first Pencil 生成策略
36
+ 3. 如果当前环境里的 adapter 名不同,先把 `Preferred adapters` 改成真实可用名称
37
+ 4. 只有在项目真的有不同视觉偏向时才调整 adapter 顺序
38
+ 5. 除非确实“没有某个本地 skill 就不能继续”,否则保持 `Require Adapter: false`
39
+ 6. 如果是复杂重设计,不要只复制 preset 就开画;还要配合 anchor-first 的 Pencil 生成策略
@@ -18,6 +18,7 @@
18
18
  - workspace composition
19
19
  - hierarchy and spacing
20
20
  - motion guidance
21
+ - anchor-surface composition
21
22
  - Pencil design refinement
22
23
  - Fallback:
23
24
  - native-da-vinci
@@ -28,5 +29,6 @@
28
29
  说明:
29
30
 
30
31
  - 优先用 `ui-ux-pro-max` 做高密度 app 布局判断
32
+ - 如果当前环境里的 adapter 名不一样,先改成真实可用名称
31
33
  - `frontend-skill` 更适合作为辅助,不要反过来把工具界面做成营销页
32
34
  - 如果结果太平、太盒子化、太像通用后台,就把 `frontend-skill` 调到第一位,并提高 design checkpoint 的要求
@@ -17,6 +17,7 @@
17
17
  - mobile page composition
18
18
  - hierarchy and spacing
19
19
  - touch-first motion guidance
20
+ - anchor-surface composition
20
21
  - Pencil design refinement
21
22
  - Fallback:
22
23
  - native-da-vinci
@@ -27,5 +28,6 @@
27
28
  说明:
28
29
 
29
30
  - `ui-ux-pro-max` 更适合移动端 app 表面的密度和平衡
31
+ - 如果当前环境里的 adapter 名不一样,先改成真实可用名称
30
32
  - motion 要轻,不要把普通 app 页面做成营销页
31
33
  - 如果结果总是变成泛化卡片堆砌或层级太弱,就把 `frontend-skill` 调到第一位,并考虑把 `Require Adapter` 改成 `true`
@@ -17,6 +17,7 @@
17
17
  - tablet page composition
18
18
  - hierarchy and spacing
19
19
  - touch-aware motion guidance
20
+ - anchor-surface composition
20
21
  - Pencil design refinement
21
22
  - Fallback:
22
23
  - native-da-vinci
@@ -27,5 +28,6 @@
27
28
  说明:
28
29
 
29
30
  - spacing 一般要比手机更舒展,但又不能像桌面端那样过密
31
+ - 如果当前环境里的 adapter 名不一样,先改成真实可用名称
30
32
  - 更适合用 adapter 去辅助分栏、画布区和主次区域的平衡
31
33
  - 如果结果还是寡淡或被边框框死,就把 `frontend-skill` 调到第一位,并要求在 Pencil 设计前先写清楚 visual thesis
@@ -18,6 +18,7 @@
18
18
  - page composition
19
19
  - hierarchy and spacing
20
20
  - responsive motion guidance
21
+ - anchor-surface composition
21
22
  - Pencil design refinement
22
23
  - Fallback:
23
24
  - native-da-vinci
@@ -28,5 +29,6 @@
28
29
  说明:
29
30
 
30
31
  - 如果是典型 product UI,优先 `ui-ux-pro-max`
32
+ - 如果当前环境里的 adapter 名不一样,先改成真实可用名称
31
33
  - 如果页面更偏品牌表达或强视觉,可以把 `frontend-skill` 放前面
32
34
  - 如果结果像很普通的 SaaS 模板,就把 `frontend-skill` 提到第一位,并把 `DA-VINCI.md` 的视觉方向写得更具体
@@ -94,10 +94,13 @@ $da-vinci use redesign-from-code to inventory the current app, identify current
94
94
  7. 先写出 anchor surface 的 visual thesis、content plan、interaction thesis 和 structural-delta 说明
95
95
  8. 创建新的或更新后的 Pencil 页面,基于重新构图而不是旧 UI 换皮,并优先持久化到 `.da-vinci/designs/`
96
96
  9. 在第一次成功写入 Pencil 后,立即验证登记的项目内 `.pen` 路径已经成为 shell 可见文件
97
- 10. 运行 `design-source checkpoint`,确认登记的项目内 `.pen` 路径、当前 Pencil 设计源和 shell 可见文件是一致的
98
- 11. 绑定路由和 Pencil 页面
99
- 12. 生成和 redesign slice 对齐的任务
100
- 13. 实现并验证
97
+ 10. 如果 Pencil MCP 可用,先运行 MCP runtime gate,并把结果记录到 `pencil-design.md`
98
+ 11. 运行 `design-source checkpoint`,确认登记的项目内 `.pen` 路径、当前 Pencil 设计源和 shell 可见文件是一致的
99
+ 12. 截图导出只放到 `.da-vinci/changes/<change-id>/exports/`,绝不能写进 `.da-vinci/designs/`
100
+ 13. 绑定路由和 Pencil 页面
101
+ 14. 生成和 redesign slice 对齐的任务
102
+ 15. 在任何终态完成声明之前,先运行 `da-vinci audit --mode completion --change <change-id> <project-path>`
103
+ 16. 只有在 completion gate 最终能通过时,才进入实现和验证
101
104
 
102
105
  ### 复杂 Android 页面示例
103
106
 
@@ -118,6 +121,8 @@ Do not treat screenshot analysis as an automatic pass if it reports hierarchy, s
118
121
  Use only Pencil-supported properties; do not use web-only props like flex or margin.
119
122
  Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
120
123
  Keep `.da-vinci/designs/` reserved for `.pen` files only.
124
+ Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
125
+ Do not report completion if the `.pen` source exists only in memory or only as exported PNGs.
121
126
  Do not pass design checkpoint if the result is just a skin-swap of the old UI.
122
127
  ```
123
128
 
@@ -42,6 +42,7 @@
42
42
  - visual contract refinement
43
43
  - page composition
44
44
  - hierarchy and spacing
45
+ - anchor-surface composition
45
46
  - Pencil design refinement
46
47
  - Fallback:
47
48
  - native-da-vinci
@@ -40,7 +40,10 @@ Live design source used for this forward test:
40
40
  Visual adapter used for this forward test:
41
41
 
42
42
  - requested adapters: `frontend-skill`, `ui-ux-pro-max`
43
+ - available requested adapters: `frontend-skill`, `ui-ux-pro-max`
44
+ - unavailable requested adapters: none
43
45
  - resolved primary adapter: `frontend-skill`
46
+ - runtime declaration: explicit before first anchor pass
44
47
  - fallback: `native-da-vinci` if no local adapter were available
45
48
 
46
49
  Important note:
@@ -10,9 +10,12 @@
10
10
 
11
11
  ## Visual Adapter Resolution
12
12
  - Requested adapters: `frontend-skill`, `ui-ux-pro-max`
13
+ - Available requested adapters: `frontend-skill`, `ui-ux-pro-max`
14
+ - Unavailable requested adapters: none
13
15
  - Resolved primary adapter: `frontend-skill`
14
16
  - Secondary helpers: none
15
17
  - Status: active
18
+ - Runtime declaration: explicitly stated before first anchor pass
16
19
  - Scope: `DA-VINCI.md`, `design.md`, `pencil-design.md`
17
20
  - Fallback reason if native Da Vinci rules were used: none
18
21
 
@@ -8,8 +8,12 @@
8
8
  - `MarkupFlow Product Detail`
9
9
 
10
10
  ## Visual Adapter Use
11
+ - Available requested adapters: `frontend-skill`, `ui-ux-pro-max`
12
+ - Unavailable requested adapters: none
11
13
  - Resolved primary adapter: `frontend-skill`
12
14
  - Secondary helpers: none
15
+ - Whether runtime execution explicitly declared the resolved primary adapter: yes
16
+ - Whether the primary adapter actively led the first-pass composition: yes
13
17
  - How it affected composition, hierarchy, or motion guidance:
14
18
  - stronger hero anchor for the desktop-product story
15
19
  - restrained panel treatment instead of generic card grids