@xenonbyte/da-vinci-workflow 0.1.25 → 0.2.1

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 (84) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +48 -67
  3. package/README.zh-CN.md +36 -66
  4. package/SKILL.md +3 -0
  5. package/commands/claude/dv/continue.md +5 -0
  6. package/commands/claude/dv/design.md +1 -0
  7. package/commands/codex/prompts/dv-continue.md +6 -1
  8. package/commands/codex/prompts/dv-design.md +1 -0
  9. package/commands/gemini/dv/continue.toml +5 -0
  10. package/commands/gemini/dv/design.toml +1 -0
  11. package/commands/templates/dv-continue.shared.md +33 -0
  12. package/docs/dv-command-reference.md +45 -2
  13. package/docs/execution-chain-migration.md +46 -0
  14. package/docs/execution-chain-plan.md +125 -0
  15. package/docs/pencil-rendering-workflow.md +9 -7
  16. package/docs/prompt-entrypoints.md +6 -0
  17. package/docs/prompt-presets/README.md +4 -0
  18. package/docs/visual-assist-presets/README.md +4 -0
  19. package/docs/workflow-examples.md +23 -11
  20. package/docs/workflow-overview.md +27 -0
  21. package/docs/zh-CN/dv-command-reference.md +45 -2
  22. package/docs/zh-CN/execution-chain-migration.md +46 -0
  23. package/docs/zh-CN/pencil-rendering-workflow.md +9 -7
  24. package/docs/zh-CN/prompt-entrypoints.md +6 -0
  25. package/docs/zh-CN/prompt-presets/README.md +5 -1
  26. package/docs/zh-CN/visual-assist-presets/README.md +5 -1
  27. package/docs/zh-CN/workflow-examples.md +23 -11
  28. package/docs/zh-CN/workflow-overview.md +27 -0
  29. package/examples/greenfield-spec-markupflow/README.md +6 -1
  30. package/lib/artifact-parsers.js +120 -0
  31. package/lib/async-offload-worker.js +26 -0
  32. package/lib/async-offload.js +82 -0
  33. package/lib/audit-parsers.js +152 -32
  34. package/lib/audit.js +145 -23
  35. package/lib/cli.js +1068 -437
  36. package/lib/diff-spec.js +242 -0
  37. package/lib/execution-signals.js +136 -0
  38. package/lib/fs-safety.js +1 -4
  39. package/lib/icon-aliases.js +7 -7
  40. package/lib/icon-search.js +21 -14
  41. package/lib/icon-sync.js +220 -41
  42. package/lib/install.js +128 -60
  43. package/lib/lint-bindings.js +143 -0
  44. package/lib/lint-spec.js +408 -0
  45. package/lib/lint-tasks.js +176 -0
  46. package/lib/mcp-runtime-gate.js +4 -7
  47. package/lib/pen-persistence.js +318 -46
  48. package/lib/pencil-lock.js +237 -25
  49. package/lib/pencil-preflight.js +233 -12
  50. package/lib/pencil-session.js +216 -36
  51. package/lib/planning-parsers.js +567 -0
  52. package/lib/scaffold.js +193 -0
  53. package/lib/scope-check.js +603 -0
  54. package/lib/sidecars.js +369 -0
  55. package/lib/supervisor-review.js +82 -35
  56. package/lib/utils.js +129 -0
  57. package/lib/verify.js +652 -0
  58. package/lib/workflow-bootstrap.js +255 -0
  59. package/lib/workflow-contract.js +107 -0
  60. package/lib/workflow-persisted-state.js +297 -0
  61. package/lib/workflow-state.js +785 -0
  62. package/package.json +21 -3
  63. package/references/artifact-templates.md +26 -0
  64. package/references/checkpoints.md +16 -0
  65. package/references/design-inputs.md +2 -0
  66. package/references/modes.md +10 -0
  67. package/references/pencil-design-to-code.md +2 -0
  68. package/scripts/fixtures/complex-sample.pen +0 -295
  69. package/scripts/fixtures/mock-pencil.js +0 -49
  70. package/scripts/test-audit-context-delta.js +0 -446
  71. package/scripts/test-audit-design-supervisor.js +0 -691
  72. package/scripts/test-audit-safety.js +0 -92
  73. package/scripts/test-icon-aliases.js +0 -96
  74. package/scripts/test-icon-search.js +0 -77
  75. package/scripts/test-icon-sync.js +0 -178
  76. package/scripts/test-mcp-runtime-gate.js +0 -287
  77. package/scripts/test-mode-consistency.js +0 -344
  78. package/scripts/test-pen-persistence.js +0 -403
  79. package/scripts/test-pencil-lock.js +0 -130
  80. package/scripts/test-pencil-preflight.js +0 -169
  81. package/scripts/test-pencil-session.js +0 -192
  82. package/scripts/test-persistence-flows.js +0 -345
  83. package/scripts/test-supervisor-review-cli.js +0 -619
  84. package/scripts/test-supervisor-review-integration.js +0 -115
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.2.1 - 2026-03-31
4
+
5
+ ### Added
6
+ - execution-chain workflow CLI surfaces: `workflow-status`, `next-step`, `lint-spec`, `scope-check`, `lint-tasks`, `lint-bindings`, `generate-sidecars`, `verify-*`, `diff-spec`, and `scaffold`
7
+ - persisted workflow-state snapshots and execution-signal files so route selection can reuse artifact-derived state while still reacting to fresh verify/audit outcomes
8
+ - planning sidecars and normalized spec/page-map/bindings/tasks diff support for drift inspection
9
+ - scaffold generation from `pencil-bindings.md`, plus workflow-state / verify / sidecar / audit execution-signal regression coverage
10
+ - split CI lanes for core regression, contracts, and workflow e2e coverage
11
+
12
+ ### Changed
13
+ - README and Chinese companion docs now document the `0.2.1` execution-chain release surface explicitly
14
+ - `generate-sidecars` now returns `BLOCK` when workflow/change resolution fails instead of emitting a misleading `PASS`
15
+ - `verify-implementation` now ignores tests, fixtures, scripts, and colocated `*.test.*` / `*.spec.*` files when checking implementation coverage heuristics
16
+
17
+ ## v0.1.26 - 2026-03-31
18
+
19
+ ### Added
20
+ - `da-vinci check-pen-baseline` to compare project-local `.pen` hashes against external or secondary `.pen` sources before a new session write phase
21
+ - `da-vinci sync-pen-source` to sync the chosen latest `.pen` source back into the project-local baseline and refresh state metadata
22
+ - `pencil-session begin` support for multi-source baseline flags: `--baseline`, `--prefer-source`, and `--sync-preferred-source`
23
+ - new persistence/session/flow regression tests covering baseline divergence detection and explicit source sync recovery
24
+ - `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
25
+ - release/doc alignment regression coverage for bootstrap scaffolding, package contents, and repo-head command documentation
26
+
27
+ ### Changed
28
+ - 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
29
+ - design prompts, skill rules, and workflow docs now require baseline alignment checks when external `.pen` backups are present
30
+ - `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
31
+ - `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
32
+ - `icon-sync` network fetch now follows HTTP redirects (with loop and redirect-limit protections) instead of assuming direct 2xx responses
33
+ - `audit` now suggests `da-vinci bootstrap-project` when required workflow artifacts are missing, instead of failing without a concrete hydration path
34
+ - `supervisor-review` retry backoff now supports `--review-retry-max-delay-ms` so repeated reviewer failures stay bounded
35
+ - `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
36
+ - `pencil-session` lifecycle rollback/release failures now preserve structured causes instead of mutating original error messages in place
37
+ - 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
38
+ - 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
39
+
3
40
  ## v0.1.25 - 2026-03-29
4
41
 
5
42
  ### Added
package/README.md CHANGED
@@ -28,68 +28,18 @@ This workflow is intended for:
28
28
 
29
29
  Latest published npm package:
30
30
 
31
- - `@xenonbyte/da-vinci-workflow@0.1.25`
32
-
33
- Release highlights:
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`)
37
- - supervisor-review parsing now explicitly handles legacy Chinese round-attempt headings (for example `## Design-Supervisor Review(第2轮尝试)`) and keeps canonical structured review fallback deterministic
38
- - `--nodes-file` metadata-payload guard now reports shorter relative file paths when possible, while preserving absolute-path fallback outside current working directory
39
- - audit parser logic is now split into `lib/audit-parsers.js`, reducing `lib/audit.js` size and making maintenance safer
40
- - recursive file traversal now uses bounded safe scans with depth/count limits and symlink skipping
41
- - completion/integrity audit now rejects out-of-root `.pen` references from `design-registry.md`
42
- - `preflight-pencil` sandbox now blocks unsafe runtime tokens, disables dynamic code generation, and reports timeout failures explicitly
43
- - icon text normalization/tokenization is now shared across `icon-search` and `icon-aliases`, removing duplicated logic and adding parity coverage
44
- - `da-vinci pencil-session end` now requires live snapshot input (`--nodes-file`) unless `--force` is used, preventing silent session close while live MCP and disk are out of sync
45
- - `build` route discipline now treats compile success as non-terminal and requires `da-vinci audit --mode completion --change <change-id> <project-path>` before reporting terminal completion
46
- - `continue` route guidance now blocks `build` recommendation whenever core design gates remain unresolved (missing project-local `.pen`, active session, runtime/design-source BLOCK, or required design-supervisor BLOCK)
47
- - added regression coverage for session-end sync guards and prompt-level build/continue gate discipline
48
- - continue-routing and recovery guidance now consistently prioritize artifact/checkpoint truth first, with contextual deltas treated as auxiliary notes only
49
- - context-delta audit now uses tighter expectation signals, status-mismatch wording, and `supersedes` validation with timestamp normalization
50
- - context-delta expectation checks are now automatic for checkpoint-bearing artifacts and allow explicit opt-in (`Context Delta Required`) only for edge cases
51
- - `design-supervisor review` is now a first-class final style-quality gate with explicit advisory versus required behavior controlled by `Require Supervisor Review`
52
- - `Visual Assist` docs now explain gate order, gate judging criteria, and branching across screenshot review, layout hygiene, design checkpoint, and design-supervisor review
53
- - `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
54
- - 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
55
- - design-supervisor review records now require explicit status, issue list, and revision outcome before they count as valid audit evidence
56
- - Pencil lock waiting now sleeps without busy-spinning, reducing CPU waste while preserving the synchronous CLI/session contract
57
- - project-local `.pen` persistence now uses an MCP-snapshot-to-disk path instead of relying on headless interactive `save()`
58
- - redesign runs now seed a registered project-local `.pen` before the first Pencil edit and record persisted snapshot hashes for later sync checks
59
- - `da-vinci write-pen` now atomically writes workflow-owned `.pen` files from MCP-readable node and variable payloads with optional reopen verification
60
- - `da-vinci ensure-pen` now seeds or verifies a registered project-local `.pen` before live editing starts
61
- - `da-vinci check-pen-sync` now compares a current live MCP snapshot payload against the persisted project-local `.pen`
62
- - `da-vinci snapshot-pen` now serves only as a disk-to-disk utility for rebuilding an existing Pencil source and verifying reopen
63
- - visual-adapter execution now requires explicit runtime declaration of the resolved primary adapter and any unavailable requested adapters
64
- - cross-platform near-name adapters such as `frontend-skill` and `frontend-design` are now treated as distinct unless the current environment explicitly resolves them
65
- - complex `redesign-from-code` runs now require a visual thesis, content plan, interaction thesis, and anchor-surface structural-delta notes before broad Pencil generation
66
- - screenshot review is now documented as a binding gate; analysis that reports hierarchy, spacing, clarity, or inconsistency issues cannot be treated as an automatic pass
67
- - form-factor-specific layout hygiene is now documented as a separate hard gate from `Visual Assist`, with blocker conditions for mobile, tablet, desktop, and web review
68
- - `.da-vinci/designs/` is now documented more strictly as a `.pen`-only directory, and project-local `.pen` persistence must be verified as shell-visible immediately after the first Pencil write
69
- - multi-surface redesign guidance now requires a shared primitive family to be defined from approved anchor surfaces before broad page expansion
70
- - Pencil generation guidance now explicitly rejects web-only properties such as `flex` and `margin`
71
- - visual-adapter resolution now requires the resolved primary adapter to actively lead the first design pass
72
- - complex redesigns now default to anchor-first Pencil generation: design 1-3 anchor surfaces, review screenshots, then expand
73
- - design checkpoint now explicitly blocks placeholder-heavy repeated scaffolds and premature broad multi-screen generation
74
- - prompt presets for mobile, desktop, web, and tablet now include `Simple redesign`, `Complex redesign`, `Design-only`, and `Continue` variants
75
- - `redesign-from-code` now states explicitly that existing code is behavior truth, not layout truth
76
- - complex pages are now expected to decompose into subpages, overlays, materially different states, and implementation surfaces before broad Pencil redesign
77
- - design-checkpoint guidance now explicitly blocks skin-swap redesigns, generic card mosaics, weak visual anchors, and decorative clutter
78
- - `Visual Assist` docs now include quick-start recommendations and a quality-first configuration for design-critical work
79
- - visual-adapter configuration is now documented explicitly, including field meanings, resolution order, and fallback behavior
80
- - ready-to-copy `Visual Assist` presets are now included for mobile, desktop, web, and tablet scenarios
81
- - the repo-local forward test now shows how `Visual Assist`, adapter resolution, and persisted `.pen` paths should be recorded
82
- - Codex natural-language usage is now documented explicitly, including `intake`, `prompt`, `continue`, and direct mode entry patterns
83
- - project-local Pencil `.pen` files are now documented to persist under `.da-vinci/designs/`
84
- - design registry and artifact templates now record preferred persisted `.pen` paths for project-local reuse
85
- - prompt-entry helper routes for `intake`, `prompt`, and `continue` are now published across Codex, Claude, and Gemini
86
- - Chinese companion docs are now intentionally limited to `README.zh-CN.md` and `docs/zh-CN/`
87
- - asset validation now covers the full shipped documentation set
88
- - `da-vinci status` now validates full installed asset sets across Codex, Claude, and Gemini
89
- - Claude and Gemini command adapters now use self-contained workflow wording after installation
90
- - `.npmrc` and `openspec/` are kept local-only and are no longer versioned or shipped in the npm package
91
- - Node-first install, uninstall, status, and asset validation commands remain the supported distribution path
92
- - repo-local forward-test example for a `greenfield-spec` workflow remains included
31
+ - `@xenonbyte/da-vinci-workflow@0.2.1`
32
+
33
+ Release highlights for `0.2.1`:
34
+
35
+ - added the execution-chain workflow surfaces: `workflow-status`, `next-step`, `lint-spec`, `scope-check`, `lint-tasks`, `lint-bindings`, `generate-sidecars`, `verify-*`, `diff-spec`, and `scaffold`
36
+ - introduced persisted workflow state plus execution-signal recording so route selection can reuse trusted snapshots while still honoring fresh verify and audit blockers
37
+ - added planning sidecars, diffing, and scaffold generation from bindings to make planning drift and implementation coverage visible from the CLI
38
+ - split CI into core regression, contracts, and workflow e2e lanes so the new workflow-state surfaces are exercised independently
39
+ - expanded regression coverage for workflow-state derivation, persisted-state reuse, planning lints, sidecar generation, verify/scaffold, and audit execution-signal integration
40
+ - fixed `generate-sidecars` so unresolved workflow/change selection returns `BLOCK` instead of a misleading `PASS`
41
+ - fixed `verify-implementation` so test, fixture, and script files do not satisfy implementation coverage heuristics
42
+ - refreshed release and command docs to document the new execution-chain surfaces in both English and Chinese
93
43
 
94
44
  ## Supported workflow modes
95
45
 
@@ -134,6 +84,11 @@ Route discipline:
134
84
  - `intake` and `continue` should usually generate a main `$da-vinci ...` or `/da-vinci ...` prompt
135
85
  - they should not default the user into `build`
136
86
  - `build` remains a direct expert route for workflows that are already implementation-ready
87
+ - when shell access is available, run `da-vinci workflow-status --project <path> [--change <id>] --json` and `da-vinci next-step --project <path> [--change <id>]` before selecting continuation route text
88
+ - run `da-vinci lint-spec --project <path> [--change <id>]` before implementation when runtime spec quality is uncertain
89
+ - run `da-vinci scope-check --project <path> [--change <id>]` before implementation when page/state propagation across planning artifacts is uncertain
90
+ - run `da-vinci verify-bindings` / `verify-implementation` / `verify-structure` / `verify-coverage` before terminal completion claims
91
+ - run `da-vinci generate-sidecars --project <path> [--change <id>]` and `da-vinci diff-spec --project <path> [--change <id>]` when planning deltas must be tracked explicitly
137
92
  - `continue` should determine route selection from artifact and checkpoint truth first
138
93
  - contextual checkpoint deltas are auxiliary recovery notes only and must not override routing
139
94
  - if contextual deltas conflict with current artifacts, ignore them for routing and record the conflict
@@ -304,6 +259,14 @@ Placement rules:
304
259
  - keep change-specific workflow files in `.da-vinci/changes/<change-id>/`
305
260
  - do not scatter `proposal.md`, `tasks.md`, and `verification.md` across the project root
306
261
 
262
+ If a repo does not have this scaffold yet, hydrate the minimum project spine first:
263
+
264
+ ```bash
265
+ da-vinci bootstrap-project --project /abs/path/to/project --change <change-id>
266
+ ```
267
+
268
+ 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.
269
+
307
270
  ## Checkpoints
308
271
 
309
272
  Da Vinci uses these checkpoints:
@@ -368,8 +331,12 @@ Rules:
368
331
  - complex pages should be decomposed into subpages, states, overlays, and implementation surfaces before Pencil redesign is treated as final
369
332
  - the preferred `.pen` path recorded in `design-registry.md` is workflow-owned state, not user-authored config
370
333
  - 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
334
+ - 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
335
+ - before a new edit round starts, compare hashes explicitly across sources and confirm source priority
336
+ - if an external source is selected as latest, sync it into the project-local `.pen` before further live edits
371
337
  - 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
372
338
  - 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
339
+ - 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
373
340
 
374
341
  Optional visual-adapter policy:
375
342
 
@@ -508,7 +475,7 @@ Both modes check the most common workflow-integrity failures in a project:
508
475
  - writes `Configured reviewers`, `Executed reviewers`, `Review source`, `Status`, `Issue list`, and `Revision outcome` into `pencil-design.md` when `--write` is provided
509
476
  - accepts explicit status input (`--status PASS|WARN|BLOCK`) or can infer a conservative status from current design artifacts
510
477
  - for required supervisor gates, prefer `--run-reviewers --write` so configured reviewer skills execute and the record is persisted in one step
511
- - reviewer execution tuning is available via `--review-concurrency`, `--review-retries`, and `--review-retry-delay-ms` (exponential backoff)
478
+ - reviewer execution tuning is available via `--review-concurrency`, `--review-retries`, `--review-retry-delay-ms`, and `--review-retry-max-delay-ms` (bounded exponential backoff)
512
479
  - keeps `design-supervisor review` available as a compatibility alias
513
480
 
514
481
  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.
@@ -518,15 +485,18 @@ Project-local `.pen` persistence now has two supported paths:
518
485
 
519
486
  - 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
520
487
  - 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`
488
+ - 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
521
489
 
522
490
  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.
523
491
 
524
492
  Persistence helpers:
525
493
 
526
494
  - required wrapper on autonomous runs:
527
- - `da-vinci pencil-session begin --project <project-path> --pen <path>`
495
+ - `da-vinci pencil-session begin --project <project-path> --pen <path> [--baseline <path>] [--prefer-source <path>] [--sync-preferred-source]`
528
496
  - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
529
497
  - `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
498
+ - `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>[,<other-pen>...] [--prefer-source <path>]`
499
+ - `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`
530
500
  - `da-vinci ensure-pen --output <path> --verify-open`
531
501
  - `da-vinci write-pen --output <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version> --verify-open`
532
502
  - `da-vinci check-pen-sync --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
@@ -593,13 +563,13 @@ Entry helpers:
593
563
  /dv:continue
594
564
  ```
595
565
 
596
- ## Repo-local forward test
566
+ ## Repo-local forward-test reference
597
567
 
598
- A complete repo-local forward test is available at:
568
+ A documentation-first repo-local forward-test reference is available at:
599
569
 
600
570
  - `examples/greenfield-spec-markupflow/`
601
571
 
602
- That example runs a `greenfield-spec` scenario from:
572
+ That example records a `greenfield-spec` scenario from:
603
573
 
604
574
  1. design brief
605
575
  2. proposal and spec
@@ -610,6 +580,17 @@ That example runs a `greenfield-spec` scenario from:
610
580
  7. static HTML delivery
611
581
  8. verification
612
582
 
583
+ 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.
584
+
585
+ 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>`.
586
+
587
+ For reviewer bridge coverage:
588
+
589
+ - default CI always runs the core local test gate (`npm run quality:ci:core`)
590
+ - when repository integration variables are enabled, the main CI workflow also runs the real reviewer bridge smoke job
591
+ - the real `codex exec` reviewer smoke remains opt-in via `DA_VINCI_RUN_SUPERVISOR_INTEGRATION=1 npm run test:supervisor-review-integration`
592
+ - `.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
593
+
613
594
  ## Example requests
614
595
 
615
596
  ### Greenfield spec
package/README.zh-CN.md CHANGED
@@ -30,68 +30,18 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
30
30
 
31
31
  最新已发布 npm 包:
32
32
 
33
- - `@xenonbyte/da-vinci-workflow@0.1.25`
34
-
35
- 已发布版本重点:
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` 启用)
39
- - supervisor-review 解析现已显式覆盖中文 legacy 轮次标题(例如 `## Design-Supervisor Review(第2轮尝试)`),并保持“优先结构化评审块”的回退策略可预测
40
- - `--nodes-file` 元数据误传保护现在优先输出更短的相对路径(在 cwd 外仍回退绝对路径),便于日志阅读
41
- - audit 解析职责已拆分到 `lib/audit-parsers.js`,`lib/audit.js` 体量下降,可维护性更好
42
- - 递归文件扫描改为安全有界遍历:增加深度/数量上限,并跳过符号链接
43
- - completion/integrity audit 现在会拦截并忽略 `design-registry.md` 中越出项目根目录的 `.pen` 引用
44
- - `preflight-pencil` 沙箱增强:拦截危险运行时 token、禁用动态代码生成,并对超时失败给出明确分类
45
- - `icon-search` 与 `icon-aliases` 现在复用同一套文本归一化/分词逻辑,去掉重复实现并补了一致性回归测试
46
- - `da-vinci pencil-session end` 现在默认要求提供 live 快照输入(`--nodes-file`);只有显式 `--force` 才允许跳过,避免 live MCP 与磁盘未同步时被静默关闭
47
- - `build` 路由现在明确:编译成功不等于流程完成;对外宣布终态前必须通过 `da-vinci audit --mode completion --change <change-id> <project-path>`
48
- - `continue` 的推荐规则现在会拦截未过设计门禁时的 `build` 选路(缺少项目内 `.pen`、session 未关闭、runtime/design-source BLOCK、required design-supervisor BLOCK)
49
- - 新增回归测试覆盖:session 结束同步防护,以及 build/continue 提示词级门禁约束
50
- - `continue` 的选路与恢复规则现已统一:先看工件/checkpoint 真相,再把 Context Delta 当作辅助信息
51
- - Context Delta 审计规则已强化:触发信号更精确、告警改为状态不一致语义,并补充 `supersedes` 校验与时间归一化
52
- - checkpoint 相关工件默认自动启用 Context Delta 期望检查;只有少数无 checkpoint 标题的工件才需要显式 `Context Delta Required`
53
- - `design-supervisor review` 现在成为正式的最终风格质量 gate,并通过 `Require Supervisor Review` 明确区分“建议性”与“硬门槛”
54
- - `Visual Assist` 文档现在补全了 gate 顺序、每层 gate 怎么审,以及 screenshot review、layout hygiene、design checkpoint、design-supervisor review 之间的分叉规则
55
- - 移动端、桌面端、Web、平板四套 `visual-assist-presets` 现在都提供三种明确变体:只有 adapter、reviewer 建议性审查、reviewer 硬签字,中英文一致
56
- - completion / integrity audit 现在真正以 `Require Supervisor Review: true` 作为硬门槛开关,而不是只要配置 reviewer 就一律阻断
57
- - `design-supervisor review` 记录现在必须有明确状态、问题列表和回改结果,才算有效审查证据
58
- - Pencil 锁等待现在改成阻塞 sleep,不再 busy wait 空转 CPU,同时保留同步 CLI/session 的调用语义
59
- - 项目内 `.pen` 持久化现在改为“从 MCP 快照写回磁盘”的正式路径,不再依赖 headless interactive `save()`
60
- - 重设计流程现在要求在第一次 Pencil 编辑前先 seed 一个登记好的项目内 `.pen`,并记录后续持久化快照 hash 以便做同步校验
61
- - `da-vinci write-pen` 现在可以把 MCP 可读的节点和变量快照原子写成工作流管理的 `.pen` 文件,并可选地做 reopen 校验
62
- - `da-vinci ensure-pen` 现在可以在 live 编辑开始前 seed 或校验登记好的项目内 `.pen`
63
- - `da-vinci check-pen-sync` 现在可以把当前 live MCP 快照和已持久化的项目内 `.pen` 做同步比对
64
- - `da-vinci snapshot-pen` 现在只作为 disk-to-disk 工具,用来从已有 Pencil 源重建规范化 `.pen` 并验证重新打开结果
65
- - visual adapter 的执行现在要求在运行时明确声明解析出来的主 adapter,以及哪些请求的 adapter 当前不可用
66
- - `frontend-skill`、`frontend-design` 这类跨平台近名 adapter 现在明确视为不同能力源,除非当前环境真的解析到了它们
67
- - 复杂 `redesign-from-code` 现在要求在大规模 Pencil 设计前先写 visual thesis、content plan、interaction thesis 和 anchor surface 的 structural-delta 说明
68
- - screenshot review 现在被明确强调为硬闸门;只要分析指出 hierarchy、spacing、clarity 或 inconsistency 问题,就不能自动判通过
69
- - form factor 专用的 layout hygiene 现在被定义成独立于 `Visual Assist` 的硬闸门,mobile、tablet、desktop、web 都有各自的 blocker 条件
70
- - `.da-vinci/designs/` 现在更明确只用于放 `.pen` 文件,而且第一次 Pencil 写入后就要验证对应 `.pen` 已经成为 shell 可见文件
71
- - 多 surface 重设计现在要求先从已通过的 anchor surface 中抽出 shared primitive family,再扩展更多页面
72
- - Pencil 生成规则现在明确拒绝 `flex`、`margin` 这类 Web 属性
73
- - visual adapter 解析现在要求“解析出来的主 adapter 必须真正主导首轮设计”,而不是只登记在工件里
74
- - 复杂重设计现在默认采用 anchor-first 的 Pencil 生成策略:先做 1 到 3 个 anchor surface,截图审查后再扩展
75
- - design checkpoint 现在会明确拦截大量空占位、重复模板和过早的大批量多页面脚手架
76
- - 移动端、桌面端、Web、平板的提示词模板现在都包含 `Simple redesign`、`Complex redesign`、`Design-only`、`Continue`
77
- - `redesign-from-code` 现在明确写清:现有代码只是真相行为,不是真相布局
78
- - 复杂页面现在明确要求在大规模 Pencil 重设计前拆成 subpage、overlay、明显不同 state 和 implementation surface
79
- - design checkpoint 现在明确会拦截旧 UI 换皮、通用卡片拼贴、弱视觉锚点和装饰性噪音
80
- - `Visual Assist` 文档现在补了快速上手建议和“设计质量优先”配置
81
- - visual adapter 的配置字段、解析顺序和回退行为现在有单独文档说明
82
- - 现在提供按移动端、桌面端、Web、平板拆分的 `Visual Assist` 可复制模板
83
- - 仓库内的 forward test 示例现在展示了 `Visual Assist`、adapter 解析结果和 `.pen` 持久化记录方式
84
- - Codex 的自然语言用法现在有单独文档,明确说明 `intake`、`prompt`、`continue` 和直接 mode 调用方式
85
- - 项目内 Pencil `.pen` 文件现在明确约定默认持久化到 `.da-vinci/designs/`
86
- - 设计源登记和工件模板现在会记录项目内优先使用的 `.pen` 路径
87
- - `intake`、`prompt`、`continue` 三个提示词入口辅助路由已随 Codex、Claude、Gemini 一起发布
88
- - 中文配套文档现在刻意只保留 `README.zh-CN.md` 和 `docs/zh-CN/`
89
- - 资产校验现在覆盖完整的随包文档集合
90
- - `da-vinci status` 会校验 Codex、Claude、Gemini 的完整安装资产
91
- - Claude 和 Gemini 安装后的命令文案已改为自洽的工作流措辞
92
- - `.npmrc` 和 `openspec/` 现在只本地保留,不再进入版本管理和 npm 包
93
- - 安装、卸载、状态、资产校验都通过 Node CLI 提供
94
- - 仓库内含一个 `greenfield-spec` 的本地 forward test
33
+ - `@xenonbyte/da-vinci-workflow@0.2.1`
34
+
35
+ `0.2.1` 版本重点:
36
+
37
+ - 新增 execution-chain CLI surface:`workflow-status`、`next-step`、`lint-spec`、`scope-check`、`lint-tasks`、`lint-bindings`、`generate-sidecars`、`verify-*`、`diff-spec`、`scaffold`
38
+ - 新增持久化 workflow state execution signal 记录,路由判断可以复用可信快照,同时继续尊重最新 verify / audit 阻塞结果
39
+ - 新增 planning sidecar、diff 和基于 bindings scaffold,方便直接从 CLI 看 planning drift 和实现覆盖
40
+ - CI 现已拆成 core regression、contracts、workflow e2e 三条 lane,execution-chain 新流程会被独立回归
41
+ - 回归测试新增覆盖 workflow-state 推导、persisted-state 复用、planning lint、sidecar 生成、verify/scaffold 与 audit execution-signal 集成
42
+ - 修复 `generate-sidecars`:当 workflow / change 无法解析时,返回 `BLOCK`,不再误报 `PASS`
43
+ - 修复 `verify-implementation`:测试文件、fixture 和脚本文件不再被当成真实实现覆盖证据
44
+ - 中英文 README 与命令文档现已同步补充 execution-chain 新表面说明
95
45
 
96
46
  ## 支持的工作流模式
97
47
 
@@ -139,6 +89,11 @@ Da Vinci 当前支持五种模式:
139
89
  - `intake` 和 `continue` 通常应该回到主工作流入口,即 `$da-vinci ...` 或 `/da-vinci ...`
140
90
  - 它们不应该默认把用户直接导向 `build`
141
91
  - `build` 仍然保留,但它是给已经实现就绪的高级直接入口
92
+ - 有 shell 能力时,优先先跑 `da-vinci workflow-status --project <path> [--change <id>] --json` 与 `da-vinci next-step --project <path> [--change <id>]` 再决定 continue 的路由文本
93
+ - 如果运行时 spec 质量不确定,进入实现前先跑 `da-vinci lint-spec --project <path> [--change <id>]`
94
+ - 如果页面/状态在规划工件之间的传播关系不确定,进入实现前先跑 `da-vinci scope-check --project <path> [--change <id>]`
95
+ - 终态前先跑 `da-vinci verify-bindings` / `verify-implementation` / `verify-structure` / `verify-coverage`
96
+ - 需要显式追踪规划变更时,先 `da-vinci generate-sidecars --project <path> [--change <id>]`,再 `da-vinci diff-spec --project <path> [--change <id>]`
142
97
  - `continue` 的选路应先看工件和 checkpoint 真相,再看上下文补充信息
143
98
  - Context Delta 只用于恢复上下文,不是阶段判定真相源
144
99
  - 如果 Context Delta 与当前工件冲突,应该忽略冲突条目并按工件真相继续
@@ -300,6 +255,14 @@ project/
300
255
  - 项目内持久化的 Pencil `.pen` 文件默认放在 `.da-vinci/designs/`
301
256
  - change 级工件放在 `.da-vinci/changes/<change-id>/`
302
257
 
258
+ 如果项目还没有这套基础骨架,可以先执行:
259
+
260
+ ```bash
261
+ da-vinci bootstrap-project --project /abs/path/to/project --change <change-id>
262
+ ```
263
+
264
+ 这个命令会先生成项目级 `.da-vinci/` 工件、默认项目内 `.pen`,以及当前工作流所要求的最小 change 级设计工件。
265
+
303
266
  ## 设计源规则
304
267
 
305
268
  - `DA-VINCI.md` 是跨页面视觉一致性的项目级视觉契约
@@ -312,8 +275,12 @@ project/
312
275
  - 复杂页面在 Pencil 重设计前应该先拆成 subpage、state、overlay 和 implementation surface
313
276
  - `design-registry.md` 里登记的首选 `.pen` 路径属于工作流自动维护的状态,不应该依赖用户手工填写
314
277
  - 一旦进入 Pencil 设计,Da Vinci 应该使用或创建这个项目内 `.pen` 路径,而不是继续沿用当前随手打开的 Pencil 文档
278
+ - 在多设计源场景(例如项目内 `.pen` + 外部备份 `.pen`)下,不能因为上一轮 `pencil-session persist` 成功就默认项目内文件一定是全局最新
279
+ - 新一轮编辑前要先做跨源 hash 对齐并明确来源优先级
280
+ - 如果外部源被确认是最新,先把它同步回项目内 `.pen`,再继续 live 编辑
315
281
  - 如果 Pencil MCP 修改了 live 文档但没有自动把项目内 `.pen` 文件落到磁盘,工作流应该先把该 `.pen` 文件补写到登记路径,再把这轮设计当成可追踪结果
316
282
  - 在进入 `pencil-bindings.md` 和实现任务前,应该先通过 `design-source checkpoint`,确认登记路径、当前设计源和 shell 可见 `.pen` 文件已经收敛成同一个项目级来源
283
+ - 多设计源场景(例如存在外部备份 `.pen`)下,`pencil-session persist` 成功只代表“本轮 live 与项目内 `.pen` 同步”,不等于“项目内文件一定是全局最新”;继续前必须做跨源 hash 对齐
317
284
 
318
285
  可选 visual adapter 规则:
319
286
 
@@ -428,9 +395,9 @@ Context Delta 与 audit 的关系:
428
395
 
429
396
  - 加上 `--write` 时,会把 `Configured reviewers`、`Executed reviewers`、`Review source`、`Status`、`Issue list`、`Revision outcome` 写入 `pencil-design.md`
430
397
  - 可通过 `--status PASS|WARN|BLOCK` 显式指定,也可基于当前设计工件做保守推断
431
- - 对 required supervisor gate,优先使用 `--run-reviewers --write`,让 reviewer skills 执行与结果持久化一体完成
432
- - reviewer 执行参数可通过 `--review-concurrency`、`--review-retries`、`--review-retry-delay-ms` 调优(指数退避)
433
- - `design-supervisor review` 作为兼容别名仍可使用
398
+ - 对 required supervisor gate,优先使用 `--run-reviewers --write`,让配置的 reviewer skill 真正执行并一次落盘
399
+ - reviewer 执行参数可通过 `--review-concurrency`、`--review-retries`、`--review-retry-delay-ms`、`--review-retry-max-delay-ms` 调优(带上限的指数退避)
400
+ - `design-supervisor review` 兼容别名仍然保留
434
401
 
435
402
  当 Pencil MCP 可用时,Da Vinci 现在还要求在终态完成声明前,把 MCP runtime gate 结果记录到 `pencil-design.md`。这层 gate 负责检查 live editor/source convergence,与 filesystem audit 分工不同。
436
403
  在重设计进行中,如果有 shell 能力,应在第一次成功写入 Pencil 后立即运行 `da-vinci audit --mode integrity <project-path>`;如果同一个 anchor surface 连续回滚,则继续配合 `da-vinci preflight-pencil` 和更小的 follow-up batch。
@@ -439,15 +406,18 @@ Context Delta 与 audit 的关系:
439
406
 
440
407
  - 首次运行路径:先用 `da-vinci ensure-pen --output <path> --verify-open` seed 登记好的项目内 `.pen`,打开这个精确路径,然后把后续 MCP 快照持续写回同一个文件
441
408
  - 继续迭代路径:如果项目里原本已有登记的 `.pen`,先打开它继续工作;但发生实质性 live edit 后,要把当前 live MCP 快照重新持久化回同一路径,并运行 `da-vinci check-pen-sync`
409
+ - 多源门禁:如果还存在外部 `.pen` 源,每次新一轮 `pencil-session begin` 前先运行 `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>`;若 hash 不一致,必须先确认来源优先级并把选中的来源同步回 `<project-pen>`
442
410
 
443
411
  如果是自治运行,session wrapper 只要可用就必须使用。只有 wrapper 确实不可用时,才退回底层 helper。
444
412
 
445
413
  持久化命令:
446
414
 
447
415
  - 自治运行必须使用的 session 命令:
448
- - `da-vinci pencil-session begin --project <project-path> --pen <path>`
416
+ - `da-vinci pencil-session begin --project <project-path> --pen <path> [--baseline <path>] [--prefer-source <path>] [--sync-preferred-source]`
449
417
  - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
450
418
  - `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
419
+ - `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>[,<other-pen>...] [--prefer-source <path>]`
420
+ - `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`
451
421
  - `da-vinci ensure-pen --output <path> --verify-open`
452
422
  - `da-vinci write-pen --output <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version> --verify-open`
453
423
  - `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
@@ -20,8 +20,13 @@ Output should include:
20
20
  - one more conservative continuation prompt when useful
21
21
 
22
22
  Route discipline:
23
+ - treat this route as prompt-first orchestration; do not assume a standalone CLI `continue` command exists
24
+ - when shell access is available, run `da-vinci workflow-status --project <path> [--change <id>] --json` before deciding the primary continuation route
25
+ - use `da-vinci next-step --project <path> [--change <id>]` as the first routing signal
26
+ - run `da-vinci scope-check --project <path> [--change <id>]` when page/state propagation looks ambiguous
23
27
  - do not restart discovery if the current artifacts already contain enough truth
24
28
  - determine route selection from artifact and checkpoint truth before reading contextual deltas
29
+ - if workflow-status or next-step output is missing, stale, or unavailable, fall back to artifact scanning and checkpoint evidence
25
30
  - use contextual deltas as auxiliary recovery context only; they must not override route selection
26
31
  - if contextual deltas conflict with current artifacts, ignore them for routing and call out the conflict
27
32
  - do not default the user into `/dv:build` unless the project is clearly implementation-ready
@@ -22,6 +22,7 @@ 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`.
@@ -7,7 +7,7 @@ Use the `da-vinci` skill for this request.
7
7
 
8
8
  Action: `continue`
9
9
 
10
- Goal:
10
+ Focus on:
11
11
  - inspect existing workflow artifacts first
12
12
  - detect the current workflow phase
13
13
  - generate the best executable continuation prompt
@@ -20,8 +20,13 @@ Output should include:
20
20
  - one more conservative continuation prompt when useful
21
21
 
22
22
  Route discipline:
23
+ - treat this route as prompt-first orchestration; do not assume a standalone CLI `continue` command exists
24
+ - when shell access is available, run `da-vinci workflow-status --project <path> [--change <id>] --json` before deciding the primary continuation route
25
+ - use `da-vinci next-step --project <path> [--change <id>]` as the first routing signal
26
+ - run `da-vinci scope-check --project <path> [--change <id>]` when page/state propagation looks ambiguous
23
27
  - do not restart discovery if the current artifacts already contain enough truth
24
28
  - determine route selection from artifact and checkpoint truth before reading contextual deltas
29
+ - if workflow-status or next-step output is missing, stale, or unavailable, fall back to artifact scanning and checkpoint evidence
25
30
  - use contextual deltas as auxiliary recovery context only; they must not override route selection
26
31
  - if contextual deltas conflict with current artifacts, ignore them for routing and call out the conflict
27
32
  - do not default the user into `/prompts:dv-build` unless the project is clearly implementation-ready
@@ -16,6 +16,7 @@ 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`.
@@ -19,8 +19,13 @@ Output should include:
19
19
  - one more conservative continuation prompt when useful
20
20
 
21
21
  Route discipline:
22
+ - treat this route as prompt-first orchestration; do not assume a standalone CLI `continue` command exists
23
+ - when shell access is available, run `da-vinci workflow-status --project <path> [--change <id>] --json` before deciding the primary continuation route
24
+ - use `da-vinci next-step --project <path> [--change <id>]` as the first routing signal
25
+ - run `da-vinci scope-check --project <path> [--change <id>]` when page/state propagation looks ambiguous
22
26
  - do not restart discovery if the current artifacts already contain enough truth
23
27
  - determine route selection from artifact and checkpoint truth before reading contextual deltas
28
+ - if workflow-status or next-step output is missing, stale, or unavailable, fall back to artifact scanning and checkpoint evidence
24
29
  - use contextual deltas as auxiliary recovery context only; they must not override route selection
25
30
  - if contextual deltas conflict with current artifacts, ignore them for routing and call out the conflict
26
31
  - do not default the user into `/dv:build` unless the project is clearly implementation-ready
@@ -15,6 +15,7 @@ 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`.
@@ -0,0 +1,33 @@
1
+ # Da Vinci Continue
2
+
3
+ {{USE_LINE}}
4
+
5
+ Action: `continue`
6
+
7
+ Focus on:
8
+ - inspect existing workflow artifacts first
9
+ - detect the current workflow phase
10
+ - generate the best executable continuation prompt
11
+
12
+ Output should include:
13
+ - detected workflow state
14
+ - missing or weak artifacts
15
+ - contextual recovery notes from recent checkpoint deltas when they are consistent with current artifacts
16
+ - one primary `{{PROMPT_PREFIX}}` prompt
17
+ - one more conservative continuation prompt when useful
18
+
19
+ Route discipline:
20
+ - treat this route as prompt-first orchestration; do not assume a standalone CLI `continue` command exists
21
+ - when shell access is available, run `da-vinci workflow-status --project <path> [--change <id>] --json` before deciding the primary continuation route
22
+ - use `da-vinci next-step --project <path> [--change <id>]` as the first routing signal
23
+ - run `da-vinci scope-check --project <path> [--change <id>]` when page/state propagation looks ambiguous
24
+ - do not restart discovery if the current artifacts already contain enough truth
25
+ - determine route selection from artifact and checkpoint truth before reading contextual deltas
26
+ - if workflow-status or next-step output is missing, stale, or unavailable, fall back to artifact scanning and checkpoint evidence
27
+ - use contextual deltas as auxiliary recovery context only; they must not override route selection
28
+ - if contextual deltas conflict with current artifacts, ignore them for routing and call out the conflict
29
+ - do not default the user into `{{BUILD_ROUTE}}` unless the project is clearly implementation-ready
30
+ - if design artifacts exist but `tasks.md` does not, prefer a continuation prompt that moves into `{{TASKS_ROUTE}}`
31
+ - only prefer `{{BUILD_ROUTE}}` once task generation and implementation readiness are already clear
32
+ - do not route into `{{BUILD_ROUTE}}` when any design gate is unresolved: missing shell-visible project-local `.pen`, active/unclosed Pencil session, runtime/design-source checkpoint still BLOCK, or required design-supervisor review still BLOCK/unaccepted
33
+ - continuation prompts should usually target the main workflow entry so Da Vinci can resume the full state machine
@@ -37,6 +37,36 @@ These helpers exist to select or resume the correct route. They are not substitu
37
37
 
38
38
  These commands do not replace route selection, but they support design execution quality:
39
39
 
40
+ - `da-vinci workflow-status --project <path> [--change <id>] [--json]`
41
+ - derives the current workflow stage from artifact and checkpoint truth
42
+ - reports blockers, warnings, handoff-gate state, and one primary route recommendation
43
+ - keep this distinct from `audit`: route guidance is not completion truth
44
+ - `da-vinci next-step --project <path> [--change <id>] [--json]`
45
+ - provides a route-first continuation summary from the same derived workflow state
46
+ - use this as the first continuation signal before free-form artifact scanning
47
+ - `da-vinci lint-spec --project <path> [--change <id>] [--strict] [--json]`
48
+ - validates Da Vinci runtime `spec.md` schema sections (`Behavior`, `States`, `Inputs`, `Outputs`, `Acceptance`, `Edge Cases`)
49
+ - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
50
+ - explicitly does not treat OpenSpec planning `ADDED Requirements` structure as runtime-spec validity
51
+ - `da-vinci scope-check --project <path> [--change <id>] [--strict] [--json]`
52
+ - checks proposal, page-map, runtime specs, pencil-design states, and tasks for scope propagation gaps
53
+ - emits a machine-readable coverage matrix for pages and states
54
+ - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
55
+ - `da-vinci lint-tasks --project <path> [--change <id>] [--strict] [--json]`
56
+ - validates top-level task groups, ordering, verification actions, and behavior-to-task coverage hints
57
+ - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
58
+ - `da-vinci lint-bindings --project <path> [--change <id>] [--strict] [--json]`
59
+ - validates implementation-to-Pencil mappings for parseability, source shape, and implementation landings
60
+ - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
61
+ - `da-vinci generate-sidecars --project <path> [--change <id>] [--json]`
62
+ - explicitly generates deterministic planning sidecars: `spec.index.json`, `tasks.index.json`, `page-map.index.json`, `bindings.index.json`
63
+ - this is the only write surface for planning sidecars; lint/status/verify surfaces should not silently rewrite them
64
+ - `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>] [--strict] [--json]`
65
+ - verifies code landings, planned-state implementation evidence, and structural consistency against bindings
66
+ - `verify-structure` reports whether checks used markup-backed analysis or heuristic fallback and exposes confidence
67
+ - `da-vinci diff-spec --project <path> [--change <id>] [--from <sidecars-dir>] [--json]`
68
+ - compares normalized planning sidecars and reports added/removed/modified requirement planning items
69
+ - includes normalized spec deltas plus broader planning summaries (tasks/page-map/bindings) under one surface
40
70
  - `da-vinci icon-sync`
41
71
  - sync official icon names (Material Symbols, Lucide, Feather, Phosphor) into `~/.da-vinci/icon-catalog.json`
42
72
  - default scope is user-level (current HOME), reusable across projects for the same user
@@ -47,12 +77,24 @@ These commands do not replace route selection, but they support design execution
47
77
  - `da-vinci icon-search --query "<text>" [--family ...] [--top ...] [--aliases ...]`
48
78
  - resolve likely `icon_font` names before writing Pencil `batch_design` operations
49
79
  - 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]`
80
+ - `da-vinci bootstrap-project --project <path> [--change <id>] [--force]`
81
+ - scaffold the minimum `.da-vinci/` workflow spine for a repo that has not been hydrated yet
82
+ - seeds a workflow-owned project-local `.pen` under `.da-vinci/designs/`
83
+ - optionally creates the current change-level design artifacts (`design-brief.md`, `design.md`, `pencil-design.md`, `pencil-bindings.md`)
84
+ - use this before the first strict `audit` run when starting from an empty repo, a doc-first example, or a partially hydrated workspace
85
+ - `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
86
  - persists a structured supervisor-review record (`Configured reviewers`, `Executed reviewers`, `Review source`, `Status`, `Issue list`, `Revision outcome`) in `pencil-design.md`
52
87
  - 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
88
+ - `--review-concurrency`, `--review-retries`, `--review-retry-delay-ms`, and `--review-retry-max-delay-ms` control parallelism plus bounded retry backoff for reviewer execution
54
89
  - when `Require Supervisor Review: true`, inferred/manual records are completion-blocking
55
90
  - `design-supervisor review` is kept as a compatibility alias that forwards to this command
91
+ - `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>[,<other-pen>...] [--prefer-source <path>]`
92
+ - compares canonical `.pen` snapshot hashes across project-local and external/secondary sources before a new design round
93
+ - blocks by default on divergence until source priority is explicit
94
+ - `--prefer-source <project-pen>` records an explicit decision to keep the project path authoritative
95
+ - `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`
96
+ - copies the selected latest `.pen` source into the project-local `.pen` path and refreshes Da Vinci state metadata
97
+ - use when external backup is the latest baseline and must be materialized before `pencil-session begin`
56
98
 
57
99
  Use these utilities during `/dv:design`, especially before anchor-surface icon finalization.
58
100
 
@@ -102,6 +144,7 @@ Outputs:
102
144
 
103
145
  Important continuation rule:
104
146
 
147
+ - when shell access is available, run `da-vinci workflow-status --project <path> [--change <id>] --json` first and use `da-vinci next-step --project <path> [--change <id>]` as the first route signal
105
148
  - if design exists but `tasks.md` does not, continuation should usually point to `tasks`
106
149
  - it should not promote `build` as a co-equal next step yet
107
150
  - route selection should be derived from artifact and checkpoint truth before contextual deltas are consulted