@xenonbyte/da-vinci-workflow 0.1.15 → 0.1.16

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.
@@ -28,6 +28,9 @@ Existing code is the behavior source of truth, not the layout truth.
28
28
  Preserve current behavior, flows, integrations, and validation rules unless explicitly required otherwise.
29
29
  Inventory the current workspaces, dialogs, overlays, and important states before Pencil work.
30
30
  Use the Visual Assist preferences declared in DA-VINCI.md.
31
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`,不要依赖 interactive `save()`。
32
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
33
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
31
34
  Do not pass design checkpoint if the result is just a boxed-up recolor of the old UI or if workspace hierarchy remains unclear.
32
35
  Persist project-local Pencil files under .da-vinci/designs/.
33
36
  ```
@@ -48,8 +51,15 @@ Use Pencil guides only as workspace constraints, not as the design direction.
48
51
  Do not start with broad multi-screen scaffolding.
49
52
  Design 1-3 anchor surfaces first, review screenshots, then expand.
50
53
  在通过 screenshot review 之前,先应用桌面端专用的 form-factor layout hygiene 规则。
54
+ 在发送非小型 `batch_design` 之前,如果有 shell 能力,先对 Pencil operations 做 preflight。
55
+ 如果同一个 anchor surface 连续两次回滚,就切到每批不超过 6 个操作的微批次,直到拿到干净的 schema-safe pass。
56
+ 在第一次成功写入 Pencil 后、继续大范围扩展前,先运行 `da-vinci audit --mode integrity <project-path>`。
57
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
58
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`;如果原本已有 `.pen`,继续设计时先打开它,但发生实质性 live edit 后要把当前 MCP 快照重新覆盖写回同一路径。
51
59
  截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
60
+ 截图审查必须记录明确的 `PASS` / `WARN` / `BLOCK`、问题列表和是否回改;“看起来很好”不算审查记录。
52
61
  如果登记的 `.pen` 设计源只存在于内存中,或只剩下导出的 PNG,就不能宣布完成。
62
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
53
63
  Do not pass design checkpoint if the result is a repeated placeholder scaffold, flat panel soup, or a recolor of the old desktop shell.
54
64
  Persist project-local Pencil files under .da-vinci/designs/.
55
65
  ```
@@ -66,6 +76,9 @@ Decompose complex screens into real design surfaces before Pencil work.
66
76
  Use the Visual Assist preferences declared in DA-VINCI.md.
67
77
  If the product is complex, design 1-3 anchor surfaces first, review screenshots, then expand.
68
78
  Stop after DA-VINCI.md, design-registry.md, page-map.md, proposal.md, specs, design.md, pencil-design.md, pencil-bindings.md, and tasks.md.
79
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`,不要依赖 interactive `save()`。
80
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
81
+ 在声明 `design complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
69
82
  Do not start code changes yet.
70
83
  ```
71
84
 
@@ -76,8 +89,10 @@ $da-vinci use continue for this existing desktop-product redesign workflow.
76
89
 
77
90
  Use the existing Da Vinci artifacts in this project.
78
91
  Do not restart discovery unless an artifact is missing or clearly wrong.
79
- Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth.
92
+ 把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。继续设计时先打开这个文件,但发生实质性 live edit 后,要把当前 MCP 快照重新覆盖写回同一路径,不要假设 interactive `save()` 已经刷回磁盘。
80
93
  If the redesign is complex, continue from the approved anchor surfaces instead of restarting broad scaffolding.
94
+ 如果 Pencil MCP 可用,且这一轮继续做了新的 Pencil 写入,就重新运行 MCP runtime gate,并把最新结果记录到 `pencil-design.md`。
95
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
81
96
  Continue into the next unfinished stage and do not stop at tasks.md when the active intent is full-delivery.
82
97
  ```
83
98
 
@@ -28,6 +28,9 @@ Existing code is the behavior source of truth, not the layout truth.
28
28
  Preserve business logic, navigation, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
29
29
  Inventory the current screens and important states before Pencil work.
30
30
  Use the Visual Assist preferences declared in DA-VINCI.md.
31
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`,不要依赖 interactive `save()`。
32
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
33
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
31
34
  Do not pass design checkpoint if the result is a skin-swap of the old UI, a generic card grid, or a weak mobile hierarchy.
32
35
  Persist project-local Pencil files under .da-vinci/designs/.
33
36
  ```
@@ -52,11 +55,18 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
52
55
  For each anchor surface, explain how the new composition differs structurally from the current layout.
53
56
  Do not treat screenshot analysis as an automatic pass if it reports hierarchy, spacing, clarity, or inconsistency issues.
54
57
  在通过 screenshot review 之前,先应用移动端专用的 form-factor layout hygiene 规则。
58
+ 在发送非小型 `batch_design` 之前,如果有 shell 能力,先对 Pencil operations 做 preflight。
59
+ 如果同一个 anchor surface 连续两次回滚,就切到每批不超过 6 个操作的微批次,直到拿到干净的 schema-safe pass。
55
60
  Use only Pencil-supported properties; do not use web-only props like flex or margin.
56
61
  Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
62
+ 在第一次成功写入 Pencil 后、继续大范围扩展前,先运行 `da-vinci audit --mode integrity <project-path>`。
63
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
64
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`;如果原本已有 `.pen`,继续设计时先打开它,但发生实质性 live edit 后要把当前 MCP 快照重新覆盖写回同一路径。
57
65
  Keep non-`.pen` workflow artifacts out of `.da-vinci/designs/`.
58
66
  截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
67
+ 截图审查必须记录明确的 `PASS` / `WARN` / `BLOCK`、问题列表和是否回改;“看起来很好”不算审查记录。
59
68
  如果登记的 `.pen` 设计源只存在于内存中,或只剩下导出的 PNG,就不能宣布完成。
69
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
60
70
  Define shared primitives from the approved anchor surfaces before broad page expansion.
61
71
  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.
62
72
  Persist project-local Pencil files under .da-vinci/designs/.
@@ -74,6 +84,9 @@ Decompose complex screens into real design surfaces before Pencil work.
74
84
  Use the Visual Assist preferences declared in DA-VINCI.md.
75
85
  If the app is complex, design 1-3 anchor surfaces first, review screenshots, then expand.
76
86
  Stop after DA-VINCI.md, design-registry.md, page-map.md, proposal.md, specs, design.md, pencil-design.md, pencil-bindings.md, and tasks.md.
87
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`,不要依赖 interactive `save()`。
88
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
89
+ 在声明 `design complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
77
90
  Do not start code changes yet.
78
91
  ```
79
92
 
@@ -84,8 +97,10 @@ $da-vinci use continue for this existing mobile-app redesign workflow.
84
97
 
85
98
  Use the existing Da Vinci artifacts in this project.
86
99
  Do not restart discovery unless an artifact is missing or clearly wrong.
87
- Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth.
100
+ 把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。继续设计时先打开这个文件,但发生实质性 live edit 后,要把当前 MCP 快照重新覆盖写回同一路径,不要假设 interactive `save()` 已经刷回磁盘。
88
101
  If the redesign is complex, keep the anchor-first flow until the design checkpoint passes.
102
+ 如果 Pencil MCP 可用,且这一轮继续做了新的 Pencil 写入,就重新运行 MCP runtime gate,并把最新结果记录到 `pencil-design.md`。
103
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
89
104
  Continue into the next unfinished stage and do not stop at tasks.md when the active intent is full-delivery.
90
105
  ```
91
106
 
@@ -28,6 +28,9 @@ Existing code is the behavior source of truth, not the layout truth.
28
28
  Preserve current behavior, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
29
29
  Inventory the current tablet surfaces and important states before Pencil work.
30
30
  Use the Visual Assist preferences declared in DA-VINCI.md.
31
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`,不要依赖 interactive `save()`。
32
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
33
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
31
34
  Do not pass design checkpoint if the result ignores tablet-scale composition or collapses into a stretched phone layout.
32
35
  Persist project-local Pencil files under .da-vinci/designs/.
33
36
  ```
@@ -48,8 +51,15 @@ Use Pencil guides only as tablet-layout constraints, not as the design direction
48
51
  Do not start with broad multi-screen scaffolding.
49
52
  Design 1-3 anchor surfaces first, review screenshots, then expand.
50
53
  在通过 screenshot review 之前,先应用平板端专用的 form-factor layout hygiene 规则。
54
+ 在发送非小型 `batch_design` 之前,如果有 shell 能力,先对 Pencil operations 做 preflight。
55
+ 如果同一个 anchor surface 连续两次回滚,就切到每批不超过 6 个操作的微批次,直到拿到干净的 schema-safe pass。
56
+ 在第一次成功写入 Pencil 后、继续大范围扩展前,先运行 `da-vinci audit --mode integrity <project-path>`。
57
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
58
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`;如果原本已有 `.pen`,继续设计时先打开它,但发生实质性 live edit 后要把当前 MCP 快照重新覆盖写回同一路径。
51
59
  截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
60
+ 截图审查必须记录明确的 `PASS` / `WARN` / `BLOCK`、问题列表和是否回改;“看起来很好”不算审查记录。
52
61
  如果登记的 `.pen` 设计源只存在于内存中,或只剩下导出的 PNG,就不能宣布完成。
62
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
53
63
  Do not pass design checkpoint if the result collapses into a stretched phone layout, repeated placeholders, or weak multi-region hierarchy.
54
64
  Persist project-local Pencil files under .da-vinci/designs/.
55
65
  ```
@@ -66,6 +76,9 @@ Decompose complex pages into real design surfaces before Pencil work.
66
76
  Use the Visual Assist preferences declared in DA-VINCI.md.
67
77
  If the product is complex, design 1-3 anchor surfaces first, review screenshots, then expand.
68
78
  Stop after DA-VINCI.md, design-registry.md, page-map.md, proposal.md, specs, design.md, pencil-design.md, pencil-bindings.md, and tasks.md.
79
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`,不要依赖 interactive `save()`。
80
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
81
+ 在声明 `design complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
69
82
  Do not start code changes yet.
70
83
  ```
71
84
 
@@ -76,8 +89,10 @@ $da-vinci use continue for this existing tablet-product redesign workflow.
76
89
 
77
90
  Use the existing Da Vinci artifacts in this project.
78
91
  Do not restart discovery unless an artifact is missing or clearly wrong.
79
- Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth.
92
+ 把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。继续设计时先打开这个文件,但发生实质性 live edit 后,要把当前 MCP 快照重新覆盖写回同一路径,不要假设 interactive `save()` 已经刷回磁盘。
80
93
  If the redesign is complex, continue from the approved anchor surfaces instead of restarting broad scaffolding.
94
+ 如果 Pencil MCP 可用,且这一轮继续做了新的 Pencil 写入,就重新运行 MCP runtime gate,并把最新结果记录到 `pencil-design.md`。
95
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
81
96
  Continue into the next unfinished stage and do not stop at tasks.md when the active intent is full-delivery.
82
97
  ```
83
98
 
@@ -28,6 +28,9 @@ Existing code is the behavior source of truth, not the layout truth.
28
28
  Preserve current business logic, routes, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
29
29
  Inventory the current product surfaces and important states before Pencil work.
30
30
  Use the Visual Assist preferences declared in DA-VINCI.md.
31
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`,不要依赖 interactive `save()`。
32
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
33
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
31
34
  Do not pass design checkpoint if the result is a generic SaaS card grid or a recolor of the old interface.
32
35
  Persist project-local Pencil files under .da-vinci/designs/.
33
36
  ```
@@ -49,8 +52,15 @@ Use Pencil guides only as responsive layout constraints, not as the design direc
49
52
  Do not start with broad multi-screen scaffolding.
50
53
  Design 1-3 anchor surfaces first, review screenshots, then expand.
51
54
  在通过 screenshot review 之前,先应用 Web 专用的 form-factor layout hygiene 规则。
55
+ 在发送非小型 `batch_design` 之前,如果有 shell 能力,先对 Pencil operations 做 preflight。
56
+ 如果同一个 anchor surface 连续两次回滚,就切到每批不超过 6 个操作的微批次,直到拿到干净的 schema-safe pass。
57
+ 在第一次成功写入 Pencil 后、继续大范围扩展前,先运行 `da-vinci audit --mode integrity <project-path>`。
58
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
59
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`;如果原本已有 `.pen`,继续设计时先打开它,但发生实质性 live edit 后要把当前 MCP 快照重新覆盖写回同一路径。
52
60
  截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
61
+ 截图审查必须记录明确的 `PASS` / `WARN` / `BLOCK`、问题列表和是否回改;“看起来很好”不算审查记录。
53
62
  如果登记的 `.pen` 设计源只存在于内存中,或只剩下导出的 PNG,就不能宣布完成。
63
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
54
64
  Do not pass design checkpoint if the result is a generic SaaS card grid, repeated placeholder scaffolds, or a recolor of the old interface.
55
65
  Persist project-local Pencil files under .da-vinci/designs/.
56
66
  ```
@@ -67,6 +77,9 @@ Decompose complex pages into real design surfaces before Pencil work.
67
77
  Use the Visual Assist preferences declared in DA-VINCI.md.
68
78
  If the product is complex, design 1-3 anchor surfaces first, review screenshots, then expand.
69
79
  Stop after DA-VINCI.md, design-registry.md, page-map.md, proposal.md, specs, design.md, pencil-design.md, pencil-bindings.md, and tasks.md.
80
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到 `.da-vinci/designs/`,不要依赖 interactive `save()`。
81
+ 如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
82
+ 在声明 `design complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
70
83
  Do not start code changes yet.
71
84
  ```
72
85
 
@@ -77,8 +90,10 @@ $da-vinci use continue for this existing web-product redesign workflow.
77
90
 
78
91
  Use the existing Da Vinci artifacts in this project.
79
92
  Do not restart discovery unless an artifact is missing or clearly wrong.
80
- Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth.
93
+ 把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。继续设计时先打开这个文件,但发生实质性 live edit 后,要把当前 MCP 快照重新覆盖写回同一路径,不要假设 interactive `save()` 已经刷回磁盘。
81
94
  If the redesign is complex, continue from the approved anchor surfaces instead of restarting broad scaffolding.
95
+ 如果 Pencil MCP 可用,且这一轮继续做了新的 Pencil 写入,就重新运行 MCP runtime gate,并把最新结果记录到 `pencil-design.md`。
96
+ 在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
82
97
  Continue into the next unfinished stage and do not stop at tasks.md when the active intent is full-delivery.
83
98
  ```
84
99
 
@@ -13,6 +13,11 @@
13
13
 
14
14
  - `docs/zh-CN/prompt-presets/`
15
15
 
16
+ 这些模板本身不负责 workflow completion gate:
17
+
18
+ - MCP runtime gate 仍然属于工作流 prompt / checkpoint 层
19
+ - `da-vinci audit --mode completion ...` 仍然属于工作流 prompt / checkpoint 层
20
+
16
21
  如果项目对设计质量要求很高,或者之前结果很普通、很丑、太像旧 UI:
17
22
 
18
23
  - 仍然先选对应场景模板
@@ -93,14 +93,20 @@ $da-vinci use redesign-from-code to inventory the current app, identify current
93
93
  6. 重建或细化 `page-map.md`,把 subpage、overlay、重要 state 一起拆出来
94
94
  7. 先写出 anchor surface 的 visual thesis、content plan、interaction thesis 和 structural-delta 说明
95
95
  8. 创建新的或更新后的 Pencil 页面,基于重新构图而不是旧 UI 换皮,并优先持久化到 `.da-vinci/designs/`
96
- 9. 在第一次成功写入 Pencil 后,立即验证登记的项目内 `.pen` 路径已经成为 shell 可见文件
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 最终能通过时,才进入实现和验证
96
+ 9. 在把 operations 发给 Pencil 前,先对非小型 `batch_design` preflight,并保持 anchor-surface 批次足够小
97
+ 10. 如果同一个 anchor surface 连续两次回滚,就切到每批不超过 6 个操作的微批次,直到拿到干净的 schema-safe pass
98
+ 11. 如果这一轮开始时还没有登记的项目内 `.pen`,先允许第一个通过审查的 live anchor surface 在内存里完成,然后立即把该 MCP 快照持久化到 `.da-vinci/designs/`
99
+ 12. 如果项目里原本已有登记的 `.pen`,继续设计时先打开它,但发生了实质性 live edit 后,必须把当前 MCP 快照重新覆盖写回同一路径
100
+ 13. 在第一次成功写入 Pencil 后,立即验证登记的项目内 `.pen` 路径已经成为 shell 可见文件
101
+ 14. 紧接着运行 `da-vinci audit --mode integrity <project-path>`
102
+ 15. 如果 Pencil MCP 可用,先运行 MCP runtime gate,并把结果记录到 `pencil-design.md`
103
+ 16. 运行 `design-source checkpoint`,确认登记的项目内 `.pen` 路径、当前 Pencil 设计源和 shell 可见文件是一致的
104
+ 17. 截图导出只放到 `.da-vinci/changes/<change-id>/exports/`,绝不能写进 `.da-vinci/designs/`
105
+ 18. 在 broad expansion 前,先把 screenshot review 的 `PASS` / `WARN` / `BLOCK`、问题列表和回改结果记清楚
106
+ 19. 绑定路由和 Pencil 页面
107
+ 20. 生成和 redesign slice 对齐的任务
108
+ 21. 在任何终态完成声明之前,先运行 `da-vinci audit --mode completion --change <change-id> <project-path>`
109
+ 22. 只有在 completion gate 最终能通过时,才进入实现和验证
104
110
 
105
111
  ### 复杂 Android 页面示例
106
112
 
@@ -118,10 +124,16 @@ Do not start with broad multi-screen scaffolding.
118
124
  Design 1-3 anchor surfaces first, review screenshots, then expand.
119
125
  For each anchor surface, explain how the new composition differs structurally from the current layout.
120
126
  Do not treat screenshot analysis as an automatic pass if it reports hierarchy, spacing, clarity, or inconsistency issues.
127
+ Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
128
+ If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
121
129
  Use only Pencil-supported properties; do not use web-only props like flex or margin.
130
+ 如果这一轮开始时还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP live 快照持久化到 `.da-vinci/designs/`,不要依赖 interactive `save()`。
131
+ 如果项目里原本已有登记的 `.pen`,继续设计时先打开它,但实质性 live edit 后要把当前 MCP 快照重新覆盖写回同一路径。
122
132
  Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
133
+ 在第一次成功写入 Pencil 后、继续大范围扩展前,先运行 `da-vinci audit --mode integrity <project-path>`。
123
134
  Keep `.da-vinci/designs/` reserved for `.pen` files only.
124
135
  Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
136
+ 截图审查必须记录明确的 `PASS` / `WARN` / `BLOCK`、问题列表和是否回改;“看起来很好”不算审查记录。
125
137
  Do not report completion if the `.pen` source exists only in memory or only as exported PNGs.
126
138
  Do not pass design checkpoint if the result is just a skin-swap of the old UI.
127
139
  ```
@@ -162,6 +174,8 @@ Use the visual-adapter preferences declared in DA-VINCI.md.
162
174
  If frontend-skill is available, use it as the primary visual adapter.
163
175
  If it is unavailable, fall back to native Da Vinci design rules and continue.
164
176
  Persist project-local Pencil files under .da-vinci/designs/.
177
+ 如果当前还没有登记的项目内 `.pen`,先把第一个通过审查的 MCP 快照持久化到这里。
178
+ 如果项目里原本已有 `.pen`,继续设计后要把当前 MCP 快照覆盖写回同一路径。
165
179
  ```
166
180
 
167
181
  ## 复杂重设计的入口辅助示例
package/lib/cli.js CHANGED
@@ -1,3 +1,4 @@
1
+ const fs = require("fs");
1
2
  const {
2
3
  VERSION,
3
4
  installPlatforms,
@@ -6,6 +7,15 @@ const {
6
7
  validateAssets
7
8
  } = require("./install");
8
9
  const { auditProject, formatAuditReport } = require("./audit");
10
+ const {
11
+ preflightPencilBatch,
12
+ formatPencilPreflightReport,
13
+ readOperations
14
+ } = require("./pencil-preflight");
15
+ const {
16
+ writePenFromPayloadFiles,
17
+ snapshotPenFile
18
+ } = require("./pen-persistence");
9
19
 
10
20
  function getOption(args, name) {
11
21
  const direct = args.find((arg) => arg.startsWith(`${name}=`));
@@ -67,12 +77,22 @@ function printHelp() {
67
77
  " da-vinci status",
68
78
  " da-vinci validate-assets",
69
79
  " da-vinci audit [project-path]",
80
+ " da-vinci preflight-pencil --ops-file <path>",
81
+ " da-vinci write-pen --output <path> --nodes-file <path> [--variables-file <path>]",
82
+ " da-vinci snapshot-pen --input <path> --output <path>",
70
83
  " da-vinci --version",
71
84
  "",
72
85
  "Options:",
73
86
  " --platform <value> codex, claude, gemini, or all",
74
87
  " --home <path> override HOME for installation targets",
75
88
  " --project <path> override project path for audit",
89
+ " --ops-file <path> Pencil batch operations file for preflight",
90
+ " --input <path> input .pen file for snapshot-pen",
91
+ " --output <path> output .pen file for write-pen or snapshot-pen",
92
+ " --nodes-file <path> JSON payload from batch_get for write-pen",
93
+ " --variables-file <path> JSON payload from get_variables for write-pen",
94
+ " --verify-open reopen the written .pen with Pencil after writing",
95
+ " --version <value> explicit .pen version when writing from MCP payloads",
76
96
  " --mode <value> integrity or completion",
77
97
  " --change <id> scope completion audit to one change id"
78
98
  ].join("\n")
@@ -138,6 +158,81 @@ async function runCli(argv) {
138
158
  return;
139
159
  }
140
160
 
161
+ if (command === "preflight-pencil") {
162
+ const opsFile = getOption(argv, "--ops-file");
163
+ let operations = "";
164
+
165
+ if (opsFile) {
166
+ operations = readOperations(opsFile);
167
+ } else if (!process.stdin.isTTY) {
168
+ operations = fs.readFileSync(0, "utf8");
169
+ } else {
170
+ throw new Error("`preflight-pencil` requires `--ops-file <path>` or piped stdin input.");
171
+ }
172
+
173
+ const result = preflightPencilBatch(operations);
174
+ const report = formatPencilPreflightReport(result);
175
+
176
+ if (result.status === "FAIL") {
177
+ throw new Error(report);
178
+ }
179
+
180
+ console.log(report);
181
+ return;
182
+ }
183
+
184
+ if (command === "write-pen") {
185
+ const outputPath = getOption(argv, "--output");
186
+ const nodesFile = getOption(argv, "--nodes-file");
187
+ const variablesFile = getOption(argv, "--variables-file");
188
+ const version = getOption(argv, "--version");
189
+ const verifyWithPencil = argv.includes("--verify-open");
190
+
191
+ if (!outputPath || !nodesFile) {
192
+ throw new Error("`write-pen` requires `--output <path>` and `--nodes-file <path>`.");
193
+ }
194
+
195
+ const result = writePenFromPayloadFiles({
196
+ outputPath,
197
+ nodesFile,
198
+ variablesFile,
199
+ version,
200
+ verifyWithPencil
201
+ });
202
+
203
+ console.log(`Wrote .pen file to ${result.outputPath}`);
204
+ console.log(`Top-level nodes: ${result.document.children.length}`);
205
+ if (result.verification) {
206
+ console.log(`Verified reopen with Pencil (${result.verification.topLevelCount} top-level nodes).`);
207
+ }
208
+ return;
209
+ }
210
+
211
+ if (command === "snapshot-pen") {
212
+ const inputPath = getOption(argv, "--input");
213
+ const outputPath = getOption(argv, "--output");
214
+ const version = getOption(argv, "--version");
215
+ const verifyWithPencil = argv.includes("--verify-open");
216
+
217
+ if (!inputPath || !outputPath) {
218
+ throw new Error("`snapshot-pen` requires `--input <path>` and `--output <path>`.");
219
+ }
220
+
221
+ const result = snapshotPenFile({
222
+ inputPath,
223
+ outputPath,
224
+ version,
225
+ verifyWithPencil
226
+ });
227
+
228
+ console.log(`Snapshotted ${result.inputPath} to ${result.outputPath}`);
229
+ console.log(`Top-level nodes: ${result.document.children.length}`);
230
+ if (result.verification) {
231
+ console.log(`Verified reopen with Pencil (${result.verification.topLevelCount} top-level nodes).`);
232
+ }
233
+ return;
234
+ }
235
+
141
236
  throw new Error(`Unknown command: ${command}`);
142
237
  }
143
238