@xenonbyte/da-vinci-workflow 0.1.9 → 0.1.11

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 (40) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +88 -6
  3. package/README.zh-CN.md +84 -3
  4. package/SKILL.md +68 -8
  5. package/docs/codex-natural-language-usage.md +4 -0
  6. package/docs/mode-use-cases.md +32 -11
  7. package/docs/prompt-entrypoints.md +4 -0
  8. package/docs/prompt-presets/README.md +27 -0
  9. package/docs/prompt-presets/desktop-app.md +46 -0
  10. package/docs/prompt-presets/mobile-app.md +46 -0
  11. package/docs/prompt-presets/tablet-app.md +46 -0
  12. package/docs/prompt-presets/web-app.md +47 -0
  13. package/docs/visual-adapters.md +82 -0
  14. package/docs/visual-assist-presets/README.md +11 -0
  15. package/docs/visual-assist-presets/desktop-app.md +1 -0
  16. package/docs/visual-assist-presets/mobile-app.md +1 -0
  17. package/docs/visual-assist-presets/tablet-app.md +1 -0
  18. package/docs/visual-assist-presets/web-app.md +1 -0
  19. package/docs/workflow-examples.md +17 -5
  20. package/docs/zh-CN/codex-natural-language-usage.md +4 -0
  21. package/docs/zh-CN/mode-use-cases.md +17 -4
  22. package/docs/zh-CN/prompt-entrypoints.md +4 -0
  23. package/docs/zh-CN/prompt-presets/README.md +27 -0
  24. package/docs/zh-CN/prompt-presets/desktop-app.md +46 -0
  25. package/docs/zh-CN/prompt-presets/mobile-app.md +46 -0
  26. package/docs/zh-CN/prompt-presets/tablet-app.md +46 -0
  27. package/docs/zh-CN/prompt-presets/web-app.md +47 -0
  28. package/docs/zh-CN/visual-adapters.md +82 -0
  29. package/docs/zh-CN/visual-assist-presets/README.md +11 -0
  30. package/docs/zh-CN/visual-assist-presets/desktop-app.md +1 -0
  31. package/docs/zh-CN/visual-assist-presets/mobile-app.md +1 -0
  32. package/docs/zh-CN/visual-assist-presets/tablet-app.md +1 -0
  33. package/docs/zh-CN/visual-assist-presets/web-app.md +1 -0
  34. package/docs/zh-CN/workflow-examples.md +17 -5
  35. package/package.json +1 -1
  36. package/references/artifact-templates.md +19 -3
  37. package/references/checkpoints.md +35 -4
  38. package/references/design-inputs.md +30 -1
  39. package/references/page-mapping.md +12 -0
  40. package/references/pencil-design-to-code.md +7 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,22 @@
4
4
 
5
5
  - No unreleased changes yet.
6
6
 
7
+ ## v0.1.11 - 2026-03-27
8
+
9
+ ### Changed
10
+ - Da Vinci now documents `design-source checkpoint` between design review and page-to-Pencil mapping so project-local `.pen` persistence is verified before implementation work proceeds
11
+ - project-local `.pen` paths in `design-registry.md` are now defined more explicitly as workflow-owned state rather than user-authored config
12
+ - Pencil workflow guidance now requires the registered `.pen` path, the active editor source, and the shell-visible project file to reconcile before mapping or implementation is treated as safe
13
+ - workflow examples and mode guides now show project-local `.pen` reconciliation as part of redesign execution rather than an optional cleanup step
14
+
15
+ ## v0.1.10 - 2026-03-27
16
+
17
+ ### Changed
18
+ - `redesign-from-code` now documents a stricter contract: existing code is behavior truth, not layout truth
19
+ - complex screens are now documented to decompose into subpages, overlays, materially different states, and implementation surfaces before broad Pencil redesign
20
+ - design-checkpoint guidance now explicitly blocks skin-swap redesigns, generic card mosaics, weak visual anchors, and decorative clutter
21
+ - `Visual Assist` documentation and README guidance now include clearer field explanations, quick-start recommendations, quality-first configuration advice, and stronger usage examples for Android-style redesign work
22
+
7
23
  ## v0.1.9 - 2026-03-27
8
24
 
9
25
  ### Added
package/README.md CHANGED
@@ -27,10 +27,14 @@ This workflow is intended for:
27
27
 
28
28
  Latest published npm package:
29
29
 
30
- - `@xenonbyte/da-vinci-workflow@0.1.9`
30
+ - `@xenonbyte/da-vinci-workflow@0.1.10`
31
31
 
32
32
  Release highlights:
33
33
 
34
+ - `redesign-from-code` now states explicitly that existing code is behavior truth, not layout truth
35
+ - complex pages are now expected to decompose into subpages, overlays, materially different states, and implementation surfaces before broad Pencil redesign
36
+ - design-checkpoint guidance now explicitly blocks skin-swap redesigns, generic card mosaics, weak visual anchors, and decorative clutter
37
+ - `Visual Assist` docs now include quick-start recommendations and a quality-first configuration for design-critical work
34
38
  - visual-adapter configuration is now documented explicitly, including field meanings, resolution order, and fallback behavior
35
39
  - ready-to-copy `Visual Assist` presets are now included for mobile, desktop, web, and tablet scenarios
36
40
  - the repo-local forward test now shows how `Visual Assist`, adapter resolution, and persisted `.pen` paths should be recorded
@@ -86,6 +90,67 @@ Route discipline:
86
90
  - they should not default the user into `build`
87
91
  - `build` remains a direct expert route for workflows that are already implementation-ready
88
92
 
93
+ ## Visual Assist Quick Start
94
+
95
+ Use `Visual Assist` when the project wants optional help from local UI-design skills such as `frontend-skill` or `ui-ux-pro-max`.
96
+
97
+ Recommended default:
98
+
99
+ ```md
100
+ ## Visual Assist
101
+ - Preferred adapters:
102
+ - ui-ux-pro-max
103
+ - frontend-skill
104
+ - Scope:
105
+ - visual contract refinement
106
+ - page composition
107
+ - hierarchy and spacing
108
+ - Pencil design refinement
109
+ - Fallback:
110
+ - native-da-vinci
111
+ - Require Adapter:
112
+ - false
113
+ ```
114
+
115
+ Use this when:
116
+
117
+ - the project is an app, dashboard, desktop tool, or other product surface
118
+ - the workflow should continue even if no local adapter is installed
119
+ - you want better composition and hierarchy without turning adapter availability into a blocker
120
+
121
+ Quality-first redesign configuration:
122
+
123
+ ```md
124
+ ## Visual Assist
125
+ - Preferred adapters:
126
+ - frontend-skill
127
+ - ui-ux-pro-max
128
+ - Scope:
129
+ - visual contract refinement
130
+ - page composition
131
+ - hierarchy and spacing
132
+ - motion guidance
133
+ - Pencil design refinement
134
+ - Fallback:
135
+ - native-da-vinci
136
+ - Require Adapter:
137
+ - true
138
+ ```
139
+
140
+ Use this when:
141
+
142
+ - the project is visually sensitive and plain fallback quality is not acceptable
143
+ - prior redesign attempts drifted into generic card grids, weak anchors, or skin-swap outputs
144
+ - you want the workflow to stop instead of silently continuing without a strong local design helper
145
+
146
+ Selection rules:
147
+
148
+ - keep `ui-ux-pro-max` first for dense app and dashboard surfaces when the visual bar is moderate
149
+ - move `frontend-skill` to the first slot when art direction, composition quality, and premium visual hierarchy matter more
150
+ - keep `Fallback: native-da-vinci` unless you explicitly want missing adapters to block the workflow
151
+ - keep `Require Adapter: false` by default and raise it to `true` only for design-critical work
152
+ - keep `Scope` limited to presentation quality; do not use it to delegate behavior, routes, or state truth
153
+
89
154
  ## Core workflow
90
155
 
91
156
  Da Vinci runs in this order:
@@ -187,9 +252,10 @@ Da Vinci uses these checkpoints:
187
252
  1. `discovery checkpoint`
188
253
  2. `spec checkpoint`
189
254
  3. `design checkpoint`
190
- 4. `mapping checkpoint`
191
- 5. `task checkpoint`
192
- 6. `execution checkpoint`
255
+ 4. `design-source checkpoint`
256
+ 5. `mapping checkpoint`
257
+ 6. `task checkpoint`
258
+ 7. `execution checkpoint`
193
259
 
194
260
  Checkpoint outcomes:
195
261
 
@@ -232,6 +298,12 @@ Rules:
232
298
  - `.da-vinci/designs/` is the default project-local location for persisted `.pen` files
233
299
  - `page-map.md` is the source of truth for implementation pages
234
300
  - `pencil-bindings.md` is the source of truth for implementation page -> Pencil page mapping
301
+ - in `redesign-from-code`, existing code is behavior truth, not layout truth
302
+ - complex pages should be decomposed into subpages, states, overlays, and implementation surfaces before Pencil redesign is treated as final
303
+ - the preferred `.pen` path recorded in `design-registry.md` is workflow-owned state, not user-authored config
304
+ - 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
305
+ - if Pencil MCP edits a live document but does not materialize the shell-visible project file automatically, the workflow should reconstruct and write the `.pen` file under the registered path before treating the design pass as traceable
306
+ - before `pencil-bindings.md` or implementation tasks are treated as safe, `design-source checkpoint` should confirm that the registered path, the active Pencil source, and the shell-visible `.pen` file converge on the same project-local source
235
307
 
236
308
  Optional visual-adapter policy:
237
309
 
@@ -241,21 +313,29 @@ Optional visual-adapter policy:
241
313
  - they must not override behavior truth, route truth, page-state truth, or acceptance rules
242
314
  - if a requested adapter is unavailable locally, Da Vinci should continue with native design rules and record the fallback in `design-registry.md`
243
315
 
316
+ Recommended practice:
317
+
318
+ - configure `Visual Assist` in `DA-VINCI.md` before broad Pencil generation begins
319
+ - for complex Android redesigns, ask Da Vinci to decompose activities, fragments, tabs, sheets, dialogs, and materially different states before design work expands
320
+ - if the output quality is weak, promote `frontend-skill`, tighten the design checkpoint bar, and prefer a fresh composition over a recolor of the old UI
321
+
244
322
  When a relevant mapping already exists:
245
323
 
246
324
  - iterate on the mapped Pencil source
247
325
  - prefer the project-local `.pen` path already registered in `design-registry.md`
326
+ - do not silently switch to a different active editor path without reconciling `design-registry.md`
248
327
 
249
328
  When mappings do not exist but local code exists:
250
329
 
251
330
  - reconstruct the baseline from the local project
252
331
  - rebuild inventory, page map, and design registry
253
- - save or export the rebuilt Pencil baseline into `.da-vinci/designs/` when possible
332
+ - decompose complex containers into real design surfaces before broad Pencil generation
333
+ - resolve an exact project-local `.pen` target and materialize that file under `.da-vinci/designs/`
254
334
 
255
335
  When neither mappings nor usable design sources exist:
256
336
 
257
337
  - create a new Pencil baseline from the current local source of truth
258
- - persist that baseline under `.da-vinci/designs/` when possible and record the exact path in `design-registry.md`
338
+ - persist that baseline under `.da-vinci/designs/` and record the exact path in `design-registry.md`
259
339
 
260
340
  ## Design input collection
261
341
 
@@ -434,6 +514,7 @@ Continue into full-delivery.
434
514
  See:
435
515
 
436
516
  - `docs/prompt-entrypoints.md`
517
+ - `docs/prompt-presets/`
437
518
  - `docs/codex-natural-language-usage.md`
438
519
  - `docs/visual-adapters.md`
439
520
  - `docs/visual-assist-presets/`
@@ -445,6 +526,7 @@ See:
445
526
  Chinese companion documents are included in this repository:
446
527
 
447
528
  - `README.zh-CN.md`
529
+ - `docs/zh-CN/prompt-presets/`
448
530
  - `docs/zh-CN/visual-adapters.md`
449
531
  - `docs/zh-CN/visual-assist-presets/`
450
532
  - `docs/zh-CN/`
package/README.zh-CN.md CHANGED
@@ -29,10 +29,14 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
29
29
 
30
30
  最新已发布 npm 包:
31
31
 
32
- - `@xenonbyte/da-vinci-workflow@0.1.9`
32
+ - `@xenonbyte/da-vinci-workflow@0.1.10`
33
33
 
34
34
  已发布版本重点:
35
35
 
36
+ - `redesign-from-code` 现在明确写清:现有代码只是真相行为,不是真相布局
37
+ - 复杂页面现在明确要求在大规模 Pencil 重设计前拆成 subpage、overlay、明显不同 state 和 implementation surface
38
+ - design checkpoint 现在明确会拦截旧 UI 换皮、通用卡片拼贴、弱视觉锚点和装饰性噪音
39
+ - `Visual Assist` 文档现在补了快速上手建议和“设计质量优先”配置
36
40
  - visual adapter 的配置字段、解析顺序和回退行为现在有单独文档说明
37
41
  - 现在提供按移动端、桌面端、Web、平板拆分的 `Visual Assist` 可复制模板
38
42
  - 仓库内的 forward test 示例现在展示了 `Visual Assist`、adapter 解析结果和 `.pen` 持久化记录方式
@@ -91,6 +95,67 @@ Da Vinci V2 支持四种模式:
91
95
  - 它们不应该默认把用户直接导向 `build`
92
96
  - `build` 仍然保留,但它是给已经实现就绪的高级直接入口
93
97
 
98
+ ## Visual Assist 快速上手
99
+
100
+ 当项目想借助本地 UI 设计 skill,例如 `frontend-skill` 或 `ui-ux-pro-max`,来提升设计质量时,就配置 `Visual Assist`。
101
+
102
+ 推荐默认配置:
103
+
104
+ ```md
105
+ ## Visual Assist
106
+ - Preferred adapters:
107
+ - ui-ux-pro-max
108
+ - frontend-skill
109
+ - Scope:
110
+ - visual contract refinement
111
+ - page composition
112
+ - hierarchy and spacing
113
+ - Pencil design refinement
114
+ - Fallback:
115
+ - native-da-vinci
116
+ - Require Adapter:
117
+ - false
118
+ ```
119
+
120
+ 适用场景:
121
+
122
+ - app、dashboard、桌面工具等产品型界面
123
+ - 本地没有 adapter 时工作流也应该继续
124
+ - 想提升构图和层级,但不希望 adapter 缺失变成阻塞
125
+
126
+ 设计质量优先配置:
127
+
128
+ ```md
129
+ ## Visual Assist
130
+ - Preferred adapters:
131
+ - frontend-skill
132
+ - ui-ux-pro-max
133
+ - Scope:
134
+ - visual contract refinement
135
+ - page composition
136
+ - hierarchy and spacing
137
+ - motion guidance
138
+ - Pencil design refinement
139
+ - Fallback:
140
+ - native-da-vinci
141
+ - Require Adapter:
142
+ - true
143
+ ```
144
+
145
+ 适用场景:
146
+
147
+ - 页面视觉质量要求高,不能接受普通 fallback 质量
148
+ - 之前的重设计已经出现“堆卡片、弱锚点、只是旧 UI 换皮”这类问题
149
+ - 你希望没有强设计辅助 skill 时直接停下,而不是继续生成普通结果
150
+
151
+ 选择建议:
152
+
153
+ - 高密度 app、dashboard、工具型界面,且视觉要求中等时,优先把 `ui-ux-pro-max` 放第一位
154
+ - 如果更重视 art direction、构图和高级感,就把 `frontend-skill` 放第一位
155
+ - 默认保留 `Fallback: native-da-vinci`
156
+ - `Require Adapter` 默认保持 `false`,只有设计要求很高时再改成 `true`
157
+ - `Scope` 只管 presentation 质量,不要拿它去定义 behavior、route 或 state truth
158
+
94
159
  ## 核心工作流顺序
95
160
 
96
161
  Da Vinci 的默认顺序是:
@@ -185,6 +250,12 @@ project/
185
250
  - `.da-vinci/designs/` 是项目内持久化 `.pen` 文件的默认位置
186
251
  - `page-map.md` 是实现页面和状态的真相源
187
252
  - `pencil-bindings.md` 是实现页面到 Pencil 页面绑定的真相源
253
+ - 在 `redesign-from-code` 里,现有代码只是真相行为,不是真相布局
254
+ - 复杂页面在 Pencil 重设计前应该先拆成 subpage、state、overlay 和 implementation surface
255
+ - `design-registry.md` 里登记的首选 `.pen` 路径属于工作流自动维护的状态,不应该依赖用户手工填写
256
+ - 一旦进入 Pencil 设计,Da Vinci 应该使用或创建这个项目内 `.pen` 路径,而不是继续沿用当前随手打开的 Pencil 文档
257
+ - 如果 Pencil MCP 修改了 live 文档但没有自动把项目内 `.pen` 文件落到磁盘,工作流应该先把该 `.pen` 文件补写到登记路径,再把这轮设计当成可追踪结果
258
+ - 在进入 `pencil-bindings.md` 和实现任务前,应该先通过 `design-source checkpoint`,确认登记路径、当前设计源和 shell 可见 `.pen` 文件已经收敛成同一个项目级来源
188
259
 
189
260
  可选 visual adapter 规则:
190
261
 
@@ -194,21 +265,29 @@ project/
194
265
  - 它不能覆盖 behavior truth、路由真相、页面状态真相或验收规则
195
266
  - 如果本地没有请求的 adapter,Da Vinci 应继续使用原生设计规则,并在 `design-registry.md` 里记录回退结果
196
267
 
268
+ 建议做法:
269
+
270
+ - 在开始大规模 Pencil 设计前,就在 `DA-VINCI.md` 里写好 `Visual Assist`
271
+ - 面对复杂 Android 重设计时,先要求 Da Vinci 把 activities、fragments、tabs、sheets、dialogs 和明显不同的 states 拆开
272
+ - 如果结果很丑,就把 `frontend-skill` 提到第一位,收紧 design checkpoint,并明确要求 fresh composition,而不是旧 UI 改色
273
+
197
274
  当已有页面映射存在时:
198
275
 
199
276
  - 优先复用已绑定的 Pencil 设计源
200
277
  - 如果 `design-registry.md` 里已经登记了 `.da-vinci/designs/` 下的本地 `.pen` 路径,优先使用它
278
+ - 不要在没有同步 `design-registry.md` 的情况下,悄悄切到另一个当前活动编辑器路径继续设计
201
279
 
202
280
  当已有代码存在但还没有映射时:
203
281
 
204
282
  - 先从当前项目重建设计基线
205
283
  - 重建 inventory、page-map、design-registry
206
- - 在可行时把新的 Pencil 基线保存或导出到 `.da-vinci/designs/`
284
+ - 先把复杂容器拆成真实的设计 surface,再进入大规模 Pencil 设计
285
+ - 先解析出明确的项目内 `.pen` 目标路径,再把新的 Pencil 基线真正落到 `.da-vinci/designs/`
207
286
 
208
287
  当既没有映射也没有可用设计源时:
209
288
 
210
289
  - 基于当前本地真相源创建新的 Pencil 基线
211
- - 在可行时把基线保存到 `.da-vinci/designs/`
290
+ - 把基线落到 `.da-vinci/designs/`
212
291
  - 并在 `design-registry.md` 里记录准确路径
213
292
 
214
293
  如果项目声明了 visual adapter:
@@ -348,6 +427,7 @@ Continue into full-delivery.
348
427
 
349
428
  - `docs/codex-natural-language-usage.md`
350
429
  - `docs/prompt-entrypoints.md`
430
+ - `docs/prompt-presets/`
351
431
  - `docs/visual-adapters.md`
352
432
  - `docs/visual-assist-presets/`
353
433
  - `docs/workflow-examples.md`
@@ -357,6 +437,7 @@ Continue into full-delivery.
357
437
  中文文档:
358
438
 
359
439
  - `README.zh-CN.md`
440
+ - `docs/zh-CN/prompt-presets/`
360
441
  - `docs/zh-CN/visual-adapters.md`
361
442
  - `docs/zh-CN/visual-assist-presets/`
362
443
  - `docs/zh-CN/`
package/SKILL.md CHANGED
@@ -15,6 +15,7 @@ Keep these rules fixed:
15
15
  - Pencil decides presentation.
16
16
  - Tasks decide implementation order.
17
17
  - Code must follow both requirements and Pencil data.
18
+ - Existing code is behavior truth, not layout truth, during `redesign-from-code`.
18
19
  - When requirements and Pencil drift apart, stop and update the source artifacts before continuing implementation.
19
20
 
20
21
  ## Execution Policy
@@ -356,6 +357,8 @@ If the active mode is `redesign-from-code`:
356
357
 
357
358
  - inventory current routes, pages, and modules before redefining page structure
358
359
  - distinguish preserved behavior from replaced presentation
360
+ - treat existing code as behavior truth and implementation-surface discovery, not as a visual-layout baseline
361
+ - default to fresh visual composition unless the user explicitly asks to preserve the current layout skeleton
359
362
  - partition specs by redesign slice when one oversized `ui-refresh` spec would hide important implementation boundaries
360
363
 
361
364
  ## Spec Partitioning Rules
@@ -397,6 +400,18 @@ Use `design-registry.md` as the project-level inventory of `.pen` sources.
397
400
 
398
401
  Use `.da-vinci/designs/` as the default project-local location for persisted Pencil files when the workflow creates or updates them.
399
402
 
403
+ Treat the project-local `.pen` path recorded in `design-registry.md` as workflow-owned state.
404
+
405
+ - users may provide external references or existing `.pen` files
406
+ - the workflow, not the user, resolves and maintains the preferred project-local `.pen` path
407
+ - do not treat `design-registry.md` as a user-authored config file
408
+
409
+ Resolve one exact project-local target before broad Pencil work begins:
410
+
411
+ - `.da-vinci/designs/project-baseline.pen` for shared baseline reconstruction
412
+ - `.da-vinci/designs/<change-id>.pen` for change-specific redesign work
413
+ - `.da-vinci/designs/<change-id>/main.pen` only when the project truly needs a nested design bundle
414
+
400
415
  Use `DA-VINCI.md` as the project-level visual source of truth for:
401
416
 
402
417
  - theme and palette
@@ -417,6 +432,7 @@ When a relevant mapping already exists:
417
432
  - iterate on the mapped Pencil source
418
433
  - prefer the project-local `.pen` file under `.da-vinci/designs/` when one is already registered
419
434
  - do not create a new design baseline unless there is a reason
435
+ - do not silently keep designing in an unrelated active Pencil document when `design-registry.md` already names a preferred path
420
436
 
421
437
  When `DA-VINCI.md` already exists:
422
438
 
@@ -428,6 +444,7 @@ When page-to-Pencil bindings already exist:
428
444
 
429
445
  - update the mapped Pencil page for the affected implementation page
430
446
  - keep the exact `.pen` file path recorded in `design-registry.md`
447
+ - if the active Pencil editor path differs from that recorded path, switch to the recorded path or explicitly reconstruct the project-local file before continuing
431
448
 
432
449
  When project mappings do not exist but existing code exists:
433
450
 
@@ -435,21 +452,22 @@ When project mappings do not exist but existing code exists:
435
452
  - reconstruct `project-inventory.md`
436
453
  - reconstruct `page-map.md`
437
454
  - create or rebuild `design-registry.md`
455
+ - resolve the exact project-local `.pen` target path before broad Pencil work starts
438
456
  - generate a new Pencil baseline only after the inventory is stable
439
- - save or export that baseline into `.da-vinci/designs/` when possible
457
+ - materialize that baseline into the resolved `.da-vinci/designs/` path and record the exact file in `design-registry.md`
440
458
 
441
459
  When neither mappings nor usable design sources exist:
442
460
 
443
461
  - state that the project is entering baseline reconstruction
444
462
  - create a new Pencil baseline from the current local source of truth
445
463
  - generate `DA-VINCI.md` from inferred or user-provided design rules before generating many unrelated pages
446
- - persist the resulting `.pen` file in `.da-vinci/designs/` when possible and record the path in `design-registry.md`
464
+ - persist the resulting `.pen` file at the resolved `.da-vinci/designs/` path and record that exact path in `design-registry.md`
447
465
 
448
466
  When a Pencil session cannot yet be exported locally:
449
467
 
450
468
  - record the live or external source in `design-registry.md`
451
- - record why local persistence is pending
452
- - do not hide the lack of a project-local `.pen` path
469
+ - reconstruct and write the project-local `.pen` file from MCP-readable document data before closing mapping or implementation work
470
+ - if the project-local file still cannot be materialized, record the reason and treat the missing file as a checkpoint issue instead of silently continuing
453
471
 
454
472
  When visual adapters are requested:
455
473
 
@@ -460,6 +478,33 @@ When visual adapters are requested:
460
478
 
461
479
  If the request is too vague to design or implement safely, ask a short clarification question before generating artifacts.
462
480
 
481
+ ## Surface Decomposition Rules
482
+
483
+ Do not treat one implementation container as one design surface by default.
484
+
485
+ For complex products, decompose by:
486
+
487
+ - canonical page
488
+ - subpage
489
+ - state
490
+ - overlay
491
+ - shared shell region
492
+ - implementation surface such as activity, fragment, tab, bottom sheet, dialog, or full-screen mode
493
+
494
+ When an Android screen contains multiple fragments, tabs, nested flows, or materially different states:
495
+
496
+ - split them into distinct design surfaces in `page-map.md`
497
+ - give each meaningful state or subpage its own Pencil target when the layout materially changes
498
+ - avoid collapsing them into one overloaded redesign screen
499
+
500
+ One implementation page may legitimately map to:
501
+
502
+ - multiple Pencil screens
503
+ - multiple states of one Pencil page
504
+ - one shared shell plus several detail surfaces
505
+
506
+ Treat surface decomposition as required when visual structure changes materially across states or subflows.
507
+
463
508
  ## Pencil Design Rules
464
509
 
465
510
  Use Pencil as a structured UI source, not as a static image source.
@@ -469,10 +514,15 @@ When creating or editing Pencil designs:
469
514
  - Build the pages required by the current scope, not an abstract moodboard
470
515
  - follow `page-map.md` as the canonical page list
471
516
  - follow `design-brief.md` for form factor and visual direction when it exists
517
+ - use the workflow-owned `.pen` path from `design-registry.md` as the active design target
518
+ - do not keep designing in whichever Pencil document happens to be open unless it already matches the registered project-local path
472
519
  - use the resolved visual adapter, when available, for composition, hierarchy, restraint, and motion guidance
520
+ - before broad page generation, write a visual thesis, a content plan, and an interaction thesis for the current surface
473
521
  - Keep page names, section names, and labels aligned with the specs
474
522
  - Make important states explicit when they change implementation: empty, loading, success, error, restricted, unavailable
475
523
  - Prefer layout clarity and information hierarchy over decorative complexity
524
+ - Reject generic UI patterns such as dashboard-card mosaics, weak visual anchors, decorative clutter, or motion with no hierarchy value
525
+ - For `redesign-from-code`, redesign from page responsibilities and state decomposition, not by recoloring or slightly rearranging the old UI
476
526
  - After changes, inspect the result visually before treating it as implementation-ready
477
527
 
478
528
  When multiple pages exist:
@@ -480,18 +530,24 @@ When multiple pages exist:
480
530
  - keep one canonical Pencil page or screen per implementation page
481
531
  - record the `.pen` file in `design-registry.md`
482
532
  - record the mapping in `pencil-bindings.md`
483
- - persist the active `.pen` file into `.da-vinci/designs/` before closing design work when possible
533
+ - ensure the active Pencil design is materialized into the registered `.da-vinci/designs/` file before closing design work
484
534
 
485
535
  ## Pencil MCP Rules
486
536
 
487
537
  When Pencil is available through MCP:
488
538
 
489
539
  - Prefer the project-local `.pen` file under `.da-vinci/designs/` when one is registered
540
+ - Treat the registered `.pen` path as authoritative; do not rely on the current active editor if its path does not match `design-registry.md`
541
+ - If the registered file exists, read and edit that exact file
542
+ - If the registered file does not yet exist, create or reconstruct the project-local file before treating the design pass as traceable
490
543
  - Read the active `.pen` file and page structure before coding
491
544
  - read the bound Pencil page for the current implementation page
492
545
  - Use Pencil data to extract layout, text, hierarchy, panels, buttons, and content regions
493
546
  - Use screenshots only as a secondary visual check
494
547
  - Treat Pencil as the design data source for presentation, spacing, and layout grouping
548
+ - Before mapping or implementation closes, verify both:
549
+ - the `.pen` path is readable through MCP
550
+ - the same path exists as a shell-visible file inside the project
495
551
 
496
552
  When Pencil is not available:
497
553
 
@@ -531,15 +587,19 @@ Run these checkpoints:
531
587
  - after Pencil design exists, before implementation tasks are locked
532
588
  - verify the design covers the required pages, states, and key interactions
533
589
 
534
- 4. `mapping checkpoint`
590
+ 4. `design-source checkpoint`
591
+ - after `design-registry.md` resolves the preferred project-local `.pen` path and active Pencil work exists
592
+ - verify the registered `.pen` path, the active Pencil editor, and shell-visible persistence agree before mapping continues
593
+
594
+ 5. `mapping checkpoint`
535
595
  - after `design-registry.md` and `pencil-bindings.md`
536
596
  - verify implementation pages and Pencil pages are bound correctly
537
597
 
538
- 5. `task checkpoint`
598
+ 6. `task checkpoint`
539
599
  - before implementation starts
540
600
  - verify tasks cover both requirements and Pencil-backed UI work
541
601
 
542
- 6. `execution checkpoint`
602
+ 7. `execution checkpoint`
543
603
  - after each top-level task group during implementation
544
604
  - verify code still matches requirements and Pencil structure
545
605
 
@@ -69,6 +69,10 @@ Supported modes:
69
69
 
70
70
  ## Scenario Recipes
71
71
 
72
+ For surface-specific prompt starting points, also see:
73
+
74
+ - `docs/prompt-presets/`
75
+
72
76
  ### 1. New project with clear requirements
73
77
 
74
78
  ```text
@@ -129,7 +129,7 @@ Generate DA-VINCI.md, proposal, specs, page map, Pencil-backed launch pages, bin
129
129
  - define the canonical pages and page responsibilities
130
130
 
131
131
  6. create `design-registry.md`
132
- - register the active `.pen` source once Pencil work starts
132
+ - resolve the workflow-owned project-local `.pen` path once Pencil work starts
133
133
  - prefer a project-local `.pen` path under `.da-vinci/designs/`
134
134
 
135
135
  7. create `design.md`
@@ -137,7 +137,7 @@ Generate DA-VINCI.md, proposal, specs, page map, Pencil-backed launch pages, bin
137
137
 
138
138
  8. create `pencil-design.md`
139
139
  - record the generated Pencil screens
140
- - save or export the active `.pen` file into `.da-vinci/designs/` when possible
140
+ - ensure the active design is materialized into the registered `.pen` path under `.da-vinci/designs/`
141
141
 
142
142
  9. create `pencil-bindings.md`
143
143
  - map implementation pages to Pencil pages
@@ -226,7 +226,7 @@ First synthesize the product direction, then generate DA-VINCI.md, specs, page m
226
226
  - `pencil-design.md`
227
227
  - `pencil-bindings.md`
228
228
  - `tasks.md`
229
- - persist the active `.pen` file into `.da-vinci/designs/` when possible
229
+ - persist the active design into the registered `.pen` path under `.da-vinci/designs/`
230
230
 
231
231
  ### Where this mode differs from `greenfield-spec`
232
232
 
@@ -313,6 +313,7 @@ Register the design sources, extract DA-VINCI.md from them, bind covered pages,
313
313
 
314
314
  3. create or update `design-registry.md`
315
315
  - register old and new `.pen` sources
316
+ - resolve one workflow-owned project-local `.pen` path for the redesign
316
317
  - mark the preferred project-local `.pen` file under `.da-vinci/designs/` when available
317
318
 
318
319
  4. create or update `page-map.md`
@@ -323,7 +324,7 @@ Register the design sources, extract DA-VINCI.md from them, bind covered pages,
323
324
 
324
325
  6. create or update `pencil-design.md`
325
326
  - build the new redesign baseline in Pencil
326
- - persist that baseline into `.da-vinci/designs/` when possible
327
+ - persist that baseline into the registered `.da-vinci/designs/` file
327
328
 
328
329
  7. create or update `pencil-bindings.md`
329
330
  - bind pages to redesign screens
@@ -341,9 +342,28 @@ Register the design sources, extract DA-VINCI.md from them, bind covered pages,
341
342
  For redesign work:
342
343
 
343
344
  - current code decides behavior
345
+ - current code does not decide the new layout or visual composition
344
346
  - `DA-VINCI.md` decides the new visual contract
345
347
  - Pencil decides page-by-page presentation
346
348
 
349
+ Fresh-layout rule:
350
+
351
+ - default to fresh visual composition driven by page purpose and state coverage
352
+ - do not treat the old UI as the design baseline unless the user explicitly asks to preserve the layout skeleton
353
+ - a recolor, light rearrangement, or minor spacing pass on the old UI is not enough for a true redesign
354
+
355
+ Project-local `.pen` rule:
356
+
357
+ - the preferred `.pen` path in `design-registry.md` is owned by the workflow, not by user hand-editing
358
+ - do not keep redesign work inside an unrelated active Pencil editor just because it is currently open
359
+ - if Pencil MCP does not materialize the registered shell-visible file automatically, reconstruct and write that `.pen` file before mapping or implementation is treated as complete
360
+
361
+ Complex-surface rule:
362
+
363
+ - if one screen contains multiple fragments, tabs, overlays, or materially different states, split it into multiple design surfaces
364
+ - one implementation page may map to several Pencil screens or states
365
+ - do not hide that complexity inside one oversized redesign page
366
+
347
367
  ### Spec partitioning rule
348
368
 
349
369
  For broad refreshes, do not keep everything inside one `ui-refresh/spec.md` unless the project surface is genuinely small or the change is mostly cosmetic.
@@ -409,13 +429,14 @@ Please inventory the current pages and shared layouts, register the HTML drafts
409
429
  Expected behavior:
410
430
 
411
431
  1. inventory current pages and shared regions
412
- 2. register the HTML drafts as design references
413
- 3. extract a stable `DA-VINCI.md`
414
- 4. split broad redesign work into multiple spec slices when needed
415
- 5. create or refine Pencil redesign screens
416
- 6. bind implementation pages to redesign screens
417
- 7. generate `tasks.md` aligned to the redesign slices
418
- 8. continue into code changes without stopping at "next recommended step"
432
+ 2. decompose complex containers into real design surfaces, subpages, overlays, and states
433
+ 3. register the HTML drafts as design references
434
+ 4. extract a stable `DA-VINCI.md`
435
+ 5. split broad redesign work into multiple spec slices when needed
436
+ 6. create or refine Pencil redesign screens
437
+ 7. bind implementation pages to redesign screens
438
+ 8. generate `tasks.md` aligned to the redesign slices
439
+ 9. continue into code changes without stopping at "next recommended step"
419
440
 
420
441
  ### Best fit
421
442
 
@@ -76,6 +76,10 @@ Do not default this sequence to `build`.
76
76
 
77
77
  ## Platform Syntax
78
78
 
79
+ For ready-to-copy surface-specific starting prompts, see:
80
+
81
+ - `docs/prompt-presets/`
82
+
79
83
  ### Codex
80
84
 
81
85
  Use:
@@ -0,0 +1,27 @@
1
+ # Prompt Presets
2
+
3
+ Use these presets when you want a copy-ready starting prompt for a specific product surface.
4
+
5
+ These presets are designed to pair with:
6
+
7
+ - `docs/visual-assist-presets/`
8
+
9
+ Recommended flow:
10
+
11
+ 1. choose the prompt preset closest to the product surface
12
+ 2. choose the matching `Visual Assist` preset
13
+ 3. copy both into your workflow setup
14
+ 4. tighten the prompt further only when the project has unusual truth sources or platform constraints
15
+
16
+ Available presets:
17
+
18
+ - `mobile-app.md`
19
+ - `desktop-app.md`
20
+ - `web-app.md`
21
+ - `tablet-app.md`
22
+
23
+ Design rule:
24
+
25
+ - prompt presets define workflow intent, decomposition rules, and truth-source handling
26
+ - visual-assist presets define UI-design helper preferences
27
+ - use both together for the strongest result