@xenonbyte/da-vinci-workflow 0.1.26 → 0.2.2

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 (45) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +28 -65
  3. package/README.zh-CN.md +28 -65
  4. package/bin/da-vinci-tui.js +8 -0
  5. package/commands/claude/dv/continue.md +5 -0
  6. package/commands/codex/prompts/dv-continue.md +6 -1
  7. package/commands/gemini/dv/continue.toml +5 -0
  8. package/commands/templates/dv-continue.shared.md +33 -0
  9. package/docs/dv-command-reference.md +35 -0
  10. package/docs/execution-chain-migration.md +46 -0
  11. package/docs/execution-chain-plan.md +125 -0
  12. package/docs/prompt-entrypoints.md +8 -0
  13. package/docs/skill-usage.md +217 -0
  14. package/docs/workflow-examples.md +10 -0
  15. package/docs/workflow-overview.md +26 -0
  16. package/docs/zh-CN/dv-command-reference.md +35 -0
  17. package/docs/zh-CN/execution-chain-migration.md +46 -0
  18. package/docs/zh-CN/prompt-entrypoints.md +8 -0
  19. package/docs/zh-CN/skill-usage.md +217 -0
  20. package/docs/zh-CN/workflow-examples.md +10 -0
  21. package/docs/zh-CN/workflow-overview.md +26 -0
  22. package/lib/artifact-parsers.js +120 -0
  23. package/lib/audit.js +61 -0
  24. package/lib/cli.js +351 -13
  25. package/lib/diff-spec.js +242 -0
  26. package/lib/execution-signals.js +136 -0
  27. package/lib/lint-bindings.js +143 -0
  28. package/lib/lint-spec.js +408 -0
  29. package/lib/lint-tasks.js +176 -0
  30. package/lib/planning-parsers.js +567 -0
  31. package/lib/scaffold.js +193 -0
  32. package/lib/scope-check.js +603 -0
  33. package/lib/sidecars.js +369 -0
  34. package/lib/supervisor-review.js +28 -3
  35. package/lib/utils.js +10 -2
  36. package/lib/verify.js +652 -0
  37. package/lib/workflow-contract.js +107 -0
  38. package/lib/workflow-persisted-state.js +297 -0
  39. package/lib/workflow-state.js +785 -0
  40. package/package.json +13 -3
  41. package/references/artifact-templates.md +26 -0
  42. package/references/checkpoints.md +14 -0
  43. package/references/modes.md +10 -0
  44. package/tui/catalog.js +1190 -0
  45. package/tui/index.js +727 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.2.2 - 2026-03-31
4
+
5
+ ### Added
6
+ - built-in terminal TUI surfaces via `da-vinci tui` and `da-vinci-tui`, with phase-grouped command discovery, bilingual labels, previewable execution, and project/change context controls
7
+ - in-TUI command parameter help so operators can inspect supported flags, placeholders, and required inputs before editing a preview command
8
+ - operator-facing English and Chinese workflow guides covering first-run routing, implementation handoff, pause/resume recovery, and TUI usage
9
+ - TUI regression coverage plus package-content checks for the dedicated TUI bin and shipped `tui/` assets
10
+
11
+ ### Changed
12
+ - README and Chinese companion docs now document the `0.2.2` TUI/operator release surface explicitly
13
+ - TUI child commands now execute from the active project context selected in the header instead of always inheriting the original launch cwd
14
+
15
+ ### Fixed
16
+ - `q` and `Ctrl-C` now fully terminate the TUI session instead of clearing the screen while leaving stdin resumed in the foreground
17
+ - preview-command editing now treats unclosed quotes as a recoverable TUI error instead of crashing the process
18
+ - the TUI JSON shortcut now uses `J`, preserving lowercase `j/k` for navigation without unreachable toggle branches
19
+
20
+ ## v0.2.1 - 2026-03-31
21
+
22
+ ### Added
23
+ - execution-chain workflow CLI surfaces: `workflow-status`, `next-step`, `lint-spec`, `scope-check`, `lint-tasks`, `lint-bindings`, `generate-sidecars`, `verify-*`, `diff-spec`, and `scaffold`
24
+ - persisted workflow-state snapshots and execution-signal files so route selection can reuse artifact-derived state while still reacting to fresh verify/audit outcomes
25
+ - planning sidecars and normalized spec/page-map/bindings/tasks diff support for drift inspection
26
+ - scaffold generation from `pencil-bindings.md`, plus workflow-state / verify / sidecar / audit execution-signal regression coverage
27
+ - split CI lanes for core regression, contracts, and workflow e2e coverage
28
+
29
+ ### Changed
30
+ - README and Chinese companion docs now document the `0.2.1` execution-chain release surface explicitly
31
+ - `generate-sidecars` now returns `BLOCK` when workflow/change resolution fails instead of emitting a misleading `PASS`
32
+ - `verify-implementation` now ignores tests, fixtures, scripts, and colocated `*.test.*` / `*.spec.*` files when checking implementation coverage heuristics
33
+
3
34
  ## v0.1.26 - 2026-03-31
4
35
 
5
36
  ### Added
package/README.md CHANGED
@@ -28,71 +28,18 @@ This workflow is intended for:
28
28
 
29
29
  Latest published npm package:
30
30
 
31
- - `@xenonbyte/da-vinci-workflow@0.1.26`
32
-
33
- Release highlights for `0.1.26`:
34
-
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
42
- - audit parser logic is now split into `lib/audit-parsers.js`, reducing `lib/audit.js` size and making maintenance safer
43
- - recursive file traversal now uses bounded safe scans with depth/count limits and symlink skipping
44
- - completion/integrity audit now rejects out-of-root `.pen` references from `design-registry.md`
45
- - `preflight-pencil` sandbox now blocks unsafe runtime tokens, disables dynamic code generation, and reports timeout failures explicitly
46
- - icon text normalization/tokenization is now shared across `icon-search` and `icon-aliases`, removing duplicated logic and adding parity coverage
47
- - `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
48
- - `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
49
- - `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)
50
- - added regression coverage for session-end sync guards and prompt-level build/continue gate discipline
51
- - continue-routing and recovery guidance now consistently prioritize artifact/checkpoint truth first, with contextual deltas treated as auxiliary notes only
52
- - context-delta audit now uses tighter expectation signals, status-mismatch wording, and `supersedes` validation with timestamp normalization
53
- - context-delta expectation checks are now automatic for checkpoint-bearing artifacts and allow explicit opt-in (`Context Delta Required`) only for edge cases
54
- - `design-supervisor review` is now a first-class final style-quality gate with explicit advisory versus required behavior controlled by `Require Supervisor Review`
55
- - `Visual Assist` docs now explain gate order, gate judging criteria, and branching across screenshot review, layout hygiene, design checkpoint, and design-supervisor review
56
- - `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
57
- - 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
58
- - design-supervisor review records now require explicit status, issue list, and revision outcome before they count as valid audit evidence
59
- - Pencil lock waiting now sleeps without busy-spinning, reducing CPU waste while preserving the synchronous CLI/session contract
60
- - project-local `.pen` persistence now uses an MCP-snapshot-to-disk path instead of relying on headless interactive `save()`
61
- - redesign runs now seed a registered project-local `.pen` before the first Pencil edit and record persisted snapshot hashes for later sync checks
62
- - `da-vinci write-pen` now atomically writes workflow-owned `.pen` files from MCP-readable node and variable payloads with optional reopen verification
63
- - `da-vinci ensure-pen` now seeds or verifies a registered project-local `.pen` before live editing starts
64
- - `da-vinci check-pen-sync` now compares a current live MCP snapshot payload against the persisted project-local `.pen`
65
- - `da-vinci snapshot-pen` now serves only as a disk-to-disk utility for rebuilding an existing Pencil source and verifying reopen
66
- - visual-adapter execution now requires explicit runtime declaration of the resolved primary adapter and any unavailable requested adapters
67
- - cross-platform near-name adapters such as `frontend-skill` and `frontend-design` are now treated as distinct unless the current environment explicitly resolves them
68
- - complex `redesign-from-code` runs now require a visual thesis, content plan, interaction thesis, and anchor-surface structural-delta notes before broad Pencil generation
69
- - 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
70
- - 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
71
- - `.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
72
- - multi-surface redesign guidance now requires a shared primitive family to be defined from approved anchor surfaces before broad page expansion
73
- - Pencil generation guidance now explicitly rejects web-only properties such as `flex` and `margin`
74
- - visual-adapter resolution now requires the resolved primary adapter to actively lead the first design pass
75
- - complex redesigns now default to anchor-first Pencil generation: design 1-3 anchor surfaces, review screenshots, then expand
76
- - design checkpoint now explicitly blocks placeholder-heavy repeated scaffolds and premature broad multi-screen generation
77
- - prompt presets for mobile, desktop, web, and tablet now include `Simple redesign`, `Complex redesign`, `Design-only`, and `Continue` variants
78
- - `redesign-from-code` now states explicitly that existing code is behavior truth, not layout truth
79
- - complex pages are now expected to decompose into subpages, overlays, materially different states, and implementation surfaces before broad Pencil redesign
80
- - design-checkpoint guidance now explicitly blocks skin-swap redesigns, generic card mosaics, weak visual anchors, and decorative clutter
81
- - `Visual Assist` docs now include quick-start recommendations and a quality-first configuration for design-critical work
82
- - visual-adapter configuration is now documented explicitly, including field meanings, resolution order, and fallback behavior
83
- - ready-to-copy `Visual Assist` presets are now included for mobile, desktop, web, and tablet scenarios
84
- - the repo-local forward test now shows how `Visual Assist`, adapter resolution, and persisted `.pen` paths should be recorded
85
- - Codex natural-language usage is now documented explicitly, including `intake`, `prompt`, `continue`, and direct mode entry patterns
86
- - project-local Pencil `.pen` files are now documented to persist under `.da-vinci/designs/`
87
- - design registry and artifact templates now record preferred persisted `.pen` paths for project-local reuse
88
- - prompt-entry helper routes for `intake`, `prompt`, and `continue` are now published across Codex, Claude, and Gemini
89
- - Chinese companion docs are now intentionally limited to `README.zh-CN.md` and `docs/zh-CN/`
90
- - asset validation now covers the full shipped documentation set
91
- - `da-vinci status` now validates full installed asset sets across Codex, Claude, and Gemini, and flags stale or locally modified copies
92
- - Claude and Gemini command adapters now use self-contained workflow wording after installation
93
- - `.npmrc` and `openspec/` are kept local-only and are no longer versioned or shipped in the npm package
94
- - Node-first install, uninstall, status, and asset validation commands remain the supported distribution path
95
- - repo-local forward-test example for a `greenfield-spec` workflow remains included
31
+ - `@xenonbyte/da-vinci-workflow@0.2.2`
32
+
33
+ Release highlights for `0.2.2`:
34
+
35
+ - added the built-in terminal TUI via `da-vinci tui` and `da-vinci-tui`, with phase-grouped command discovery, bilingual labels, command previews, and project/change context management
36
+ - added command-parameter help inside the TUI so operators can inspect supported flags and placeholder requirements without leaving the terminal
37
+ - added operator-facing English and Chinese workflow guides that explain first-run routing, implementation handoff, pause/resume rules, and TUI usage
38
+ - expanded release coverage with TUI-specific regression tests plus package-content checks for the dedicated TUI bin and shipped `tui/` assets
39
+ - fixed TUI exit handling so `q` and `Ctrl-C` actually terminate the interactive session instead of leaving stdin resumed in the foreground
40
+ - fixed preview-command editing so unclosed quotes are handled as a recoverable TUI error instead of crashing the process
41
+ - fixed TUI JSON toggling by moving the shortcut to `J`, preserving `j/k` for navigation only
42
+ - fixed TUI child-command execution so relative paths resolve from the active project context selected in the header
96
43
 
97
44
  ## Supported workflow modes
98
45
 
@@ -137,10 +84,26 @@ Route discipline:
137
84
  - `intake` and `continue` should usually generate a main `$da-vinci ...` or `/da-vinci ...` prompt
138
85
  - they should not default the user into `build`
139
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
140
92
  - `continue` should determine route selection from artifact and checkpoint truth first
141
93
  - contextual checkpoint deltas are auxiliary recovery notes only and must not override routing
142
94
  - if contextual deltas conflict with current artifacts, ignore them for routing and record the conflict
143
95
 
96
+ ## TUI Quick Start
97
+
98
+ If the growing CLI surface is the main usability problem, use the built-in terminal UI instead of memorizing commands.
99
+
100
+ - launch with `da-vinci tui` or `da-vinci-tui`
101
+ - use `npx -p @xenonbyte/da-vinci-workflow da-vinci tui` when the package is not installed globally
102
+ - the TUI groups commands by workflow phase, supports English and Chinese descriptions, and lets you launch the selected command after previewing it
103
+ - `p` sets project path context, `c` sets change-id context, `l` toggles language, `m` edits the preview command, and `Enter` runs it
104
+
105
+ Use [docs/skill-usage.md](/Users/xubo/x-skills/da-vinci/docs/skill-usage.md) for the operator-facing workflow, resume rules, and TUI guidance.
106
+
144
107
  ## Visual Assist Quick Start
145
108
 
146
109
  Use `Visual Assist` when the project wants optional help from local UI-design skills such as `frontend-skill` or `ui-ux-pro-max`.
package/README.zh-CN.md CHANGED
@@ -30,71 +30,18 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
30
30
 
31
31
  最新已发布 npm 包:
32
32
 
33
- - `@xenonbyte/da-vinci-workflow@0.1.26`
34
-
35
- `0.1.26` 版本重点:
36
-
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 外仍回退绝对路径),便于日志阅读
44
- - audit 解析职责已拆分到 `lib/audit-parsers.js`,`lib/audit.js` 体量下降,可维护性更好
45
- - 递归文件扫描改为安全有界遍历:增加深度/数量上限,并跳过符号链接
46
- - completion/integrity audit 现在会拦截并忽略 `design-registry.md` 中越出项目根目录的 `.pen` 引用
47
- - `preflight-pencil` 沙箱增强:拦截危险运行时 token、禁用动态代码生成,并对超时失败给出明确分类
48
- - `icon-search` 与 `icon-aliases` 现在复用同一套文本归一化/分词逻辑,去掉重复实现并补了一致性回归测试
49
- - `da-vinci pencil-session end` 现在默认要求提供 live 快照输入(`--nodes-file`);只有显式 `--force` 才允许跳过,避免 live MCP 与磁盘未同步时被静默关闭
50
- - `build` 路由现在明确:编译成功不等于流程完成;对外宣布终态前必须通过 `da-vinci audit --mode completion --change <change-id> <project-path>`
51
- - `continue` 的推荐规则现在会拦截未过设计门禁时的 `build` 选路(缺少项目内 `.pen`、session 未关闭、runtime/design-source BLOCK、required design-supervisor BLOCK)
52
- - 新增回归测试覆盖:session 结束同步防护,以及 build/continue 提示词级门禁约束
53
- - `continue` 的选路与恢复规则现已统一:先看工件/checkpoint 真相,再把 Context Delta 当作辅助信息
54
- - Context Delta 审计规则已强化:触发信号更精确、告警改为状态不一致语义,并补充 `supersedes` 校验与时间归一化
55
- - checkpoint 相关工件默认自动启用 Context Delta 期望检查;只有少数无 checkpoint 标题的工件才需要显式 `Context Delta Required`
56
- - `design-supervisor review` 现在成为正式的最终风格质量 gate,并通过 `Require Supervisor Review` 明确区分“建议性”与“硬门槛”
57
- - `Visual Assist` 文档现在补全了 gate 顺序、每层 gate 怎么审,以及 screenshot review、layout hygiene、design checkpoint、design-supervisor review 之间的分叉规则
58
- - 移动端、桌面端、Web、平板四套 `visual-assist-presets` 现在都提供三种明确变体:只有 adapter、reviewer 建议性审查、reviewer 硬签字,中英文一致
59
- - completion / integrity audit 现在真正以 `Require Supervisor Review: true` 作为硬门槛开关,而不是只要配置 reviewer 就一律阻断
60
- - `design-supervisor review` 记录现在必须有明确状态、问题列表和回改结果,才算有效审查证据
61
- - Pencil 锁等待现在改成阻塞 sleep,不再 busy wait 空转 CPU,同时保留同步 CLI/session 的调用语义
62
- - 项目内 `.pen` 持久化现在改为“从 MCP 快照写回磁盘”的正式路径,不再依赖 headless interactive `save()`
63
- - 重设计流程现在要求在第一次 Pencil 编辑前先 seed 一个登记好的项目内 `.pen`,并记录后续持久化快照 hash 以便做同步校验
64
- - `da-vinci write-pen` 现在可以把 MCP 可读的节点和变量快照原子写成工作流管理的 `.pen` 文件,并可选地做 reopen 校验
65
- - `da-vinci ensure-pen` 现在可以在 live 编辑开始前 seed 或校验登记好的项目内 `.pen`
66
- - `da-vinci check-pen-sync` 现在可以把当前 live MCP 快照和已持久化的项目内 `.pen` 做同步比对
67
- - `da-vinci snapshot-pen` 现在只作为 disk-to-disk 工具,用来从已有 Pencil 源重建规范化 `.pen` 并验证重新打开结果
68
- - visual adapter 的执行现在要求在运行时明确声明解析出来的主 adapter,以及哪些请求的 adapter 当前不可用
69
- - `frontend-skill`、`frontend-design` 这类跨平台近名 adapter 现在明确视为不同能力源,除非当前环境真的解析到了它们
70
- - 复杂 `redesign-from-code` 现在要求在大规模 Pencil 设计前先写 visual thesis、content plan、interaction thesis 和 anchor surface 的 structural-delta 说明
71
- - screenshot review 现在被明确强调为硬闸门;只要分析指出 hierarchy、spacing、clarity 或 inconsistency 问题,就不能自动判通过
72
- - form factor 专用的 layout hygiene 现在被定义成独立于 `Visual Assist` 的硬闸门,mobile、tablet、desktop、web 都有各自的 blocker 条件
73
- - `.da-vinci/designs/` 现在更明确只用于放 `.pen` 文件,而且第一次 Pencil 写入后就要验证对应 `.pen` 已经成为 shell 可见文件
74
- - 多 surface 重设计现在要求先从已通过的 anchor surface 中抽出 shared primitive family,再扩展更多页面
75
- - Pencil 生成规则现在明确拒绝 `flex`、`margin` 这类 Web 属性
76
- - visual adapter 解析现在要求“解析出来的主 adapter 必须真正主导首轮设计”,而不是只登记在工件里
77
- - 复杂重设计现在默认采用 anchor-first 的 Pencil 生成策略:先做 1 到 3 个 anchor surface,截图审查后再扩展
78
- - design checkpoint 现在会明确拦截大量空占位、重复模板和过早的大批量多页面脚手架
79
- - 移动端、桌面端、Web、平板的提示词模板现在都包含 `Simple redesign`、`Complex redesign`、`Design-only`、`Continue`
80
- - `redesign-from-code` 现在明确写清:现有代码只是真相行为,不是真相布局
81
- - 复杂页面现在明确要求在大规模 Pencil 重设计前拆成 subpage、overlay、明显不同 state 和 implementation surface
82
- - design checkpoint 现在明确会拦截旧 UI 换皮、通用卡片拼贴、弱视觉锚点和装饰性噪音
83
- - `Visual Assist` 文档现在补了快速上手建议和“设计质量优先”配置
84
- - visual adapter 的配置字段、解析顺序和回退行为现在有单独文档说明
85
- - 现在提供按移动端、桌面端、Web、平板拆分的 `Visual Assist` 可复制模板
86
- - 仓库内的 forward test 示例现在展示了 `Visual Assist`、adapter 解析结果和 `.pen` 持久化记录方式
87
- - Codex 的自然语言用法现在有单独文档,明确说明 `intake`、`prompt`、`continue` 和直接 mode 调用方式
88
- - 项目内 Pencil `.pen` 文件现在明确约定默认持久化到 `.da-vinci/designs/`
89
- - 设计源登记和工件模板现在会记录项目内优先使用的 `.pen` 路径
90
- - `intake`、`prompt`、`continue` 三个提示词入口辅助路由已随 Codex、Claude、Gemini 一起发布
91
- - 中文配套文档现在刻意只保留 `README.zh-CN.md` 和 `docs/zh-CN/`
92
- - 资产校验现在覆盖完整的随包文档集合
93
- - `da-vinci status` 会校验 Codex、Claude、Gemini 的完整安装资产,并标记陈旧或被本地改写的副本
94
- - Claude 和 Gemini 安装后的命令文案已改为自洽的工作流措辞
95
- - `.npmrc` 和 `openspec/` 现在只本地保留,不再进入版本管理和 npm 包
96
- - 安装、卸载、状态、资产校验都通过 Node CLI 提供
97
- - 仓库内含一个 `greenfield-spec` 的本地 forward-test 参考示例(文档优先,不是可直接通过 `da-vinci audit` 的 `.da-vinci/` 审计夹具)
33
+ - `@xenonbyte/da-vinci-workflow@0.2.2`
34
+
35
+ `0.2.2` 版本重点:
36
+
37
+ - 新增内置终端 TUI:可通过 `da-vinci tui` `da-vinci-tui` 启动,按阶段分组浏览命令,支持中英文说明、命令预览以及 project/change 上下文维护
38
+ - 新增 TUI 内的命令参数帮助,可以直接在终端里查看支持的 flag、占位符和必填参数
39
+ - 新增中英文 operator 文档,专门说明第一次如何进入、实现前如何衔接、中途退出后怎么恢复,以及 TUI 怎么配合
40
+ - 回归测试与打包校验现已覆盖 TUI 专项路径,包括独立 bin、`tui/` 目录资产和帮助输出
41
+ - 修复 TUI 退出路径:`q` `Ctrl-C` 现在会真正结束会话,不再把进程留在前台挂住
42
+ - 修复预览命令编辑:未闭合引号现在会显示可恢复错误页,不再直接把 TUI 进程打崩
43
+ - 修复 TUI 的 JSON 切换快捷键冲突:现在使用 `J` 切换 `--json`,`j/k` 只负责移动
44
+ - 修复 TUI 子命令执行目录:相对路径现在会基于当前 header 里选中的项目上下文解析
98
45
 
99
46
  ## 支持的工作流模式
100
47
 
@@ -142,10 +89,26 @@ Da Vinci 当前支持五种模式:
142
89
  - `intake` 和 `continue` 通常应该回到主工作流入口,即 `$da-vinci ...` 或 `/da-vinci ...`
143
90
  - 它们不应该默认把用户直接导向 `build`
144
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>]`
145
97
  - `continue` 的选路应先看工件和 checkpoint 真相,再看上下文补充信息
146
98
  - Context Delta 只用于恢复上下文,不是阶段判定真相源
147
99
  - 如果 Context Delta 与当前工件冲突,应该忽略冲突条目并按工件真相继续
148
100
 
101
+ ## TUI 快速上手
102
+
103
+ 如果真正的痛点是 CLI 面太多、不想记命令,就直接用内置终端 TUI。
104
+
105
+ - 用 `da-vinci tui` 或 `da-vinci-tui` 启动
106
+ - 没有全局安装时,用 `npx -p @xenonbyte/da-vinci-workflow da-vinci tui`
107
+ - TUI 会按工作流阶段对命令分组,支持中英文说明,并在执行前先给出命令预览
108
+ - `p` 设置项目路径上下文,`c` 设置 change-id 上下文,`l` 切换语言,`m` 编辑预览命令,`Enter` 执行
109
+
110
+ 如果你想看“人到底怎么用这个 skill、暂停后怎么续跑、TUI 怎么配合”的完整说明,直接看 [docs/zh-CN/skill-usage.md](/Users/xubo/x-skills/da-vinci/docs/zh-CN/skill-usage.md)。
111
+
149
112
  ## Visual Assist 快速上手
150
113
 
151
114
  当项目想借助本地 UI 设计 skill,例如 `frontend-skill` 或 `ui-ux-pro-max`,来提升设计质量时,就配置 `Visual Assist`。
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { runCli } = require("../lib/cli");
4
+
5
+ runCli(["tui", ...process.argv.slice(2)]).catch((error) => {
6
+ console.error(error.message || String(error));
7
+ process.exit(1);
8
+ });
@@ -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
@@ -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
@@ -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
@@ -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,40 @@ 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 tui [--project <path>] [--change <id>] [--lang en|zh]`
41
+ - opens a workflow-oriented terminal UI that groups commands by phase and lets you run them after previewing the generated CLI
42
+ - use `da-vinci-tui` as the dedicated bin alias, or `npx -p @xenonbyte/da-vinci-workflow da-vinci tui` without a global install
43
+ - useful when the command surface is harder to remember than the workflow itself
44
+ - `da-vinci workflow-status --project <path> [--change <id>] [--json]`
45
+ - derives the current workflow stage from artifact and checkpoint truth
46
+ - reports blockers, warnings, handoff-gate state, and one primary route recommendation
47
+ - keep this distinct from `audit`: route guidance is not completion truth
48
+ - `da-vinci next-step --project <path> [--change <id>] [--json]`
49
+ - provides a route-first continuation summary from the same derived workflow state
50
+ - use this as the first continuation signal before free-form artifact scanning
51
+ - `da-vinci lint-spec --project <path> [--change <id>] [--strict] [--json]`
52
+ - validates Da Vinci runtime `spec.md` schema sections (`Behavior`, `States`, `Inputs`, `Outputs`, `Acceptance`, `Edge Cases`)
53
+ - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
54
+ - explicitly does not treat OpenSpec planning `ADDED Requirements` structure as runtime-spec validity
55
+ - `da-vinci scope-check --project <path> [--change <id>] [--strict] [--json]`
56
+ - checks proposal, page-map, runtime specs, pencil-design states, and tasks for scope propagation gaps
57
+ - emits a machine-readable coverage matrix for pages and states
58
+ - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
59
+ - `da-vinci lint-tasks --project <path> [--change <id>] [--strict] [--json]`
60
+ - validates top-level task groups, ordering, verification actions, and behavior-to-task coverage hints
61
+ - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
62
+ - `da-vinci lint-bindings --project <path> [--change <id>] [--strict] [--json]`
63
+ - validates implementation-to-Pencil mappings for parseability, source shape, and implementation landings
64
+ - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
65
+ - `da-vinci generate-sidecars --project <path> [--change <id>] [--json]`
66
+ - explicitly generates deterministic planning sidecars: `spec.index.json`, `tasks.index.json`, `page-map.index.json`, `bindings.index.json`
67
+ - this is the only write surface for planning sidecars; lint/status/verify surfaces should not silently rewrite them
68
+ - `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>] [--strict] [--json]`
69
+ - verifies code landings, planned-state implementation evidence, and structural consistency against bindings
70
+ - `verify-structure` reports whether checks used markup-backed analysis or heuristic fallback and exposes confidence
71
+ - `da-vinci diff-spec --project <path> [--change <id>] [--from <sidecars-dir>] [--json]`
72
+ - compares normalized planning sidecars and reports added/removed/modified requirement planning items
73
+ - includes normalized spec deltas plus broader planning summaries (tasks/page-map/bindings) under one surface
40
74
  - `da-vinci icon-sync`
41
75
  - sync official icon names (Material Symbols, Lucide, Feather, Phosphor) into `~/.da-vinci/icon-catalog.json`
42
76
  - default scope is user-level (current HOME), reusable across projects for the same user
@@ -114,6 +148,7 @@ Outputs:
114
148
 
115
149
  Important continuation rule:
116
150
 
151
+ - 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
117
152
  - if design exists but `tasks.md` does not, continuation should usually point to `tasks`
118
153
  - it should not promote `build` as a co-equal next step yet
119
154
  - route selection should be derived from artifact and checkpoint truth before contextual deltas are consulted
@@ -0,0 +1,46 @@
1
+ # Execution-Chain Migration Guide
2
+
3
+ Use this guide when enabling the execution-chain upgrade surfaces on existing projects.
4
+
5
+ ## 1. Sidecar Generation Lifecycle
6
+
7
+ Planning sidecars are explicit artifacts, not hidden by-products.
8
+
9
+ - generate with `da-vinci generate-sidecars --project <path> [--change <id>]`
10
+ - sidecars are written under `.da-vinci/changes/<change-id>/sidecars/`
11
+ - lint, status, and verify commands must not silently rewrite sidecars
12
+ - regenerate sidecars after meaningful proposal/spec/page-map/tasks/bindings changes
13
+
14
+ ## 2. Advisory vs Strict Rollout
15
+
16
+ Default policy:
17
+
18
+ - `lint-spec`, `scope-check`, `lint-tasks`, `lint-bindings` are advisory (`WARN` without hard exit)
19
+ - pass `--strict` to promote warnings to blocking command exits
20
+ - promote strict mode in CI only after warning baselines stabilize
21
+
22
+ Audit integration:
23
+
24
+ - integrity audit treats planning-signal `BLOCK` as warning-level advisory evidence
25
+ - completion audit treats verification-signal `BLOCK` as failure-level evidence
26
+
27
+ ## 3. Persisted Workflow State Fallback
28
+
29
+ `workflow-status` uses `.da-vinci/state/workflow.json` only when:
30
+
31
+ - state schema version is supported
32
+ - change entry exists
33
+ - state timestamp is fresh
34
+ - fingerprint matches current artifact truth
35
+
36
+ If any check fails, Da Vinci falls back to derived state from artifacts and records reconciliation notes.
37
+
38
+ ## 4. Scaffold Constraints
39
+
40
+ `da-vinci scaffold` is an MVP skeleton generator with strict constraints:
41
+
42
+ - output is TODO-marked and reviewable only
43
+ - output is not final code generation
44
+ - no multi-framework expansion in the MVP
45
+ - scaffold boundaries come from `pencil-bindings.md` mappings
46
+ - verify scaffold output with `verify-bindings`, `verify-implementation`, and `verify-structure` before acceptance
@@ -0,0 +1,125 @@
1
+ # Execution-Chain Upgrade Plan Notes
2
+
3
+ This document records planning decisions required by the execution-chain upgrade.
4
+
5
+ ## Phase 0 Pre-work Decisions
6
+
7
+ ### Workflow inventory summary
8
+
9
+ Canonical workflow definitions currently live across:
10
+
11
+ - `SKILL.md`
12
+ - `references/` (`modes`, `checkpoints`, `artifact-templates`)
13
+ - command assets (`commands/*/dv/*`)
14
+ - CLI surfaces (`lib/cli.js`)
15
+ - workflow tests (`scripts/test-mode-consistency.js`, workflow-state tests)
16
+
17
+ ### Canonical contract concepts
18
+
19
+ The workflow contract must own:
20
+
21
+ - modes
22
+ - required artifacts
23
+ - checkpoints
24
+ - route dependencies
25
+ - stage handoff gates
26
+ - status vocabulary (`PASS/WARN/BLOCK`)
27
+
28
+ ### Compatibility boundaries
29
+
30
+ Existing projects can adopt upgrades without mandatory rewrites when:
31
+
32
+ - sidecars are optional until explicitly generated
33
+ - persisted workflow state is optional and falls back to derived state
34
+ - legacy artifact headings remain parseable
35
+
36
+ ### Sequencing rules
37
+
38
+ - scaffolding is downstream from verification-backed planning decisions
39
+ - persisted write-back is downstream from derived read-model stability
40
+ - prompt-first `continue` remains route orchestration, not standalone CLI continuation
41
+
42
+ ### Schema boundary
43
+
44
+ - OpenSpec planning specs define this upgrade itself
45
+ - Da Vinci runtime artifacts (`spec.md`, `tasks.md`, `pencil-bindings.md`, etc.) remain independent runtime schemas
46
+
47
+ ### Runtime section inventory
48
+
49
+ - `spec.md`: `Behavior`, `States`, `Inputs`, `Outputs`, `Acceptance`, `Edge Cases`
50
+ - `page-map.md`: canonical pages and states-per-page
51
+ - `tasks.md`: top-level task groups and checklist execution items
52
+ - `pencil-bindings.md`: implementation -> design mappings
53
+ - `verification.md`: requirement/design/binding/outcome evidence
54
+
55
+ ### Parser ownership strategy
56
+
57
+ - heading and section primitives stay in `audit-parsers.js`
58
+ - runtime planning parsers live in `planning-parsers.js`
59
+ - runtime spec parser lives in `artifact-parsers.js`
60
+
61
+ ### Test layering strategy
62
+
63
+ - unit: parser and envelope tests
64
+ - integration: command-level fixture tests (`lint-*`, `scope-check`, `verify-*`, sidecars, diff)
65
+ - contract: workflow-contract and generated command-asset checks
66
+ - backward compatibility: fixtures missing sidecars/workflow state/new template metadata
67
+
68
+ ### Phase-level estimates and re-baseline rule
69
+
70
+ - Phase 1: 1-2 weeks
71
+ - Phase 2: 1-2 weeks
72
+ - Phase 3: 1-2 weeks
73
+ - Phase 4a: 1-2 weeks
74
+ - Phase 4b: 1-2 weeks
75
+ - Phase 4c: 1-2 weeks
76
+
77
+ Re-baseline rule:
78
+
79
+ - if phase-exit DoD misses by >20%, freeze scope expansion and re-estimate remaining phases before adding new surfaces
80
+
81
+ ## DoD and MVP Mapping
82
+
83
+ ### Measurable DoD checks
84
+
85
+ - Phase 0: inventory, parser ownership, schema boundaries, and test layers documented
86
+ - Phase 1: workflow-status/next-step + prompt-first continue integration + contract tests green
87
+ - Phase 2: lint/scope + deterministic sidecars + advisory/strict semantics tested
88
+ - Phase 3: verify surfaces + task-group metadata + audit wiring tested
89
+ - Phase 4a: persisted state + diff + compatibility hardening tested
90
+ - Phase 4b: constrained scaffold MVP tested
91
+ - Phase 4c: command-asset convergence + docs + release controls tested
92
+
93
+ ### First-release MVP scope
94
+
95
+ In scope:
96
+
97
+ - workflow-status/next-step
98
+ - lint-spec/lint-tasks/lint-bindings/scope-check
99
+ - generate-sidecars + diff-spec
100
+ - verify-bindings/verify-implementation/verify-structure/verify-coverage
101
+ - persisted workflow-state fallback
102
+ - constrained scaffold skeleton output
103
+
104
+ Out of scope:
105
+
106
+ - multi-framework scaffold generation
107
+ - autonomous production code generation from `.pen` without review
108
+
109
+ ### CI and validation mapping
110
+
111
+ - core regression lane: `npm run quality:ci:core`
112
+ - workflow e2e lane: `npm run quality:ci:e2e`
113
+ - reviewer bridge lane: `npm run quality:reviewer-bridge-smoke` (opt-in)
114
+ - contract lane: `npm run quality:ci:contracts`
115
+
116
+ ### Promotion rules
117
+
118
+ - MVP -> full rollout promotion requires all phase DoD checks green for two consecutive CI cycles
119
+ - advisory-to-strict promotion for planning lint requires warning baseline review and owner signoff
120
+
121
+ ### Release criteria and fallback
122
+
123
+ - release requires core + contracts + e2e lanes green
124
+ - stale persisted state always falls back to derived state
125
+ - verify-structure unsupported cases must emit heuristic fallback with confidence
@@ -64,6 +64,12 @@ What it should output:
64
64
 
65
65
  Continuation precedence:
66
66
 
67
+ - when shell access is available, run `da-vinci workflow-status --project <path> [--change <id>] --json` before route selection
68
+ - use `da-vinci next-step --project <path> [--change <id>]` as the first continuation routing signal
69
+ - run `da-vinci lint-spec --project <path> [--change <id>]` when runtime spec quality is uncertain before routing into `build`
70
+ - run `da-vinci scope-check --project <path> [--change <id>]` when page or state propagation across planning artifacts is uncertain
71
+ - run `da-vinci verify-bindings --project <path> [--change <id>]` and `da-vinci verify-coverage --project <path> [--change <id>]` before terminal completion routing
72
+ - run `da-vinci diff-spec --project <path> [--change <id>]` after planning edits when continuation must reason about changed requirement slices
67
73
  - determine routing from artifact and checkpoint truth first
68
74
  - use contextual checkpoint deltas only as auxiliary recovery context
69
75
  - if contextual deltas conflict with current artifacts, ignore them for routing and note the conflict
@@ -79,6 +85,8 @@ Use this default sequence:
79
85
 
80
86
  Do not default this sequence to `build`.
81
87
 
88
+ If command recall becomes the main friction, launch `da-vinci tui` and use the grouped workflow surfaces from the terminal UI instead of memorizing each CLI surface manually.
89
+
82
90
  `build` is still valid, but it is an expert route for workflows that are already implementation-ready.
83
91
 
84
92
  State rule: