@xenonbyte/da-vinci-workflow 0.1.18 → 0.1.20

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 (58) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +61 -4
  3. package/README.zh-CN.md +57 -6
  4. package/SKILL.md +11 -3
  5. package/commands/claude/dv/continue.md +4 -0
  6. package/commands/claude/dv/design.md +3 -2
  7. package/commands/codex/prompts/dv-continue.md +4 -0
  8. package/commands/codex/prompts/dv-design.md +3 -2
  9. package/commands/gemini/dv/continue.toml +4 -0
  10. package/commands/gemini/dv/design.toml +3 -2
  11. package/docs/codex-natural-language-usage.md +5 -0
  12. package/docs/dv-command-reference.md +4 -0
  13. package/docs/mode-use-cases.md +6 -4
  14. package/docs/pencil-rendering-workflow.md +79 -15
  15. package/docs/prompt-entrypoints.md +11 -1
  16. package/docs/prompt-presets/README.md +7 -4
  17. package/docs/prompt-presets/desktop-app.md +51 -7
  18. package/docs/prompt-presets/mobile-app.md +51 -7
  19. package/docs/prompt-presets/tablet-app.md +51 -7
  20. package/docs/prompt-presets/web-app.md +51 -7
  21. package/docs/visual-adapters.md +179 -1
  22. package/docs/visual-assist-presets/README.md +28 -5
  23. package/docs/visual-assist-presets/desktop-app.md +88 -2
  24. package/docs/visual-assist-presets/mobile-app.md +89 -2
  25. package/docs/visual-assist-presets/tablet-app.md +88 -2
  26. package/docs/visual-assist-presets/web-app.md +88 -2
  27. package/docs/workflow-examples.md +8 -3
  28. package/docs/workflow-overview.md +23 -0
  29. package/docs/zh-CN/codex-natural-language-usage.md +5 -0
  30. package/docs/zh-CN/dv-command-reference.md +4 -0
  31. package/docs/zh-CN/mode-use-cases.md +7 -5
  32. package/docs/zh-CN/pencil-rendering-workflow.md +79 -15
  33. package/docs/zh-CN/prompt-entrypoints.md +13 -1
  34. package/docs/zh-CN/prompt-presets/README.md +7 -4
  35. package/docs/zh-CN/prompt-presets/desktop-app.md +50 -7
  36. package/docs/zh-CN/prompt-presets/mobile-app.md +50 -7
  37. package/docs/zh-CN/prompt-presets/tablet-app.md +50 -7
  38. package/docs/zh-CN/prompt-presets/web-app.md +50 -7
  39. package/docs/zh-CN/visual-adapters.md +179 -1
  40. package/docs/zh-CN/visual-assist-presets/README.md +28 -5
  41. package/docs/zh-CN/visual-assist-presets/desktop-app.md +88 -1
  42. package/docs/zh-CN/visual-assist-presets/mobile-app.md +89 -2
  43. package/docs/zh-CN/visual-assist-presets/tablet-app.md +89 -2
  44. package/docs/zh-CN/visual-assist-presets/web-app.md +88 -1
  45. package/docs/zh-CN/workflow-examples.md +8 -3
  46. package/docs/zh-CN/workflow-overview.md +23 -0
  47. package/lib/audit.js +654 -0
  48. package/lib/pencil-lock.js +15 -4
  49. package/package.json +4 -1
  50. package/references/artifact-templates.md +57 -0
  51. package/references/checkpoints.md +44 -19
  52. package/references/modes.md +2 -2
  53. package/references/pencil-design-to-code.md +3 -3
  54. package/references/prompt-recipes.md +12 -2
  55. package/scripts/test-audit-context-delta.js +446 -0
  56. package/scripts/test-audit-design-supervisor.js +348 -0
  57. package/scripts/test-mode-consistency.js +134 -0
  58. package/scripts/test-pencil-lock.js +130 -0
@@ -26,7 +26,7 @@ PNG exports are review artifacts only. They are not the design source of truth.
26
26
 
27
27
  ## Session Model
28
28
 
29
- Da Vinci now prefers the session wrapper:
29
+ Da Vinci now requires the session wrapper on autonomous runs:
30
30
 
31
31
  - `da-vinci pencil-session begin`
32
32
  - `da-vinci pencil-session persist`
@@ -38,6 +38,8 @@ This wrapper exists to make three things mandatory:
38
38
  - serialized Pencil MCP write access
39
39
  - explicit live-to-disk persistence and sync verification
40
40
 
41
+ If `DA-VINCI.md` declares `Design-supervisor reviewers`, Da Vinci also runs a final style-quality review after the structural design gates pass. It becomes a blocking gate only when `DA-VINCI.md` sets `Require Supervisor Review: true`.
42
+
41
43
  ## First-Run Path
42
44
 
43
45
  When the project does not yet have a registered `.pen`:
@@ -61,6 +63,14 @@ When the project already has a registered `.pen`:
61
63
 
62
64
  Da Vinci does not assume live MCP edits were flushed automatically.
63
65
 
66
+ ## Continuation Recovery Rule
67
+
68
+ When resuming from existing artifacts:
69
+
70
+ - choose routing from current artifact and checkpoint truth first
71
+ - use checkpoint-adjacent `Context Delta` notes only as auxiliary recovery context
72
+ - if a contextual delta conflicts with current artifact/checkpoint truth, ignore that conflicting entry and record the conflict before continuing
73
+
64
74
  ## Persistence Rule
65
75
 
66
76
  Da Vinci does not treat headless interactive `save()` as authoritative persistence truth.
@@ -89,7 +99,7 @@ Use:
89
99
  - `da-vinci pencil-lock acquire`
90
100
  - `da-vinci pencil-lock release`
91
101
 
92
- or prefer the session wrapper, which manages the lock for you.
102
+ or use the session wrapper, which manages the lock for you.
93
103
 
94
104
  This prevents multiple projects from competing for the same active editor.
95
105
 
@@ -141,6 +151,41 @@ The render output cannot pass if:
141
151
  - it ignores screenshot-review findings
142
152
  - it still shows repeated schema-instability
143
153
 
154
+ ### Design-Supervisor Review
155
+
156
+ When `DA-VINCI.md` declares `Design-supervisor reviewers`, run a final `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint for the currently approved anchor set.
157
+
158
+ When `Require Supervisor Review: true`, missing, blocked, or unaccepted review results block broad expansion, implementation-task handoff, and terminal completion. When `Require Supervisor Review: false`, still record the review when configured, but treat it as advisory rather than completion-blocking.
159
+
160
+ Use it to judge:
161
+
162
+ - style quality
163
+ - brand distinctiveness
164
+ - cross-screen visual coherence
165
+ - token-to-render alignment
166
+ - whether the approved anchors are strong enough to expand or implement from
167
+
168
+ Reviewers are separate from `Preferred adapters`.
169
+
170
+ - adapters lead the design pass
171
+ - reviewers judge the approved result
172
+
173
+ Recommended inputs:
174
+
175
+ - reviewed screenshots
176
+ - Pencil `get_variables()` output
177
+ - `visual-thesis.md`
178
+ - `content-plan.md`
179
+ - `interaction-thesis.md`
180
+
181
+ Record:
182
+
183
+ - reviewer names
184
+ - review inputs
185
+ - `PASS` / `WARN` / `BLOCK`
186
+ - issue list
187
+ - revision outcome
188
+
144
189
  ## Design-Source Gate
145
190
 
146
191
  After active Pencil work exists, Da Vinci runs `design-source checkpoint`.
@@ -190,6 +235,14 @@ da-vinci audit --mode completion --change <change-id> <project-path>
190
235
 
191
236
  This audit now also expects `.da-vinci/state/pencil-session.json` to reflect the latest persisted `.pen` hash.
192
237
 
238
+ Context-delta audit expectations are warning-only:
239
+
240
+ - missing concrete context deltas for checkpoint-bearing artifacts -> `WARN`
241
+ - incomplete context-delta entries -> `WARN`
242
+ - context-delta status mismatch with current checkpoints -> `WARN`
243
+ - a mismatch can indicate stale checkpoint status or stale context-delta notes
244
+ - these warnings improve resume quality but do not create standalone completion blockers
245
+
193
246
  ## Preferred Command Chain
194
247
 
195
248
  Typical autonomous chain:
@@ -198,8 +251,10 @@ Typical autonomous chain:
198
251
  2. Pencil MCP edits
199
252
  3. `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
200
253
  4. screenshot review + layout hygiene
201
- 5. `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
202
- 6. `da-vinci audit --mode completion --change <change-id> <project-path>`
254
+ 5. design checkpoint
255
+ 6. design-supervisor review when configured
256
+ 7. `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
257
+ 8. `da-vinci audit --mode completion --change <change-id> <project-path>`
203
258
 
204
259
  ## Flow Diagram
205
260
 
@@ -217,15 +272,24 @@ flowchart TD
217
272
  H --> F
218
273
  I --> J{Screenshot review and layout hygiene pass?}
219
274
  J -- No --> F
220
- J -- Yes --> K[pencil-session persist writes live MCP snapshot back to .pen]
221
- K --> L[check-pen-sync verifies live hash equals persisted hash]
222
- L --> M{design-source checkpoint and runtime gate pass?}
223
- M -- No --> F
224
- M -- Yes --> N{More design work needed?}
225
- N -- Yes --> E
226
- N -- No --> O[pencil-session end releases lock]
227
- O --> P[completion audit]
228
- P --> Q{completion audit pass?}
229
- Q -- No --> F
230
- Q -- Yes --> R[design complete]
275
+ J -- Yes --> K{Design checkpoint pass?}
276
+ K -- No --> F
277
+ K -- Yes --> L{Design-supervisor review configured?}
278
+ L -- Yes --> M[Run design-supervisor review on screenshots plus theme inputs]
279
+ L -- No --> N[pencil-session persist writes live MCP snapshot back to .pen]
280
+ M --> O{Require Supervisor Review?}
281
+ O -- No --> N
282
+ O -- Yes --> P{Review PASS or accepted WARN?}
283
+ P -- No --> F
284
+ P -- Yes --> N
285
+ N --> Q[check-pen-sync verifies live hash equals persisted hash]
286
+ Q --> R{design-source checkpoint and runtime gate pass?}
287
+ R -- No --> F
288
+ R -- Yes --> S{More design work needed?}
289
+ S -- Yes --> E
290
+ S -- No --> T[pencil-session end releases lock]
291
+ T --> U[completion audit]
292
+ U --> V{completion audit pass?}
293
+ V -- No --> F
294
+ V -- Yes --> W[design complete]
231
295
  ```
@@ -58,9 +58,16 @@ What it should output:
58
58
 
59
59
  - detected workflow state
60
60
  - missing or weak artifacts
61
+ - contextual recovery notes from recent checkpoint deltas when available
61
62
  - one primary continuation prompt
62
63
  - one more conservative continuation prompt when useful
63
64
 
65
+ Continuation precedence:
66
+
67
+ - determine routing from artifact and checkpoint truth first
68
+ - use contextual checkpoint deltas only as auxiliary recovery context
69
+ - if contextual deltas conflict with current artifacts, ignore them for routing and note the conflict
70
+
64
71
  ## Default Flow
65
72
 
66
73
  Use this default sequence:
@@ -125,6 +132,9 @@ $da-vinci use intake for this existing Android project.
125
132
  I need to globally replace the UI.
126
133
  Existing code is the behavior source of truth.
127
134
  HTML references are in /abs/path/to/mockups.
135
+ Treat the HTML directory as visual reference only, not behavior truth or final design-source truth.
136
+ Open the HTML references in a real browser and wait 3-5 seconds, or until the visual state settles, before judging the final styling.
137
+ Inventory which pages and states the HTML directory actually covers and which still need to be inferred from behavior truth.
128
138
  ```
129
139
 
130
140
  Expected outcome:
@@ -159,7 +169,7 @@ Use:
159
169
  $da-vinci use intake for this existing product.
160
170
 
161
171
  This is a large overhaul, not only a UI refresh.
162
- Current codebase is important reference evidence and migration baseline, but it should not be treated as the final target behavior truth.
172
+ Current codebase is reference evidence and migration baseline, not the final target behavior truth.
163
173
  We need to redefine flows, logic, and page structure while preserving selected integrations and constraints.
164
174
  Generate the best executable Da Vinci workflow prompt for the next step.
165
175
  ```
@@ -17,7 +17,7 @@ Recommended flow:
17
17
  4. copy both into your workflow setup
18
18
  5. tighten the prompt further only when the project has unusual truth sources or platform constraints
19
19
  6. when Pencil MCP is active, prefer the redesign prompts that explicitly require an MCP runtime gate plus a completion audit before terminal completion claims
20
- 7. for project-local `.pen` persistence, prefer prompts that drive `da-vinci pencil-session begin / persist / end`; fall back to the lower-level `ensure-pen + write-pen + check-pen-sync` chain only when the wrapper cannot be used
20
+ 7. for project-local `.pen` persistence on autonomous runs, require prompts that drive `da-vinci pencil-session begin / persist / end`; fall back to the lower-level `ensure-pen + write-pen + check-pen-sync` chain only when the wrapper truly cannot be used
21
21
 
22
22
  Available presets:
23
23
 
@@ -38,6 +38,7 @@ Each scene preset should now include:
38
38
 
39
39
  - `Simple redesign`
40
40
  - `Complex redesign`
41
+ - `Redesign with reference directory`
41
42
  - `Design-only`
42
43
  - `Continue`
43
44
 
@@ -45,7 +46,7 @@ Each scene preset should now include:
45
46
 
46
47
  These are not surface-specific redesign presets.
47
48
 
48
- Use them when the project already exists, but the target flows or logic are being rewritten and the old codebase should be treated as reference evidence plus migration context.
49
+ Use them when the project already exists, but the target flows or logic are being rewritten and the old codebase should be treated as reference evidence and migration baseline.
49
50
 
50
51
  ### 1. Intake For A Broad Existing-Product Overhaul
51
52
 
@@ -59,7 +60,7 @@ Use when:
59
60
  $da-vinci use intake for this existing product.
60
61
 
61
62
  This is a broad overhaul, not only a UI refresh.
62
- Current codebase is important reference evidence and migration baseline, but it should not be treated as the final target behavior truth.
63
+ Current codebase is reference evidence and migration baseline, not the final target behavior truth.
63
64
  We need to redefine flows, logic, page structure, and selected UI surfaces while preserving only the approved integrations, permissions, and constraints.
64
65
  Recommend the best Da Vinci mode and generate the best executable next-step prompt.
65
66
  ```
@@ -97,7 +98,7 @@ $da-vinci use overhaul-from-code to design the new target product surfaces from
97
98
 
98
99
  Use the existing .da-vinci/project-inventory.md, proposal.md, migration-contract.md, target specs, page-map.md, DA-VINCI.md, and design-registry.md.
99
100
  Treat the new proposal and specs as the target behavior truth.
100
- Treat the old codebase only as reference evidence and migration context.
101
+ Treat the old codebase only as reference evidence and migration baseline.
101
102
  Design 1-3 anchor surfaces first, review screenshots, then expand.
102
103
  Persist project-local Pencil files under .da-vinci/designs/.
103
104
  Run the normal Pencil runtime gate and completion audit before terminal completion claims.
@@ -115,5 +116,7 @@ $da-vinci use continue for this existing overhaul-from-code workflow.
115
116
 
116
117
  Use the existing Da Vinci artifacts.
117
118
  Detect whether the workflow should return to breakdown, continue with design, generate tasks, continue implementation, or verify drift.
119
+ Determine routing from artifact and checkpoint truth first, then use contextual checkpoint deltas only as auxiliary recovery notes.
120
+ If a contextual delta conflicts with current artifacts, ignore that delta and record the conflict before continuing.
118
121
  Prefer the artifact-backed next safe stage instead of restarting the overhaul from scratch.
119
122
  ```
@@ -19,6 +19,7 @@ Use this when the workflow needs:
19
19
 
20
20
  - Use `Simple redesign` when the desktop surface is narrow, mostly single-workspace, or has limited state branching.
21
21
  - Use `Complex redesign` when the product has multiple workspaces, side panels, overlays, inspectors, or materially different states.
22
+ - Use `Redesign with reference directory` when you have a local HTML or mockup directory that should guide desktop composition as a visual reference only.
22
23
  - Use `Design-only` when you want the design chain and task readiness without code changes yet.
23
24
  - Use `Continue` when the workflow already created artifacts and needs to resume.
24
25
 
@@ -32,7 +33,7 @@ Use these templates when the desktop product already exists, but workspace model
32
33
  $da-vinci use intake for this existing desktop product.
33
34
 
34
35
  This is a broad overhaul, not only a UI refresh.
35
- Current desktop codebase is important reference evidence and migration baseline, but it should not be treated as the final target behavior truth.
36
+ Current desktop codebase is reference evidence and migration baseline, not the final target behavior truth.
36
37
  We need to redefine flows, workspace structure, interaction model, and selected UI surfaces while preserving only approved integrations, permissions, and constraints.
37
38
  Recommend the best Da Vinci mode and generate the best executable next-step prompt.
38
39
  ```
@@ -61,7 +62,7 @@ $da-vinci use overhaul-from-code to design the new target desktop surfaces from
61
62
 
62
63
  Use the existing .da-vinci/project-inventory.md, proposal.md, migration-contract.md, target specs, page-map.md, DA-VINCI.md, and design-registry.md.
63
64
  Treat the new proposal and specs as the target behavior truth.
64
- Treat the old desktop codebase only as reference evidence and migration context.
65
+ Treat the old desktop codebase only as reference evidence and migration baseline.
65
66
  Design 1-3 anchor surfaces first, review screenshots, then expand.
66
67
  Persist project-local Pencil files under .da-vinci/designs/.
67
68
  Run the normal Pencil runtime gate and completion audit before terminal completion claims.
@@ -74,6 +75,8 @@ $da-vinci use continue for this existing overhaul-from-code desktop workflow.
74
75
 
75
76
  Use the existing Da Vinci artifacts.
76
77
  Detect whether the workflow should return to breakdown, continue with design, generate tasks, continue implementation, or verify drift.
78
+ Determine routing from artifact and checkpoint truth first, then use contextual checkpoint deltas only as auxiliary recovery notes.
79
+ If a contextual delta conflicts with current artifacts, ignore that delta and record the conflict before continuing.
77
80
  Prefer the artifact-backed next safe stage instead of restarting the overhaul from scratch.
78
81
  ```
79
82
 
@@ -84,9 +87,11 @@ $da-vinci use redesign-from-code to redesign this existing desktop product.
84
87
 
85
88
  Existing code is the behavior source of truth, not the layout truth.
86
89
  Preserve current behavior, flows, integrations, and validation rules unless explicitly required otherwise.
90
+ Treat this as full-delivery unless explicitly changed.
91
+ Do not stop after discovery, anchor surfaces, phase summaries, or task generation; continue through tasks, build, and verify once the corresponding checkpoints pass.
87
92
  Inventory the current workspaces, dialogs, overlays, and important states before Pencil work.
88
93
  Use the Visual Assist preferences declared in DA-VINCI.md.
89
- Before the first Pencil edit, prefer `da-vinci pencil-session begin --project <project-path> --pen <path>` so the registered project-local `.pen` is seeded and the global Pencil lock is held; fall back to `da-vinci ensure-pen --output <path> --verify-open` only when the session wrapper cannot be used.
94
+ Before the first Pencil edit, require `da-vinci pencil-session begin --project <project-path> --pen <path>` so the registered project-local `.pen` is seeded and the global Pencil lock is held; fall back to `da-vinci ensure-pen --output <path> --verify-open` only when the session wrapper cannot be used.
90
95
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
91
96
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
92
97
  Do not pass design checkpoint if the result is just a boxed-up recolor of the old UI or if workspace hierarchy remains unclear.
@@ -100,6 +105,8 @@ $da-vinci use redesign-from-code to redesign this existing desktop product.
100
105
 
101
106
  Existing code is the behavior source of truth, not the layout truth.
102
107
  Preserve current behavior, flows, integrations, and validation rules unless explicitly required otherwise.
108
+ Treat this as full-delivery unless explicitly changed.
109
+ Do not stop after discovery, anchor surfaces, phase summaries, or task generation; continue through tasks, build, and verify once the corresponding checkpoints pass.
103
110
  Inventory primary workspaces, side panels, inspectors, dialogs, settings flows, overlays, and materially different states before broad Pencil work.
104
111
  Decompose complex screens into primary surfaces, secondary surfaces, overlays, and implementation surfaces.
105
112
  Create the required discovery and design-source artifacts in their standard locations before the first anchor surface.
@@ -113,15 +120,48 @@ Before non-trivial `batch_design` calls, preflight the Pencil operations when sh
113
120
  If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
114
121
  Run `da-vinci audit --mode integrity <project-path>` after the first successful Pencil write before broad expansion continues.
115
122
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
116
- Prefer `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits. Fall back to the lower-level `ensure-pen + write-pen + check-pen-sync` chain only when the session wrapper cannot be used.
123
+ Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits. Fall back to the lower-level `ensure-pen + write-pen + check-pen-sync` chain only when the session wrapper cannot be used.
117
124
  Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
118
125
  Record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome; "looks good" is not enough.
126
+ If `DA-VINCI.md` configures `Design-supervisor reviewers`, run `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint, using screenshots plus Pencil variables and the design theses as inputs. If `Require Supervisor Review: true`, treat missing, blocked, or unaccepted review results as blocking before broad expansion or terminal completion.
119
127
  Do not report completion if the registered `.pen` source exists only in memory or only as exported PNGs.
120
128
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
121
129
  Do not pass design checkpoint if the result is a repeated placeholder scaffold, flat panel soup, or a recolor of the old desktop shell.
122
130
  Persist project-local Pencil files under .da-vinci/designs/.
123
131
  ```
124
132
 
133
+ ## Redesign With Reference Directory
134
+
135
+ ```text
136
+ $da-vinci use redesign-from-code to redesign this existing desktop product.
137
+
138
+ Existing code is the behavior source of truth, not the layout truth.
139
+ Preserve current behavior, flows, integrations, and validation rules unless explicitly required otherwise.
140
+ Treat this as full-delivery unless explicitly changed.
141
+ Do not stop after discovery, anchor surfaces, phase summaries, or task generation; continue through tasks, build, and verify once the corresponding checkpoints pass.
142
+
143
+ Use <reference-directory> as the local HTML design-reference directory.
144
+ Treat that directory as visual reference material only, not as behavior truth, workspace truth, or final design-source truth.
145
+ Inventory which workspaces, side panels, inspectors, dialogs, overlays, and materially different states are covered by the reference directory and which are not before broad Pencil work begins.
146
+ For uncovered states or surfaces, derive the design from the approved anchor surfaces, the project visual contract, and the existing behavior truth.
147
+
148
+ If browser access is available, open the HTML reference screens in a real browser and wait 3-5 seconds, or until the visual state settles, before judging hierarchy, spacing, styling, or component treatment.
149
+ Do not review the initial unhydrated or partially rendered state.
150
+ If a reference screen visibly changes after load, use the settled state as the visual reference baseline and record that delayed settling was required.
151
+
152
+ Use the HTML reference screens only as composition and styling input where they are relevant and stable.
153
+ Do not mechanically clone them when they conflict with behavior truth, missing states, or implementation reality.
154
+
155
+ Design 1-3 anchor surfaces first, review screenshots, then expand.
156
+ For each anchor surface, explain how the new composition differs structurally from the current layout and whether it is primarily HTML-referenced, partially HTML-referenced, or inferred.
157
+
158
+ Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
159
+ Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits.
160
+ Run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
161
+ Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
162
+ Persist project-local Pencil files under .da-vinci/designs/.
163
+ ```
164
+
125
165
  ## Design-Only
126
166
 
127
167
  ```text
@@ -129,12 +169,14 @@ $da-vinci use redesign-from-code to redesign this existing desktop product.
129
169
 
130
170
  Existing code is the behavior source of truth, not the layout truth.
131
171
  Preserve current behavior, flows, and integrations.
172
+ Treat this as design-only, not full-delivery.
132
173
  Inventory workspaces, side panels, dialogs, overlays, and important states.
133
174
  Decompose complex screens into real design surfaces before Pencil work.
134
175
  Use the Visual Assist preferences declared in DA-VINCI.md.
135
176
  If the product is complex, design 1-3 anchor surfaces first, review screenshots, then expand.
136
- 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.
137
- Before the first Pencil edit, prefer `da-vinci pencil-session begin --project <project-path> --pen <path>` so the registered project-local `.pen` is seeded and locked; fall back to `da-vinci ensure-pen --output <path> --verify-open` only when the session wrapper cannot be used.
177
+ Stop after DA-VINCI.md, design-registry.md, page-map.md, proposal.md, specs, design.md, pencil-design.md, and pencil-bindings.md.
178
+ Do not generate `tasks.md` unless the user explicitly changes the delivery intent beyond design-only.
179
+ Before the first Pencil edit, require `da-vinci pencil-session begin --project <project-path> --pen <path>` so the registered project-local `.pen` is seeded and locked; fall back to `da-vinci ensure-pen --output <path> --verify-open` only when the session wrapper cannot be used.
138
180
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
139
181
  Before reporting `design complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
140
182
  Do not start code changes yet.
@@ -147,7 +189,9 @@ $da-vinci use continue for this existing desktop-product redesign workflow.
147
189
 
148
190
  Use the existing Da Vinci artifacts in this project.
149
191
  Do not restart discovery unless an artifact is missing or clearly wrong.
150
- Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth. Prefer `da-vinci pencil-session begin --project <project-path> --pen <path>` when resuming, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits; fall back to the lower-level `write-pen + check-pen-sync` path only when the session wrapper cannot be used.
192
+ Determine continuation routing from current artifact and checkpoint truth first, then use contextual checkpoint deltas only as auxiliary recovery notes.
193
+ If a contextual delta conflicts with current artifacts, ignore that delta and record the conflict before continuing.
194
+ Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth. If the resumed session will perform Pencil edits, require `da-vinci pencil-session begin --project <project-path> --pen <path>`, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits; fall back to the lower-level `write-pen + check-pen-sync` path only when the session wrapper cannot be used.
151
195
  If the redesign is complex, continue from the approved anchor surfaces instead of restarting broad scaffolding.
152
196
  If Pencil MCP is active and this session performs new Pencil writes, rerun the MCP runtime gate and record the refreshed result in `pencil-design.md`.
153
197
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
@@ -19,6 +19,7 @@ Use this when the workflow needs:
19
19
 
20
20
  - Use `Simple redesign` when the app surface is small, mostly contained, or has only a few canonical screens.
21
21
  - Use `Complex redesign` when the app has multiple activities, fragments, tabs, overlays, or materially different states.
22
+ - Use `Redesign with reference directory` when you have a local HTML or mockup directory that should guide visual composition without becoming the behavior truth.
22
23
  - Use `Design-only` when you want the full design chain but do not want code changes yet.
23
24
  - Use `Continue` when `.da-vinci/` artifacts already exist and the workflow needs to resume.
24
25
 
@@ -32,7 +33,7 @@ Use these templates when the product already exists, but mobile flows, logic, an
32
33
  $da-vinci use intake for this existing mobile product.
33
34
 
34
35
  This is a broad overhaul, not only a UI refresh.
35
- Current Android or mobile code is important reference evidence and migration baseline, but it should not be treated as the final target behavior truth.
36
+ Current Android or mobile code is reference evidence and migration baseline, not the final target behavior truth.
36
37
  We need to redefine mobile flows, states, navigation structure, and selected surfaces while preserving only approved integrations, permissions, and constraints.
37
38
  Recommend the best Da Vinci mode and generate the best executable next-step prompt.
38
39
  ```
@@ -61,7 +62,7 @@ $da-vinci use overhaul-from-code to design the new target mobile surfaces from t
61
62
 
62
63
  Use the existing .da-vinci/project-inventory.md, proposal.md, migration-contract.md, target specs, page-map.md, DA-VINCI.md, and design-registry.md.
63
64
  Treat the new proposal and specs as the target behavior truth.
64
- Treat the old mobile codebase only as reference evidence and migration context.
65
+ Treat the old mobile codebase only as reference evidence and migration baseline.
65
66
  Design 1-3 anchor surfaces first, review screenshots, then expand.
66
67
  Persist project-local Pencil files under .da-vinci/designs/.
67
68
  Run the normal Pencil runtime gate and completion audit before terminal completion claims.
@@ -74,6 +75,8 @@ $da-vinci use continue for this existing overhaul-from-code mobile workflow.
74
75
 
75
76
  Use the existing Da Vinci artifacts.
76
77
  Detect whether the workflow should return to breakdown, continue with design, generate tasks, continue implementation, or verify drift.
78
+ Determine routing from artifact and checkpoint truth first, then use contextual checkpoint deltas only as auxiliary recovery notes.
79
+ If a contextual delta conflicts with current artifacts, ignore that delta and record the conflict before continuing.
77
80
  Prefer the artifact-backed next safe stage instead of restarting the overhaul from scratch.
78
81
  ```
79
82
 
@@ -84,9 +87,11 @@ $da-vinci use redesign-from-code to redesign this existing mobile app.
84
87
 
85
88
  Existing code is the behavior source of truth, not the layout truth.
86
89
  Preserve business logic, navigation, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
90
+ Treat this as full-delivery unless explicitly changed.
91
+ Do not stop after discovery, anchor surfaces, phase summaries, or task generation; continue through tasks, build, and verify once the corresponding checkpoints pass.
87
92
  Inventory the current screens and important states before Pencil work.
88
93
  Use the Visual Assist preferences declared in DA-VINCI.md.
89
- Before the first Pencil edit, prefer `da-vinci pencil-session begin --project <project-path> --pen <path>` so the registered project-local `.pen` is seeded and the global Pencil lock is held; fall back to `da-vinci ensure-pen --output <path> --verify-open` only when the session wrapper cannot be used.
94
+ Before the first Pencil edit, require `da-vinci pencil-session begin --project <project-path> --pen <path>` so the registered project-local `.pen` is seeded and the global Pencil lock is held; fall back to `da-vinci ensure-pen --output <path> --verify-open` only when the session wrapper cannot be used.
90
95
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
91
96
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
92
97
  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.
@@ -100,6 +105,8 @@ $da-vinci use redesign-from-code to redesign this existing mobile app.
100
105
 
101
106
  Existing code is the behavior source of truth, not the layout truth.
102
107
  Preserve business logic, navigation, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
108
+ Treat this as full-delivery unless explicitly changed.
109
+ Do not stop after discovery, anchor surfaces, phase summaries, or task generation; continue through tasks, build, and verify once the corresponding checkpoints pass.
103
110
  Inventory activities, fragments, tabs, dialogs, bottom sheets, nested flows, overlays, and materially different states before broad Pencil work.
104
111
  Decompose complex screens into subpages, overlays, materially different states, and implementation surfaces.
105
112
  Create the required discovery and design-source artifacts in their standard locations before the first anchor surface.
@@ -119,10 +126,11 @@ Use only Pencil-supported properties; do not use web-only props like flex or mar
119
126
  Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
120
127
  Run `da-vinci audit --mode integrity <project-path>` after that first successful Pencil write before broad expansion continues.
121
128
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
122
- Prefer `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits. Fall back to the lower-level `ensure-pen + write-pen + check-pen-sync` chain only when the session wrapper cannot be used.
129
+ Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits. Fall back to the lower-level `ensure-pen + write-pen + check-pen-sync` chain only when the session wrapper cannot be used.
123
130
  Keep non-`.pen` workflow artifacts out of `.da-vinci/designs/`.
124
131
  Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
125
132
  Record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome; "looks good" is not enough.
133
+ If `DA-VINCI.md` configures `Design-supervisor reviewers`, run `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint, using screenshots plus Pencil variables and the design theses as inputs. If `Require Supervisor Review: true`, treat missing, blocked, or unaccepted review results as blocking before broad expansion or terminal completion.
126
134
  Do not report completion if the registered `.pen` source exists only in memory or only as exported PNGs.
127
135
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
128
136
  Define shared primitives from the approved anchor surfaces before broad page expansion.
@@ -130,6 +138,38 @@ Do not pass design checkpoint if the result is a skin-swap of the old UI, a gene
130
138
  Persist project-local Pencil files under .da-vinci/designs/.
131
139
  ```
132
140
 
141
+ ## Redesign With Reference Directory
142
+
143
+ ```text
144
+ $da-vinci use redesign-from-code to redesign this existing mobile app.
145
+
146
+ Existing code is the behavior source of truth, not the layout truth.
147
+ Preserve business logic, navigation, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
148
+ Treat this as full-delivery unless explicitly changed.
149
+ Do not stop after discovery, anchor surfaces, phase summaries, or task generation; continue through tasks, build, and verify once the corresponding checkpoints pass.
150
+
151
+ Use <reference-directory> as the local HTML design-reference directory.
152
+ Treat that directory as visual reference material only, not as behavior truth, route truth, or final design-source truth.
153
+ Inventory which activities, fragments, tabs, sheets, overlays, and materially different states are covered by the reference directory and which are not before broad Pencil work begins.
154
+ For uncovered states or surfaces, derive the design from the approved anchor surfaces, the project visual contract, and the existing behavior truth.
155
+
156
+ If browser access is available, open the HTML reference screens in a real browser and wait 3-5 seconds, or until the visual state settles, before judging hierarchy, spacing, styling, or component treatment.
157
+ Do not review the initial unhydrated or partially rendered state.
158
+ If a reference screen visibly changes after load, use the settled state as the visual reference baseline and record that delayed settling was required.
159
+
160
+ Use the HTML reference screens only as composition and styling input where they are relevant and stable.
161
+ Do not mechanically clone them when they conflict with behavior truth, missing states, or implementation reality.
162
+
163
+ Design 1-3 anchor surfaces first, review screenshots, then expand.
164
+ For each anchor surface, explain how the new composition differs structurally from the current layout and whether it is primarily HTML-referenced, partially HTML-referenced, or inferred.
165
+
166
+ Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
167
+ Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits.
168
+ Run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
169
+ Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
170
+ Persist project-local Pencil files under .da-vinci/designs/.
171
+ ```
172
+
133
173
  ## Design-Only
134
174
 
135
175
  ```text
@@ -137,12 +177,14 @@ $da-vinci use redesign-from-code to redesign this existing mobile app.
137
177
 
138
178
  Existing code is the behavior source of truth, not the layout truth.
139
179
  Preserve current behavior and navigation.
180
+ Treat this as design-only, not full-delivery.
140
181
  Inventory screens, tabs, dialogs, bottom sheets, nested flows, overlays, and important states.
141
182
  Decompose complex screens into real design surfaces before Pencil work.
142
183
  Use the Visual Assist preferences declared in DA-VINCI.md.
143
184
  If the app is complex, design 1-3 anchor surfaces first, review screenshots, then expand.
144
- 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.
145
- Before the first Pencil edit, prefer `da-vinci pencil-session begin --project <project-path> --pen <path>` so the registered project-local `.pen` is seeded and locked; fall back to `da-vinci ensure-pen --output <path> --verify-open` only when the session wrapper cannot be used.
185
+ Stop after DA-VINCI.md, design-registry.md, page-map.md, proposal.md, specs, design.md, pencil-design.md, and pencil-bindings.md.
186
+ Do not generate `tasks.md` unless the user explicitly changes the delivery intent beyond design-only.
187
+ Before the first Pencil edit, require `da-vinci pencil-session begin --project <project-path> --pen <path>` so the registered project-local `.pen` is seeded and locked; fall back to `da-vinci ensure-pen --output <path> --verify-open` only when the session wrapper cannot be used.
146
188
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
147
189
  Before reporting `design complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
148
190
  Do not start code changes yet.
@@ -155,7 +197,9 @@ $da-vinci use continue for this existing mobile-app redesign workflow.
155
197
 
156
198
  Use the existing Da Vinci artifacts in this project.
157
199
  Do not restart discovery unless an artifact is missing or clearly wrong.
158
- Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth. Prefer `da-vinci pencil-session begin --project <project-path> --pen <path>` when resuming, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits; fall back to the lower-level `write-pen + check-pen-sync` path only when the session wrapper cannot be used.
200
+ Determine continuation routing from current artifact and checkpoint truth first, then use contextual checkpoint deltas only as auxiliary recovery notes.
201
+ If a contextual delta conflicts with current artifacts, ignore that delta and record the conflict before continuing.
202
+ Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth. If the resumed session will perform Pencil edits, require `da-vinci pencil-session begin --project <project-path> --pen <path>`, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits; fall back to the lower-level `write-pen + check-pen-sync` path only when the session wrapper cannot be used.
159
203
  If the redesign is complex, keep the anchor-first flow until the design checkpoint passes.
160
204
  If Pencil MCP is active and this session performs new Pencil writes, rerun the MCP runtime gate and record the refreshed result in `pencil-design.md`.
161
205
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.