@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.1.20 - 2026-03-29
4
+
5
+ ### Added
6
+ - `scripts/test-audit-context-delta.js` to cover context-delta expectation signals, status mismatch reporting, `supersedes` validation, and timestamp-normalized reference matching
7
+
8
+ ### Changed
9
+ - continue prompt/docs behavior now consistently route from artifact and checkpoint truth first, with contextual deltas used only as auxiliary recovery context
10
+ - context-delta audit expectation signals now trigger on `## Checkpoint Status` and `## MCP Runtime Gate` (or explicit `Context Delta Required` opt-in) instead of broad `## Outcome` matching
11
+ - context-delta mismatch warnings now use neutral status-mismatch wording and include per-checkpoint status history
12
+ - context-delta `supersedes` fields are now validated against earlier entries in the same artifact, including parseable timestamp normalization
13
+ - README, Chinese README, workflow docs, prompt docs, and templates now document automatic context-delta checks plus optional explicit opt-in usage
14
+
15
+ ## v0.1.19 - 2026-03-28
16
+
17
+ ### Added
18
+ - `design-supervisor review` as a documented final style-quality gate that stays distinct from `Preferred adapters`
19
+ - `scripts/test-audit-design-supervisor.js` to cover advisory versus required reviewer branches, missing review records, and malformed review records
20
+ - `scripts/test-pencil-lock.js` to verify blocking lock waits and timeout behavior after removing the old busy-wait loop
21
+
22
+ ### Changed
23
+ - `Visual Assist` guidance now explains `Design-supervisor reviewers`, `Require Supervisor Review`, gate order, gate judging criteria, and per-gate branching in both English and Chinese
24
+ - `visual-assist-presets` for mobile, desktop, web, and tablet now ship three explicit variants: adapter-only, advisory reviewer, and required reviewer signoff
25
+ - completion and integrity audit now treat `Require Supervisor Review: true` as the actual hard-gate switch instead of forcing all configured reviewers into a blocking path
26
+ - design-supervisor review records now require explicit status, issue list, and revision outcome before they count as valid audit evidence
27
+ - Pencil lock waiting now uses blocking sleep via `Atomics.wait(...)` instead of CPU-burning busy waits while preserving the synchronous CLI call graph
28
+ - Chinese `visual-assist-presets` now match the English three-variant structure without extra duplicated configuration blocks
29
+
3
30
  ## v0.1.18 - 2026-03-28
4
31
 
5
32
  ### Added
package/README.md CHANGED
@@ -28,10 +28,19 @@ This workflow is intended for:
28
28
 
29
29
  Latest published npm package:
30
30
 
31
- - `@xenonbyte/da-vinci-workflow@0.1.18`
31
+ - `@xenonbyte/da-vinci-workflow@0.1.20`
32
32
 
33
33
  Release highlights:
34
34
 
35
+ - continue-routing and recovery guidance now consistently prioritize artifact/checkpoint truth first, with contextual deltas treated as auxiliary notes only
36
+ - context-delta audit now uses tighter expectation signals, status-mismatch wording, and `supersedes` validation with timestamp normalization
37
+ - context-delta expectation checks are now automatic for checkpoint-bearing artifacts and allow explicit opt-in (`Context Delta Required`) only for edge cases
38
+ - `design-supervisor review` is now a first-class final style-quality gate with explicit advisory versus required behavior controlled by `Require Supervisor Review`
39
+ - `Visual Assist` docs now explain gate order, gate judging criteria, and branching across screenshot review, layout hygiene, design checkpoint, and design-supervisor review
40
+ - `visual-assist-presets` for mobile, desktop, web, and tablet now ship three explicit variants: adapter-only, advisory reviewer, and required reviewer signoff in both English and Chinese
41
+ - completion and integrity audit now respect `Require Supervisor Review: true` as the actual hard-gate switch instead of treating every configured reviewer as automatically blocking
42
+ - design-supervisor review records now require explicit status, issue list, and revision outcome before they count as valid audit evidence
43
+ - Pencil lock waiting now sleeps without busy-spinning, reducing CPU waste while preserving the synchronous CLI/session contract
35
44
  - project-local `.pen` persistence now uses an MCP-snapshot-to-disk path instead of relying on headless interactive `save()`
36
45
  - redesign runs now seed a registered project-local `.pen` before the first Pencil edit and record persisted snapshot hashes for later sync checks
37
46
  - `da-vinci write-pen` now atomically writes workflow-owned `.pen` files from MCP-readable node and variable payloads with optional reopen verification
@@ -112,6 +121,9 @@ Route discipline:
112
121
  - `intake` and `continue` should usually generate a main `$da-vinci ...` or `/da-vinci ...` prompt
113
122
  - they should not default the user into `build`
114
123
  - `build` remains a direct expert route for workflows that are already implementation-ready
124
+ - `continue` should determine route selection from artifact and checkpoint truth first
125
+ - contextual checkpoint deltas are auxiliary recovery notes only and must not override routing
126
+ - if contextual deltas conflict with current artifacts, ignore them for routing and record the conflict
115
127
 
116
128
  ## Visual Assist Quick Start
117
129
 
@@ -124,6 +136,17 @@ Recommended default:
124
136
  - Preferred adapters:
125
137
  - ui-ux-pro-max
126
138
  - frontend-skill
139
+ - Design-supervisor reviewers:
140
+ - frontend-skill
141
+ - ui-ux-pro-max
142
+ - Design-supervisor review mode:
143
+ - screenshot-and-theme
144
+ - Design-supervisor review inputs:
145
+ - screenshots
146
+ - pencil variables
147
+ - visual thesis
148
+ - content plan
149
+ - interaction thesis
127
150
  - Scope:
128
151
  - visual contract refinement
129
152
  - page composition
@@ -134,6 +157,8 @@ Recommended default:
134
157
  - native-da-vinci
135
158
  - Require Adapter:
136
159
  - false
160
+ - Require Supervisor Review:
161
+ - false
137
162
  ```
138
163
 
139
164
  Use this when:
@@ -149,6 +174,17 @@ Quality-first redesign configuration:
149
174
  - Preferred adapters:
150
175
  - frontend-skill
151
176
  - ui-ux-pro-max
177
+ - Design-supervisor reviewers:
178
+ - frontend-skill
179
+ - ui-ux-pro-max
180
+ - Design-supervisor review mode:
181
+ - screenshot-and-theme
182
+ - Design-supervisor review inputs:
183
+ - screenshots
184
+ - pencil variables
185
+ - visual thesis
186
+ - content plan
187
+ - interaction thesis
152
188
  - Scope:
153
189
  - visual contract refinement
154
190
  - page composition
@@ -160,6 +196,8 @@ Quality-first redesign configuration:
160
196
  - native-da-vinci
161
197
  - Require Adapter:
162
198
  - true
199
+ - Require Supervisor Review:
200
+ - true
163
201
  ```
164
202
 
165
203
  Use this when:
@@ -187,6 +225,9 @@ Selection rules:
187
225
  - use only Pencil-supported properties; do not rely on web-only props such as `flex` or `margin`
188
226
  - keep `Fallback: native-da-vinci` unless you explicitly want missing adapters to block the workflow
189
227
  - keep `Require Adapter: false` by default and raise it to `true` only for design-critical work
228
+ - keep `Design-supervisor reviewers` separate from `Preferred adapters`; adapters lead first-pass composition, reviewers judge final style maturity
229
+ - keep `Require Supervisor Review: false` unless reviewer-backed style signoff is itself a delivery requirement
230
+ - `Require Supervisor Review: true` means missing, blocked, or unaccepted reviewer results should block broad expansion, implementation-task handoff, and terminal completion
190
231
  - keep `Scope` limited to presentation quality; do not use it to delegate behavior, routes, or state truth
191
232
 
192
233
  ## Core workflow
@@ -305,6 +346,11 @@ Checkpoint outcomes:
305
346
  - `WARN`
306
347
  - `BLOCK`
307
348
 
349
+ Context delta notes:
350
+
351
+ - keep concise `Context Delta` entries inside existing change artifacts (`pencil-design.md`, `tasks.md`, `verification.md`)
352
+ - treat contextual deltas as recovery aids, not as a second source of phase truth
353
+
308
354
  ## Execution Policy
309
355
 
310
356
  Da Vinci is `autonomous-by-default`.
@@ -320,6 +366,7 @@ Default behavior:
320
366
  - `PASS` -> continue
321
367
  - `WARN` -> record and continue
322
368
  - `BLOCK` -> stop only when the blocker cannot be resolved from existing artifacts or local context
369
+ - missing or status-mismatched contextual deltas -> warn and continue
323
370
 
324
371
  Typical stop conditions:
325
372
 
@@ -341,7 +388,7 @@ Rules:
341
388
  - `page-map.md` is the source of truth for implementation pages
342
389
  - `pencil-bindings.md` is the source of truth for implementation page -> Pencil page mapping
343
390
  - in `redesign-from-code`, existing code is behavior truth, not layout truth
344
- - in `overhaul-from-code`, existing code is reference evidence and migration baseline, not automatic final behavior truth
391
+ - in `overhaul-from-code`, existing code is reference evidence and migration baseline, not the final target behavior truth
345
392
  - complex pages should be decomposed into subpages, states, overlays, and implementation surfaces before Pencil redesign is treated as final
346
393
  - the preferred `.pen` path recorded in `design-registry.md` is workflow-owned state, not user-authored config
347
394
  - 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
@@ -441,6 +488,13 @@ da-vinci uninstall --platform codex,claude,gemini
441
488
  - `--mode integrity`: a mid-workflow filesystem-truth check for missing baseline artifacts, misplaced exports, polluted `.da-vinci/designs/`, and missing persisted `.pen` sources
442
489
  - `--mode completion`: a strict pre-completion gate for one change scope; use `--change <change-id>` and treat any failure as blocking
443
490
 
491
+ Context-delta integration in audit:
492
+
493
+ - missing, incomplete, or status-mismatched contextual delta entries are warning-level signals
494
+ - these warnings improve resume quality but do not introduce new completion failure gates by themselves
495
+ - expectation checks are automatic when an artifact includes `## Checkpoint Status` or `## MCP Runtime Gate`; no manual toggle is needed in normal workflows
496
+ - only add `Context Delta Required: true` (also accepts `yes` / `on` / `1`) for artifacts that intentionally opt in without those headings
497
+
444
498
  Both modes check the most common workflow-integrity failures in a project:
445
499
 
446
500
  - missing standard Da Vinci artifacts
@@ -456,16 +510,18 @@ Both modes check the most common workflow-integrity failures in a project:
456
510
  - warns when anchor-surface batches are too large and should be split before retrying
457
511
 
458
512
  When Pencil MCP is active, Da Vinci now also expects an MCP runtime gate record in `pencil-design.md` before terminal completion claims. That runtime gate checks live editor/source convergence separately from filesystem audit.
459
- During active redesign work, prefer running `da-vinci audit --mode integrity <project-path>` immediately after the first successful Pencil write, then use `da-vinci preflight-pencil` plus smaller follow-up batches if the same anchor surface rolls back twice.
513
+ During active redesign work, run `da-vinci audit --mode integrity <project-path>` immediately after the first successful Pencil write, then use `da-vinci preflight-pencil` plus smaller follow-up batches if the same anchor surface rolls back twice.
460
514
 
461
515
  Project-local `.pen` persistence now has two supported paths:
462
516
 
463
517
  - first-run path: seed the registered project-local `.pen` with `da-vinci ensure-pen --output <path> --verify-open`, open that exact path, then persist later MCP snapshot writes back to the same file
464
518
  - resume path: if a registered project-local `.pen` already exists, reopen it for continuity, but after material live edits persist a fresh live MCP snapshot back to that same path and run `da-vinci check-pen-sync`
465
519
 
520
+ On autonomous redesign runs, the session wrapper is required when it is available. Lower-level helpers remain available only when the wrapper truly cannot be used.
521
+
466
522
  Persistence helpers:
467
523
 
468
- - preferred wrapper:
524
+ - required wrapper on autonomous runs:
469
525
  - `da-vinci pencil-session begin --project <project-path> --pen <path>`
470
526
  - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
471
527
  - `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
@@ -592,6 +648,7 @@ $da-vinci use intake for this existing Android project.
592
648
  I need to globally replace the UI.
593
649
  Existing Android code is the behavior source of truth.
594
650
  HTML references are in /abs/path/to/mockups.
651
+ Treat this as full-delivery unless I explicitly narrow it to design-only.
595
652
  ```
596
653
 
597
654
  ### Continue after inventory and spec work
package/README.zh-CN.md CHANGED
@@ -30,10 +30,19 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
30
30
 
31
31
  最新已发布 npm 包:
32
32
 
33
- - `@xenonbyte/da-vinci-workflow@0.1.18`
33
+ - `@xenonbyte/da-vinci-workflow@0.1.20`
34
34
 
35
35
  已发布版本重点:
36
36
 
37
+ - `continue` 的选路与恢复规则现已统一:先看工件/checkpoint 真相,再把 Context Delta 当作辅助信息
38
+ - Context Delta 审计规则已强化:触发信号更精确、告警改为状态不一致语义,并补充 `supersedes` 校验与时间归一化
39
+ - checkpoint 相关工件默认自动启用 Context Delta 期望检查;只有少数无 checkpoint 标题的工件才需要显式 `Context Delta Required`
40
+ - `design-supervisor review` 现在成为正式的最终风格质量 gate,并通过 `Require Supervisor Review` 明确区分“建议性”与“硬门槛”
41
+ - `Visual Assist` 文档现在补全了 gate 顺序、每层 gate 怎么审,以及 screenshot review、layout hygiene、design checkpoint、design-supervisor review 之间的分叉规则
42
+ - 移动端、桌面端、Web、平板四套 `visual-assist-presets` 现在都提供三种明确变体:只有 adapter、reviewer 建议性审查、reviewer 硬签字,中英文一致
43
+ - completion / integrity audit 现在真正以 `Require Supervisor Review: true` 作为硬门槛开关,而不是只要配置 reviewer 就一律阻断
44
+ - `design-supervisor review` 记录现在必须有明确状态、问题列表和回改结果,才算有效审查证据
45
+ - Pencil 锁等待现在改成阻塞 sleep,不再 busy wait 空转 CPU,同时保留同步 CLI/session 的调用语义
37
46
  - 项目内 `.pen` 持久化现在改为“从 MCP 快照写回磁盘”的正式路径,不再依赖 headless interactive `save()`
38
47
  - 重设计流程现在要求在第一次 Pencil 编辑前先 seed 一个登记好的项目内 `.pen`,并记录后续持久化快照 hash 以便做同步校验
39
48
  - `da-vinci write-pen` 现在可以把 MCP 可读的节点和变量快照原子写成工作流管理的 `.pen` 文件,并可选地做 reopen 校验
@@ -89,7 +98,7 @@ Da Vinci 当前支持五种模式:
89
98
 
90
99
  ### `overhaul-from-code`
91
100
 
92
- 已有项目,但目标是做系统级大改版;现有代码仍然是迁移基线和参考证据,但不再天然等于新版本的最终行为真相。
101
+ 已有项目,但目标是做系统级大改版;现有代码是参考证据和迁移基线,不是新系统最终行为真相。
93
102
 
94
103
  ### `feature-change`
95
104
 
@@ -117,6 +126,9 @@ Da Vinci 当前支持五种模式:
117
126
  - `intake` 和 `continue` 通常应该回到主工作流入口,即 `$da-vinci ...` 或 `/da-vinci ...`
118
127
  - 它们不应该默认把用户直接导向 `build`
119
128
  - `build` 仍然保留,但它是给已经实现就绪的高级直接入口
129
+ - `continue` 的选路应先看工件和 checkpoint 真相,再看上下文补充信息
130
+ - Context Delta 只用于恢复上下文,不是阶段判定真相源
131
+ - 如果 Context Delta 与当前工件冲突,应该忽略冲突条目并按工件真相继续
120
132
 
121
133
  ## Visual Assist 快速上手
122
134
 
@@ -129,6 +141,17 @@ Da Vinci 当前支持五种模式:
129
141
  - Preferred adapters:
130
142
  - ui-ux-pro-max
131
143
  - frontend-skill
144
+ - Design-supervisor reviewers:
145
+ - frontend-skill
146
+ - ui-ux-pro-max
147
+ - Design-supervisor review mode:
148
+ - screenshot-and-theme
149
+ - Design-supervisor review inputs:
150
+ - screenshots
151
+ - pencil variables
152
+ - visual thesis
153
+ - content plan
154
+ - interaction thesis
132
155
  - Scope:
133
156
  - visual contract refinement
134
157
  - page composition
@@ -139,6 +162,8 @@ Da Vinci 当前支持五种模式:
139
162
  - native-da-vinci
140
163
  - Require Adapter:
141
164
  - false
165
+ - Require Supervisor Review:
166
+ - false
142
167
  ```
143
168
 
144
169
  适用场景:
@@ -154,6 +179,17 @@ Da Vinci 当前支持五种模式:
154
179
  - Preferred adapters:
155
180
  - frontend-skill
156
181
  - ui-ux-pro-max
182
+ - Design-supervisor reviewers:
183
+ - frontend-skill
184
+ - ui-ux-pro-max
185
+ - Design-supervisor review mode:
186
+ - screenshot-and-theme
187
+ - Design-supervisor review inputs:
188
+ - screenshots
189
+ - pencil variables
190
+ - visual thesis
191
+ - content plan
192
+ - interaction thesis
157
193
  - Scope:
158
194
  - visual contract refinement
159
195
  - page composition
@@ -165,6 +201,8 @@ Da Vinci 当前支持五种模式:
165
201
  - native-da-vinci
166
202
  - Require Adapter:
167
203
  - true
204
+ - Require Supervisor Review:
205
+ - true
168
206
  ```
169
207
 
170
208
  适用场景:
@@ -192,6 +230,9 @@ Da Vinci 当前支持五种模式:
192
230
  - 只使用 Pencil 支持的属性,不要继续使用 `flex`、`margin` 这类 Web 属性
193
231
  - 默认保留 `Fallback: native-da-vinci`
194
232
  - `Require Adapter` 默认保持 `false`,只有设计要求很高时再改成 `true`
233
+ - 把 `Design-supervisor reviewers` 和 `Preferred adapters` 分开;adapter 负责首轮设计引导,reviewer 负责最终风格质量把关
234
+ - `Require Supervisor Review` 默认保持 `false`,只有“reviewer 签字本身就是交付门槛”时才改成 `true`
235
+ - `Require Supervisor Review: true` 表示只要缺失、阻断、或未被接受的 reviewer 结果,就不能扩屏、交接实现或宣告完成
195
236
  - `Scope` 只管 presentation 质量,不要拿它去定义 behavior、route 或 state truth
196
237
 
197
238
  ## 核心工作流顺序
@@ -291,7 +332,7 @@ project/
291
332
  - `page-map.md` 是实现页面和状态的真相源
292
333
  - `pencil-bindings.md` 是实现页面到 Pencil 页面绑定的真相源
293
334
  - 在 `redesign-from-code` 里,现有代码只是真相行为,不是真相布局
294
- - 在 `overhaul-from-code` 里,现有代码是参考基线和迁移约束,不是新系统天然的最终行为真相
335
+ - 在 `overhaul-from-code` 里,现有代码是参考证据和迁移基线,不是新系统最终行为真相
295
336
  - 复杂页面在 Pencil 重设计前应该先拆成 subpage、state、overlay 和 implementation surface
296
337
  - `design-registry.md` 里登记的首选 `.pen` 路径属于工作流自动维护的状态,不应该依赖用户手工填写
297
338
  - 一旦进入 Pencil 设计,Da Vinci 应该使用或创建这个项目内 `.pen` 路径,而不是继续沿用当前随手打开的 Pencil 文档
@@ -368,6 +409,13 @@ da-vinci uninstall --platform codex,claude,gemini
368
409
  - `--mode integrity`:适合在工作进行中检查文件系统真相,比如基础工件缺失、导出路径错误、`.da-vinci/designs/` 被污染、项目内 `.pen` 没落盘
369
410
  - `--mode completion`:适合在宣称完成前做严格检查;配合 `--change <change-id>` 使用,任何失败都应视为阻断
370
411
 
412
+ Context Delta 与 audit 的关系:
413
+
414
+ - Context Delta 缺失、字段不完整或与最新 checkpoint 不一致时,属于告警(`WARN`)
415
+ - 这些告警用于提升续跑质量,不应单独变成新的 completion 失败门槛
416
+ - 当工件包含 `## Checkpoint Status` 或 `## MCP Runtime Gate` 时,期望检查会自动启用,正常流程不需要手动开关
417
+ - 只有在不包含这些标题但仍想启用检查时,才需要写 `Context Delta Required: true`(也支持 `yes` / `on` / `1`)
418
+
371
419
  两种模式都会检查项目里最常见的工作流完整性问题:
372
420
 
373
421
  - 标准 Da Vinci 工件缺失
@@ -383,16 +431,18 @@ da-vinci uninstall --platform codex,claude,gemini
383
431
  - 当 anchor-surface 批次太大时给出拆批警告,避免继续大块回滚
384
432
 
385
433
  当 Pencil MCP 可用时,Da Vinci 现在还要求在终态完成声明前,把 MCP runtime gate 结果记录到 `pencil-design.md`。这层 gate 负责检查 live editor/source convergence,与 filesystem audit 分工不同。
386
- 在重设计进行中,建议在第一次成功写入 Pencil 后立即运行 `da-vinci audit --mode integrity <project-path>`;如果同一个 anchor surface 连续回滚,则继续配合 `da-vinci preflight-pencil` 和更小的 follow-up batch。
434
+ 在重设计进行中,如果有 shell 能力,应在第一次成功写入 Pencil 后立即运行 `da-vinci audit --mode integrity <project-path>`;如果同一个 anchor surface 连续回滚,则继续配合 `da-vinci preflight-pencil` 和更小的 follow-up batch。
387
435
 
388
436
  项目内 `.pen` 持久化现在分成两条受支持路径:
389
437
 
390
438
  - 首次运行路径:先用 `da-vinci ensure-pen --output <path> --verify-open` seed 登记好的项目内 `.pen`,打开这个精确路径,然后把后续 MCP 快照持续写回同一个文件
391
439
  - 继续迭代路径:如果项目里原本已有登记的 `.pen`,先打开它继续工作;但发生实质性 live edit 后,要把当前 live MCP 快照重新持久化回同一路径,并运行 `da-vinci check-pen-sync`
392
440
 
393
- 推荐使用的持久化命令:
441
+ 如果是自治运行,session wrapper 只要可用就必须使用。只有 wrapper 确实不可用时,才退回底层 helper。
442
+
443
+ 持久化命令:
394
444
 
395
- - 优先使用封装好的 session 命令:
445
+ - 自治运行必须使用的 session 命令:
396
446
  - `da-vinci pencil-session begin --project <project-path> --pen <path>`
397
447
  - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
398
448
  - `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
@@ -502,6 +552,7 @@ $da-vinci use intake for this existing Android project.
502
552
  I need to globally replace the UI.
503
553
  Existing Android code is the behavior source of truth.
504
554
  HTML references are in /abs/path/to/mockups.
555
+ Treat this as full-delivery unless I explicitly narrow it to design-only.
505
556
  ```
506
557
 
507
558
  ### 已有工件后继续推进
package/SKILL.md CHANGED
@@ -16,7 +16,7 @@ Keep these rules fixed:
16
16
  - Tasks decide implementation order.
17
17
  - Code must follow both requirements and Pencil data.
18
18
  - Existing code is behavior truth, not layout truth, during `redesign-from-code`.
19
- - Existing code is reference evidence and migration baseline, not default final behavior truth, during `overhaul-from-code`.
19
+ - Existing code is reference evidence and migration baseline, not the final target behavior truth, during `overhaul-from-code`.
20
20
  - When requirements and Pencil drift apart, stop and update the source artifacts before continuing implementation.
21
21
 
22
22
  ## Execution Policy
@@ -136,8 +136,11 @@ Use these helper actions when the user needs help entering or resuming the workf
136
136
  - detected workflow state
137
137
  - gaps or blockers
138
138
  - one executable continuation prompt
139
+ - contextual recovery notes from recent checkpoint deltas when consistent with current artifacts
139
140
  - do not restart discovery if the artifacts already provide enough truth
140
141
  - do not default to `build` unless the project is clearly implementation-ready
142
+ - determine route selection from artifact and checkpoint truth first; contextual deltas are auxiliary and must not override routing
143
+ - if contextual deltas conflict with current artifacts, ignore them for routing and record the conflict
141
144
 
142
145
  ## V2 Mode Selection
143
146
 
@@ -253,7 +256,7 @@ During active Pencil work:
253
256
  - when shell access is available, preflight non-trivial `batch_design` operation strings before sending them to Pencil
254
257
  - prefer 12 or fewer operations on anchor-surface batches; if the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds
255
258
  - do not rely on headless interactive `save()` as the persistence truth; when live MCP edits exist, persist project-local `.pen` files from MCP-readable document snapshots
256
- - prefer the session wrapper commands:
259
+ - use the session wrapper commands on autonomous runs:
257
260
  `da-vinci pencil-session begin --project <project-path> --pen <path>`
258
261
  `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
259
262
  `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
@@ -277,6 +280,10 @@ During active Pencil work:
277
280
  - exported screenshots are review artifacts only; place them under `.da-vinci/changes/<change-id>/exports/` and never treat them as a substitute for the project-local `.pen` source
278
281
  - screenshot review is binding: if the review calls out hierarchy, spacing, clarity, inconsistency, or unresolved-placeholder issues, revise the screen before treating the checkpoint as `PASS`
279
282
  - screenshot review must record an explicit `PASS`, `WARN`, or `BLOCK` plus the concrete issue list and revision outcome; phrases such as "looks good" do not count as review evidence
283
+ - if `DA-VINCI.md` declares `Design-supervisor reviewers`, run `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint for the approved anchor set
284
+ - keep `Design-supervisor reviewers` separate from `Preferred adapters`; adapters lead the design pass, reviewers judge whether the final style quality is strong enough to expand or implement
285
+ - when `design-supervisor review` is active, review screenshots together with Pencil theme variables, `visual-thesis.md`, `content-plan.md`, and `interaction-thesis.md`, then record an explicit `PASS`, `WARN`, or `BLOCK` plus issue list and revision outcome in `pencil-design.md`
286
+ - if `DA-VINCI.md` sets `Require Supervisor Review: true`, treat missing, blocked, or unaccepted `design-supervisor review` as a blocker before broad expansion, implementation-task handoff, or terminal completion
280
287
 
281
288
  ## Load References On Demand
282
289
 
@@ -438,7 +445,7 @@ If the active mode is `redesign-from-code`:
438
445
  If the active mode is `overhaul-from-code`:
439
446
 
440
447
  - inventory current routes, pages, modules, key flows, integrations, and permission boundaries before redefining the target product
441
- - treat existing code as reference evidence and migration baseline rather than default final behavior truth
448
+ - treat existing code as reference evidence and migration baseline rather than the final target behavior truth
442
449
  - classify current system areas into `preserve`, `revise`, `retire`, and `unknown` in `migration-contract.md`
443
450
  - stabilize new `proposal.md` and `specs/` before broad Pencil design or implementation
444
451
  - update `page-map.md` to reflect the new target page set, not only the old route tree
@@ -727,6 +734,7 @@ Checkpoint handling:
727
734
  - `PASS`: continue automatically
728
735
  - `WARN`: record the issue and continue automatically
729
736
  - `BLOCK`: stop, report the blocker, and ask only if the blocker cannot be resolved from existing artifacts
737
+ - contextual-delta issues: warn and continue; do not treat missing/stale contextual notes as standalone blockers
730
738
 
731
739
  ## Drift Policy
732
740
 
@@ -15,11 +15,15 @@ Focus on:
15
15
  Output should include:
16
16
  - detected workflow state
17
17
  - missing or weak artifacts
18
+ - contextual recovery notes from recent checkpoint deltas when they are consistent with current artifacts
18
19
  - one primary `/da-vinci continue ...` prompt
19
20
  - one more conservative continuation prompt when useful
20
21
 
21
22
  Route discipline:
22
23
  - do not restart discovery if the current artifacts already contain enough truth
24
+ - determine route selection from artifact and checkpoint truth before reading contextual deltas
25
+ - use contextual deltas as auxiliary recovery context only; they must not override route selection
26
+ - if contextual deltas conflict with current artifacts, ignore them for routing and call out the conflict
23
27
  - do not default the user into `/dv:build` unless the project is clearly implementation-ready
24
28
  - if design artifacts exist but `tasks.md` does not, prefer a continuation prompt that moves into `/dv:tasks`
25
29
  - only prefer `/dv:build` once task generation and implementation readiness are already clear
@@ -20,10 +20,11 @@ Create or update:
20
20
  Run the `design checkpoint` before locking implementation tasks.
21
21
  Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
22
22
  If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
23
- Prefer the session wrapper commands: `da-vinci pencil-session begin`, `da-vinci pencil-session persist`, and `da-vinci pencil-session end`.
24
- Before the first Pencil edit, begin a Pencil session so the registered project-local `.pen` is seeded and locked before editing starts.
23
+ Require the session wrapper commands on autonomous runs: `da-vinci pencil-session begin`, `da-vinci pencil-session persist`, and `da-vinci pencil-session end`.
24
+ Before the first Pencil edit, require `da-vinci pencil-session begin` so the registered project-local `.pen` is seeded and locked before editing starts.
25
25
  If a registered project-local `.pen` already exists, reopen it for continuity but persist a fresh live MCP snapshot back to that same path through `pencil-session persist` after material edits.
26
26
  After the first successful Pencil write, run `da-vinci audit --mode integrity <project-path>` before broad expansion continues.
27
27
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
28
28
  Screenshot review must record an explicit `PASS`, `WARN`, or `BLOCK` plus the issue list and revision outcome; "looks good" is not a valid review record.
29
+ If `DA-VINCI.md` declares `Design-supervisor reviewers`, run `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint, then record the reviewers, inputs, status, issue list, and revision outcome in `pencil-design.md`. If `Require Supervisor Review: true`, treat missing, blocked, or unaccepted review results as blocking before broad expansion or terminal completion.
29
30
  Before reporting `design complete` or `workflow complete`, run `da-vinci audit --mode completion --change <change-id> <project-path>` and treat any failure as blocking.
@@ -15,11 +15,15 @@ Goal:
15
15
  Output should include:
16
16
  - detected workflow state
17
17
  - missing or weak artifacts
18
+ - contextual recovery notes from recent checkpoint deltas when they are consistent with current artifacts
18
19
  - one primary `$da-vinci continue ...` prompt
19
20
  - one more conservative continuation prompt when useful
20
21
 
21
22
  Route discipline:
22
23
  - do not restart discovery if the current artifacts already contain enough truth
24
+ - determine route selection from artifact and checkpoint truth before reading contextual deltas
25
+ - use contextual deltas as auxiliary recovery context only; they must not override route selection
26
+ - if contextual deltas conflict with current artifacts, ignore them for routing and call out the conflict
23
27
  - do not default the user into `/prompts:dv-build` unless the project is clearly implementation-ready
24
28
  - if design artifacts exist but `tasks.md` does not, prefer a continuation prompt that moves into `/prompts:dv-tasks`
25
29
  - only prefer `/prompts:dv-build` once task generation and implementation readiness are already clear
@@ -14,10 +14,11 @@ Output should move the work toward:
14
14
  Use Pencil-backed structure as the design source when available.
15
15
  Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
16
16
  If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
17
- Prefer the session wrapper commands: `da-vinci pencil-session begin`, `da-vinci pencil-session persist`, and `da-vinci pencil-session end`.
18
- Before the first Pencil edit, begin a Pencil session so the registered project-local `.pen` is seeded and locked before editing starts.
17
+ Require the session wrapper commands on autonomous runs: `da-vinci pencil-session begin`, `da-vinci pencil-session persist`, and `da-vinci pencil-session end`.
18
+ Before the first Pencil edit, require `da-vinci pencil-session begin` so the registered project-local `.pen` is seeded and locked before editing starts.
19
19
  If a registered project-local `.pen` already exists, reopen it for continuity but persist a fresh live MCP snapshot back to that same path through `pencil-session persist` after material edits.
20
20
  After the first successful Pencil write, run `da-vinci audit --mode integrity <project-path>` before broad expansion continues.
21
21
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
22
22
  Screenshot review must record an explicit `PASS`, `WARN`, or `BLOCK` plus the issue list and revision outcome; "looks good" is not a valid review record.
23
+ If `DA-VINCI.md` declares `Design-supervisor reviewers`, run `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint, then record the reviewers, inputs, status, issue list, and revision outcome in `pencil-design.md`. If `Require Supervisor Review: true`, treat missing, blocked, or unaccepted review results as blocking before broad expansion or terminal completion.
23
24
  Before claiming `design complete` or `workflow complete`, run `da-vinci audit --mode completion --change <change-id> <project-path>` and treat any failure as blocking.
@@ -14,11 +14,15 @@ Focus on:
14
14
  Output should include:
15
15
  - detected workflow state
16
16
  - missing or weak artifacts
17
+ - contextual recovery notes from recent checkpoint deltas when they are consistent with current artifacts
17
18
  - one primary `/da-vinci continue ...` prompt
18
19
  - one more conservative continuation prompt when useful
19
20
 
20
21
  Route discipline:
21
22
  - do not restart discovery if the current artifacts already contain enough truth
23
+ - determine route selection from artifact and checkpoint truth before reading contextual deltas
24
+ - use contextual deltas as auxiliary recovery context only; they must not override route selection
25
+ - if contextual deltas conflict with current artifacts, ignore them for routing and call out the conflict
22
26
  - do not default the user into `/dv:build` unless the project is clearly implementation-ready
23
27
  - if design artifacts exist but `tasks.md` does not, prefer a continuation prompt that moves into `/dv:tasks`
24
28
  - only prefer `/dv:build` once task generation and implementation readiness are already clear
@@ -13,11 +13,12 @@ Create or update:
13
13
  Use Pencil-backed page coverage as the source of presentation truth.
14
14
  Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
15
15
  If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
16
- Prefer the session wrapper commands: `da-vinci pencil-session begin`, `da-vinci pencil-session persist`, and `da-vinci pencil-session end`.
17
- Before the first Pencil edit, begin a Pencil session so the registered project-local `.pen` is seeded and locked before editing starts.
16
+ Require the session wrapper commands on autonomous runs: `da-vinci pencil-session begin`, `da-vinci pencil-session persist`, and `da-vinci pencil-session end`.
17
+ Before the first Pencil edit, require `da-vinci pencil-session begin` so the registered project-local `.pen` is seeded and locked before editing starts.
18
18
  If a registered project-local `.pen` already exists, reopen it for continuity but persist a fresh live MCP snapshot back to that same path through `pencil-session persist` after material edits.
19
19
  After the first successful Pencil write, run `da-vinci audit --mode integrity <project-path>` before broad expansion continues.
20
20
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
21
21
  Screenshot review must record an explicit `PASS`, `WARN`, or `BLOCK` plus the issue list and revision outcome; "looks good" is not a valid review record.
22
+ If `DA-VINCI.md` declares `Design-supervisor reviewers`, run `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint, then record the reviewers, inputs, status, issue list, and revision outcome in `pencil-design.md`. If `Require Supervisor Review: true`, treat missing, blocked, or unaccepted review results as blocking before broad expansion or terminal completion.
22
23
  Before reporting `design complete` or `workflow complete`, run `da-vinci audit --mode completion --change <change-id> <project-path>` and treat any failure as blocking.
23
24
  """
@@ -53,6 +53,7 @@ Use this when:
53
53
  - `DA-VINCI.md` already exists
54
54
  - `.da-vinci/` artifacts already exist
55
55
  - the workflow paused and needs to resume
56
+ - route selection should come from artifact/checkpoint truth first, then contextual deltas
56
57
 
57
58
  ### Run a mode directly
58
59
 
@@ -135,6 +136,8 @@ I need to globally replace the UI.
135
136
  Existing Android code is the behavior source of truth.
136
137
  UI reference directory: /abs/path/to/mockups
137
138
  Treat the HTML files there as presentation references only, not behavior truth.
139
+ Open the HTML references in a real browser and wait 3-5 seconds, or until the visual state settles, before judging the final styling.
140
+ Inventory which pages and states the reference directory actually covers and which still need to be inferred from behavior truth.
138
141
  Preserve business logic, navigation, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
139
142
  Inspect the real codebase first and determine whether the UI stack is Jetpack Compose, XML, or mixed.
140
143
  Inventory all activities, fragments, composable destinations, nav graphs, dialogs, bottom sheets, tabs, nested flows, shared shells, subpages, and important states.
@@ -149,6 +152,8 @@ $da-vinci use continue for this existing redesign-from-code workflow.
149
152
 
150
153
  Use the existing Da Vinci artifacts in this project.
151
154
  Existing code remains the behavior source of truth.
155
+ Determine route progression from current artifacts and checkpoints first.
156
+ Use contextual checkpoint deltas only as auxiliary recovery notes.
152
157
  Do not restart discovery unless an artifact is missing or clearly wrong.
153
158
  Do not stop at tasks.md.
154
159
  Continue into implementation and verification.
@@ -73,6 +73,7 @@ Outputs:
73
73
 
74
74
  - detected workflow state
75
75
  - missing or weak artifacts
76
+ - contextual recovery notes from recent checkpoint deltas when consistent with current artifacts
76
77
  - one primary continuation prompt
77
78
  - one conservative continuation prompt when useful
78
79
 
@@ -80,6 +81,8 @@ Important continuation rule:
80
81
 
81
82
  - if design exists but `tasks.md` does not, continuation should usually point to `tasks`
82
83
  - it should not promote `build` as a co-equal next step yet
84
+ - route selection should be derived from artifact and checkpoint truth before contextual deltas are consulted
85
+ - if contextual deltas conflict with current artifacts, ignore those deltas for route selection and report the conflict
83
86
 
84
87
  ### `/dv:breakdown`
85
88
 
@@ -116,6 +119,7 @@ This stage includes:
116
119
  - anchor-first design
117
120
  - screenshot review
118
121
  - layout hygiene
122
+ - design-supervisor review when configured
119
123
  - `.pen` persistence
120
124
  - design checkpoint
121
125
  - design-source checkpoint
@@ -63,7 +63,7 @@ Choose the mode by project start condition:
63
63
 
64
64
  4. `overhaul-from-code`
65
65
  - project already exists
66
- - current code is still migration evidence
66
+ - current code is reference evidence and migration baseline
67
67
  - flows, logic, information architecture, or UI are being broadly redefined
68
68
 
69
69
  5. `feature-change`
@@ -82,6 +82,8 @@ Common rule:
82
82
 
83
83
  - `intake` and `continue` should normally lead back to the main workflow entry
84
84
  - they should not default the user into `build` unless the project is already implementation-ready
85
+ - `continue` should determine route selection from artifact/checkpoint truth first, then use contextual deltas as auxiliary recovery notes
86
+ - if contextual deltas conflict with current artifacts, ignore those deltas for routing and record the conflict
85
87
 
86
88
  ---
87
89
 
@@ -143,7 +145,7 @@ Generate DA-VINCI.md, proposal, specs, page map, Pencil-backed launch pages, bin
143
145
 
144
146
  8. create `pencil-design.md`
145
147
  - record the generated Pencil screens
146
- - prefer `da-vinci pencil-session begin` before the first Pencil edit so the registered `.pen` is seeded and locked up front
148
+ - require `da-vinci pencil-session begin` before the first Pencil edit so the registered `.pen` is seeded and locked up front
147
149
  - if a registered project-local `.pen` already exists, reopen it for continuity but overwrite it from the current live MCP snapshot through `da-vinci pencil-session persist` after material live edits
148
150
  - keep screenshot exports under `.da-vinci/changes/<change-id>/exports/` rather than `.da-vinci/designs/`
149
151
 
@@ -502,7 +504,7 @@ Goal:
502
504
 
503
505
  ```text
504
506
  $da-vinci use overhaul-from-code to overhaul this existing product.
505
- Treat current code as migration evidence and reference baseline, not automatic final behavior truth.
507
+ Treat current code as reference evidence and migration baseline, not the final target behavior truth.
506
508
  Inventory the current system, define preserve/revise/retire/unknown boundaries, rewrite the target flows and specs, then generate Pencil-backed design work and implementation tasks.
507
509
  ```
508
510
 
@@ -544,7 +546,7 @@ Inventory the current system, define preserve/revise/retire/unknown boundaries,
544
546
  ### Where this mode differs from `redesign-from-code`
545
547
 
546
548
  - `redesign-from-code` keeps old code as behavior truth
547
- - `overhaul-from-code` treats old code as reference baseline and migration context
549
+ - `overhaul-from-code` treats old code as reference evidence and migration baseline
548
550
  - `redesign-from-code` is mainly for broad UI replacement
549
551
  - `overhaul-from-code` is for broad product rewrites on top of an existing system
550
552