@xenonbyte/da-vinci-workflow 0.1.7 → 0.1.9

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 (35) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +50 -7
  3. package/README.zh-CN.md +102 -7
  4. package/SKILL.md +63 -13
  5. package/docs/codex-natural-language-usage.md +167 -0
  6. package/docs/mode-use-cases.md +19 -0
  7. package/docs/prompt-entrypoints.md +12 -5
  8. package/docs/visual-adapters.md +173 -0
  9. package/docs/visual-assist-presets/README.md +24 -0
  10. package/docs/visual-assist-presets/desktop-app.md +35 -0
  11. package/docs/visual-assist-presets/mobile-app.md +35 -0
  12. package/docs/visual-assist-presets/tablet-app.md +35 -0
  13. package/docs/visual-assist-presets/web-app.md +35 -0
  14. package/docs/workflow-examples.md +46 -20
  15. package/docs/zh-CN/codex-natural-language-usage.md +168 -0
  16. package/docs/zh-CN/mode-use-cases.md +19 -0
  17. package/docs/zh-CN/prompt-entrypoints.md +12 -5
  18. package/docs/zh-CN/visual-adapters.md +175 -0
  19. package/docs/zh-CN/visual-assist-presets/README.md +24 -0
  20. package/docs/zh-CN/visual-assist-presets/desktop-app.md +31 -0
  21. package/docs/zh-CN/visual-assist-presets/mobile-app.md +30 -0
  22. package/docs/zh-CN/visual-assist-presets/tablet-app.md +30 -0
  23. package/docs/zh-CN/visual-assist-presets/web-app.md +31 -0
  24. package/docs/zh-CN/workflow-examples.md +46 -20
  25. package/examples/greenfield-spec-markupflow/DA-VINCI.md +14 -0
  26. package/examples/greenfield-spec-markupflow/README.md +9 -2
  27. package/examples/greenfield-spec-markupflow/design-registry.md +13 -4
  28. package/examples/greenfield-spec-markupflow/pencil-bindings.md +4 -4
  29. package/examples/greenfield-spec-markupflow/pencil-design.md +15 -2
  30. package/package.json +1 -1
  31. package/references/artifact-templates.md +38 -0
  32. package/references/design-inputs.md +22 -5
  33. package/references/page-mapping.md +9 -0
  34. package/references/pencil-design-to-code.md +9 -0
  35. package/references/platform-adapters.md +4 -4
package/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@
4
4
 
5
5
  - No unreleased changes yet.
6
6
 
7
+ ## v0.1.9 - 2026-03-27
8
+
9
+ ### Added
10
+ - `docs/visual-adapters.md` and `docs/zh-CN/visual-adapters.md` to explain visual-adapter configuration, resolution, and fallback behavior
11
+ - `docs/visual-assist-presets/` and `docs/zh-CN/visual-assist-presets/` with ready-to-copy `Visual Assist` presets for mobile, desktop, web, and tablet product surfaces
12
+
13
+ ### Changed
14
+ - forward-test example artifacts now show `Visual Assist`, `Visual Adapter Resolution`, and project-local `.pen` persistence patterns
15
+ - workflow examples and README navigation now point to the new visual-adapter and preset documentation
16
+
17
+ ## v0.1.8 - 2026-03-27
18
+
19
+ ### Added
20
+ - Codex natural-language usage guides in `docs/codex-natural-language-usage.md` and `docs/zh-CN/codex-natural-language-usage.md`
21
+
22
+ ### Changed
23
+ - Codex workflow docs now standardize on `$da-vinci ...` natural-language entry patterns for `intake`, `prompt`, `continue`, and direct mode usage
24
+ - Da Vinci now documents `.da-vinci/designs/` as the default project-local location for persisted Pencil `.pen` files
25
+ - artifact templates, mode guides, and design references now record preferred project-local `.pen` paths in `design-registry.md`
26
+
7
27
  ## v0.1.7 - 2026-03-27
8
28
 
9
29
  ### Changed
package/README.md CHANGED
@@ -27,10 +27,16 @@ This workflow is intended for:
27
27
 
28
28
  Latest published npm package:
29
29
 
30
- - `@xenonbyte/da-vinci-workflow@0.1.7`
30
+ - `@xenonbyte/da-vinci-workflow@0.1.9`
31
31
 
32
32
  Release highlights:
33
33
 
34
+ - visual-adapter configuration is now documented explicitly, including field meanings, resolution order, and fallback behavior
35
+ - ready-to-copy `Visual Assist` presets are now included for mobile, desktop, web, and tablet scenarios
36
+ - the repo-local forward test now shows how `Visual Assist`, adapter resolution, and persisted `.pen` paths should be recorded
37
+ - Codex natural-language usage is now documented explicitly, including `intake`, `prompt`, `continue`, and direct mode entry patterns
38
+ - project-local Pencil `.pen` files are now documented to persist under `.da-vinci/designs/`
39
+ - design registry and artifact templates now record preferred persisted `.pen` paths for project-local reuse
34
40
  - prompt-entry helper routes for `intake`, `prompt`, and `continue` are now published across Codex, Claude, and Gemini
35
41
  - Chinese companion docs are now intentionally limited to `README.zh-CN.md` and `docs/zh-CN/`
36
42
  - asset validation now covers the full shipped documentation set
@@ -87,7 +93,7 @@ Da Vinci runs in this order:
87
93
  1. select the active mode
88
94
  2. build the correct source artifacts
89
95
  3. detect or generate `DA-VINCI.md` as the project visual contract
90
- 4. collect design inputs and register design sources
96
+ 4. collect design inputs, prefer project-local `.pen` files under `.da-vinci/designs/`, and register design sources
91
97
  5. define or discover the project page map
92
98
  6. create or update Pencil designs
93
99
  7. bind implementation pages to Pencil pages
@@ -105,6 +111,7 @@ Depending on the mode, the workflow may use these artifacts:
105
111
  - `DA-VINCI.md`
106
112
  - `.da-vinci/changes/<change-id>/design-brief.md`
107
113
  - `.da-vinci/design-registry.md`
114
+ - `.da-vinci/designs/`
108
115
  - `.da-vinci/page-map.md`
109
116
  - `.da-vinci/changes/<change-id>/proposal.md`
110
117
  - `.da-vinci/changes/<change-id>/specs/<capability>/spec.md`
@@ -121,6 +128,7 @@ Depending on the mode, the workflow may use these artifacts:
121
128
  - `DA-VINCI.md`: project-level visual contract for theme, palette, typography direction, component tone, and page-consistency rules
122
129
  - `design-brief.md`: form factor, style, density, brand constraints, and layout preferences
123
130
  - `design-registry.md`: project-level `.pen` source inventory
131
+ - `.da-vinci/designs/`: project-local persisted Pencil sources such as `project-baseline.pen` or change-specific `.pen` files
124
132
  - `page-map.md`: canonical page list and page responsibilities
125
133
  - `proposal.md`: change scope and outcomes
126
134
  - `spec.md`: behavior, states, edge cases, and acceptance rules
@@ -146,6 +154,9 @@ project/
146
154
  └── .da-vinci/
147
155
  ├── project-inventory.md
148
156
  ├── design-registry.md
157
+ ├── designs/
158
+ │ ├── project-baseline.pen
159
+ │ └── <change-id>.pen
149
160
  ├── page-map.md
150
161
  └── changes/
151
162
  └── <change-id>/
@@ -165,6 +176,7 @@ Placement rules:
165
176
 
166
177
  - keep `DA-VINCI.md` at the project root
167
178
  - keep project-wide workflow files in `.da-vinci/`
179
+ - keep project-local Pencil files in `.da-vinci/designs/`
168
180
  - keep change-specific workflow files in `.da-vinci/changes/<change-id>/`
169
181
  - do not scatter `proposal.md`, `tasks.md`, and `verification.md` across the project root
170
182
 
@@ -217,21 +229,33 @@ Rules:
217
229
 
218
230
  - `DA-VINCI.md` is the project-level visual contract for cross-page consistency
219
231
  - `design-registry.md` is the project-level inventory of `.pen` sources
232
+ - `.da-vinci/designs/` is the default project-local location for persisted `.pen` files
220
233
  - `page-map.md` is the source of truth for implementation pages
221
234
  - `pencil-bindings.md` is the source of truth for implementation page -> Pencil page mapping
222
235
 
236
+ Optional visual-adapter policy:
237
+
238
+ - `DA-VINCI.md` may declare preferred visual adapters for design assistance
239
+ - visual adapters are optional helpers for composition, hierarchy, spacing, and motion guidance
240
+ - they may refine `DA-VINCI.md`, `design.md`, and `pencil-design.md`
241
+ - they must not override behavior truth, route truth, page-state truth, or acceptance rules
242
+ - if a requested adapter is unavailable locally, Da Vinci should continue with native design rules and record the fallback in `design-registry.md`
243
+
223
244
  When a relevant mapping already exists:
224
245
 
225
246
  - iterate on the mapped Pencil source
247
+ - prefer the project-local `.pen` path already registered in `design-registry.md`
226
248
 
227
249
  When mappings do not exist but local code exists:
228
250
 
229
251
  - reconstruct the baseline from the local project
230
252
  - rebuild inventory, page map, and design registry
253
+ - save or export the rebuilt Pencil baseline into `.da-vinci/designs/` when possible
231
254
 
232
255
  When neither mappings nor usable design sources exist:
233
256
 
234
257
  - 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`
235
259
 
236
260
  ## Design input collection
237
261
 
@@ -243,6 +267,7 @@ Before generating Pencil designs for a greenfield project, Da Vinci should colle
243
267
  - density
244
268
  - brand direction
245
269
  - responsive priority
270
+ - optional visual-adapter preferences
246
271
 
247
272
  Preferred inference order:
248
273
 
@@ -257,6 +282,12 @@ If `DA-VINCI.md` does not exist:
257
282
  - generate it from stable user preferences, existing project signals, or inferred defaults
258
283
  - save it before generating many project pages, so later pages do not drift stylistically
259
284
 
285
+ If the project requests visual adapters:
286
+
287
+ - resolve them from the user request first, then `DA-VINCI.md`, then locally available skills
288
+ - choose one primary adapter when multiple helpers are available
289
+ - treat them as non-blocking unless the user explicitly requires a specific adapter
290
+
260
291
  ## Installation
261
292
 
262
293
  Install the package:
@@ -299,9 +330,9 @@ $da-vinci <request>
299
330
  Entry helpers:
300
331
 
301
332
  ```text
302
- /prompts:dv-intake
303
- /prompts:dv-prompt
304
- /prompts:dv-continue
333
+ $da-vinci use intake for <project situation>
334
+ $da-vinci use prompt for <known scenario>
335
+ $da-vinci use continue for <existing workflow state>
305
336
  ```
306
337
 
307
338
  ### Claude
@@ -382,13 +413,20 @@ $da-vinci use feature-change to add a billing page, generate the relevant Pencil
382
413
  ### Prompt intake for a complex redesign
383
414
 
384
415
  ```text
385
- /dv:intake I need to globally replace the UI of an existing Android project. Existing code is the behavior source of truth. HTML references are in /abs/path/to/mockups.
416
+ $da-vinci use intake for this existing Android project.
417
+
418
+ I need to globally replace the UI.
419
+ Existing Android code is the behavior source of truth.
420
+ HTML references are in /abs/path/to/mockups.
386
421
  ```
387
422
 
388
423
  ### Continue after inventory and spec work
389
424
 
390
425
  ```text
391
- /dv:continue Continue this redesign-from-code workflow into full-delivery using the existing Da Vinci artifacts.
426
+ $da-vinci use continue for this existing redesign-from-code workflow.
427
+
428
+ Use the existing Da Vinci artifacts.
429
+ Continue into full-delivery.
392
430
  ```
393
431
 
394
432
  ## Workflow examples
@@ -396,6 +434,9 @@ $da-vinci use feature-change to add a billing page, generate the relevant Pencil
396
434
  See:
397
435
 
398
436
  - `docs/prompt-entrypoints.md`
437
+ - `docs/codex-natural-language-usage.md`
438
+ - `docs/visual-adapters.md`
439
+ - `docs/visual-assist-presets/`
399
440
  - `docs/workflow-examples.md`
400
441
  - `docs/mode-use-cases.md`
401
442
 
@@ -404,6 +445,8 @@ See:
404
445
  Chinese companion documents are included in this repository:
405
446
 
406
447
  - `README.zh-CN.md`
448
+ - `docs/zh-CN/visual-adapters.md`
449
+ - `docs/zh-CN/visual-assist-presets/`
407
450
  - `docs/zh-CN/`
408
451
 
409
452
  ## Repository layout
package/README.zh-CN.md CHANGED
@@ -29,10 +29,16 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
29
29
 
30
30
  最新已发布 npm 包:
31
31
 
32
- - `@xenonbyte/da-vinci-workflow@0.1.7`
32
+ - `@xenonbyte/da-vinci-workflow@0.1.9`
33
33
 
34
34
  已发布版本重点:
35
35
 
36
+ - visual adapter 的配置字段、解析顺序和回退行为现在有单独文档说明
37
+ - 现在提供按移动端、桌面端、Web、平板拆分的 `Visual Assist` 可复制模板
38
+ - 仓库内的 forward test 示例现在展示了 `Visual Assist`、adapter 解析结果和 `.pen` 持久化记录方式
39
+ - Codex 的自然语言用法现在有单独文档,明确说明 `intake`、`prompt`、`continue` 和直接 mode 调用方式
40
+ - 项目内 Pencil `.pen` 文件现在明确约定默认持久化到 `.da-vinci/designs/`
41
+ - 设计源登记和工件模板现在会记录项目内优先使用的 `.pen` 路径
36
42
  - `intake`、`prompt`、`continue` 三个提示词入口辅助路由已随 Codex、Claude、Gemini 一起发布
37
43
  - 中文配套文档现在刻意只保留 `README.zh-CN.md` 和 `docs/zh-CN/`
38
44
  - 资产校验现在覆盖完整的随包文档集合
@@ -92,7 +98,7 @@ Da Vinci 的默认顺序是:
92
98
  1. 选择 mode
93
99
  2. 生成正确的源工件
94
100
  3. 检测或生成 `DA-VINCI.md`
95
- 4. 收集设计输入并登记设计源
101
+ 4. 收集设计输入,优先使用 `.da-vinci/designs/` 下的项目内 `.pen` 文件,并登记设计源
96
102
  5. 定义或发现页面地图
97
103
  6. 创建或更新 Pencil 设计
98
104
  7. 绑定实现页面到 Pencil 页面
@@ -110,6 +116,7 @@ Da Vinci 的默认顺序是:
110
116
  - `DA-VINCI.md`
111
117
  - `.da-vinci/changes/<change-id>/design-brief.md`
112
118
  - `.da-vinci/design-registry.md`
119
+ - `.da-vinci/designs/`
113
120
  - `.da-vinci/page-map.md`
114
121
  - `.da-vinci/changes/<change-id>/proposal.md`
115
122
  - `.da-vinci/changes/<change-id>/specs/<capability>/spec.md`
@@ -126,6 +133,7 @@ Da Vinci 的默认顺序是:
126
133
  - `DA-VINCI.md`:项目级视觉契约
127
134
  - `design-brief.md`:设计方向、形态、密度、品牌和限制条件
128
135
  - `design-registry.md`:项目级 `.pen` 设计源登记
136
+ - `.da-vinci/designs/`:项目内持久化的 Pencil 设计源,例如 `project-baseline.pen` 或按 change 保存的 `.pen` 文件
129
137
  - `page-map.md`:页面、职责、状态和共享区域
130
138
  - `proposal.md`:范围、目标、非目标和成功标准
131
139
  - `spec.md`:行为、状态、边界和验收规则
@@ -135,6 +143,81 @@ Da Vinci 的默认顺序是:
135
143
  - `tasks.md`:任务分组和实施顺序
136
144
  - `verification.md`:覆盖度和漂移检查
137
145
 
146
+ ## 工件放置建议
147
+
148
+ 推荐结构:
149
+
150
+ ```text
151
+ project/
152
+ ├── DA-VINCI.md
153
+ └── .da-vinci/
154
+ ├── project-inventory.md
155
+ ├── design-registry.md
156
+ ├── designs/
157
+ │ ├── project-baseline.pen
158
+ │ └── <change-id>.pen
159
+ ├── page-map.md
160
+ └── changes/
161
+ └── <change-id>/
162
+ ├── brainstorm.md
163
+ ├── design-brief.md
164
+ ├── proposal.md
165
+ ├── design.md
166
+ ├── pencil-design.md
167
+ ├── pencil-bindings.md
168
+ ├── tasks.md
169
+ ├── verification.md
170
+ └── specs/
171
+ └── <capability>/spec.md
172
+ ```
173
+
174
+ 规则:
175
+
176
+ - `DA-VINCI.md` 放在项目根目录
177
+ - 项目级工作流工件放在 `.da-vinci/`
178
+ - 项目内持久化的 Pencil `.pen` 文件默认放在 `.da-vinci/designs/`
179
+ - change 级工件放在 `.da-vinci/changes/<change-id>/`
180
+
181
+ ## 设计源规则
182
+
183
+ - `DA-VINCI.md` 是跨页面视觉一致性的项目级视觉契约
184
+ - `design-registry.md` 用来登记项目中的 `.pen` 设计源
185
+ - `.da-vinci/designs/` 是项目内持久化 `.pen` 文件的默认位置
186
+ - `page-map.md` 是实现页面和状态的真相源
187
+ - `pencil-bindings.md` 是实现页面到 Pencil 页面绑定的真相源
188
+
189
+ 可选 visual adapter 规则:
190
+
191
+ - `DA-VINCI.md` 可以声明期望使用的 visual adapter 来辅助设计
192
+ - visual adapter 只用于增强构图、层级、留白、节奏和 motion 判断
193
+ - 它可以影响 `DA-VINCI.md`、`design.md`、`pencil-design.md`
194
+ - 它不能覆盖 behavior truth、路由真相、页面状态真相或验收规则
195
+ - 如果本地没有请求的 adapter,Da Vinci 应继续使用原生设计规则,并在 `design-registry.md` 里记录回退结果
196
+
197
+ 当已有页面映射存在时:
198
+
199
+ - 优先复用已绑定的 Pencil 设计源
200
+ - 如果 `design-registry.md` 里已经登记了 `.da-vinci/designs/` 下的本地 `.pen` 路径,优先使用它
201
+
202
+ 当已有代码存在但还没有映射时:
203
+
204
+ - 先从当前项目重建设计基线
205
+ - 重建 inventory、page-map、design-registry
206
+ - 在可行时把新的 Pencil 基线保存或导出到 `.da-vinci/designs/`
207
+
208
+ 当既没有映射也没有可用设计源时:
209
+
210
+ - 基于当前本地真相源创建新的 Pencil 基线
211
+ - 在可行时把基线保存到 `.da-vinci/designs/`
212
+ - 并在 `design-registry.md` 里记录准确路径
213
+
214
+ 如果项目声明了 visual adapter:
215
+
216
+ - 先看用户请求,其次看 `DA-VINCI.md`,再看本地可用 skill
217
+ - 如果存在多个可用辅助 skill,收敛出一个 primary adapter,必要时再保留 secondary helpers
218
+ - 默认把它当成非阻塞增强层
219
+ - 只有用户明确要求必须使用某个 adapter 时,缺失才应阻塞工作流
220
+
138
221
  ## 安装
139
222
 
140
223
  安装 npm 包:
@@ -177,9 +260,9 @@ $da-vinci <request>
177
260
  辅助入口:
178
261
 
179
262
  ```text
180
- /prompts:dv-intake
181
- /prompts:dv-prompt
182
- /prompts:dv-continue
263
+ $da-vinci use intake for <project situation>
264
+ $da-vinci use prompt for <known scenario>
265
+ $da-vinci use continue for <existing workflow state>
183
266
  ```
184
267
 
185
268
  ### Claude
@@ -243,20 +326,30 @@ $da-vinci use feature-change to add a billing page, generate the relevant Pencil
243
326
  ### 复杂重设计先做 intake
244
327
 
245
328
  ```text
246
- /dv:intake I need to globally replace the UI of an existing Android project. Existing code is the behavior source of truth. HTML references are in /abs/path/to/mockups.
329
+ $da-vinci use intake for this existing Android project.
330
+
331
+ I need to globally replace the UI.
332
+ Existing Android code is the behavior source of truth.
333
+ HTML references are in /abs/path/to/mockups.
247
334
  ```
248
335
 
249
336
  ### 已有工件后继续推进
250
337
 
251
338
  ```text
252
- /dv:continue Continue this redesign-from-code workflow into full-delivery using the existing Da Vinci artifacts.
339
+ $da-vinci use continue for this existing redesign-from-code workflow.
340
+
341
+ Use the existing Da Vinci artifacts.
342
+ Continue into full-delivery.
253
343
  ```
254
344
 
255
345
  ## 文档导航
256
346
 
257
347
  英文文档:
258
348
 
349
+ - `docs/codex-natural-language-usage.md`
259
350
  - `docs/prompt-entrypoints.md`
351
+ - `docs/visual-adapters.md`
352
+ - `docs/visual-assist-presets/`
260
353
  - `docs/workflow-examples.md`
261
354
  - `docs/mode-use-cases.md`
262
355
  - `references/`
@@ -264,6 +357,8 @@ $da-vinci use feature-change to add a billing page, generate the relevant Pencil
264
357
  中文文档:
265
358
 
266
359
  - `README.zh-CN.md`
360
+ - `docs/zh-CN/visual-adapters.md`
361
+ - `docs/zh-CN/visual-assist-presets/`
267
362
  - `docs/zh-CN/`
268
363
 
269
364
  ## 仓库布局
package/SKILL.md CHANGED
@@ -70,7 +70,7 @@ Do not stop merely because:
70
70
 
71
71
  - some pages are still out of scope
72
72
  - a future follow-up spec may be needed for untouched behavior
73
- - a design source should also be saved or exported for better traceability
73
+ - a project-local `.pen` export is still pending for traceability, unless that missing file would make the active design source ambiguous
74
74
 
75
75
  Those are warnings unless they prevent safe implementation of the current in-scope work.
76
76
 
@@ -80,9 +80,12 @@ Canonical workflow name is `da-vinci`.
80
80
 
81
81
  - Codex preferred: `$da-vinci <request>`
82
82
  - Claude and Gemini preferred: `/da-vinci <request>` when platform adapters exist
83
- - Explicit action routes also exist for workflow entry help:
84
- - Codex: `/prompts:dv-intake`, `/prompts:dv-prompt`, `/prompts:dv-continue`
85
- - Claude and Gemini: `/dv:intake`, `/dv:prompt`, `/dv:continue`
83
+ - For Codex helper intents, prefer natural-language patterns:
84
+ - `$da-vinci use intake for <project situation>`
85
+ - `$da-vinci use prompt for <known scenario>`
86
+ - `$da-vinci use continue for <existing workflow state>`
87
+ - Claude and Gemini helper routes remain:
88
+ - `/dv:intake`, `/dv:prompt`, `/dv:continue`
86
89
  - Natural-language invocation remains the default path
87
90
 
88
91
  ## Prompt Entry Routes
@@ -148,6 +151,7 @@ Before generating new Pencil designs for a greenfield project, collect or infer:
148
151
  - detect whether `DA-VINCI.md` already exists
149
152
  - if it exists, treat it as the visual baseline for future pages
150
153
  - if it does not exist, generate it from stable user preferences, existing project signals, or inferred defaults before broad Pencil page generation
154
+ - if it declares preferred visual adapters, treat them as optional design-assist preferences, not as behavior truth
151
155
 
152
156
  1. product form factor
153
157
  - desktop software
@@ -177,6 +181,13 @@ Use this priority order:
177
181
 
178
182
  Do not repeatedly ask for inputs that are already stable in the artifacts.
179
183
 
184
+ Treat visual adapters as optional design-assist layers.
185
+
186
+ - resolve them from the user request first, then `DA-VINCI.md`, then locally available skills
187
+ - use them to improve visual contract quality, composition, hierarchy, spacing, and motion guidance
188
+ - do not let them redefine behavior, page truth, route truth, or acceptance rules
189
+ - if a requested adapter is unavailable locally, continue with native Da Vinci design rules and record the fallback
190
+
180
191
  ## Default Workflow
181
192
 
182
193
  Run the workflow in this order:
@@ -184,7 +195,7 @@ Run the workflow in this order:
184
195
  1. Select the active mode
185
196
  2. Build the correct source artifacts for that mode
186
197
  3. Detect or generate `DA-VINCI.md` as the project visual contract
187
- 4. Collect design inputs and register available design sources
198
+ 4. Collect design inputs, prefer project-local `.pen` files under `.da-vinci/designs/`, and register available design sources
188
199
  5. Define or discover the project page map
189
200
  6. Create or update Pencil designs for the required pages
190
201
  7. Bind implementation pages to Pencil pages
@@ -221,14 +232,15 @@ Use these artifacts unless the project defines a different schema:
221
232
  3. `DA-VINCI.md`
222
233
  4. `.da-vinci/changes/<change-id>/design-brief.md`
223
234
  5. `.da-vinci/design-registry.md`
224
- 6. `.da-vinci/page-map.md`
225
- 7. `.da-vinci/changes/<change-id>/proposal.md`
226
- 8. `.da-vinci/changes/<change-id>/specs/<capability>/spec.md`
227
- 9. `.da-vinci/changes/<change-id>/design.md`
228
- 10. `.da-vinci/changes/<change-id>/pencil-design.md`
229
- 11. `.da-vinci/changes/<change-id>/pencil-bindings.md`
230
- 12. `.da-vinci/changes/<change-id>/tasks.md`
231
- 13. `.da-vinci/changes/<change-id>/verification.md`
235
+ 6. `.da-vinci/designs/`
236
+ 7. `.da-vinci/page-map.md`
237
+ 8. `.da-vinci/changes/<change-id>/proposal.md`
238
+ 9. `.da-vinci/changes/<change-id>/specs/<capability>/spec.md`
239
+ 10. `.da-vinci/changes/<change-id>/design.md`
240
+ 11. `.da-vinci/changes/<change-id>/pencil-design.md`
241
+ 12. `.da-vinci/changes/<change-id>/pencil-bindings.md`
242
+ 13. `.da-vinci/changes/<change-id>/tasks.md`
243
+ 14. `.da-vinci/changes/<change-id>/verification.md`
232
244
 
233
245
  Not every mode requires every artifact.
234
246
 
@@ -254,6 +266,7 @@ Optional artifacts:
254
266
  - `DA-VINCI.md`: project-level visual contract for theme, color system, surface treatment, typography direction, and cross-page style rules
255
267
  - `design-brief.md`: form factor, visual direction, density, brand constraints, and UI preferences
256
268
  - `design-registry.md`: project-level `.pen` file inventory and active design sources
269
+ - `.da-vinci/designs/`: project-local persisted Pencil sources such as `project-baseline.pen` or change-specific `.pen` files
257
270
  - `page-map.md`: canonical page list, page responsibilities, route mapping, and page states
258
271
  - `proposal.md`: scope, goal, non-goals, and success criteria
259
272
  - `spec.md`: behavior, states, inputs, outputs, edge cases, and acceptance rules
@@ -277,10 +290,17 @@ Keep this file at the project root so the visual contract is easy to discover an
277
290
 
278
291
  - `.da-vinci/project-inventory.md`
279
292
  - `.da-vinci/design-registry.md`
293
+ - `.da-vinci/designs/`
280
294
  - `.da-vinci/page-map.md`
281
295
 
282
296
  These files describe project-wide facts that can outlive any one change.
283
297
 
298
+ Recommended `.pen` persistence patterns:
299
+
300
+ - `.da-vinci/designs/project-baseline.pen`
301
+ - `.da-vinci/designs/<change-id>.pen`
302
+ - `.da-vinci/designs/<change-id>/main.pen`
303
+
284
304
  ### Change-level workflow directory
285
305
 
286
306
  - `.da-vinci/changes/<change-id>/brainstorm.md`
@@ -375,6 +395,8 @@ Do not split page-by-page unless the product is unusually fragmented. Prefer imp
375
395
 
376
396
  Use `design-registry.md` as the project-level inventory of `.pen` sources.
377
397
 
398
+ Use `.da-vinci/designs/` as the default project-local location for persisted Pencil files when the workflow creates or updates them.
399
+
378
400
  Use `DA-VINCI.md` as the project-level visual source of truth for:
379
401
 
380
402
  - theme and palette
@@ -382,20 +404,30 @@ Use `DA-VINCI.md` as the project-level visual source of truth for:
382
404
  - typography direction
383
405
  - component tone
384
406
  - rules for cross-page consistency
407
+ - optional visual adapter preferences
408
+
409
+ Treat visual adapters as optional helpers for presentation quality only.
410
+
411
+ - they may refine `DA-VINCI.md`, `design.md`, and `pencil-design.md`
412
+ - they must not override behavior truth from requirements or existing code
413
+ - they must not replace `page-map.md`, `design-registry.md`, or `pencil-bindings.md`
385
414
 
386
415
  When a relevant mapping already exists:
387
416
 
388
417
  - iterate on the mapped Pencil source
418
+ - prefer the project-local `.pen` file under `.da-vinci/designs/` when one is already registered
389
419
  - do not create a new design baseline unless there is a reason
390
420
 
391
421
  When `DA-VINCI.md` already exists:
392
422
 
393
423
  - use it as the baseline visual contract
394
424
  - do not regenerate visual direction from scratch unless the change explicitly rebrands or resets the product style
425
+ - if it declares preferred visual adapters, try to resolve them without blocking the workflow
395
426
 
396
427
  When page-to-Pencil bindings already exist:
397
428
 
398
429
  - update the mapped Pencil page for the affected implementation page
430
+ - keep the exact `.pen` file path recorded in `design-registry.md`
399
431
 
400
432
  When project mappings do not exist but existing code exists:
401
433
 
@@ -404,12 +436,27 @@ When project mappings do not exist but existing code exists:
404
436
  - reconstruct `page-map.md`
405
437
  - create or rebuild `design-registry.md`
406
438
  - generate a new Pencil baseline only after the inventory is stable
439
+ - save or export that baseline into `.da-vinci/designs/` when possible
407
440
 
408
441
  When neither mappings nor usable design sources exist:
409
442
 
410
443
  - state that the project is entering baseline reconstruction
411
444
  - create a new Pencil baseline from the current local source of truth
412
445
  - 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`
447
+
448
+ When a Pencil session cannot yet be exported locally:
449
+
450
+ - 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
453
+
454
+ When visual adapters are requested:
455
+
456
+ - resolve them from local availability when possible
457
+ - choose one primary adapter when multiple helpers are available
458
+ - record the requested adapters, resolved primary adapter, any secondary helpers, and fallback status in `design-registry.md`
459
+ - continue with native Da Vinci design rules when no adapter is available unless the user explicitly requires a specific adapter
413
460
 
414
461
  If the request is too vague to design or implement safely, ask a short clarification question before generating artifacts.
415
462
 
@@ -422,6 +469,7 @@ When creating or editing Pencil designs:
422
469
  - Build the pages required by the current scope, not an abstract moodboard
423
470
  - follow `page-map.md` as the canonical page list
424
471
  - follow `design-brief.md` for form factor and visual direction when it exists
472
+ - use the resolved visual adapter, when available, for composition, hierarchy, restraint, and motion guidance
425
473
  - Keep page names, section names, and labels aligned with the specs
426
474
  - Make important states explicit when they change implementation: empty, loading, success, error, restricted, unavailable
427
475
  - Prefer layout clarity and information hierarchy over decorative complexity
@@ -432,11 +480,13 @@ When multiple pages exist:
432
480
  - keep one canonical Pencil page or screen per implementation page
433
481
  - record the `.pen` file in `design-registry.md`
434
482
  - record the mapping in `pencil-bindings.md`
483
+ - persist the active `.pen` file into `.da-vinci/designs/` before closing design work when possible
435
484
 
436
485
  ## Pencil MCP Rules
437
486
 
438
487
  When Pencil is available through MCP:
439
488
 
489
+ - Prefer the project-local `.pen` file under `.da-vinci/designs/` when one is registered
440
490
  - Read the active `.pen` file and page structure before coding
441
491
  - read the bound Pencil page for the current implementation page
442
492
  - Use Pencil data to extract layout, text, hierarchy, panels, buttons, and content regions