@xenonbyte/da-vinci-workflow 0.1.24 → 0.1.26

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 (62) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/README.md +41 -10
  3. package/README.zh-CN.md +30 -10
  4. package/SKILL.md +4 -0
  5. package/commands/claude/dv/design.md +2 -1
  6. package/commands/codex/prompts/dv-design.md +2 -1
  7. package/commands/gemini/dv/design.toml +2 -1
  8. package/docs/constraint-files.md +1 -0
  9. package/docs/dv-command-reference.md +14 -2
  10. package/docs/pencil-rendering-workflow.md +9 -7
  11. package/docs/prompt-presets/README.md +4 -0
  12. package/docs/visual-assist-presets/README.md +4 -0
  13. package/docs/workflow-examples.md +13 -11
  14. package/docs/workflow-overview.md +2 -0
  15. package/docs/zh-CN/constraint-files.md +1 -0
  16. package/docs/zh-CN/dv-command-reference.md +14 -2
  17. package/docs/zh-CN/pencil-rendering-workflow.md +9 -7
  18. package/docs/zh-CN/prompt-presets/README.md +5 -1
  19. package/docs/zh-CN/visual-assist-presets/README.md +5 -1
  20. package/docs/zh-CN/workflow-examples.md +13 -11
  21. package/docs/zh-CN/workflow-overview.md +2 -0
  22. package/examples/greenfield-spec-markupflow/README.md +6 -1
  23. package/lib/async-offload-worker.js +26 -0
  24. package/lib/async-offload.js +82 -0
  25. package/lib/audit-parsers.js +223 -51
  26. package/lib/audit.js +91 -23
  27. package/lib/cli.js +749 -433
  28. package/lib/fs-safety.js +1 -4
  29. package/lib/icon-aliases.js +7 -7
  30. package/lib/icon-search.js +21 -14
  31. package/lib/icon-sync.js +220 -41
  32. package/lib/install.js +128 -60
  33. package/lib/mcp-runtime-gate.js +4 -7
  34. package/lib/pen-persistence.js +365 -46
  35. package/lib/pencil-lock.js +237 -25
  36. package/lib/pencil-preflight.js +233 -12
  37. package/lib/pencil-session.js +216 -36
  38. package/lib/supervisor-review.js +56 -34
  39. package/lib/utils.js +121 -0
  40. package/lib/workflow-bootstrap.js +255 -0
  41. package/package.json +13 -3
  42. package/references/artifact-templates.md +1 -0
  43. package/references/checkpoints.md +2 -0
  44. package/references/design-inputs.md +2 -0
  45. package/references/pencil-design-to-code.md +2 -0
  46. package/scripts/fixtures/complex-sample.pen +0 -295
  47. package/scripts/fixtures/mock-pencil.js +0 -49
  48. package/scripts/test-audit-context-delta.js +0 -446
  49. package/scripts/test-audit-design-supervisor.js +0 -537
  50. package/scripts/test-audit-safety.js +0 -92
  51. package/scripts/test-icon-aliases.js +0 -96
  52. package/scripts/test-icon-search.js +0 -77
  53. package/scripts/test-icon-sync.js +0 -178
  54. package/scripts/test-mcp-runtime-gate.js +0 -287
  55. package/scripts/test-mode-consistency.js +0 -339
  56. package/scripts/test-pen-persistence.js +0 -254
  57. package/scripts/test-pencil-lock.js +0 -130
  58. package/scripts/test-pencil-preflight.js +0 -169
  59. package/scripts/test-pencil-session.js +0 -192
  60. package/scripts/test-persistence-flows.js +0 -345
  61. package/scripts/test-supervisor-review-cli.js +0 -619
  62. package/scripts/test-supervisor-review-integration.js +0 -115
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.1.26 - 2026-03-31
4
+
5
+ ### Added
6
+ - `da-vinci check-pen-baseline` to compare project-local `.pen` hashes against external or secondary `.pen` sources before a new session write phase
7
+ - `da-vinci sync-pen-source` to sync the chosen latest `.pen` source back into the project-local baseline and refresh state metadata
8
+ - `pencil-session begin` support for multi-source baseline flags: `--baseline`, `--prefer-source`, and `--sync-preferred-source`
9
+ - new persistence/session/flow regression tests covering baseline divergence detection and explicit source sync recovery
10
+ - `da-vinci bootstrap-project` to scaffold a minimal `.da-vinci/` project spine, seed a workflow-owned project-local `.pen`, and optionally create change-level design artifacts
11
+ - release/doc alignment regression coverage for bootstrap scaffolding, package contents, and repo-head command documentation
12
+
13
+ ### Changed
14
+ - multi-source baseline policy now treats `pencil-session persist` as live-vs-project sync evidence only; cross-source freshness must be explicitly aligned before continuing edits
15
+ - design prompts, skill rules, and workflow docs now require baseline alignment checks when external `.pen` backups are present
16
+ - `pencil-lock` now recovers stale lock files only when the owning project no longer has an active Pencil session, with a short grace window to avoid begin-time races
17
+ - `pencil-session end --force` now records explicit `forceWithoutSync` session metadata, and completion audit now fails when a session was force-closed without final live sync verification
18
+ - `icon-sync` network fetch now follows HTTP redirects (with loop and redirect-limit protections) instead of assuming direct 2xx responses
19
+ - `audit` now suggests `da-vinci bootstrap-project` when required workflow artifacts are missing, instead of failing without a concrete hydration path
20
+ - `supervisor-review` retry backoff now supports `--review-retry-max-delay-ms` so repeated reviewer failures stay bounded
21
+ - `icon-sync` upstream source URLs are now configurable, and `icon-search` score weights are exported as named constants instead of relying on undocumented magic numbers
22
+ - `pencil-session` lifecycle rollback/release failures now preserve structured causes instead of mutating original error messages in place
23
+ - the main CI workflow can now attach the real reviewer bridge smoke job automatically when repository integration variables are enabled, while retaining the local core gate as the always-on baseline
24
+ - README and command-reference docs now document the `0.1.26` bootstrap/reviewer/CI release surface explicitly instead of leaving those changes as repo-head-only notes
25
+
26
+ ## v0.1.25 - 2026-03-29
27
+
28
+ ### Added
29
+ - `scripts/test-audit-design-supervisor.js` now covers Chinese legacy review headings (for example `## Design-Supervisor Review(第2轮尝试)`) and ensures structured fallback parsing remains deterministic
30
+ - `scripts/test-pen-persistence.js` now verifies metadata-payload error paths prefer concise relative paths when `--nodes-file` is under current working directory
31
+
32
+ ### Changed
33
+ - `pen-persistence` now formats `--nodes-file` metadata-payload error locations using relative paths when possible (absolute path fallback when outside cwd)
34
+ - design-supervisor heading parsing now accepts both ASCII and full-width parentheses in heading suffixes
35
+ - legacy round-attempt heading detection now supports both English `Round ... Attempt` and Chinese `第N轮尝试` variants
36
+
3
37
  ## v0.1.24 - 2026-03-29
4
38
 
5
39
  ### Added
@@ -9,7 +43,7 @@
9
43
  - `scripts/test-supervisor-review-integration.js` optional real `codex exec` smoke test (`DA_VINCI_RUN_SUPERVISOR_INTEGRATION=1`)
10
44
 
11
45
  ### Changed
12
- - supervisor-review audit parsing now accepts latest `## Design-Supervisor Review (Round X Attempt)` sections, multiline issue/outcome fields, and `Result` as a status alias
46
+ - supervisor-review audit parsing now prefers the latest structured `## Design-Supervisor Review` block, warns when the newest entry is a legacy/non-structured round attempt, and still supports multiline issue/outcome fields plus `Result` as a status alias
13
47
  - completion audit now enforces skill-backed supervisor evidence (`Review source: skill` + executed configured reviewers) when `Require Supervisor Review: true`
14
48
  - design prompts/skill docs now require configured reviewer skills to actually execute review before writing supervisor results
15
49
  - command references and constraint docs (EN/ZH) now document structured reviewer fields and required skill-backed behavior for hard-gate projects
package/README.md CHANGED
@@ -28,12 +28,17 @@ This workflow is intended for:
28
28
 
29
29
  Latest published npm package:
30
30
 
31
- - `@xenonbyte/da-vinci-workflow@0.1.24`
31
+ - `@xenonbyte/da-vinci-workflow@0.1.26`
32
32
 
33
- Release highlights:
33
+ Release highlights for `0.1.26`:
34
34
 
35
- - `da-vinci supervisor-review --run-reviewers` now supports configurable parallel reviewer execution and resilient retry backoff (`--review-concurrency`, `--review-retries`, `--review-retry-delay-ms`)
36
- - added optional `test:supervisor-review-integration` smoke coverage for real `codex exec` review runner flows (enabled via `DA_VINCI_RUN_SUPERVISOR_INTEGRATION=1`)
35
+ - `da-vinci bootstrap-project --project <path> [--change <id>]` now scaffolds the minimum `.da-vinci/` artifact spine, seeds a workflow-owned project-local `.pen`, and gives a concrete next-step handoff into `pencil-session begin`
36
+ - audit failures now suggest `da-vinci bootstrap-project` when the project is missing the required `.da-vinci/` structure, reducing “hard fail with no recovery path” friction
37
+ - `da-vinci supervisor-review --run-reviewers` now supports configurable parallel reviewer execution, resilient retry backoff, and capped retry delay (`--review-concurrency`, `--review-retries`, `--review-retry-delay-ms`, `--review-retry-max-delay-ms`)
38
+ - real `codex exec` reviewer smoke remains opt-in, but the main CI workflow can now attach that smoke job automatically when repository integration variables are enabled; the separate `reviewer-bridge-smoke` workflow remains available for manual/weekly runs
39
+ - `icon-sync` now supports configurable source URLs, and `icon-search` exports named scoring weights instead of relying on undocumented magic numbers
40
+ - supervisor-review parsing now explicitly handles legacy Chinese round-attempt headings (for example `## Design-Supervisor Review(第2轮尝试)`) and keeps canonical structured review fallback deterministic
41
+ - `--nodes-file` metadata-payload guard now reports shorter relative file paths when possible, while preserving absolute-path fallback outside current working directory
37
42
  - audit parser logic is now split into `lib/audit-parsers.js`, reducing `lib/audit.js` size and making maintenance safer
38
43
  - recursive file traversal now uses bounded safe scans with depth/count limits and symlink skipping
39
44
  - completion/integrity audit now rejects out-of-root `.pen` references from `design-registry.md`
@@ -83,7 +88,7 @@ Release highlights:
83
88
  - prompt-entry helper routes for `intake`, `prompt`, and `continue` are now published across Codex, Claude, and Gemini
84
89
  - Chinese companion docs are now intentionally limited to `README.zh-CN.md` and `docs/zh-CN/`
85
90
  - asset validation now covers the full shipped documentation set
86
- - `da-vinci status` now validates full installed asset sets across Codex, Claude, and Gemini
91
+ - `da-vinci status` now validates full installed asset sets across Codex, Claude, and Gemini, and flags stale or locally modified copies
87
92
  - Claude and Gemini command adapters now use self-contained workflow wording after installation
88
93
  - `.npmrc` and `openspec/` are kept local-only and are no longer versioned or shipped in the npm package
89
94
  - Node-first install, uninstall, status, and asset validation commands remain the supported distribution path
@@ -302,6 +307,14 @@ Placement rules:
302
307
  - keep change-specific workflow files in `.da-vinci/changes/<change-id>/`
303
308
  - do not scatter `proposal.md`, `tasks.md`, and `verification.md` across the project root
304
309
 
310
+ If a repo does not have this scaffold yet, hydrate the minimum project spine first:
311
+
312
+ ```bash
313
+ da-vinci bootstrap-project --project /abs/path/to/project --change <change-id>
314
+ ```
315
+
316
+ That command creates the required project-level files, seeds a default project-local `.pen`, and lays down the minimum change-level design artifacts expected by the current workflow.
317
+
305
318
  ## Checkpoints
306
319
 
307
320
  Da Vinci uses these checkpoints:
@@ -366,8 +379,12 @@ Rules:
366
379
  - complex pages should be decomposed into subpages, states, overlays, and implementation surfaces before Pencil redesign is treated as final
367
380
  - the preferred `.pen` path recorded in `design-registry.md` is workflow-owned state, not user-authored config
368
381
  - 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
382
+ - in multi-source scenarios (for example project-local `.pen` plus an external backup `.pen`), do not assume the project file is globally latest just because a prior `pencil-session persist` succeeded
383
+ - before a new edit round starts, compare hashes explicitly across sources and confirm source priority
384
+ - if an external source is selected as latest, sync it into the project-local `.pen` before further live edits
369
385
  - if Pencil MCP edits a live document but does not materialize the shell-visible project file automatically, the workflow should reconstruct and write the `.pen` file under the registered path before treating the design pass as traceable
370
386
  - before `pencil-bindings.md` or implementation tasks are treated as safe, `design-source checkpoint` should confirm that the registered path, the active Pencil source, and the shell-visible `.pen` file converge on the same project-local source
387
+ - in multi-source scenarios (for example external backup `.pen` files), a successful `pencil-session persist` only proves live-vs-project sync for that run; it does not prove the project file is globally latest until cross-source hash alignment is confirmed
371
388
 
372
389
  Optional visual-adapter policy:
373
390
 
@@ -506,7 +523,7 @@ Both modes check the most common workflow-integrity failures in a project:
506
523
  - writes `Configured reviewers`, `Executed reviewers`, `Review source`, `Status`, `Issue list`, and `Revision outcome` into `pencil-design.md` when `--write` is provided
507
524
  - accepts explicit status input (`--status PASS|WARN|BLOCK`) or can infer a conservative status from current design artifacts
508
525
  - for required supervisor gates, prefer `--run-reviewers --write` so configured reviewer skills execute and the record is persisted in one step
509
- - reviewer execution tuning is available via `--review-concurrency`, `--review-retries`, and `--review-retry-delay-ms` (exponential backoff)
526
+ - reviewer execution tuning is available via `--review-concurrency`, `--review-retries`, `--review-retry-delay-ms`, and `--review-retry-max-delay-ms` (bounded exponential backoff)
510
527
  - keeps `design-supervisor review` available as a compatibility alias
511
528
 
512
529
  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.
@@ -516,15 +533,18 @@ Project-local `.pen` persistence now has two supported paths:
516
533
 
517
534
  - 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
518
535
  - 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`
536
+ - multi-source guard: when external `.pen` sources also exist, run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before each new `pencil-session begin`; if hashes diverge, confirm source priority explicitly and sync the chosen source into `<project-pen>` before new edits
519
537
 
520
538
  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
539
 
522
540
  Persistence helpers:
523
541
 
524
542
  - required wrapper on autonomous runs:
525
- - `da-vinci pencil-session begin --project <project-path> --pen <path>`
543
+ - `da-vinci pencil-session begin --project <project-path> --pen <path> [--baseline <path>] [--prefer-source <path>] [--sync-preferred-source]`
526
544
  - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
527
545
  - `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
546
+ - `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>[,<other-pen>...] [--prefer-source <path>]`
547
+ - `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`
528
548
  - `da-vinci ensure-pen --output <path> --verify-open`
529
549
  - `da-vinci write-pen --output <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version> --verify-open`
530
550
  - `da-vinci check-pen-sync --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
@@ -591,13 +611,13 @@ Entry helpers:
591
611
  /dv:continue
592
612
  ```
593
613
 
594
- ## Repo-local forward test
614
+ ## Repo-local forward-test reference
595
615
 
596
- A complete repo-local forward test is available at:
616
+ A documentation-first repo-local forward-test reference is available at:
597
617
 
598
618
  - `examples/greenfield-spec-markupflow/`
599
619
 
600
- That example runs a `greenfield-spec` scenario from:
620
+ That example records a `greenfield-spec` scenario from:
601
621
 
602
622
  1. design brief
603
623
  2. proposal and spec
@@ -608,6 +628,17 @@ That example runs a `greenfield-spec` scenario from:
608
628
  7. static HTML delivery
609
629
  8. verification
610
630
 
631
+ It is not a drop-in `da-vinci audit` fixture. The example keeps its walkthrough artifacts at the repository root for readability; the current audit commands expect a hydrated `.da-vinci/` tree plus persisted session/state metadata.
632
+
633
+ If you want to turn that example shape into a runnable audit scaffold, start by hydrating a real project tree with `da-vinci bootstrap-project --project <project-path> --change <change-id>`.
634
+
635
+ For reviewer bridge coverage:
636
+
637
+ - default CI always runs the core local test gate (`npm run quality:ci:core`)
638
+ - when repository integration variables are enabled, the main CI workflow also runs the real reviewer bridge smoke job
639
+ - the real `codex exec` reviewer smoke remains opt-in via `DA_VINCI_RUN_SUPERVISOR_INTEGRATION=1 npm run test:supervisor-review-integration`
640
+ - `.github/workflows/reviewer-bridge-smoke.yml` provides a dedicated manual/weekly smoke workflow; when enabled, it treats missing integration wiring as a hard failure instead of silently `SKIP`-ing
641
+
611
642
  ## Example requests
612
643
 
613
644
  ### Greenfield spec
package/README.zh-CN.md CHANGED
@@ -30,12 +30,17 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
30
30
 
31
31
  最新已发布 npm 包:
32
32
 
33
- - `@xenonbyte/da-vinci-workflow@0.1.24`
33
+ - `@xenonbyte/da-vinci-workflow@0.1.26`
34
34
 
35
- 已发布版本重点:
35
+ `0.1.26` 版本重点:
36
36
 
37
- - `da-vinci supervisor-review --run-reviewers` 现已支持 reviewer 并发执行与失败重试退避(`--review-concurrency`、`--review-retries`、`--review-retry-delay-ms`)
38
- - 新增可选 `test:supervisor-review-integration` 烟测,用于覆盖真实 `codex exec` 评审执行链路(通过 `DA_VINCI_RUN_SUPERVISOR_INTEGRATION=1` 启用)
37
+ - 新增 `da-vinci bootstrap-project --project <path> [--change <id>]`,可快速生成最小 `.da-vinci/` 工件骨架、seed 一个工作流管理的项目内 `.pen`,并给出后续 `pencil-session begin` 的明确下一步
38
+ - audit 现在在缺少 `.da-vinci/` 或关键工件时,会直接提示可执行的 `da-vinci bootstrap-project` 修复命令,不再只报硬错误
39
+ - `da-vinci supervisor-review --run-reviewers` 现已支持 reviewer 并发执行、失败重试退避,以及最大退避封顶(`--review-concurrency`、`--review-retries`、`--review-retry-delay-ms`、`--review-retry-max-delay-ms`)
40
+ - 真实 `codex exec` reviewer bridge 仍然是 opt-in,但主 CI workflow 现在在仓库变量已配置时也能自动挂上 reviewer smoke job;独立的 `reviewer-bridge-smoke` workflow 仍保留给手动/定时烟测
41
+ - `icon-sync` 现在支持可配置的上游 source URL,`icon-search` 评分权重也改成了具名常量,降低后续维护成本
42
+ - supervisor-review 解析现已显式覆盖中文 legacy 轮次标题(例如 `## Design-Supervisor Review(第2轮尝试)`),并保持“优先结构化评审块”的回退策略可预测
43
+ - `--nodes-file` 元数据误传保护现在优先输出更短的相对路径(在 cwd 外仍回退绝对路径),便于日志阅读
39
44
  - audit 解析职责已拆分到 `lib/audit-parsers.js`,`lib/audit.js` 体量下降,可维护性更好
40
45
  - 递归文件扫描改为安全有界遍历:增加深度/数量上限,并跳过符号链接
41
46
  - completion/integrity audit 现在会拦截并忽略 `design-registry.md` 中越出项目根目录的 `.pen` 引用
@@ -85,11 +90,11 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
85
90
  - `intake`、`prompt`、`continue` 三个提示词入口辅助路由已随 Codex、Claude、Gemini 一起发布
86
91
  - 中文配套文档现在刻意只保留 `README.zh-CN.md` 和 `docs/zh-CN/`
87
92
  - 资产校验现在覆盖完整的随包文档集合
88
- - `da-vinci status` 会校验 Codex、Claude、Gemini 的完整安装资产
93
+ - `da-vinci status` 会校验 Codex、Claude、Gemini 的完整安装资产,并标记陈旧或被本地改写的副本
89
94
  - Claude 和 Gemini 安装后的命令文案已改为自洽的工作流措辞
90
95
  - `.npmrc` 和 `openspec/` 现在只本地保留,不再进入版本管理和 npm 包
91
96
  - 安装、卸载、状态、资产校验都通过 Node CLI 提供
92
- - 仓库内含一个 `greenfield-spec` 的本地 forward test
97
+ - 仓库内含一个 `greenfield-spec` 的本地 forward-test 参考示例(文档优先,不是可直接通过 `da-vinci audit` 的 `.da-vinci/` 审计夹具)
93
98
 
94
99
  ## 支持的工作流模式
95
100
 
@@ -298,6 +303,14 @@ project/
298
303
  - 项目内持久化的 Pencil `.pen` 文件默认放在 `.da-vinci/designs/`
299
304
  - change 级工件放在 `.da-vinci/changes/<change-id>/`
300
305
 
306
+ 如果项目还没有这套基础骨架,可以先执行:
307
+
308
+ ```bash
309
+ da-vinci bootstrap-project --project /abs/path/to/project --change <change-id>
310
+ ```
311
+
312
+ 这个命令会先生成项目级 `.da-vinci/` 工件、默认项目内 `.pen`,以及当前工作流所要求的最小 change 级设计工件。
313
+
301
314
  ## 设计源规则
302
315
 
303
316
  - `DA-VINCI.md` 是跨页面视觉一致性的项目级视觉契约
@@ -310,8 +323,12 @@ project/
310
323
  - 复杂页面在 Pencil 重设计前应该先拆成 subpage、state、overlay 和 implementation surface
311
324
  - `design-registry.md` 里登记的首选 `.pen` 路径属于工作流自动维护的状态,不应该依赖用户手工填写
312
325
  - 一旦进入 Pencil 设计,Da Vinci 应该使用或创建这个项目内 `.pen` 路径,而不是继续沿用当前随手打开的 Pencil 文档
326
+ - 在多设计源场景(例如项目内 `.pen` + 外部备份 `.pen`)下,不能因为上一轮 `pencil-session persist` 成功就默认项目内文件一定是全局最新
327
+ - 新一轮编辑前要先做跨源 hash 对齐并明确来源优先级
328
+ - 如果外部源被确认是最新,先把它同步回项目内 `.pen`,再继续 live 编辑
313
329
  - 如果 Pencil MCP 修改了 live 文档但没有自动把项目内 `.pen` 文件落到磁盘,工作流应该先把该 `.pen` 文件补写到登记路径,再把这轮设计当成可追踪结果
314
330
  - 在进入 `pencil-bindings.md` 和实现任务前,应该先通过 `design-source checkpoint`,确认登记路径、当前设计源和 shell 可见 `.pen` 文件已经收敛成同一个项目级来源
331
+ - 多设计源场景(例如存在外部备份 `.pen`)下,`pencil-session persist` 成功只代表“本轮 live 与项目内 `.pen` 同步”,不等于“项目内文件一定是全局最新”;继续前必须做跨源 hash 对齐
315
332
 
316
333
  可选 visual adapter 规则:
317
334
 
@@ -426,9 +443,9 @@ Context Delta 与 audit 的关系:
426
443
 
427
444
  - 加上 `--write` 时,会把 `Configured reviewers`、`Executed reviewers`、`Review source`、`Status`、`Issue list`、`Revision outcome` 写入 `pencil-design.md`
428
445
  - 可通过 `--status PASS|WARN|BLOCK` 显式指定,也可基于当前设计工件做保守推断
429
- - 对 required supervisor gate,优先使用 `--run-reviewers --write`,让 reviewer skills 执行与结果持久化一体完成
430
- - reviewer 执行参数可通过 `--review-concurrency`、`--review-retries`、`--review-retry-delay-ms` 调优(指数退避)
431
- - `design-supervisor review` 作为兼容别名仍可使用
446
+ - 对 required supervisor gate,优先使用 `--run-reviewers --write`,让配置的 reviewer skill 真正执行并一次落盘
447
+ - reviewer 执行参数可通过 `--review-concurrency`、`--review-retries`、`--review-retry-delay-ms`、`--review-retry-max-delay-ms` 调优(带上限的指数退避)
448
+ - `design-supervisor review` 兼容别名仍然保留
432
449
 
433
450
  当 Pencil MCP 可用时,Da Vinci 现在还要求在终态完成声明前,把 MCP runtime gate 结果记录到 `pencil-design.md`。这层 gate 负责检查 live editor/source convergence,与 filesystem audit 分工不同。
434
451
  在重设计进行中,如果有 shell 能力,应在第一次成功写入 Pencil 后立即运行 `da-vinci audit --mode integrity <project-path>`;如果同一个 anchor surface 连续回滚,则继续配合 `da-vinci preflight-pencil` 和更小的 follow-up batch。
@@ -437,15 +454,18 @@ Context Delta 与 audit 的关系:
437
454
 
438
455
  - 首次运行路径:先用 `da-vinci ensure-pen --output <path> --verify-open` seed 登记好的项目内 `.pen`,打开这个精确路径,然后把后续 MCP 快照持续写回同一个文件
439
456
  - 继续迭代路径:如果项目里原本已有登记的 `.pen`,先打开它继续工作;但发生实质性 live edit 后,要把当前 live MCP 快照重新持久化回同一路径,并运行 `da-vinci check-pen-sync`
457
+ - 多源门禁:如果还存在外部 `.pen` 源,每次新一轮 `pencil-session begin` 前先运行 `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>`;若 hash 不一致,必须先确认来源优先级并把选中的来源同步回 `<project-pen>`
440
458
 
441
459
  如果是自治运行,session wrapper 只要可用就必须使用。只有 wrapper 确实不可用时,才退回底层 helper。
442
460
 
443
461
  持久化命令:
444
462
 
445
463
  - 自治运行必须使用的 session 命令:
446
- - `da-vinci pencil-session begin --project <project-path> --pen <path>`
464
+ - `da-vinci pencil-session begin --project <project-path> --pen <path> [--baseline <path>] [--prefer-source <path>] [--sync-preferred-source]`
447
465
  - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
448
466
  - `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
467
+ - `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>[,<other-pen>...] [--prefer-source <path>]`
468
+ - `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`
449
469
  - `da-vinci ensure-pen --output <path> --verify-open`
450
470
  - `da-vinci write-pen --output <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version> --verify-open`
451
471
  - `da-vinci check-pen-sync --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
package/SKILL.md CHANGED
@@ -260,6 +260,9 @@ During active Pencil work:
260
260
  `da-vinci pencil-session begin --project <project-path> --pen <path>`
261
261
  `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
262
262
  `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
263
+ - when multiple `.pen` sources exist (for example external backups), run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before a new `pencil-session begin`
264
+ - if baseline hashes diverge, do not treat the previous `persist` success as global freshness; confirm source priority explicitly (`--prefer-source`) and sync the chosen source into the project-local `.pen` before new edits
265
+ - use `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>` when an external source is selected as latest and must be materialized into the project-local baseline
263
266
  - before the first Pencil edit on a redesign pass, begin a Pencil session so the registered project-local `.pen` exists before editing and the global Pencil lock is held for that project
264
267
  - acquire the global Pencil lock before MCP write operations on a project and release it after the write phase so two projects do not compete for the same active editor
265
268
  - when a registered project-local `.pen` already exists, reopen it for continuity, but after material live edits persist a fresh MCP snapshot back to that same path instead of assuming live edits were flushed automatically
@@ -283,6 +286,7 @@ During active Pencil work:
283
286
  - if `DA-VINCI.md` declares `Design-supervisor reviewers`, run an explicit review pass with those reviewer skills on the approved anchor set, then persist the structured result with `da-vinci supervisor-review --project <project-path> --change <change-id> --run-reviewers --write` (or the compatibility alias `design-supervisor review --run-reviewers --write`)
284
287
  - 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
288
  - when `design-supervisor review` is active, review screenshots together with Pencil theme variables, `visual-thesis.md`, `content-plan.md`, and `interaction-thesis.md`; record `Configured reviewers`, `Executed reviewers`, `Review source`, explicit `PASS`/`WARN`/`BLOCK`, issue list, and revision outcome in `pencil-design.md`
289
+ - do not hand-write ad-hoc headings such as `## Design-Supervisor Review (Round X Attempt)`; use `da-vinci supervisor-review --write` (or overwrite the canonical `## Design-Supervisor Review` block) so audit can consume structured evidence deterministically
286
290
  - 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
287
291
 
288
292
  ## Load References On Demand
@@ -22,9 +22,10 @@ Before non-trivial `batch_design` calls, preflight the Pencil operations when sh
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
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
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
+ When multiple `.pen` sources exist (for example an external backup), run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before `pencil-session begin`. If hashes diverge, confirm source priority explicitly and sync the chosen source into the project-local `.pen` (for example `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`) before continuing edits.
25
26
  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
27
  After the first successful Pencil write, run `da-vinci audit --mode integrity <project-path>` before broad expansion continues.
27
28
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
28
29
  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`, execute those reviewer skills on the approved anchor screenshots (do not skip to inferred review), then persist the structured result via `da-vinci supervisor-review --project <project-path> --change <change-id> --run-reviewers --write` (or the compatibility alias `design-supervisor review --run-reviewers --write`). Record configured/ executed reviewers, review source, status, issue list, and revision outcome in `pencil-design.md`. If `Require Supervisor Review: true`, treat missing, blocked, unaccepted, or non-skill-backed review results as blocking before broad expansion or terminal completion.
30
+ If `DA-VINCI.md` declares `Design-supervisor reviewers`, execute those reviewer skills on the approved anchor screenshots (do not skip to inferred review), then persist the structured result via `da-vinci supervisor-review --project <project-path> --change <change-id> --run-reviewers --write` (or the compatibility alias `design-supervisor review --run-reviewers --write`). Record configured/ executed reviewers, review source, status, issue list, and revision outcome in `pencil-design.md`. Do not add ad-hoc headings like `## Design-Supervisor Review (Round X Attempt)`; keep a canonical structured section so audit can parse it deterministically. If `Require Supervisor Review: true`, treat missing, blocked, unaccepted, or non-skill-backed review results as blocking before broad expansion or terminal completion.
30
31
  Before reporting `design complete` or `workflow complete`, run `da-vinci audit --mode completion --change <change-id> <project-path>` and treat any failure as blocking.
@@ -16,9 +16,10 @@ Before non-trivial `batch_design` calls, preflight the Pencil operations when sh
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
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
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
+ When multiple `.pen` sources exist (for example an external backup), run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before `pencil-session begin`. If hashes diverge, confirm source priority explicitly and sync the chosen source into the project-local `.pen` (for example `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`) before continuing edits.
19
20
  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
21
  After the first successful Pencil write, run `da-vinci audit --mode integrity <project-path>` before broad expansion continues.
21
22
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
22
23
  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`, execute those reviewer skills on the approved anchor screenshots (do not skip to inferred review), then persist the structured result via `da-vinci supervisor-review --project <project-path> --change <change-id> --run-reviewers --write` (or the compatibility alias `design-supervisor review --run-reviewers --write`). Record configured/ executed reviewers, review source, status, issue list, and revision outcome in `pencil-design.md`. If `Require Supervisor Review: true`, treat missing, blocked, unaccepted, or non-skill-backed review results as blocking before broad expansion or terminal completion.
24
+ If `DA-VINCI.md` declares `Design-supervisor reviewers`, execute those reviewer skills on the approved anchor screenshots (do not skip to inferred review), then persist the structured result via `da-vinci supervisor-review --project <project-path> --change <change-id> --run-reviewers --write` (or the compatibility alias `design-supervisor review --run-reviewers --write`). Record configured/ executed reviewers, review source, status, issue list, and revision outcome in `pencil-design.md`. Do not add ad-hoc headings like `## Design-Supervisor Review (Round X Attempt)`; keep a canonical structured section so audit can parse it deterministically. If `Require Supervisor Review: true`, treat missing, blocked, unaccepted, or non-skill-backed review results as blocking before broad expansion or terminal completion.
24
25
  Before claiming `design complete` or `workflow complete`, run `da-vinci audit --mode completion --change <change-id> <project-path>` and treat any failure as blocking.
@@ -15,10 +15,11 @@ Before non-trivial `batch_design` calls, preflight the Pencil operations when sh
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
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
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
+ When multiple `.pen` sources exist (for example an external backup), run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before `pencil-session begin`. If hashes diverge, confirm source priority explicitly and sync the chosen source into the project-local `.pen` (for example `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`) before continuing edits.
18
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.
19
20
  After the first successful Pencil write, run `da-vinci audit --mode integrity <project-path>` before broad expansion continues.
20
21
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
21
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.
22
- If `DA-VINCI.md` declares `Design-supervisor reviewers`, execute those reviewer skills on the approved anchor screenshots (do not skip to inferred review), then persist the structured result via `da-vinci supervisor-review --project <project-path> --change <change-id> --run-reviewers --write` (or the compatibility alias `design-supervisor review --run-reviewers --write`). Record configured/ executed reviewers, review source, status, issue list, and revision outcome in `pencil-design.md`. If `Require Supervisor Review: true`, treat missing, blocked, unaccepted, or non-skill-backed review results as blocking before broad expansion or terminal completion.
23
+ If `DA-VINCI.md` declares `Design-supervisor reviewers`, execute those reviewer skills on the approved anchor screenshots (do not skip to inferred review), then persist the structured result via `da-vinci supervisor-review --project <project-path> --change <change-id> --run-reviewers --write` (or the compatibility alias `design-supervisor review --run-reviewers --write`). Record configured/ executed reviewers, review source, status, issue list, and revision outcome in `pencil-design.md`. Do not add ad-hoc headings like `## Design-Supervisor Review (Round X Attempt)`; keep a canonical structured section so audit can parse it deterministically. If `Require Supervisor Review: true`, treat missing, blocked, unaccepted, or non-skill-backed review results as blocking before broad expansion or terminal completion.
23
24
  Before reporting `design complete` or `workflow complete`, run `da-vinci audit --mode completion --change <change-id> <project-path>` and treat any failure as blocking.
24
25
  """
@@ -46,6 +46,7 @@ The workflow audit currently parses specific fields. Keep these names stable.
46
46
  - `Revision outcome`
47
47
 
48
48
  When supervisor review is required, missing, blocked, unaccepted, or non-skill-backed review evidence blocks completion.
49
+ Avoid ad-hoc headings such as `## Design-Supervisor Review (Round X Attempt)`; keep a canonical structured supervisor-review section (prefer `da-vinci supervisor-review --write`) so audit can parse the latest review deterministically.
49
50
 
50
51
  ## Advisory Constraint Sections (Customizable)
51
52
 
@@ -47,12 +47,24 @@ These commands do not replace route selection, but they support design execution
47
47
  - `da-vinci icon-search --query "<text>" [--family ...] [--top ...] [--aliases ...]`
48
48
  - resolve likely `icon_font` names before writing Pencil `batch_design` operations
49
49
  - supports mixed EN/ZH terms and optional alias expansion via `~/.da-vinci/icon-aliases.json`
50
- - `da-vinci supervisor-review --project <path> --change <id> [--run-reviewers] [--review-concurrency <value>] [--review-retries <value>] [--review-retry-delay-ms <value>] [--source <skill|manual|inferred>] [--executed-reviewers <csv>] [--status ...] [--issue-list ...] [--revision-outcome ...] [--write]`
50
+ - `da-vinci bootstrap-project --project <path> [--change <id>] [--force]`
51
+ - scaffold the minimum `.da-vinci/` workflow spine for a repo that has not been hydrated yet
52
+ - seeds a workflow-owned project-local `.pen` under `.da-vinci/designs/`
53
+ - optionally creates the current change-level design artifacts (`design-brief.md`, `design.md`, `pencil-design.md`, `pencil-bindings.md`)
54
+ - use this before the first strict `audit` run when starting from an empty repo, a doc-first example, or a partially hydrated workspace
55
+ - `da-vinci supervisor-review --project <path> --change <id> [--run-reviewers] [--review-concurrency <value>] [--review-retries <value>] [--review-retry-delay-ms <value>] [--review-retry-max-delay-ms <value>] [--source <skill|manual|inferred>] [--executed-reviewers <csv>] [--status ...] [--issue-list ...] [--revision-outcome ...] [--write]`
51
56
  - persists a structured supervisor-review record (`Configured reviewers`, `Executed reviewers`, `Review source`, `Status`, `Issue list`, `Revision outcome`) in `pencil-design.md`
52
57
  - use `--run-reviewers --write` for one-step execution + record persistence through configured reviewer skills
53
- - `--review-concurrency`, `--review-retries`, and `--review-retry-delay-ms` control parallelism and retry backoff for reviewer execution
58
+ - `--review-concurrency`, `--review-retries`, `--review-retry-delay-ms`, and `--review-retry-max-delay-ms` control parallelism plus bounded retry backoff for reviewer execution
54
59
  - when `Require Supervisor Review: true`, inferred/manual records are completion-blocking
55
60
  - `design-supervisor review` is kept as a compatibility alias that forwards to this command
61
+ - `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>[,<other-pen>...] [--prefer-source <path>]`
62
+ - compares canonical `.pen` snapshot hashes across project-local and external/secondary sources before a new design round
63
+ - blocks by default on divergence until source priority is explicit
64
+ - `--prefer-source <project-pen>` records an explicit decision to keep the project path authoritative
65
+ - `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`
66
+ - copies the selected latest `.pen` source into the project-local `.pen` path and refreshes Da Vinci state metadata
67
+ - use when external backup is the latest baseline and must be materialized before `pencil-session begin`
56
68
 
57
69
  Use these utilities during `/dv:design`, especially before anchor-surface icon finalization.
58
70
 
@@ -196,6 +196,7 @@ It verifies:
196
196
  - the active editor matches that `.pen`
197
197
  - the shell-visible file exists
198
198
  - the registered `.pen` is not still only in memory
199
+ - when external or secondary `.pen` files exist, baseline hash alignment and source-priority confirmation are explicitly recorded before a new edit round
199
200
  - `.da-vinci/designs/` is not polluted by markdown or PNG files
200
201
 
201
202
  ## MCP Runtime Gate
@@ -248,13 +249,14 @@ Context-delta audit expectations are warning-only:
248
249
  Typical autonomous chain:
249
250
 
250
251
  1. `da-vinci pencil-session begin --project <project-path> --pen <path>`
251
- 2. Pencil MCP edits
252
- 3. `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
253
- 4. screenshot review + layout hygiene
254
- 5. design checkpoint
255
- 6. design-supervisor review when configured
256
- 7. `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
257
- 8. `da-vinci audit --mode completion --change <change-id> <project-path>`
252
+ 2. if external/secondary `.pen` files exist, run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before edits; if diverged, sync the preferred source into `<project-pen>` first
253
+ 3. Pencil MCP edits
254
+ 4. `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
255
+ 5. screenshot review + layout hygiene
256
+ 6. design checkpoint
257
+ 7. design-supervisor review when configured
258
+ 8. `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
259
+ 9. `da-vinci audit --mode completion --change <change-id> <project-path>`
258
260
 
259
261
  ## Flow Diagram
260
262
 
@@ -1,7 +1,11 @@
1
1
  # Prompt Presets
2
2
 
3
+ ## Template Notes
4
+
3
5
  Use these presets when you want a copy-ready starting prompt for a specific product surface.
4
6
 
7
+ This section explains what each preset family is for, when to use it, and how it should pair with `Visual Assist` plus workflow gates.
8
+
5
9
  These presets primarily target screen-design work once the workflow mode is already clear.
6
10
  For broad existing-product rewrites where flows or logic are also changing, prefer `overhaul-from-code` plus `intake`/custom prompt setup first, then reuse the relevant design-oriented preset after `proposal.md`, `migration-contract.md`, and target `specs/` stabilize.
7
11
 
@@ -1,7 +1,11 @@
1
1
  # Visual Assist Presets
2
2
 
3
+ ## Template Notes
4
+
3
5
  Use these presets as starting points for the `## Visual Assist` section inside `DA-VINCI.md`.
4
6
 
7
+ This section explains the intent of each preset family, how the variants differ, and which workflow responsibilities must stay outside the preset itself.
8
+
5
9
  Each preset is intentionally conservative:
6
10
 
7
11
  - one primary adapter direction
@@ -88,17 +88,18 @@ Expected flow:
88
88
  10. for functional icons, run `da-vinci icon-sync` then `da-vinci icon-search --query "<intent>"` to pick `icon_font` names before writing icon nodes
89
89
  11. if the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds
90
90
  12. require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit so the registered `.pen` is seeded and the global Pencil lock is held
91
- 13. during live design work, use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material edits, then end with `da-vinci pencil-session end ...`
92
- 14. verify the registered project-local `.pen` path becomes shell-visible immediately after the first successful Pencil write
93
- 15. run `da-vinci audit --mode integrity <project-path>` immediately after that first successful write
94
- 16. if Pencil MCP is active, run the MCP runtime gate and record it in `pencil-design.md`
95
- 17. run `design-source checkpoint` to confirm the registered project-local `.pen` path, the active Pencil source, and the shell-visible file all agree
96
- 18. export screenshots only under `.da-vinci/changes/<change-id>/exports/`, never into `.da-vinci/designs/`
97
- 19. record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome before broad expansion
98
- 20. bind routes and pages to Pencil screens
99
- 21. generate tasks aligned to the redesign slices
100
- 22. run `da-vinci audit --mode completion --change <change-id> <project-path>` before any terminal completion claim
101
- 23. build and verify only after the completion gate can eventually pass
91
+ 13. when external or secondary `.pen` sources exist, run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before the new session write phase; if diverged, sync the chosen source into `<project-pen>` first
92
+ 14. during live design work, use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material edits, then end with `da-vinci pencil-session end ...`
93
+ 15. verify the registered project-local `.pen` path becomes shell-visible immediately after the first successful Pencil write
94
+ 16. run `da-vinci audit --mode integrity <project-path>` immediately after that first successful write
95
+ 17. if Pencil MCP is active, run the MCP runtime gate and record it in `pencil-design.md`
96
+ 18. run `design-source checkpoint` to confirm the registered project-local `.pen` path, the active Pencil source, and the shell-visible file all agree
97
+ 19. export screenshots only under `.da-vinci/changes/<change-id>/exports/`, never into `.da-vinci/designs/`
98
+ 20. record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome before broad expansion
99
+ 21. bind routes and pages to Pencil screens
100
+ 22. generate tasks aligned to the redesign slices
101
+ 23. run `da-vinci audit --mode completion --change <change-id> <project-path>` before any terminal completion claim
102
+ 24. build and verify only after the completion gate can eventually pass
102
103
 
103
104
  ### Complex Android example
104
105
 
@@ -122,6 +123,7 @@ Before non-trivial `batch_design` calls, preflight the Pencil operations when sh
122
123
  If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
123
124
  Use only Pencil-supported properties; do not use web-only props like flex or margin.
124
125
  Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit.
126
+ When external or secondary `.pen` files exist, run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` first; if hashes diverge, sync the preferred source into `<project-pen>` before editing.
125
127
  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 `da-vinci pencil-session persist`.
126
128
  Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
127
129
  Run `da-vinci audit --mode integrity <project-path>` after that first successful Pencil write before broad expansion continues.
@@ -58,6 +58,8 @@ Depending on mode, Da Vinci typically builds this spine:
58
58
 
59
59
  `DA-VINCI.md` remains the project-level workflow and visual contract file.
60
60
 
61
+ If you are starting from an empty repo, a documentation-first example, or a half-hydrated workspace, run `da-vinci bootstrap-project --project <project-path> --change <change-id>` before the first strict audit. That command creates the minimum project spine plus a workflow-owned project-local `.pen` baseline.
62
+
61
63
  ## Phase Breakdown
62
64
 
63
65
  ### 1. Intake And Mode Selection
@@ -48,6 +48,7 @@
48
48
  - `Revision outcome`
49
49
 
50
50
  当 supervisor review 是必需时,缺失、`BLOCK`、未接受、或非 skill-backed 的评审证据都会阻断 completion。
51
+ 避免写临时标题(例如 `## Design-Supervisor Review (Round X Attempt)`);应保持规范化、结构化的 supervisor-review 段(优先使用 `da-vinci supervisor-review --write`),这样 audit 才能稳定解析最新评审证据。
51
52
 
52
53
  ## 指导型约束段(可定制)
53
54
 
@@ -49,12 +49,24 @@ Da Vinci 期望它们遵循工作流状态。
49
49
  - `da-vinci icon-search --query "<关键词>" [--family ...] [--top ...] [--aliases ...]`
50
50
  - 在写 Pencil `batch_design` 前先收敛可用的 `icon_font` 名称
51
51
  - 支持中英文混合词,并可通过 `~/.da-vinci/icon-aliases.json` 做语义扩展
52
- - `da-vinci supervisor-review --project <path> --change <id> [--run-reviewers] [--review-concurrency <value>] [--review-retries <value>] [--review-retry-delay-ms <value>] [--source <skill|manual|inferred>] [--executed-reviewers <csv>] [--status ...] [--issue-list ...] [--revision-outcome ...] [--write]`
52
+ - `da-vinci bootstrap-project --project <path> [--change <id>] [--force]`
53
+ - 给还没水合完成的仓库补齐最小 `.da-vinci/` 工作流骨架
54
+ - 会在 `.da-vinci/designs/` 下 seed 一个工作流管理的项目内 `.pen`
55
+ - 传 `--change <id>` 时会顺手创建当前 change 所需的最小设计工件(`design-brief.md`、`design.md`、`pencil-design.md`、`pencil-bindings.md`)
56
+ - 适合从空仓库、文档示例、或只做了一半的工作区开始时,先补齐 audit 所需的基础工件
57
+ - `da-vinci supervisor-review --project <path> --change <id> [--run-reviewers] [--review-concurrency <value>] [--review-retries <value>] [--review-retry-delay-ms <value>] [--review-retry-max-delay-ms <value>] [--source <skill|manual|inferred>] [--executed-reviewers <csv>] [--status ...] [--issue-list ...] [--revision-outcome ...] [--write]`
53
58
  - 持久化结构化 supervisor review 记录(`Configured reviewers`、`Executed reviewers`、`Review source`、`Status`、`Issue list`、`Revision outcome`)到 `pencil-design.md`
54
59
  - 推荐直接用 `--run-reviewers --write` 一步完成 reviewer skills 执行与记录落盘
55
- - 通过 `--review-concurrency`、`--review-retries`、`--review-retry-delay-ms` 可调 reviewer 并发与重试退避
60
+ - 通过 `--review-concurrency`、`--review-retries`、`--review-retry-delay-ms`、`--review-retry-max-delay-ms` 可调 reviewer 并发与有上限的重试退避
56
61
  - 当 `Require Supervisor Review: true` 时,`manual/inferred` 记录会被 completion 阻断
57
62
  - `design-supervisor review` 作为兼容别名保留,并会转发到该命令
63
+ - `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>[,<other-pen>...] [--prefer-source <path>]`
64
+ - 在新一轮设计前比较项目内/外部(或次要)`.pen` 的 canonical snapshot hash
65
+ - 默认在 hash 分叉时阻断,直到来源优先级被显式确认
66
+ - `--prefer-source <project-pen>` 可记录“继续以项目内路径为准”的显式决策
67
+ - `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`
68
+ - 把被选中的最新 `.pen` 来源同步到项目内 `.pen` 路径,并刷新 Da Vinci state 元数据
69
+ - 当外部备份是最新基线时,在 `pencil-session begin` 前先执行
58
70
 
59
71
  建议在 `/dv:design` 阶段使用,尤其是在 anchor surface 的图标定稿前。
60
72
 
@@ -198,6 +198,7 @@ active Pencil 工作一旦存在,就要跑 `design-source checkpoint`。
198
198
  - active editor 是否就是这个 `.pen`
199
199
  - shell 上是否真的存在这个 `.pen`
200
200
  - 登记的 `.pen` 是否还停留在“只有内存,没有磁盘”
201
+ - 如果存在外部或次要 `.pen`,是否在新一轮编辑前显式完成了基线 hash 对齐和来源优先级确认
201
202
  - `.da-vinci/designs/` 是否被 markdown 或 PNG 污染
202
203
 
203
204
  ## MCP Runtime Gate
@@ -250,13 +251,14 @@ Context Delta 相关审计期望都是告警级:
250
251
  典型自治流程:
251
252
 
252
253
  1. `da-vinci pencil-session begin --project <project-path> --pen <path>`
253
- 2. Pencil MCP 编辑
254
- 3. `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
255
- 4. screenshot review + layout hygiene
256
- 5. design checkpoint
257
- 6. 如果配置了,就执行 design-supervisor review
258
- 7. `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
259
- 8. `da-vinci audit --mode completion --change <change-id> <project-path>`
254
+ 2. 如果存在外部/次要 `.pen`,在编辑前先运行 `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>`;若分叉,先把优先来源同步回 `<project-pen>`
255
+ 3. Pencil MCP 编辑
256
+ 4. `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
257
+ 5. screenshot review + layout hygiene
258
+ 6. design checkpoint
259
+ 7. 如果配置了,就执行 design-supervisor review
260
+ 8. `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
261
+ 9. `da-vinci audit --mode completion --change <change-id> <project-path>`
260
262
 
261
263
  ## 流程图
262
264
 
@@ -1,7 +1,11 @@
1
- # 场景提示词模板
1
+ # 场景提示词模版说明
2
+
3
+ ## 模版说明
2
4
 
3
5
  这些模板用于在不同产品形态下,快速拿到可直接执行的起始提示词。
4
6
 
7
+ 这部分主要说明每类模板适合什么场景、应该怎么搭配使用,以及它和 `Visual Assist`、workflow gate 之间的边界。
8
+
5
9
  这些模板主要服务于 screen 设计阶段。
6
10
  如果是存量系统的大改版,且流程或逻辑也会一起变化,应该先用 `overhaul-from-code` 搭配 `intake` 或自定义提示词把 `proposal.md`、`migration-contract.md` 和目标 `specs/` 稳定下来,再复用对应的设计模板。
7
11
 
@@ -1,7 +1,11 @@
1
- # Visual Assist 场景模板
1
+ # Visual Assist 场景模版说明
2
+
3
+ ## 模版说明
2
4
 
3
5
  这些模板用于作为 `DA-VINCI.md` 里 `## Visual Assist` 的起始配置。
4
6
 
7
+ 这部分主要说明每类模板的用途、不同变体的差别,以及哪些 workflow gate 仍然必须放在模板外单独处理。
8
+
5
9
  每个模板都刻意保持保守:
6
10
 
7
11
  - 一个主要 adapter 方向