@xenonbyte/da-vinci-workflow 0.1.11 → 0.1.13

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 (33) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +25 -1
  3. package/README.zh-CN.md +25 -1
  4. package/SKILL.md +23 -0
  5. package/commands/claude/da-vinci.md +3 -0
  6. package/commands/codex/prompts/da-vinci.md +3 -0
  7. package/commands/gemini/da-vinci.toml +3 -0
  8. package/docs/codex-natural-language-usage.md +7 -0
  9. package/docs/mode-use-cases.md +18 -0
  10. package/docs/prompt-presets/README.md +10 -2
  11. package/docs/prompt-presets/desktop-app.md +56 -18
  12. package/docs/prompt-presets/mobile-app.md +64 -18
  13. package/docs/prompt-presets/tablet-app.md +53 -15
  14. package/docs/prompt-presets/web-app.md +55 -17
  15. package/docs/visual-adapters.md +27 -0
  16. package/docs/visual-assist-presets/README.md +2 -0
  17. package/docs/workflow-examples.md +23 -9
  18. package/docs/zh-CN/codex-natural-language-usage.md +7 -0
  19. package/docs/zh-CN/mode-use-cases.md +17 -0
  20. package/docs/zh-CN/prompt-presets/README.md +10 -2
  21. package/docs/zh-CN/prompt-presets/desktop-app.md +56 -18
  22. package/docs/zh-CN/prompt-presets/mobile-app.md +63 -17
  23. package/docs/zh-CN/prompt-presets/tablet-app.md +53 -15
  24. package/docs/zh-CN/prompt-presets/web-app.md +54 -16
  25. package/docs/zh-CN/visual-adapters.md +27 -0
  26. package/docs/zh-CN/visual-assist-presets/README.md +2 -0
  27. package/docs/zh-CN/workflow-examples.md +23 -9
  28. package/package.json +1 -1
  29. package/references/artifact-templates.md +46 -0
  30. package/references/checkpoints.md +19 -1
  31. package/references/design-inputs.md +12 -1
  32. package/references/pencil-design-to-code.md +22 -1
  33. package/references/platform-adapters.md +6 -0
@@ -8,40 +8,78 @@
8
8
 
9
9
  适合这种需求:
10
10
 
11
- - responsive 页面层级
12
- - marketing 与 product surface 的区分
11
+ - responsive 层级
12
+ - marketing surface 与 product surface 的区分
13
13
  - 明确处理 empty、loading、error、authenticated states
14
- - 把复杂流程拆成真实的设计 surface,而不是一个大页面
15
14
 
16
- 推荐提示词:
15
+ ## 如何选择
16
+
17
+ - `Simple redesign` 适合产品表面不大、主要页面不多、状态分支有限的项目。
18
+ - `Complex redesign` 适合同时混合 marketing、auth、onboarding、app surface、dialogs、drawers 和大量状态的项目。
19
+ - `Design-only` 适合先把设计链路和绑定做完,但暂时不改代码。
20
+ - `Continue` 适合已经有 `.da-vinci/` 工件,需要继续推进的项目。
21
+
22
+ ## Simple Redesign
17
23
 
18
24
  ```text
19
25
  $da-vinci use redesign-from-code to redesign this existing web product.
20
26
 
21
27
  Existing code is the behavior source of truth, not the layout truth.
22
28
  Preserve current business logic, routes, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
23
- Inventory responsive surfaces, authenticated areas, settings pages, dialogs, drawers, overlays, and important states before broad Pencil work.
24
- Separate marketing-style surfaces from product-workflow surfaces when they require different visual treatment.
25
- Decompose complex pages into subpages, overlays, materially different states, and implementation surfaces.
29
+ Inventory the current product surfaces and important states before Pencil work.
26
30
  Use the Visual Assist preferences declared in DA-VINCI.md.
27
31
  Do not pass design checkpoint if the result is a generic SaaS card grid or a recolor of the old interface.
28
32
  Persist project-local Pencil files under .da-vinci/designs/.
29
33
  ```
30
34
 
31
- 什么时候先走 `intake`:
35
+ ## Complex Redesign
32
36
 
33
- - 同时混合 marketing、auth、onboarding 和 app surfaces
34
- - 第一条提示词很难一次说清
35
- - 存在外部设计参考,但它们必须服从现有行为真相
37
+ ```text
38
+ $da-vinci use redesign-from-code to redesign this existing web product.
36
39
 
37
- `intake` 版本:
40
+ Existing code is the behavior source of truth, not the layout truth.
41
+ Preserve current business logic, routes, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
42
+ Inventory responsive product surfaces, marketing surfaces, authenticated areas, settings pages, dialogs, drawers, overlays, and materially different states before broad Pencil work.
43
+ Separate marketing-style surfaces from product-workflow surfaces when they require different visual treatment.
44
+ Decompose complex pages into subpages, overlays, materially different states, and implementation surfaces.
45
+ Use the Visual Assist preferences declared in DA-VINCI.md.
46
+ Treat the resolved primary visual adapter as the first-pass design lead.
47
+ Use Pencil guides only as responsive layout constraints, not as the design direction.
48
+ Do not start with broad multi-screen scaffolding.
49
+ Design 1-3 anchor surfaces first, review screenshots, then expand.
50
+ Do not pass design checkpoint if the result is a generic SaaS card grid, repeated placeholder scaffolds, or a recolor of the old interface.
51
+ Persist project-local Pencil files under .da-vinci/designs/.
52
+ ```
53
+
54
+ ## Design-Only
38
55
 
39
56
  ```text
40
- $da-vinci use intake for this existing web product.
57
+ $da-vinci use redesign-from-code to redesign this existing web product.
41
58
 
42
- I need to redesign the UI while preserving current behavior.
43
59
  Existing code is the behavior source of truth, not the layout truth.
60
+ Preserve current behavior, routes, permissions, integrations, and state transitions.
44
61
  Inventory product surfaces, marketing surfaces, overlays, and important states.
45
- Decompose complex pages before Pencil work.
46
- Generate the best executable Da Vinci workflow prompt for the next step.
62
+ Decompose complex pages into real design surfaces before Pencil work.
63
+ Use the Visual Assist preferences declared in DA-VINCI.md.
64
+ If the product is complex, design 1-3 anchor surfaces first, review screenshots, then expand.
65
+ 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.
66
+ Do not start code changes yet.
47
67
  ```
68
+
69
+ ## Continue
70
+
71
+ ```text
72
+ $da-vinci use continue for this existing web-product redesign workflow.
73
+
74
+ Use the existing Da Vinci artifacts in this project.
75
+ Do not restart discovery unless an artifact is missing or clearly wrong.
76
+ Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth.
77
+ If the redesign is complex, continue from the approved anchor surfaces instead of restarting broad scaffolding.
78
+ Continue into the next unfinished stage and do not stop at tasks.md when the active intent is full-delivery.
79
+ ```
80
+
81
+ ## 什么时候先走 Intake
82
+
83
+ - 产品混合了很多 surface 类型和真相源
84
+ - 外部参考让第一条工作流请求变复杂
85
+ - 第一条提示词仍然很难一次说对
@@ -118,6 +118,7 @@ visual adapter 是可选的 presentation 质量增强层。
118
118
  - 你希望 Da Vinci 优先尝试的本地 skill 列表
119
119
  - 顺序有意义
120
120
  - 即使多个 skill 都可用,最终也应该收敛出一个 primary adapter
121
+ - 不要把不同平台上的近名 adapter(例如 `frontend-skill` 和 `frontend-design`)默认当成同一个能力源,应该按当前环境里真实已安装、真实命名的 adapter 来解析
121
122
  - `Scope`
122
123
  - adapter 被允许影响的范围
123
124
  - 应该限制在构图、层级、spacing、Pencil refinement 这类 presentation 质量问题
@@ -180,9 +181,12 @@ adapter 的解析顺序建议固定为:
180
181
  ```md
181
182
  ## Visual Adapter Resolution
182
183
  - Requested adapters: frontend-skill, ui-ux-pro-max
184
+ - Available requested adapters: frontend-skill
185
+ - Unavailable requested adapters: none
183
186
  - Resolved primary adapter: frontend-skill
184
187
  - Secondary helpers: none
185
188
  - Status: active
189
+ - Runtime declaration: explicitly stated before first anchor pass
186
190
  - Scope: DA-VINCI.md, design.md, pencil-design.md
187
191
  - Fallback reason if native Da Vinci rules were used: none
188
192
  ```
@@ -204,9 +208,23 @@ adapter 的解析顺序建议固定为:
204
208
  当 visual adapter 生效时:
205
209
 
206
210
  - 在 Pencil 设计前或设计过程中,用它来增强构图和层级判断
211
+ - 解析出来的主 adapter 应该成为首轮设计的 art direction 主导,而不是只登记在 `design-registry.md` 里
212
+ - 在第一个 anchor screen 设计前,必须在运行日志里明确写出解析结果
213
+ - 在第一个 anchor screen 之前,先在这个 adapter 的主导下写出 visual thesis、content plan 和 interaction thesis
207
214
  - 页面命名和状态覆盖仍然要服从 `page-map.md`
208
215
  - 最终 presentation 真相仍然落在 Pencil `.pen` 数据里,而不是 adapter 的文字建议里
209
216
 
217
+ 面对复杂重设计时,还要额外遵守:
218
+
219
+ - 不要一开始就批量搭很多空 screen
220
+ - 先做 1 到 3 个 anchor surface
221
+ - 每个 anchor surface 都要先做成完整构图,再扩展更多页面
222
+ - 对每个 anchor surface,都要简短说明“新的构图与当前布局结构相比,具体改了什么”
223
+ - 每做完一个 anchor surface 都先截图审查,再决定是否 clone 变体或继续扩展
224
+ - 不要把截图分析结果自动当作通过;只要它指出 hierarchy、spacing、clarity、inconsistency 或 unresolved placeholder 问题,就应该先修再继续
225
+ - 在扩展更多页面前,先从已通过的 anchor surface 中抽出一组 shared primitives
226
+ - 如果结果仍然大量是占位块或重复模板,直接把 `design checkpoint` 判成 `BLOCK`,不要在坏底稿上继续叠更多页面
227
+
210
228
  把结果记录到 `pencil-design.md`。
211
229
 
212
230
  推荐字段:
@@ -236,6 +254,15 @@ If it is unavailable, fall back to native Da Vinci design rules and continue.
236
254
  Persist project-local Pencil files under .da-vinci/designs/.
237
255
  ```
238
256
 
257
+ 如果是复杂 Android 或多 surface 项目,建议再额外加上:
258
+
259
+ ```text
260
+ Use frontend-skill explicitly as the primary visual reasoning source.
261
+ Use Pencil guides only as layout constraints, not as the design direction.
262
+ Do not start with broad multi-screen scaffolding.
263
+ Design 1-3 anchor surfaces first, review screenshots, then expand.
264
+ ```
265
+
239
266
  ## adapter 选择建议
240
267
 
241
268
  - `frontend-skill`
@@ -19,6 +19,7 @@
19
19
  - 把 `frontend-skill` 提到第一位
20
20
  - 视情况把 `Require Adapter` 改成 `true`
21
21
  - 在大规模 Pencil 设计前先把 design checkpoint 门槛抬高
22
+ - 改成 anchor-first:先做 1 到 3 个 anchor surface,截图审查通过后再扩展
22
23
 
23
24
  可用模板:
24
25
 
@@ -33,3 +34,4 @@
33
34
  2. 把其中的 `## Visual Assist` 片段复制到 `DA-VINCI.md`
34
35
  3. 只有在项目真的有不同视觉偏向时才调整 adapter 顺序
35
36
  4. 除非确实“没有某个本地 skill 就不能继续”,否则保持 `Require Adapter: false`
37
+ 5. 如果是复杂重设计,不要只复制 preset 就开画;还要配合 anchor-first 的 Pencil 生成策略
@@ -64,10 +64,11 @@ $da-vinci use greenfield-brainstorm to turn product brainstorming into a page ma
64
64
  4. 写入 `specs/<capability>/spec.md`
65
65
  5. 定义 `page-map.md`
66
66
  6. 解析请求的 visual adapter,并把结果记到 `design-registry.md`
67
- 7. 建立或登记 Pencil 设计源
68
- 8. 完成页面绑定
69
- 9. 生成任务
70
- 10. 实现并验证
67
+ 7. 建立或登记项目内 Pencil 设计源
68
+ 8. 先做 1 到 3 个 anchor surface,并完成截图审查,再扩展更多页面
69
+ 9. 完成页面绑定
70
+ 10. 生成任务
71
+ 11. 实现并验证
71
72
 
72
73
  ## 3. `redesign-from-code`
73
74
 
@@ -90,11 +91,13 @@ $da-vinci use redesign-from-code to inventory the current app, identify current
90
91
  4. 在 `proposal.md` 中定义重设计范围
91
92
  5. 当范围过大时,把工作拆成多个 `specs/<slice>/spec.md`
92
93
  6. 重建或细化 `page-map.md`,把 subpage、overlay、重要 state 一起拆出来
93
- 7. 创建新的或更新后的 Pencil 页面,基于重新构图而不是旧 UI 换皮,并优先持久化到 `.da-vinci/designs/`
94
- 8. 运行 `design-source checkpoint`,确认登记的项目内 `.pen` 路径、当前 Pencil 设计源和 shell 可见文件是一致的
95
- 9. 绑定路由和 Pencil 页面
96
- 10. 生成和 redesign slice 对齐的任务
97
- 11. 实现并验证
94
+ 7. 先写出 anchor surface visual thesis、content plan、interaction thesis 和 structural-delta 说明
95
+ 8. 创建新的或更新后的 Pencil 页面,基于重新构图而不是旧 UI 换皮,并优先持久化到 `.da-vinci/designs/`
96
+ 9. 在第一次成功写入 Pencil 后,立即验证登记的项目内 `.pen` 路径已经成为 shell 可见文件
97
+ 10. 运行 `design-source checkpoint`,确认登记的项目内 `.pen` 路径、当前 Pencil 设计源和 shell 可见文件是一致的
98
+ 11. 绑定路由和 Pencil 页面
99
+ 12. 生成和 redesign slice 对齐的任务
100
+ 13. 实现并验证
98
101
 
99
102
  ### 复杂 Android 页面示例
100
103
 
@@ -104,6 +107,17 @@ $da-vinci use redesign-from-code to redesign this existing Android app.
104
107
  Existing code is the behavior source of truth, not the layout truth.
105
108
  Inventory activities, fragments, tabs, dialogs, bottom sheets, nested flows, and important states.
106
109
  Decompose complex screens into separate design surfaces before Pencil work.
110
+ Use frontend-skill explicitly as the primary visual reasoning source.
111
+ State the resolved primary visual adapter explicitly in the log before the first anchor surface.
112
+ Write a visual thesis, content plan, and interaction thesis before the first anchor surface.
113
+ Use Pencil guides only as layout constraints, not as the design direction.
114
+ Do not start with broad multi-screen scaffolding.
115
+ Design 1-3 anchor surfaces first, review screenshots, then expand.
116
+ For each anchor surface, explain how the new composition differs structurally from the current layout.
117
+ Do not treat screenshot analysis as an automatic pass if it reports hierarchy, spacing, clarity, or inconsistency issues.
118
+ Use only Pencil-supported properties; do not use web-only props like flex or margin.
119
+ Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
120
+ Keep `.da-vinci/designs/` reserved for `.pen` files only.
107
121
  Do not pass design checkpoint if the result is just a skin-swap of the old UI.
108
122
  ```
109
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenonbyte/da-vinci-workflow",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Requirement-to-design-to-code workflow skill for Codex, Claude, and Gemini",
5
5
  "bin": {
6
6
  "da-vinci": "bin/da-vinci.js"
@@ -11,6 +11,7 @@ Write artifacts into the target project using this rule:
11
11
  - keep `DA-VINCI.md` at the project root
12
12
  - keep project-level workflow files in `.da-vinci/`
13
13
  - keep project-local Pencil `.pen` files in `.da-vinci/designs/`
14
+ - keep workflow markdown out of `.da-vinci/designs/`; that directory is reserved for `.pen` sources only
14
15
  - keep change-level workflow files in `.da-vinci/changes/<change-id>/`
15
16
 
16
17
  Recommended placement:
@@ -86,6 +87,10 @@ Use this structure:
86
87
  - Route
87
88
  - Page purpose
88
89
 
90
+ ## Implementation Surfaces
91
+ - Activity / fragment / tab / dialog / sheet / overlay
92
+ - Materially different states
93
+
89
94
  ## UI Regions
90
95
  - Shared layout regions
91
96
  - Repeated page patterns
@@ -241,9 +246,12 @@ Use this structure:
241
246
 
242
247
  ## Visual Adapter Resolution
243
248
  - Requested adapters
249
+ - Available requested adapters
250
+ - Unavailable requested adapters
244
251
  - Resolved primary adapter
245
252
  - Secondary helpers
246
253
  - Status: active / fallback / unavailable
254
+ - Whether runtime execution explicitly declared the resolved primary adapter
247
255
  - Scope
248
256
  - Fallback reason if native Da Vinci rules were used
249
257
 
@@ -255,6 +263,7 @@ Use this structure:
255
263
  - Why a source is active
256
264
  - Whether a source is safe to iterate
257
265
  - Whether shell-visible filesystem persistence exists
266
+ - Whether shell-visible persistence was verified immediately after the first Pencil write
258
267
  - Whether the file had to be reconstructed from MCP-readable document data
259
268
  ```
260
269
 
@@ -399,9 +408,23 @@ Use this structure:
399
408
  ```md
400
409
  # Design
401
410
 
411
+ ## Visual Thesis
412
+ - One-sentence art-direction statement
413
+
414
+ ## Content Plan
415
+ - Primary anchor
416
+ - Supporting rail
417
+ - Action lane
418
+
419
+ ## Interaction Thesis
420
+ - Motion or presence ideas that affect hierarchy or affordance
421
+
402
422
  ## Page Map
403
423
  - Pages and sections
404
424
 
425
+ ## Structural Delta From Current Layout
426
+ - For each anchor surface, how the new composition differs from the current XML or layout grouping
427
+
405
428
  ## Interaction Model
406
429
  - Primary actions
407
430
  - Secondary actions
@@ -415,6 +438,12 @@ Use this structure:
415
438
  - Reusable blocks
416
439
  - Page-specific blocks
417
440
 
441
+ ## Shared Primitive Plan
442
+ - Top bar
443
+ - Segmented tabs
444
+ - Metric rails
445
+ - Tiles, rows, trays, overlays
446
+
418
447
  ## Content Notes
419
448
  - Key text
420
449
  - Priority order
@@ -442,10 +471,26 @@ Use this structure:
442
471
 
443
472
  ## Visual Adapter Use
444
473
  - Resolved primary adapter
474
+ - Available requested adapters
475
+ - Unavailable requested adapters
445
476
  - Secondary helpers
477
+ - Whether runtime execution explicitly declared the resolved primary adapter
478
+ - Whether the primary adapter actively led the first-pass composition
446
479
  - How it affected composition, hierarchy, or motion guidance
447
480
  - Whether native Da Vinci fallback was used
448
481
 
482
+ ## Anchor Surfaces
483
+ - Which 1-3 anchor screens were designed first
484
+ - Structural-delta summary for each anchor surface
485
+ - Screenshot review status for each anchor
486
+ - Whether screenshot review found hierarchy, spacing, clarity, or inconsistency issues
487
+ - Whether each anchor was revised after screenshot review
488
+ - Whether broad multi-screen expansion is approved yet
489
+
490
+ ## Shared Primitives
491
+ - Reusable UI family extracted from the approved anchors
492
+ - Whether broad page expansion happened before or after the primitive family was defined
493
+
449
494
  ## Page Mapping
450
495
  - Requirement -> Pencil page
451
496
 
@@ -464,6 +509,7 @@ Use this structure:
464
509
  ## Implementation Notes
465
510
  - Important layout or styling constraints to preserve in code
466
511
  - Persistence notes if the project-local `.pen` file had to be reconstructed from MCP-readable document data
512
+ - Confirmation that `.da-vinci/designs/` was used only for `.pen` files
467
513
  ```
468
514
 
469
515
  Recommended path:
@@ -37,6 +37,7 @@ Use the design checkpoint to confirm:
37
37
  - the current Pencil pages follow the same visual baseline
38
38
  - later pages are not re-inventing the product style from scratch
39
39
  - `redesign-from-code` is not treating the old UI layout as the new design baseline
40
+ - non-design workflow markdown is not being written into `.da-vinci/designs/`, which should stay reserved for project-local `.pen` sources
40
41
 
41
42
  ## `discovery checkpoint`
42
43
 
@@ -49,6 +50,7 @@ Check:
49
50
  - product form factor and visual direction are known, inferred, or explicitly deferred
50
51
  - candidate pages or current pages are clear enough to move into `page-map.md`
51
52
  - open questions are explicitly tracked
53
+ - workflow artifacts are being written to standard locations, especially keeping `.da-vinci/designs/` for `.pen` files rather than markdown notes
52
54
 
53
55
  Result meanings:
54
56
 
@@ -94,9 +96,16 @@ Check:
94
96
  - major layout strategy matches the design artifact
95
97
  - Pencil names and artifact names are aligned enough to implement from
96
98
  - Pencil pages follow the current `DA-VINCI.md` visual contract
99
+ - runtime logs or artifacts explicitly name the requested adapters, which were available, which were unavailable, and which adapter was resolved as primary
100
+ - if visual adapters were requested, the resolved primary adapter clearly shaped the first design pass instead of being recorded only as metadata
101
+ - when a primary adapter is active, the workflow wrote a visual thesis, content plan, and interaction thesis before broad anchor-surface generation
102
+ - complex redesigns have 1-3 fully composed anchor surfaces reviewed before broad multi-screen expansion
103
+ - each anchor surface includes a short explanation of how its composition differs structurally from the current layout truth
97
104
  - each page has a clear visual anchor or primary working surface
98
105
  - section hierarchy is readable without relying on decorative chrome
99
106
  - the design does not collapse into generic card-grid or border-heavy filler UI
107
+ - the design is not placeholder-heavy or built from repeated empty templates masquerading as finished screens
108
+ - shared primitives or a reusable component family are identified before the workflow expands a multi-surface redesign from the anchor pages
100
109
  - motion ideas, if present, improve hierarchy or affordance instead of adding noise
101
110
  - complex pages with multiple fragments, subpages, overlays, or materially different states are decomposed clearly enough to design and implement from
102
111
  - `redesign-from-code` output is a fresh composition driven by page responsibility and state, not a skin-swap of the old UI
@@ -107,6 +116,14 @@ Result meanings:
107
116
  - `WARN`: minor design gaps exist, but the visual direction is still coherent
108
117
  - `BLOCK`: design is not ready to drive implementation, or the result is generic, cluttered, or materially below the intended visual bar
109
118
 
119
+ Automatic failures:
120
+
121
+ - if broad Pencil generation starts before anchor surfaces are compositionally stable, treat the design checkpoint as `BLOCK`
122
+ - if more than roughly 20% of a screen's primary content area is unresolved placeholder scaffolding, treat the design checkpoint as `BLOCK`
123
+ - if multiple screens are effectively the same scaffold with title changes, treat the design checkpoint as `BLOCK`
124
+ - if screenshot review or image analysis calls out hierarchy, spacing, clarity, inconsistency, or unresolved-placeholder issues and the workflow marks the screen as passed without revision, treat the design checkpoint as `BLOCK`
125
+ - if a redesign screen materially mirrors the current XML grouping with only recolor, spacing tweaks, or minor rearrangement, treat the design checkpoint as `BLOCK`
126
+
110
127
  ## `design-source checkpoint`
111
128
 
112
129
  Run after `design-registry.md` resolves the preferred project-local `.pen` path and after active Pencil work exists, but before mapping is treated as safe.
@@ -116,8 +133,9 @@ Check:
116
133
  - `design-registry.md` records one specific preferred project-local `.pen` path
117
134
  - the preferred `.pen` path is workflow-owned state, not a hand-wavy placeholder
118
135
  - the active Pencil editor path matches the preferred project-local `.pen` path, or the mismatch has been reconciled explicitly
119
- - if the workflow created or edited Pencil work, the preferred project-local `.pen` file exists as a shell-visible file
136
+ - if the workflow created or edited Pencil work, the preferred project-local `.pen` file exists as a shell-visible file immediately after the first successful Pencil write, not just at workflow close
120
137
  - if Pencil MCP only exposed a live document, the workflow reconstructed and wrote the registered project-local `.pen` file from MCP-readable document data before continuing
138
+ - `.da-vinci/designs/` is being used cleanly for project-local `.pen` files rather than mixed with workflow markdown
121
139
  - `design-registry.md`, `pencil-design.md`, and `pencil-bindings.md` describe the same active project-local `.pen` source clearly enough to map and implement from
122
140
 
123
141
  Result meanings:
@@ -9,6 +9,7 @@ Check for `DA-VINCI.md` first, then check whether the project already has persis
9
9
  - if it exists, treat it as the project visual contract
10
10
  - if `DA-VINCI.md` declares preferred visual adapters, treat them as optional design-assist preferences
11
11
  - if `.da-vinci/designs/*.pen` exists, treat those files as project-local design inputs and record the exact preferred path in `design-registry.md`
12
+ - treat non-`.pen` files inside `.da-vinci/designs/` as artifact-placement drift that must be corrected instead of as valid design inputs
12
13
  - if it does not exist, generate it from the best stable inputs before broad Pencil page generation
13
14
  - avoid re-deriving the visual language page by page
14
15
 
@@ -107,6 +108,16 @@ If Pencil creates or updates a baseline during the workflow:
107
108
  If the project requests a visual adapter:
108
109
 
109
110
  - try to resolve it from locally available skills
111
+ - do not assume that near-name adapters on different platforms are equivalent; resolve only adapters that are explicitly named and installed in the current environment unless the project intentionally maps them
110
112
  - choose one primary adapter when multiple helpers are available
111
- - record the requested adapters, resolved primary adapter, any secondary helpers, and fallback result in `design-registry.md`
113
+ - record the requested adapters, which were available, which were unavailable, the resolved primary adapter, any secondary helpers, and fallback result in `design-registry.md`
114
+ - treat the resolved primary adapter as the design lead for the first Pencil pass, especially for anchor screens and other quality-critical surfaces
115
+ - if the resolved primary adapter is active, state that resolution explicitly in the runtime log before the first anchor-screen pass and let it shape the visual thesis, content plan, and interaction thesis
116
+ - use Pencil guides or style helpers only as platform and buildability constraints, not as the art-direction source
117
+ - if `Require Adapter: true` and the requested adapter is unavailable, block instead of silently downgrading the visual bar
112
118
  - if no adapter is available, continue with native Da Vinci design rules unless the user explicitly required a specific adapter
119
+
120
+ For `redesign-from-code` on complex products:
121
+
122
+ - write a short structural-delta note for each anchor surface explaining how the new composition differs from the current layout grouping
123
+ - keep those notes in `design.md` or `pencil-design.md` before broad multi-screen generation begins
@@ -38,10 +38,30 @@ If the current active Pencil editor does not match the preferred path in `design
38
38
 
39
39
  If the project resolved a visual adapter:
40
40
 
41
- - use it to refine composition, hierarchy, spacing discipline, and motion suggestions before or during Pencil design work
41
+ - use it to lead early composition, hierarchy, spacing discipline, and motion suggestions before or during Pencil design work
42
+ - on complex redesigns, apply it first to 1-3 anchor surfaces before expanding the rest of the screen set
43
+ - if it is active, make that resolution explicit in the runtime log and let it shape the visual thesis, content plan, and interaction thesis before the first anchor screen
44
+ - do not let Pencil guides, generic style packs, or repeated scaffolding override the resolved primary adapter's role in the first-pass art direction
42
45
  - do not let it override behavior, route truth, or page-state truth
43
46
  - treat it as a presentation-quality assistant, not as a replacement for Pencil or requirements
44
47
 
48
+ For `redesign-from-code`:
49
+
50
+ - preserve behavior from the current codebase, not the current layout grouping
51
+ - write a short structural-delta note for each anchor surface explaining how the new composition differs from the current XML or screen grouping
52
+ - if the result still mirrors the old layout with only recolor or spacing tweaks, treat it as a failed redesign pass
53
+
54
+ ## Pencil Operation Discipline
55
+
56
+ When generating or editing Pencil data:
57
+
58
+ - use only Pencil-supported properties and layout concepts
59
+ - do not emit web- or CSS-only properties such as `flex` or `margin`
60
+ - prefer smaller, schema-safe batches on anchor screens so errors do not roll back large composition chunks
61
+ - verify the registered project-local `.pen` path becomes shell-visible immediately after the first successful Pencil write
62
+ - keep workflow markdown out of `.da-vinci/designs/`; reserve that directory for `.pen` files only
63
+ - after the first approved anchor surfaces, extract a shared primitive family before broad page expansion
64
+
45
65
  ## Map Pencil To Frontend
46
66
 
47
67
  Use these default mappings:
@@ -76,4 +96,5 @@ Before treating the code as complete:
76
96
  - compare major sections against Pencil
77
97
  - compare headline and CTA hierarchy against Pencil
78
98
  - compare panel grouping against Pencil
99
+ - compare the implemented structure against the approved structural-delta notes for anchor surfaces
79
100
  - note any intentional deviations
@@ -93,3 +93,9 @@ Keep these stable:
93
93
  - prompt helper semantics
94
94
 
95
95
  Platform adapters may differ in command syntax, but not in workflow semantics.
96
+
97
+ Visual-adapter names may differ across platforms.
98
+
99
+ - do not assume that near-name adapters such as `frontend-skill` and `frontend-design` are equivalent
100
+ - resolve the actual installed adapter names for the current environment
101
+ - record the requested adapters, available adapters, unavailable adapters, and resolved primary adapter explicitly in runtime artifacts