@xenonbyte/da-vinci-workflow 0.2.3 → 0.2.5

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 (49) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +32 -7
  3. package/README.zh-CN.md +151 -7
  4. package/SKILL.md +45 -704
  5. package/commands/claude/dv/build.md +5 -0
  6. package/commands/claude/dv/continue.md +4 -0
  7. package/commands/claude/dv/tasks.md +6 -0
  8. package/commands/claude/dv/verify.md +2 -0
  9. package/commands/codex/prompts/dv-build.md +5 -0
  10. package/commands/codex/prompts/dv-continue.md +4 -0
  11. package/commands/codex/prompts/dv-tasks.md +6 -0
  12. package/commands/codex/prompts/dv-verify.md +2 -0
  13. package/commands/gemini/dv/build.toml +5 -0
  14. package/commands/gemini/dv/continue.toml +4 -0
  15. package/commands/gemini/dv/tasks.toml +6 -0
  16. package/commands/gemini/dv/verify.toml +2 -0
  17. package/commands/templates/dv-continue.shared.md +4 -0
  18. package/docs/discipline-and-orchestration-upgrade.md +83 -0
  19. package/docs/dv-command-reference.md +33 -5
  20. package/docs/execution-chain-migration.md +23 -0
  21. package/docs/prompt-entrypoints.md +6 -0
  22. package/docs/skill-contract-maintenance.md +14 -0
  23. package/docs/skill-usage.md +16 -0
  24. package/docs/workflow-overview.md +17 -0
  25. package/docs/zh-CN/dv-command-reference.md +31 -5
  26. package/docs/zh-CN/execution-chain-migration.md +23 -0
  27. package/docs/zh-CN/prompt-entrypoints.md +6 -0
  28. package/docs/zh-CN/skill-usage.md +16 -0
  29. package/docs/zh-CN/workflow-overview.md +17 -0
  30. package/lib/audit-parsers.js +148 -1
  31. package/lib/cli/helpers.js +43 -0
  32. package/lib/cli/lint-family.js +56 -0
  33. package/lib/cli/verify-family.js +79 -0
  34. package/lib/cli.js +123 -145
  35. package/lib/execution-profile.js +143 -0
  36. package/lib/execution-signals.js +19 -1
  37. package/lib/lint-tasks.js +86 -2
  38. package/lib/planning-parsers.js +263 -19
  39. package/lib/scaffold.js +454 -23
  40. package/lib/supervisor-review.js +2 -1
  41. package/lib/task-execution.js +160 -0
  42. package/lib/task-review.js +197 -0
  43. package/lib/utils.js +19 -0
  44. package/lib/verify.js +1308 -85
  45. package/lib/workflow-state.js +452 -30
  46. package/lib/worktree-preflight.js +214 -0
  47. package/package.json +1 -1
  48. package/references/artifact-templates.md +56 -6
  49. package/references/skill-workflow-detail.md +66 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.2.5 - 2026-04-02
4
+
5
+ ### Added
6
+ - modular CLI command-family handlers for verify/lint surfaces via `lib/cli/verify-family.js`, `lib/cli/lint-family.js`, and shared helpers in `lib/cli/helpers.js`
7
+ - framework-aware scaffold template coverage for React/Next.js/Vue/Svelte with explicit fallback metadata and expanded verify/scaffold regression tests
8
+ - skill-contract split guardrails with `references/skill-workflow-detail.md`, `docs/skill-contract-maintenance.md`, and `scripts/test-skill-contract-core.js`
9
+
10
+ ### Changed
11
+ - `verify-implementation` and `verify-structure` now emit richer evidence and incremental scan metadata (mode, confidence, boundaries, filtered input stats)
12
+ - core `SKILL.md` was reduced to invariant workflow contract plus on-demand reference map; stage-specific procedures now live in owner references
13
+ - shared path helpers (`normalizeRelativePath`, `pathWithinRoot`) moved into `lib/utils.js` to avoid duplicated logic drift
14
+
15
+ ### Fixed
16
+ - `resolveImplementationLanding` now resolves `.vue`, `.svelte`, and SvelteKit `src/routes/<route>/+page.svelte` landings
17
+ - `verify-implementation` no longer treats regex literal bodies as syntax-aware high-confidence coverage evidence
18
+ - `verify-structure` no longer treats comment-only pseudo markup as real structural evidence
19
+ - `--changed-files` now blocks symlink-based root-escape paths via realpath boundary checks
20
+ - framework detection no longer reports definitive `unknown` when probe scans hit file-count limits; now marked ambiguous with warning context
21
+
22
+ ## v0.2.4 - 2026-04-02
23
+
24
+ ### Changed
25
+ - design-approval freshness gates now compare approval markers against `design.md`, `pencil-design.md`, and `pencil-bindings.md` modification times
26
+ - planning parser verification command extraction now accepts template-standard `da-vinci verify-*` commands in `tasks.md`
27
+ - worktree preflight now degrades to advisory warning and recommends isolation when `git status` is unavailable (including non-git directories)
28
+ - supervisor-review retry normalization now preserves explicit `0` retry configuration instead of silently falling back to defaults
29
+ - Chinese README now includes missing parity sections for checkpoint policy, execution policy, spec granularity, design input collection, repo-local forward-test reference, and current status
30
+
31
+ ### Fixed
32
+ - resolve-change failure envelopes in `task-execution` and `task-review` no longer emit `undefined` when failure arrays are empty
33
+ - `.kongming/` workspace output is now ignored by repository git tracking
34
+
3
35
  ## v0.2.3 - 2026-04-02
4
36
 
5
37
  ### Added
package/README.md CHANGED
@@ -28,15 +28,36 @@ This workflow is intended for:
28
28
 
29
29
  Latest published npm package:
30
30
 
31
- - `@xenonbyte/da-vinci-workflow@0.2.3`
31
+ - `@xenonbyte/da-vinci-workflow@0.2.5`
32
32
 
33
- Release highlights for `0.2.3`:
33
+ Release highlights for `0.2.5`:
34
34
 
35
- - added scene-first `Design Ops` actions for managed `Save Current Design`, icon sync progress, and Visual Assist platform+quality presets
36
- - tightened `Current Status` route mapping so `/dv:tasks`, `/dv:build`, and bootstrap routes are no longer forced into unrelated scene actions
37
- - removed stale hidden Advanced-command UI branches and aligned reachable keyboard/help behavior with scene-only navigation
38
- - simplified install/uninstall operations to one-click all-platform actions (`Codex`, `Claude Code`, `Gemini`) from the TUI
39
- - expanded regression coverage for TUI scene order, route mapping, and environment-stable `save-current-design` CLI behavior
35
+ - verify and lint command handling is now modularized (`lib/cli/verify-family.js`, `lib/cli/lint-family.js`, `lib/cli/helpers.js`) while preserving `--continue-on-error` semantics
36
+ - verification surfaces now expose richer evidence metadata and incremental scan reporting for `--changed-files`
37
+ - scaffold now supports framework-aware reviewable templates for Next.js, React, Vue, and Svelte, while preserving existing implementation landing shape precedence
38
+ - `resolveImplementationLanding` now resolves `.vue`, `.svelte`, and SvelteKit `+page.svelte` route landings
39
+ - verification hardening fixes now block regex-literal false positives, comment-only pseudo-markup structure passes, and symlink-escape changed-files paths
40
+
41
+ ## Discipline And Orchestration Upgrade
42
+
43
+ The upgrade specification is tracked by:
44
+
45
+ - `openspec/changes/discipline-and-orchestration-upgrade/`
46
+
47
+ Implemented capability set:
48
+
49
+ - design-approval discipline before implementation handoff
50
+ - stronger `lint-tasks` quality checks for execution readiness
51
+ - bounded orchestration hints (roles, concurrency, review order) derived from workflow state
52
+ - structured implementer and two-stage task-review evidence
53
+ - completion wording discipline backed by fresh verification evidence
54
+ - optional worktree preflight for isolation-sensitive execution
55
+ - structured `task-execution` and `task-review` command surfaces for per-task evidence
56
+
57
+ This upgrade does **not** replace artifact truth, checkpoint truth, or completion audit authority.
58
+ `workflow-status`, `next-step`, and orchestration outputs remain bounded by the existing contract.
59
+
60
+ See [docs/discipline-and-orchestration-upgrade.md](/Users/xubo/x-skills/da-vinci/docs/discipline-and-orchestration-upgrade.md) for operator and maintainer guidance, and the OpenSpec change folder for implementation details.
40
61
 
41
62
  ## Supported workflow modes
42
63
 
@@ -84,7 +105,11 @@ Route discipline:
84
105
  - 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
85
106
  - run `da-vinci lint-spec --project <path> [--change <id>]` before implementation when runtime spec quality is uncertain
86
107
  - run `da-vinci scope-check --project <path> [--change <id>]` before implementation when page/state propagation across planning artifacts is uncertain
108
+ - run `da-vinci worktree-preflight --project <path> [--change <id>]` before bounded-parallel execution to decide whether isolation is recommended
109
+ - use `da-vinci task-execution --project <path> --change <id> --task-group <id> ...` to persist implementer result envelopes (`DONE`, `DONE_WITH_CONCERNS`, `NEEDS_CONTEXT`, `BLOCKED`)
110
+ - use `da-vinci task-review --project <path> --change <id> --task-group <id> --stage <spec|quality> ...` to persist ordered two-stage review evidence
87
111
  - run `da-vinci verify-bindings` / `verify-implementation` / `verify-structure` / `verify-coverage` before terminal completion claims
112
+ - require fresh verification evidence plus `da-vinci audit --mode completion --change <id> <project-path>` before any terminal completion claim
88
113
  - 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
89
114
  - `continue` should determine route selection from artifact and checkpoint truth first
90
115
  - contextual checkpoint deltas are auxiliary recovery notes only and must not override routing
package/README.zh-CN.md CHANGED
@@ -30,15 +30,36 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
30
30
 
31
31
  最新已发布 npm 包:
32
32
 
33
- - `@xenonbyte/da-vinci-workflow@0.2.3`
33
+ - `@xenonbyte/da-vinci-workflow@0.2.5`
34
34
 
35
- `0.2.3` 版本重点:
35
+ `0.2.5` 版本重点:
36
36
 
37
- - 新增场景化 `设计操作`:支持托管 `保存当前设计稿`、图标库同步进度反馈,以及 Visual Assist 平台+质量预设写入
38
- - 收紧 `当前状态` 场景映射:`/dv:tasks`、`/dv:build`、bootstrap 不再被错误导向到无关场景
39
- - 清理已下线的 Advanced 命令路径残留,TUI 键位与帮助文本统一为可达的场景交互
40
- - `安装与卸载` 统一为一键全平台动作(`Codex`、`Claude Code`、`Gemini`)
41
- - 补强回归测试:覆盖 TUI 场景顺序、路由映射,以及 `save-current-design` 的环境隔离稳定性
37
+ - verify/lint 命令分层模块化(`lib/cli/verify-family.js`、`lib/cli/lint-family.js`、`lib/cli/helpers.js`),并保持 `--continue-on-error` 语义不变
38
+ - verification 系列命令增加更细粒度 evidence 元数据与 `--changed-files` 增量扫描报告
39
+ - scaffold 增加 Next.js / React / Vue / Svelte 框架感知模板,并保持“已有 landing 形态优先”
40
+ - `resolveImplementationLanding` 现已支持 `.vue`、`.svelte`,以及 SvelteKit 的 `+page.svelte` 路由 landing
41
+ - verification 加固修复:阻断 regex 字面量误判、注释伪 markup 误判通过、以及 symlink 绕过 `--changed-files` 根目录限制
42
+
43
+ ## Discipline And Orchestration 升级
44
+
45
+ 该升级的规格与追踪在:
46
+
47
+ - `openspec/changes/discipline-and-orchestration-upgrade/`
48
+
49
+ 当前已实现能力:
50
+
51
+ - 在实现交接前增加设计批准纪律闸门
52
+ - 强化 `lint-tasks` 的执行就绪质量检查
53
+ - 基于 workflow state 给出有边界的编排提示(角色、并发、审查顺序)
54
+ - 增加结构化 implementer 结果与两阶段 task review 证据
55
+ - 用 fresh verification evidence 约束 completion 表述
56
+ - 为隔离敏感的执行场景提供可选 worktree preflight
57
+ - 提供结构化 `task-execution` / `task-review` 命令面用于任务级证据落盘
58
+
59
+ 该升级**不会**替代现有 artifact truth、checkpoint truth 和 completion audit 权威。
60
+ `workflow-status`、`next-step` 与 orchestration 输出仍然受现有契约约束。
61
+
62
+ 可先阅读 [docs/discipline-and-orchestration-upgrade.md](/Users/xubo/x-skills/da-vinci/docs/discipline-and-orchestration-upgrade.md) 了解说明,再结合 OpenSpec 目录查看具体实现拆分。
42
63
 
43
64
  ## 支持的工作流模式
44
65
 
@@ -89,7 +110,11 @@ Da Vinci 当前支持五种模式:
89
110
  - 有 shell 能力时,优先先跑 `da-vinci workflow-status --project <path> [--change <id>] --json` 与 `da-vinci next-step --project <path> [--change <id>]` 再决定 continue 的路由文本
90
111
  - 如果运行时 spec 质量不确定,进入实现前先跑 `da-vinci lint-spec --project <path> [--change <id>]`
91
112
  - 如果页面/状态在规划工件之间的传播关系不确定,进入实现前先跑 `da-vinci scope-check --project <path> [--change <id>]`
113
+ - 计划走并行执行前,先跑 `da-vinci worktree-preflight --project <path> [--change <id>]` 评估是否应启用隔离
114
+ - 用 `da-vinci task-execution --project <path> --change <id> --task-group <id> ...` 记录 implementer 结果包(`DONE`、`DONE_WITH_CONCERNS`、`NEEDS_CONTEXT`、`BLOCKED`)
115
+ - 用 `da-vinci task-review --project <path> --change <id> --task-group <id> --stage <spec|quality> ...` 记录两阶段有序 review 证据
92
116
  - 终态前先跑 `da-vinci verify-bindings` / `verify-implementation` / `verify-structure` / `verify-coverage`
117
+ - 任何终态 completion 表述前,必须同时具备 fresh verification evidence 与 `da-vinci audit --mode completion --change <id> <project-path>` 通过
93
118
  - 需要显式追踪规划变更时,先 `da-vinci generate-sidecars --project <path> [--change <id>]`,再 `da-vinci diff-spec --project <path> [--change <id>]`
94
119
  - `continue` 的选路应先看工件和 checkpoint 真相,再看上下文补充信息
95
120
  - Context Delta 只用于恢复上下文,不是阶段判定真相源
@@ -238,6 +263,14 @@ Da Vinci 的默认顺序是:
238
263
  - `tasks.md`:任务分组和实施顺序
239
264
  - `verification.md`:覆盖度和漂移检查
240
265
 
266
+ ### Spec 粒度规则
267
+
268
+ spec 应按能力边界或重设计切片来拆分,不要按“页面数量”机械拆分。
269
+
270
+ 对于范围较大的 `redesign-from-code`,优先拆成多个 `specs/<slice>/spec.md`,不要堆成一个超大的 `ui-refresh/spec.md`。
271
+
272
+ 对于范围较大的 `overhaul-from-code`,优先使用多个 `specs/<slice>/spec.md` + 一个 `migration-contract.md`,不要把“保留行为”和“废弃行为”混在单一重写 spec 里。
273
+
241
274
  ## 工件放置建议
242
275
 
243
276
  推荐结构:
@@ -282,6 +315,54 @@ da-vinci bootstrap-project --project /abs/path/to/project --change <change-id>
282
315
 
283
316
  这个命令会先生成项目级 `.da-vinci/` 工件、默认项目内 `.pen`,以及当前工作流所要求的最小 change 级设计工件。
284
317
 
318
+ ## Checkpoints
319
+
320
+ Da Vinci 使用以下检查点:
321
+
322
+ 1. `discovery checkpoint`
323
+ 2. `spec checkpoint`
324
+ 3. `design checkpoint`
325
+ 4. `design-source checkpoint`
326
+ 5. `mapping checkpoint`
327
+ 6. `task checkpoint`
328
+ 7. `execution checkpoint`
329
+
330
+ 检查结果:
331
+
332
+ - `PASS`
333
+ - `WARN`
334
+ - `BLOCK`
335
+
336
+ Context Delta 记录约束:
337
+
338
+ - 在已有 change 工件里维护简洁 `Context Delta`(常见是 `pencil-design.md`、`tasks.md`、`verification.md`)
339
+ - Context Delta 仅用于恢复上下文,不是阶段真相源
340
+
341
+ ## Execution Policy
342
+
343
+ Da Vinci 默认是 `autonomous-by-default`。
344
+
345
+ 这意味着:
346
+
347
+ - 不会在每个阶段都停下来等待用户确认
348
+ - checkpoint 是内部质量门禁,不是审批门禁
349
+ - 只有遇到真实阻塞才停
350
+
351
+ 默认行为:
352
+
353
+ - `PASS` -> 继续
354
+ - `WARN` -> 记录并继续
355
+ - `BLOCK` -> 仅在无法从现有工件或本地上下文消解时停止
356
+ - Context Delta 缺失或状态不一致 -> 告警并继续
357
+
358
+ 常见停止条件:
359
+
360
+ - 用户明确要求暂停
361
+ - 缺失输入会实质改变设计或实现结果
362
+ - 需要外部授权或认证
363
+ - 多个真相源冲突到无法可靠判断
364
+ - 即将执行破坏性、会改变基线的动作
365
+
285
366
  ## 设计源规则
286
367
 
287
368
  - `DA-VINCI.md` 是跨页面视觉一致性的项目级视觉契约
@@ -341,6 +422,23 @@ da-vinci bootstrap-project --project /abs/path/to/project --change <change-id>
341
422
  - 默认把它当成非阻塞增强层
342
423
  - 只有用户明确要求必须使用某个 adapter 时,缺失才应阻塞工作流
343
424
 
425
+ ## 设计输入收集
426
+
427
+ 在 greenfield 项目开始 Pencil 设计前,Da Vinci 应先收集或推断:
428
+
429
+ - 项目是否已有 `DA-VINCI.md`
430
+ - 目标平台与设备形态(mobile / tablet / desktop / web)
431
+ - 品牌方向、字体方向、色彩风格和密度预期
432
+ - 是否存在必须遵守的设计约束(设计系统、交互约束、无障碍约束)
433
+ - 是否存在外部参考素材(截图、竞品、风格板、历史设计稿)
434
+ - 设计输出是否只交付设计,还是会继续进入实现与验收
435
+
436
+ 如果输入不足以稳定方向:
437
+
438
+ - 先在 `design-brief.md` 记录待确认项与临时假设
439
+ - 用最小可验证设计面推进,不直接铺开全量页面
440
+ - 在下一轮 checkpoint 明确补齐缺失输入
441
+
344
442
  ## 安装
345
443
 
346
444
  安装 npm 包:
@@ -506,6 +604,38 @@ $da-vinci use continue for <existing workflow state>
506
604
  /dv:continue
507
605
  ```
508
606
 
607
+ ## 仓库内 forward-test 参考
608
+
609
+ 仓库里有一个“文档优先”的 forward-test 参考样例:
610
+
611
+ - `examples/greenfield-spec-markupflow/`
612
+
613
+ 该样例记录了 `greenfield-spec` 场景从以下阶段推进的完整链路:
614
+
615
+ 1. design brief
616
+ 2. proposal 与 spec
617
+ 3. page map
618
+ 4. Pencil 设计源登记
619
+ 5. Pencil 页面绑定
620
+ 6. implementation tasks
621
+ 7. 静态 HTML 交付
622
+ 8. verification
623
+
624
+ 它不是可直接喂给 `da-vinci audit` 的完整 fixture。样例为了可读性把工件放在仓库根;而当前 audit 期望的是完整 `.da-vinci/` 树和持久化状态元数据。
625
+
626
+ 如果你要把样例形态转换成可执行审计的项目骨架,请先运行:
627
+
628
+ ```bash
629
+ da-vinci bootstrap-project --project <project-path> --change <change-id>
630
+ ```
631
+
632
+ reviewer bridge 覆盖策略:
633
+
634
+ - 默认 CI 始终运行本地核心门禁(`npm run quality:ci:core`)
635
+ - 仅在仓库集成变量可用时,主 CI 才追加真实 reviewer bridge smoke 任务
636
+ - 真实 `codex exec` reviewer smoke 仍是显式 opt-in:`DA_VINCI_RUN_SUPERVISOR_INTEGRATION=1 npm run test:supervisor-review-integration`
637
+ - `.github/workflows/reviewer-bridge-smoke.yml` 提供手动/定时 smoke;启用后会把集成缺线视为失败,而不是静默 `SKIP`
638
+
509
639
  ## 示例请求
510
640
 
511
641
  ### Greenfield spec
@@ -615,3 +745,17 @@ da-vinci/
615
745
  │ └── zh-CN/
616
746
  └── references/
617
747
  ```
748
+
749
+ ## 当前状态
750
+
751
+ 当前仓库包含:
752
+
753
+ - Da Vinci skill 本体
754
+ - 三平台命令适配(Codex / Claude / Gemini)
755
+ - 工作流参考文档
756
+ - 可执行示例
757
+
758
+ 下一阶段自然演进方向:
759
+
760
+ 1. 持续补强 install / uninstall / status 的回归覆盖
761
+ 2. 在真实项目上做带提交历史的 forward-test(含项目内 `.pen` 设计源)