@xenonbyte/da-vinci-workflow 0.1.17 → 0.1.19

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 (66) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +73 -4
  3. package/README.zh-CN.md +72 -5
  4. package/SKILL.md +64 -2
  5. package/commands/claude/da-vinci.md +1 -0
  6. package/commands/claude/dv/continue.md +2 -0
  7. package/commands/claude/dv/design.md +3 -2
  8. package/commands/claude/dv/intake.md +2 -0
  9. package/commands/codex/prompts/da-vinci.md +1 -0
  10. package/commands/codex/prompts/dv-continue.md +2 -0
  11. package/commands/codex/prompts/dv-design.md +3 -2
  12. package/commands/codex/prompts/dv-intake.md +2 -1
  13. package/commands/gemini/da-vinci.toml +1 -0
  14. package/commands/gemini/dv/continue.toml +2 -0
  15. package/commands/gemini/dv/design.toml +3 -2
  16. package/commands/gemini/dv/intake.toml +2 -0
  17. package/docs/codex-natural-language-usage.md +10 -0
  18. package/docs/dv-command-reference.md +402 -0
  19. package/docs/mode-use-cases.md +95 -3
  20. package/docs/pencil-rendering-workflow.md +279 -0
  21. package/docs/prompt-entrypoints.md +28 -0
  22. package/docs/prompt-presets/README.md +82 -1
  23. package/docs/prompt-presets/desktop-app.md +103 -5
  24. package/docs/prompt-presets/mobile-app.md +103 -5
  25. package/docs/prompt-presets/tablet-app.md +103 -5
  26. package/docs/prompt-presets/web-app.md +103 -5
  27. package/docs/visual-adapters.md +190 -0
  28. package/docs/visual-assist-presets/README.md +28 -5
  29. package/docs/visual-assist-presets/desktop-app.md +88 -2
  30. package/docs/visual-assist-presets/mobile-app.md +89 -2
  31. package/docs/visual-assist-presets/tablet-app.md +88 -2
  32. package/docs/visual-assist-presets/web-app.md +88 -2
  33. package/docs/workflow-examples.md +31 -4
  34. package/docs/workflow-overview.md +243 -0
  35. package/docs/zh-CN/codex-natural-language-usage.md +10 -0
  36. package/docs/zh-CN/dv-command-reference.md +402 -0
  37. package/docs/zh-CN/mode-use-cases.md +49 -4
  38. package/docs/zh-CN/pencil-rendering-workflow.md +281 -0
  39. package/docs/zh-CN/prompt-entrypoints.md +28 -0
  40. package/docs/zh-CN/prompt-presets/README.md +82 -1
  41. package/docs/zh-CN/prompt-presets/desktop-app.md +103 -5
  42. package/docs/zh-CN/prompt-presets/mobile-app.md +103 -5
  43. package/docs/zh-CN/prompt-presets/tablet-app.md +103 -5
  44. package/docs/zh-CN/prompt-presets/web-app.md +103 -5
  45. package/docs/zh-CN/visual-adapters.md +190 -0
  46. package/docs/zh-CN/visual-assist-presets/README.md +28 -5
  47. package/docs/zh-CN/visual-assist-presets/desktop-app.md +88 -1
  48. package/docs/zh-CN/visual-assist-presets/mobile-app.md +89 -2
  49. package/docs/zh-CN/visual-assist-presets/tablet-app.md +89 -2
  50. package/docs/zh-CN/visual-assist-presets/web-app.md +88 -1
  51. package/docs/zh-CN/workflow-examples.md +34 -4
  52. package/docs/zh-CN/workflow-overview.md +245 -0
  53. package/lib/audit.js +199 -0
  54. package/lib/pencil-lock.js +15 -4
  55. package/package.json +4 -1
  56. package/references/artifact-templates.md +65 -0
  57. package/references/checkpoints.md +43 -19
  58. package/references/design-inputs.md +6 -0
  59. package/references/modes.md +34 -0
  60. package/references/page-mapping.md +58 -0
  61. package/references/pencil-design-to-code.md +8 -2
  62. package/references/platform-adapters.md +1 -0
  63. package/references/prompt-recipes.md +44 -0
  64. package/scripts/test-audit-design-supervisor.js +348 -0
  65. package/scripts/test-mode-consistency.js +289 -0
  66. package/scripts/test-pencil-lock.js +130 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.1.19 - 2026-03-28
4
+
5
+ ### Added
6
+ - `design-supervisor review` as a documented final style-quality gate that stays distinct from `Preferred adapters`
7
+ - `scripts/test-audit-design-supervisor.js` to cover advisory versus required reviewer branches, missing review records, and malformed review records
8
+ - `scripts/test-pencil-lock.js` to verify blocking lock waits and timeout behavior after removing the old busy-wait loop
9
+
10
+ ### Changed
11
+ - `Visual Assist` guidance now explains `Design-supervisor reviewers`, `Require Supervisor Review`, gate order, gate judging criteria, and per-gate branching in both English and Chinese
12
+ - `visual-assist-presets` for mobile, desktop, web, and tablet now ship three explicit variants: adapter-only, advisory reviewer, and required reviewer signoff
13
+ - completion and integrity audit now treat `Require Supervisor Review: true` as the actual hard-gate switch instead of forcing all configured reviewers into a blocking path
14
+ - design-supervisor review records now require explicit status, issue list, and revision outcome before they count as valid audit evidence
15
+ - Pencil lock waiting now uses blocking sleep via `Atomics.wait(...)` instead of CPU-burning busy waits while preserving the synchronous CLI call graph
16
+ - Chinese `visual-assist-presets` now match the English three-variant structure without extra duplicated configuration blocks
17
+
18
+ ## v0.1.18 - 2026-03-28
19
+
20
+ ### Added
21
+ - `overhaul-from-code` as a fifth workflow mode for broad existing-product rewrites where the current codebase remains migration evidence, but new `proposal.md` and `specs/` become the target behavior truth
22
+ - `migration-contract.md` as a first-class change artifact for preserve / revise / retire / unknown decisions in overhaul work
23
+ - `docs/dv-command-reference.md` and `docs/zh-CN/dv-command-reference.md` to explain route responsibilities, stateful next-step recommendations, and verify rollback behavior
24
+
25
+ ### Changed
26
+ - intake, mode guides, prompt recipes, workflow examples, and natural-language usage now distinguish `overhaul-from-code` from `redesign-from-code` instead of forcing large product rewrites into UI-only redesign semantics
27
+ - workflow, checkpoint, and design-input guidance now require overhaul runs to stabilize `proposal.md`, `migration-contract.md`, target `specs/`, and `page-map.md` before broad Pencil generation
28
+ - visual-adapter and Pencil design guidance now explain how `overhaul-from-code` keeps current code as reference evidence while using the new truth sources to drive design and implementation
29
+ - prompt preset docs now include dedicated `overhaul-from-code` intake, breakdown, design, and continue templates for mobile, desktop, web, and tablet surfaces
30
+ - page-mapping, checkpoint, and command-reference docs now explain how to recover when bindings still exist but either implementation or the design source is missing
31
+
3
32
  ## v0.1.17 - 2026-03-28
4
33
 
5
34
  ### Added
package/README.md CHANGED
@@ -21,16 +21,23 @@ This workflow is intended for:
21
21
  - 0-to-1 product delivery
22
22
  - brainstorm-to-product delivery
23
23
  - redesign from existing code
24
+ - large existing-product overhauls where flows and logic also change
24
25
  - scoped feature delivery on an existing product
25
26
 
26
27
  ## Current release
27
28
 
28
29
  Latest published npm package:
29
30
 
30
- - `@xenonbyte/da-vinci-workflow@0.1.16`
31
+ - `@xenonbyte/da-vinci-workflow@0.1.19`
31
32
 
32
33
  Release highlights:
33
34
 
35
+ - `design-supervisor review` is now a first-class final style-quality gate with explicit advisory versus required behavior controlled by `Require Supervisor Review`
36
+ - `Visual Assist` docs now explain gate order, gate judging criteria, and branching across screenshot review, layout hygiene, design checkpoint, and design-supervisor review
37
+ - `visual-assist-presets` for mobile, desktop, web, and tablet now ship three explicit variants: adapter-only, advisory reviewer, and required reviewer signoff in both English and Chinese
38
+ - completion and integrity audit now respect `Require Supervisor Review: true` as the actual hard-gate switch instead of treating every configured reviewer as automatically blocking
39
+ - design-supervisor review records now require explicit status, issue list, and revision outcome before they count as valid audit evidence
40
+ - Pencil lock waiting now sleeps without busy-spinning, reducing CPU waste while preserving the synchronous CLI/session contract
34
41
  - project-local `.pen` persistence now uses an MCP-snapshot-to-disk path instead of relying on headless interactive `save()`
35
42
  - redesign runs now seed a registered project-local `.pen` before the first Pencil edit and record persisted snapshot hashes for later sync checks
36
43
  - `da-vinci write-pen` now atomically writes workflow-owned `.pen` files from MCP-readable node and variable payloads with optional reopen verification
@@ -70,7 +77,7 @@ Release highlights:
70
77
 
71
78
  ## Supported workflow modes
72
79
 
73
- Da Vinci V2 supports four modes.
80
+ Da Vinci currently supports five modes.
74
81
 
75
82
  ### `greenfield-spec`
76
83
 
@@ -84,6 +91,10 @@ Use when the project is new but the inputs come from multiple rounds of rough pr
84
91
 
85
92
  Use when an existing project already has routes, pages, and UI, and the goal is a broad redesign or UI replacement.
86
93
 
94
+ ### `overhaul-from-code`
95
+
96
+ Use when an existing project is undergoing a broad system-level rewrite and current code is still valuable as migration evidence, but no longer the complete target behavior truth.
97
+
87
98
  ### `feature-change`
88
99
 
89
100
  Use when an existing product needs a scoped requirement change, page addition, or page update.
@@ -119,6 +130,17 @@ Recommended default:
119
130
  - Preferred adapters:
120
131
  - ui-ux-pro-max
121
132
  - frontend-skill
133
+ - Design-supervisor reviewers:
134
+ - frontend-skill
135
+ - ui-ux-pro-max
136
+ - Design-supervisor review mode:
137
+ - screenshot-and-theme
138
+ - Design-supervisor review inputs:
139
+ - screenshots
140
+ - pencil variables
141
+ - visual thesis
142
+ - content plan
143
+ - interaction thesis
122
144
  - Scope:
123
145
  - visual contract refinement
124
146
  - page composition
@@ -129,6 +151,8 @@ Recommended default:
129
151
  - native-da-vinci
130
152
  - Require Adapter:
131
153
  - false
154
+ - Require Supervisor Review:
155
+ - false
132
156
  ```
133
157
 
134
158
  Use this when:
@@ -144,6 +168,17 @@ Quality-first redesign configuration:
144
168
  - Preferred adapters:
145
169
  - frontend-skill
146
170
  - ui-ux-pro-max
171
+ - Design-supervisor reviewers:
172
+ - frontend-skill
173
+ - ui-ux-pro-max
174
+ - Design-supervisor review mode:
175
+ - screenshot-and-theme
176
+ - Design-supervisor review inputs:
177
+ - screenshots
178
+ - pencil variables
179
+ - visual thesis
180
+ - content plan
181
+ - interaction thesis
147
182
  - Scope:
148
183
  - visual contract refinement
149
184
  - page composition
@@ -155,6 +190,8 @@ Quality-first redesign configuration:
155
190
  - native-da-vinci
156
191
  - Require Adapter:
157
192
  - true
193
+ - Require Supervisor Review:
194
+ - true
158
195
  ```
159
196
 
160
197
  Use this when:
@@ -182,6 +219,9 @@ Selection rules:
182
219
  - use only Pencil-supported properties; do not rely on web-only props such as `flex` or `margin`
183
220
  - keep `Fallback: native-da-vinci` unless you explicitly want missing adapters to block the workflow
184
221
  - keep `Require Adapter: false` by default and raise it to `true` only for design-critical work
222
+ - keep `Design-supervisor reviewers` separate from `Preferred adapters`; adapters lead first-pass composition, reviewers judge final style maturity
223
+ - keep `Require Supervisor Review: false` unless reviewer-backed style signoff is itself a delivery requirement
224
+ - `Require Supervisor Review: true` means missing, blocked, or unaccepted reviewer results should block broad expansion, implementation-task handoff, and terminal completion
185
225
  - keep `Scope` limited to presentation quality; do not use it to delegate behavior, routes, or state truth
186
226
 
187
227
  ## Core workflow
@@ -225,6 +265,7 @@ Depending on the mode, the workflow may use these artifacts:
225
265
  - `project-inventory.md`: current routes, pages, and UI patterns from an existing codebase
226
266
  - `DA-VINCI.md`: project-level visual contract for theme, palette, typography direction, component tone, and page-consistency rules
227
267
  - `design-brief.md`: form factor, style, density, brand constraints, and layout preferences
268
+ - `migration-contract.md`: preserve / revise / retire / unknown boundaries for existing-system overhaul work
228
269
  - `design-registry.md`: project-level `.pen` source inventory
229
270
  - `.da-vinci/designs/`: project-local persisted Pencil sources such as `project-baseline.pen` or change-specific `.pen` files
230
271
  - `page-map.md`: canonical page list and page responsibilities
@@ -242,6 +283,8 @@ Use specs as capability or redesign-slice boundaries, not as page counters.
242
283
 
243
284
  For broad `redesign-from-code` work, prefer multiple `specs/<slice>/spec.md` files over one oversized `ui-refresh/spec.md`.
244
285
 
286
+ For broad `overhaul-from-code` work, prefer multiple `specs/<slice>/spec.md` files plus one `migration-contract.md` over one oversized rewrite spec that mixes preserved and retired system behavior.
287
+
245
288
  ## Artifact placement
246
289
 
247
290
  Recommended project layout:
@@ -260,6 +303,7 @@ project/
260
303
  └── <change-id>/
261
304
  ├── brainstorm.md
262
305
  ├── design-brief.md
306
+ ├── migration-contract.md
263
307
  ├── proposal.md
264
308
  ├── design.md
265
309
  ├── pencil-design.md
@@ -332,6 +376,7 @@ Rules:
332
376
  - `page-map.md` is the source of truth for implementation pages
333
377
  - `pencil-bindings.md` is the source of truth for implementation page -> Pencil page mapping
334
378
  - in `redesign-from-code`, existing code is behavior truth, not layout truth
379
+ - in `overhaul-from-code`, existing code is reference evidence and migration baseline, not the final target behavior truth
335
380
  - complex pages should be decomposed into subpages, states, overlays, and implementation surfaces before Pencil redesign is treated as final
336
381
  - the preferred `.pen` path recorded in `design-registry.md` is workflow-owned state, not user-authored config
337
382
  - when Pencil work starts, Da Vinci should use or create that exact project-local `.pen` path instead of relying on whichever Pencil document happens to be active
@@ -446,16 +491,18 @@ Both modes check the most common workflow-integrity failures in a project:
446
491
  - warns when anchor-surface batches are too large and should be split before retrying
447
492
 
448
493
  When Pencil MCP is active, Da Vinci now also expects an MCP runtime gate record in `pencil-design.md` before terminal completion claims. That runtime gate checks live editor/source convergence separately from filesystem audit.
449
- During active redesign work, prefer running `da-vinci audit --mode integrity <project-path>` immediately after the first successful Pencil write, then use `da-vinci preflight-pencil` plus smaller follow-up batches if the same anchor surface rolls back twice.
494
+ During active redesign work, run `da-vinci audit --mode integrity <project-path>` immediately after the first successful Pencil write, then use `da-vinci preflight-pencil` plus smaller follow-up batches if the same anchor surface rolls back twice.
450
495
 
451
496
  Project-local `.pen` persistence now has two supported paths:
452
497
 
453
498
  - first-run path: seed the registered project-local `.pen` with `da-vinci ensure-pen --output <path> --verify-open`, open that exact path, then persist later MCP snapshot writes back to the same file
454
499
  - resume path: if a registered project-local `.pen` already exists, reopen it for continuity, but after material live edits persist a fresh live MCP snapshot back to that same path and run `da-vinci check-pen-sync`
455
500
 
501
+ On autonomous redesign runs, the session wrapper is required when it is available. Lower-level helpers remain available only when the wrapper truly cannot be used.
502
+
456
503
  Persistence helpers:
457
504
 
458
- - preferred wrapper:
505
+ - required wrapper on autonomous runs:
459
506
  - `da-vinci pencil-session begin --project <project-path> --pen <path>`
460
507
  - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
461
508
  - `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
@@ -562,6 +609,12 @@ $da-vinci use greenfield-brainstorm to turn several product ideas into a page ma
562
609
  $da-vinci use redesign-from-code to inventory the existing app, identify current pages, and generate a new Pencil-backed UI plan
563
610
  ```
564
611
 
612
+ ### Overhaul from code
613
+
614
+ ```text
615
+ $da-vinci use overhaul-from-code to inventory the current product, define preserve/revise/retire boundaries, rewrite the target flows and specs, and generate a Pencil-backed overhaul plan
616
+ ```
617
+
565
618
  ### Feature change
566
619
 
567
620
  ```text
@@ -576,6 +629,7 @@ $da-vinci use intake for this existing Android project.
576
629
  I need to globally replace the UI.
577
630
  Existing Android code is the behavior source of truth.
578
631
  HTML references are in /abs/path/to/mockups.
632
+ Treat this as full-delivery unless I explicitly narrow it to design-only.
579
633
  ```
580
634
 
581
635
  ### Continue after inventory and spec work
@@ -587,13 +641,25 @@ Use the existing Da Vinci artifacts.
587
641
  Continue into full-delivery.
588
642
  ```
589
643
 
644
+ ### Continue after overhaul planning
645
+
646
+ ```text
647
+ $da-vinci use continue for this existing overhaul-from-code workflow.
648
+
649
+ Use the existing Da Vinci artifacts.
650
+ Continue from proposal, migration-contract, and target specs into design or implementation.
651
+ ```
652
+
590
653
  ## Workflow examples
591
654
 
592
655
  See:
593
656
 
594
657
  - `docs/prompt-entrypoints.md`
658
+ - `docs/dv-command-reference.md`
595
659
  - `docs/prompt-presets/`
596
660
  - includes `Simple redesign`, `Complex redesign`, `Design-only`, and `Continue` variants in each surface file
661
+ - `docs/workflow-overview.md`
662
+ - `docs/pencil-rendering-workflow.md`
597
663
  - `docs/codex-natural-language-usage.md`
598
664
  - `docs/visual-adapters.md`
599
665
  - `docs/visual-assist-presets/`
@@ -605,8 +671,11 @@ See:
605
671
  Chinese companion documents are included in this repository:
606
672
 
607
673
  - `README.zh-CN.md`
674
+ - `docs/zh-CN/dv-command-reference.md`
608
675
  - `docs/zh-CN/prompt-presets/`
609
676
  - each surface file also includes `Simple redesign`, `Complex redesign`, `Design-only`, and `Continue`
677
+ - `docs/zh-CN/workflow-overview.md`
678
+ - `docs/zh-CN/pencil-rendering-workflow.md`
610
679
  - `docs/zh-CN/visual-adapters.md`
611
680
  - `docs/zh-CN/visual-assist-presets/`
612
681
  - `docs/zh-CN/`
package/README.zh-CN.md CHANGED
@@ -23,16 +23,23 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
23
23
  - 0 到 1 的产品交付
24
24
  - 从 brainstorming 走向可实施产品
25
25
  - 基于现有代码做全局 UI 重设计
26
+ - 基于现有代码做流程、逻辑和 UI 一起变化的大改版
26
27
  - 在现有产品上做范围明确的 feature-change
27
28
 
28
29
  ## 当前发布状态
29
30
 
30
31
  最新已发布 npm 包:
31
32
 
32
- - `@xenonbyte/da-vinci-workflow@0.1.16`
33
+ - `@xenonbyte/da-vinci-workflow@0.1.19`
33
34
 
34
35
  已发布版本重点:
35
36
 
37
+ - `design-supervisor review` 现在成为正式的最终风格质量 gate,并通过 `Require Supervisor Review` 明确区分“建议性”与“硬门槛”
38
+ - `Visual Assist` 文档现在补全了 gate 顺序、每层 gate 怎么审,以及 screenshot review、layout hygiene、design checkpoint、design-supervisor review 之间的分叉规则
39
+ - 移动端、桌面端、Web、平板四套 `visual-assist-presets` 现在都提供三种明确变体:只有 adapter、reviewer 建议性审查、reviewer 硬签字,中英文一致
40
+ - completion / integrity audit 现在真正以 `Require Supervisor Review: true` 作为硬门槛开关,而不是只要配置 reviewer 就一律阻断
41
+ - `design-supervisor review` 记录现在必须有明确状态、问题列表和回改结果,才算有效审查证据
42
+ - Pencil 锁等待现在改成阻塞 sleep,不再 busy wait 空转 CPU,同时保留同步 CLI/session 的调用语义
36
43
  - 项目内 `.pen` 持久化现在改为“从 MCP 快照写回磁盘”的正式路径,不再依赖 headless interactive `save()`
37
44
  - 重设计流程现在要求在第一次 Pencil 编辑前先 seed 一个登记好的项目内 `.pen`,并记录后续持久化快照 hash 以便做同步校验
38
45
  - `da-vinci write-pen` 现在可以把 MCP 可读的节点和变量快照原子写成工作流管理的 `.pen` 文件,并可选地做 reopen 校验
@@ -72,7 +79,7 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
72
79
 
73
80
  ## 支持的工作流模式
74
81
 
75
- Da Vinci V2 支持四种模式:
82
+ Da Vinci 当前支持五种模式:
76
83
 
77
84
  ### `greenfield-spec`
78
85
 
@@ -86,6 +93,10 @@ Da Vinci V2 支持四种模式:
86
93
 
87
94
  已有项目,代码和行为已存在,目标是做广泛或全局的 UI 重设计。
88
95
 
96
+ ### `overhaul-from-code`
97
+
98
+ 已有项目,但目标是做系统级大改版;现有代码是参考证据和迁移基线,不是新系统最终行为真相。
99
+
89
100
  ### `feature-change`
90
101
 
91
102
  已有项目,只做某个功能、页面、流程的局部修改。
@@ -124,6 +135,17 @@ Da Vinci V2 支持四种模式:
124
135
  - Preferred adapters:
125
136
  - ui-ux-pro-max
126
137
  - frontend-skill
138
+ - Design-supervisor reviewers:
139
+ - frontend-skill
140
+ - ui-ux-pro-max
141
+ - Design-supervisor review mode:
142
+ - screenshot-and-theme
143
+ - Design-supervisor review inputs:
144
+ - screenshots
145
+ - pencil variables
146
+ - visual thesis
147
+ - content plan
148
+ - interaction thesis
127
149
  - Scope:
128
150
  - visual contract refinement
129
151
  - page composition
@@ -134,6 +156,8 @@ Da Vinci V2 支持四种模式:
134
156
  - native-da-vinci
135
157
  - Require Adapter:
136
158
  - false
159
+ - Require Supervisor Review:
160
+ - false
137
161
  ```
138
162
 
139
163
  适用场景:
@@ -149,6 +173,17 @@ Da Vinci V2 支持四种模式:
149
173
  - Preferred adapters:
150
174
  - frontend-skill
151
175
  - ui-ux-pro-max
176
+ - Design-supervisor reviewers:
177
+ - frontend-skill
178
+ - ui-ux-pro-max
179
+ - Design-supervisor review mode:
180
+ - screenshot-and-theme
181
+ - Design-supervisor review inputs:
182
+ - screenshots
183
+ - pencil variables
184
+ - visual thesis
185
+ - content plan
186
+ - interaction thesis
152
187
  - Scope:
153
188
  - visual contract refinement
154
189
  - page composition
@@ -160,6 +195,8 @@ Da Vinci V2 支持四种模式:
160
195
  - native-da-vinci
161
196
  - Require Adapter:
162
197
  - true
198
+ - Require Supervisor Review:
199
+ - true
163
200
  ```
164
201
 
165
202
  适用场景:
@@ -187,6 +224,9 @@ Da Vinci V2 支持四种模式:
187
224
  - 只使用 Pencil 支持的属性,不要继续使用 `flex`、`margin` 这类 Web 属性
188
225
  - 默认保留 `Fallback: native-da-vinci`
189
226
  - `Require Adapter` 默认保持 `false`,只有设计要求很高时再改成 `true`
227
+ - 把 `Design-supervisor reviewers` 和 `Preferred adapters` 分开;adapter 负责首轮设计引导,reviewer 负责最终风格质量把关
228
+ - `Require Supervisor Review` 默认保持 `false`,只有“reviewer 签字本身就是交付门槛”时才改成 `true`
229
+ - `Require Supervisor Review: true` 表示只要缺失、阻断、或未被接受的 reviewer 结果,就不能扩屏、交接实现或宣告完成
190
230
  - `Scope` 只管 presentation 质量,不要拿它去定义 behavior、route 或 state truth
191
231
 
192
232
  ## 核心工作流顺序
@@ -230,6 +270,7 @@ Da Vinci 的默认顺序是:
230
270
  - `project-inventory.md`:现有代码库里的路由、页面、UI 结构盘点
231
271
  - `DA-VINCI.md`:项目级视觉契约
232
272
  - `design-brief.md`:设计方向、形态、密度、品牌和限制条件
273
+ - `migration-contract.md`:存量系统在大改版中哪些保留、修改、废弃、待确认的边界
233
274
  - `design-registry.md`:项目级 `.pen` 设计源登记
234
275
  - `.da-vinci/designs/`:项目内持久化的 Pencil 设计源,例如 `project-baseline.pen` 或按 change 保存的 `.pen` 文件
235
276
  - `page-map.md`:页面、职责、状态和共享区域
@@ -259,6 +300,7 @@ project/
259
300
  └── <change-id>/
260
301
  ├── brainstorm.md
261
302
  ├── design-brief.md
303
+ ├── migration-contract.md
262
304
  ├── proposal.md
263
305
  ├── design.md
264
306
  ├── pencil-design.md
@@ -284,6 +326,7 @@ project/
284
326
  - `page-map.md` 是实现页面和状态的真相源
285
327
  - `pencil-bindings.md` 是实现页面到 Pencil 页面绑定的真相源
286
328
  - 在 `redesign-from-code` 里,现有代码只是真相行为,不是真相布局
329
+ - 在 `overhaul-from-code` 里,现有代码是参考证据和迁移基线,不是新系统最终行为真相
287
330
  - 复杂页面在 Pencil 重设计前应该先拆成 subpage、state、overlay 和 implementation surface
288
331
  - `design-registry.md` 里登记的首选 `.pen` 路径属于工作流自动维护的状态,不应该依赖用户手工填写
289
332
  - 一旦进入 Pencil 设计,Da Vinci 应该使用或创建这个项目内 `.pen` 路径,而不是继续沿用当前随手打开的 Pencil 文档
@@ -375,16 +418,18 @@ da-vinci uninstall --platform codex,claude,gemini
375
418
  - 当 anchor-surface 批次太大时给出拆批警告,避免继续大块回滚
376
419
 
377
420
  当 Pencil MCP 可用时,Da Vinci 现在还要求在终态完成声明前,把 MCP runtime gate 结果记录到 `pencil-design.md`。这层 gate 负责检查 live editor/source convergence,与 filesystem audit 分工不同。
378
- 在重设计进行中,建议在第一次成功写入 Pencil 后立即运行 `da-vinci audit --mode integrity <project-path>`;如果同一个 anchor surface 连续回滚,则继续配合 `da-vinci preflight-pencil` 和更小的 follow-up batch。
421
+ 在重设计进行中,如果有 shell 能力,应在第一次成功写入 Pencil 后立即运行 `da-vinci audit --mode integrity <project-path>`;如果同一个 anchor surface 连续回滚,则继续配合 `da-vinci preflight-pencil` 和更小的 follow-up batch。
379
422
 
380
423
  项目内 `.pen` 持久化现在分成两条受支持路径:
381
424
 
382
425
  - 首次运行路径:先用 `da-vinci ensure-pen --output <path> --verify-open` seed 登记好的项目内 `.pen`,打开这个精确路径,然后把后续 MCP 快照持续写回同一个文件
383
426
  - 继续迭代路径:如果项目里原本已有登记的 `.pen`,先打开它继续工作;但发生实质性 live edit 后,要把当前 live MCP 快照重新持久化回同一路径,并运行 `da-vinci check-pen-sync`
384
427
 
385
- 推荐使用的持久化命令:
428
+ 如果是自治运行,session wrapper 只要可用就必须使用。只有 wrapper 确实不可用时,才退回底层 helper。
386
429
 
387
- - 优先使用封装好的 session 命令:
430
+ 持久化命令:
431
+
432
+ - 自治运行必须使用的 session 命令:
388
433
  - `da-vinci pencil-session begin --project <project-path> --pen <path>`
389
434
  - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
390
435
  - `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
@@ -474,6 +519,12 @@ $da-vinci use greenfield-brainstorm to turn several product ideas into a page ma
474
519
  $da-vinci use redesign-from-code to inventory the existing app, identify current pages, and generate a new Pencil-backed UI plan
475
520
  ```
476
521
 
522
+ ### Overhaul from code
523
+
524
+ ```text
525
+ $da-vinci use overhaul-from-code to inventory the current product, define preserve/revise/retire boundaries, rewrite the target flows and specs, and generate a Pencil-backed overhaul plan
526
+ ```
527
+
477
528
  ### Feature change
478
529
 
479
530
  ```text
@@ -488,6 +539,7 @@ $da-vinci use intake for this existing Android project.
488
539
  I need to globally replace the UI.
489
540
  Existing Android code is the behavior source of truth.
490
541
  HTML references are in /abs/path/to/mockups.
542
+ Treat this as full-delivery unless I explicitly narrow it to design-only.
491
543
  ```
492
544
 
493
545
  ### 已有工件后继续推进
@@ -499,14 +551,26 @@ Use the existing Da Vinci artifacts.
499
551
  Continue into full-delivery.
500
552
  ```
501
553
 
554
+ ### 大改版场景继续推进
555
+
556
+ ```text
557
+ $da-vinci use continue for this existing overhaul-from-code workflow.
558
+
559
+ Use the existing Da Vinci artifacts.
560
+ Continue from proposal, migration-contract, and target specs into design or implementation.
561
+ ```
562
+
502
563
  ## 文档导航
503
564
 
504
565
  英文文档:
505
566
 
506
567
  - `docs/codex-natural-language-usage.md`
568
+ - `docs/dv-command-reference.md`
507
569
  - `docs/prompt-entrypoints.md`
508
570
  - `docs/prompt-presets/`
509
571
  - 每个场景文件都包含 `Simple redesign`、`Complex redesign`、`Design-only`、`Continue`
572
+ - `docs/workflow-overview.md`
573
+ - `docs/pencil-rendering-workflow.md`
510
574
  - `docs/visual-adapters.md`
511
575
  - `docs/visual-assist-presets/`
512
576
  - `docs/workflow-examples.md`
@@ -516,8 +580,11 @@ Continue into full-delivery.
516
580
  中文文档:
517
581
 
518
582
  - `README.zh-CN.md`
583
+ - `docs/zh-CN/dv-command-reference.md`
519
584
  - `docs/zh-CN/prompt-presets/`
520
585
  - 每个场景文件也都包含 `Simple redesign`、`Complex redesign`、`Design-only`、`Continue`
586
+ - `docs/zh-CN/workflow-overview.md`
587
+ - `docs/zh-CN/pencil-rendering-workflow.md`
521
588
  - `docs/zh-CN/visual-adapters.md`
522
589
  - `docs/zh-CN/visual-assist-presets/`
523
590
  - `docs/zh-CN/`
package/SKILL.md CHANGED
@@ -16,6 +16,7 @@ Keep these rules fixed:
16
16
  - Tasks decide implementation order.
17
17
  - Code must follow both requirements and Pencil data.
18
18
  - Existing code is behavior truth, not layout truth, during `redesign-from-code`.
19
+ - Existing code is reference evidence and migration baseline, not the final target behavior truth, during `overhaul-from-code`.
19
20
  - When requirements and Pencil drift apart, stop and update the source artifacts before continuing implementation.
20
21
 
21
22
  ## Execution Policy
@@ -75,6 +76,25 @@ Do not stop merely because:
75
76
 
76
77
  Those are warnings unless they prevent safe implementation of the current in-scope work.
77
78
 
79
+ ## Next-Step Recommendation Discipline
80
+
81
+ When Da Vinci reports a "next recommended step" or offers route suggestions, make the recommendation stateful rather than listing every possible command as if they were equally valid.
82
+
83
+ Use this order:
84
+
85
+ - if discovery or design-source artifacts are still missing, recommend the missing discovery or design work first
86
+ - if design is still blocking, recommend `design`
87
+ - if design is ready enough for implementation planning but `.da-vinci/changes/<change-id>/tasks.md` does not exist yet, recommend `tasks`
88
+ - if `tasks.md` exists and `task checkpoint` is at least `PASS` or an explicitly accepted `WARN`, recommend `build`
89
+ - if implementation is already underway or complete enough to check drift, recommend `verify`
90
+
91
+ Hard rules:
92
+
93
+ - do not present `build` as a co-equal next step when `tasks.md` does not exist yet
94
+ - do not present `build` as the primary next step immediately after design completion unless task generation is already done and implementation readiness is clear
95
+ - if design is complete but more in-scope surfaces still need design work, `design` may remain an optional branch, but `tasks` stays the primary next step before `build`
96
+ - if multiple commands are shown, clearly mark only one as the primary next step for the current workflow state
97
+
78
98
  ## Invocation Model
79
99
 
80
100
  Canonical workflow name is `da-vinci`.
@@ -134,7 +154,10 @@ Supported modes:
134
154
  3. `redesign-from-code`
135
155
  - use when an existing product already has code and the UI must be redesigned globally or broadly
136
156
 
137
- 4. `feature-change`
157
+ 4. `overhaul-from-code`
158
+ - use when an existing product needs a broad system-level rewrite where flows, logic, information architecture, and UI may all change
159
+
160
+ 5. `feature-change`
138
161
  - use when an existing product needs a scoped requirement change, page addition, or page update
139
162
 
140
163
  If the user does not specify a mode:
@@ -142,6 +165,7 @@ If the user does not specify a mode:
142
165
  - choose `greenfield-spec` for new projects with clear requirements
143
166
  - choose `greenfield-brainstorm` for exploratory new product ideation
144
167
  - choose `redesign-from-code` for broad UI replacement on existing code
168
+ - choose `overhaul-from-code` for broad existing-project rewrites where old code is no longer the full behavior truth
145
169
  - choose `feature-change` for incremental product work
146
170
 
147
171
  ## Design Input Collection
@@ -229,7 +253,7 @@ During active Pencil work:
229
253
  - when shell access is available, preflight non-trivial `batch_design` operation strings before sending them to Pencil
230
254
  - prefer 12 or fewer operations on anchor-surface batches; if the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds
231
255
  - do not rely on headless interactive `save()` as the persistence truth; when live MCP edits exist, persist project-local `.pen` files from MCP-readable document snapshots
232
- - prefer the session wrapper commands:
256
+ - use the session wrapper commands on autonomous runs:
233
257
  `da-vinci pencil-session begin --project <project-path> --pen <path>`
234
258
  `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
235
259
  `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
@@ -253,6 +277,10 @@ During active Pencil work:
253
277
  - exported screenshots are review artifacts only; place them under `.da-vinci/changes/<change-id>/exports/` and never treat them as a substitute for the project-local `.pen` source
254
278
  - screenshot review is binding: if the review calls out hierarchy, spacing, clarity, inconsistency, or unresolved-placeholder issues, revise the screen before treating the checkpoint as `PASS`
255
279
  - screenshot review must record an explicit `PASS`, `WARN`, or `BLOCK` plus the concrete issue list and revision outcome; phrases such as "looks good" do not count as review evidence
280
+ - if `DA-VINCI.md` declares `Design-supervisor reviewers`, run `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint for the approved anchor set
281
+ - keep `Design-supervisor reviewers` separate from `Preferred adapters`; adapters lead the design pass, reviewers judge whether the final style quality is strong enough to expand or implement
282
+ - when `design-supervisor review` is active, review screenshots together with Pencil theme variables, `visual-thesis.md`, `content-plan.md`, and `interaction-thesis.md`, then record an explicit `PASS`, `WARN`, or `BLOCK` plus issue list and revision outcome in `pencil-design.md`
283
+ - if `DA-VINCI.md` sets `Require Supervisor Review: true`, treat missing, blocked, or unaccepted `design-supervisor review` as a blocker before broad expansion, implementation-task handoff, or terminal completion
256
284
 
257
285
  ## Load References On Demand
258
286
 
@@ -378,6 +406,12 @@ Use these minimum flows:
378
406
 
379
407
  For broad refreshes, treat `.da-vinci/changes/<change-id>/specs/` as a redesign-slice directory, not as a single-file location.
380
408
 
409
+ ### `overhaul-from-code`
410
+
411
+ `.da-vinci/project-inventory` -> `.da-vinci/changes/<change-id>/proposal` -> `.da-vinci/changes/<change-id>/migration-contract` -> `.da-vinci/changes/<change-id>/specs` -> `.da-vinci/page-map` -> `DA-VINCI` -> `.da-vinci/design-registry` -> `.da-vinci/changes/<change-id>/design-brief` -> `.da-vinci/changes/<change-id>/design` -> `.da-vinci/changes/<change-id>/pencil-design` -> `.da-vinci/changes/<change-id>/pencil-bindings` -> `.da-vinci/changes/<change-id>/tasks` -> `.da-vinci/changes/<change-id>/verification`
412
+
413
+ For broad overhauls, treat `.da-vinci/changes/<change-id>/specs/` as an overhaul-slice directory and keep `migration-contract.md` singular for preserve/revise/retire decisions.
414
+
381
415
  ### `feature-change`
382
416
 
383
417
  `.da-vinci/changes/<change-id>/proposal` -> `.da-vinci/changes/<change-id>/specs` -> `.da-vinci/page-map` for affected pages -> `DA-VINCI` -> `.da-vinci/design-registry` -> `.da-vinci/changes/<change-id>/design` -> `.da-vinci/changes/<change-id>/pencil-design` delta -> `.da-vinci/changes/<change-id>/pencil-bindings` delta -> `.da-vinci/changes/<change-id>/tasks` -> `.da-vinci/changes/<change-id>/verification`
@@ -405,6 +439,15 @@ If the active mode is `redesign-from-code`:
405
439
  - default to fresh visual composition unless the user explicitly asks to preserve the current layout skeleton
406
440
  - partition specs by redesign slice when one oversized `ui-refresh` spec would hide important implementation boundaries
407
441
 
442
+ If the active mode is `overhaul-from-code`:
443
+
444
+ - inventory current routes, pages, modules, key flows, integrations, and permission boundaries before redefining the target product
445
+ - treat existing code as reference evidence and migration baseline rather than the final target behavior truth
446
+ - classify current system areas into `preserve`, `revise`, `retire`, and `unknown` in `migration-contract.md`
447
+ - stabilize new `proposal.md` and `specs/` before broad Pencil design or implementation
448
+ - update `page-map.md` to reflect the new target page set, not only the old route tree
449
+ - route verify failures back to `migration-contract.md`, `page-map.md`, or specs when overhaul truth is still unstable
450
+
408
451
  ## Spec Partitioning Rules
409
452
 
410
453
  Do not default to one oversized `ui-refresh` spec for broad redesign work.
@@ -438,6 +481,24 @@ One redesign spec is acceptable when the refresh is mostly cosmetic, narrow, or
438
481
 
439
482
  Do not split page-by-page unless the product is unusually fragmented. Prefer implementable redesign slices over raw page counts.
440
483
 
484
+ For `overhaul-from-code`:
485
+
486
+ - keep one overall `proposal.md`
487
+ - keep one `migration-contract.md`
488
+ - keep one project-level `DA-VINCI.md`
489
+ - keep one project-level `project-inventory.md`
490
+ - keep one project-level `design-registry.md`
491
+ - keep one project-level `page-map.md`
492
+ - split `specs/` by overhaul slice when the rewrite spans multiple implementation or migration boundaries
493
+
494
+ Preferred overhaul slices:
495
+
496
+ - `shell-and-navigation`
497
+ - `core-flows`
498
+ - `account-and-settings`
499
+ - `legacy-migration`
500
+ - `admin-or-restricted`
501
+
441
502
  ## Design Source Rules
442
503
 
443
504
  Use `design-registry.md` as the project-level inventory of `.pen` sources.
@@ -698,3 +759,4 @@ After meaningful work, report:
698
759
  5. blockers or drift
699
760
 
700
761
  Keep updates concise and operational.
762
+ Make `next recommended step` follow the state rules above; do not list `build` next to `tasks` as if they were equivalent when task generation has not happened yet.
@@ -22,6 +22,7 @@ Notes:
22
22
  - Requirements decide behavior.
23
23
  - Pencil decides presentation.
24
24
  - Code must follow both.
25
+ - After design but before `tasks.md` exists, prefer `/dv:tasks` as the next route; treat `/dv:build` as implementation-ready only.
25
26
  - If `Visual Assist` is configured, resolve and state the actual primary visual adapter for this environment instead of assuming cross-platform skill equivalence.
26
27
  - Keep `.da-vinci/designs/` reserved for `.pen` files only.
27
28
  - On complex redesigns, design 1-3 anchor surfaces first and treat screenshot review as a binding gate before broad expansion.
@@ -21,4 +21,6 @@ Output should include:
21
21
  Route discipline:
22
22
  - do not restart discovery if the current artifacts already contain enough truth
23
23
  - do not default the user into `/dv:build` unless the project is clearly implementation-ready
24
+ - if design artifacts exist but `tasks.md` does not, prefer a continuation prompt that moves into `/dv:tasks`
25
+ - only prefer `/dv:build` once task generation and implementation readiness are already clear
24
26
  - continuation prompts should usually target the main workflow entry so Da Vinci can resume the full state machine
@@ -20,10 +20,11 @@ Create or update:
20
20
  Run the `design checkpoint` before locking implementation tasks.
21
21
  Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
22
22
  If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
23
- Prefer the session wrapper commands: `da-vinci pencil-session begin`, `da-vinci pencil-session persist`, and `da-vinci pencil-session end`.
24
- Before the first Pencil edit, begin a Pencil session so the registered project-local `.pen` is seeded and locked before editing starts.
23
+ Require the session wrapper commands on autonomous runs: `da-vinci pencil-session begin`, `da-vinci pencil-session persist`, and `da-vinci pencil-session end`.
24
+ Before the first Pencil edit, require `da-vinci pencil-session begin` so the registered project-local `.pen` is seeded and locked before editing starts.
25
25
  If a registered project-local `.pen` already exists, reopen it for continuity but persist a fresh live MCP snapshot back to that same path through `pencil-session persist` after material edits.
26
26
  After the first successful Pencil write, run `da-vinci audit --mode integrity <project-path>` before broad expansion continues.
27
27
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
28
28
  Screenshot review must record an explicit `PASS`, `WARN`, or `BLOCK` plus the issue list and revision outcome; "looks good" is not a valid review record.
29
+ If `DA-VINCI.md` declares `Design-supervisor reviewers`, run `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint, then record the reviewers, inputs, status, issue list, and revision outcome in `pencil-design.md`. If `Require Supervisor Review: true`, treat missing, blocked, or unaccepted review results as blocking before broad expansion or terminal completion.
29
30
  Before reporting `design complete` or `workflow complete`, run `da-vinci audit --mode completion --change <change-id> <project-path>` and treat any failure as blocking.
@@ -24,3 +24,5 @@ Output should include:
24
24
  Route discipline:
25
25
  - do not default the user into `/dv:build`
26
26
  - `intake` should usually produce a main workflow prompt, not a build-only prompt
27
+ - prefer `redesign-from-code`, `overhaul-from-code`, or `feature-change` when the request starts from an existing project
28
+ - prefer `overhaul-from-code` when an existing project is redefining flows or logic rather than only replacing UI
@@ -21,6 +21,7 @@ Available routes:
21
21
 
22
22
  Important:
23
23
  - Treat `/prompts:*` as action selectors in Codex.
24
+ - After design but before `tasks.md` exists, prefer `/prompts:dv-tasks` as the next route; treat `/prompts:dv-build` as implementation-ready only.
24
25
  - If `Visual Assist` is configured, resolve and state the actual primary visual adapter for this environment instead of assuming cross-platform skill equivalence.
25
26
  - Keep `.da-vinci/designs/` reserved for `.pen` files only.
26
27
  - On complex redesigns, design 1-3 anchor surfaces first and treat screenshot review as a binding gate before broad expansion.
@@ -21,4 +21,6 @@ Output should include:
21
21
  Route discipline:
22
22
  - do not restart discovery if the current artifacts already contain enough truth
23
23
  - do not default the user into `/prompts:dv-build` unless the project is clearly implementation-ready
24
+ - if design artifacts exist but `tasks.md` does not, prefer a continuation prompt that moves into `/prompts:dv-tasks`
25
+ - only prefer `/prompts:dv-build` once task generation and implementation readiness are already clear
24
26
  - continuation prompts should usually target the main workflow entry so Da Vinci can resume the full state machine