@xenonbyte/da-vinci-workflow 0.2.1 → 0.2.3
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.
- package/CHANGELOG.md +32 -0
- package/README.md +33 -12
- package/README.zh-CN.md +34 -12
- package/bin/da-vinci-tui.js +8 -0
- package/commands/claude/dv/breakdown.md +8 -0
- package/commands/claude/dv/build.md +11 -0
- package/commands/claude/dv/design.md +5 -2
- package/commands/claude/dv/tasks.md +8 -0
- package/commands/claude/dv/verify.md +9 -0
- package/commands/codex/prompts/dv-breakdown.md +8 -0
- package/commands/codex/prompts/dv-build.md +11 -0
- package/commands/codex/prompts/dv-design.md +5 -2
- package/commands/codex/prompts/dv-tasks.md +8 -0
- package/commands/codex/prompts/dv-verify.md +8 -0
- package/commands/gemini/dv/breakdown.toml +8 -0
- package/commands/gemini/dv/build.toml +11 -0
- package/commands/gemini/dv/design.toml +5 -2
- package/commands/gemini/dv/tasks.toml +8 -0
- package/commands/gemini/dv/verify.toml +8 -0
- package/docs/dv-command-reference.md +47 -0
- package/docs/execution-chain-plan.md +10 -3
- package/docs/mode-use-cases.md +2 -1
- package/docs/pencil-rendering-workflow.md +15 -12
- package/docs/prompt-entrypoints.md +2 -0
- package/docs/prompt-presets/README.md +1 -1
- package/docs/prompt-presets/desktop-app.md +3 -3
- package/docs/prompt-presets/mobile-app.md +3 -3
- package/docs/prompt-presets/tablet-app.md +3 -3
- package/docs/prompt-presets/web-app.md +3 -3
- package/docs/skill-usage.md +224 -0
- package/docs/workflow-examples.md +16 -13
- package/docs/workflow-overview.md +3 -0
- package/docs/zh-CN/dv-command-reference.md +47 -0
- package/docs/zh-CN/mode-use-cases.md +2 -1
- package/docs/zh-CN/pencil-rendering-workflow.md +15 -12
- package/docs/zh-CN/prompt-entrypoints.md +2 -0
- package/docs/zh-CN/prompt-presets/README.md +1 -1
- package/docs/zh-CN/prompt-presets/desktop-app.md +3 -3
- package/docs/zh-CN/prompt-presets/mobile-app.md +3 -3
- package/docs/zh-CN/prompt-presets/tablet-app.md +3 -3
- package/docs/zh-CN/prompt-presets/web-app.md +3 -3
- package/docs/zh-CN/skill-usage.md +224 -0
- package/docs/zh-CN/workflow-examples.md +15 -13
- package/docs/zh-CN/workflow-overview.md +3 -0
- package/examples/greenfield-spec-markupflow/.da-vinci/state/execution-signals/demo__lint-tasks.json +16 -0
- package/lib/audit-parsers.js +18 -9
- package/lib/audit.js +3 -26
- package/lib/cli.js +72 -0
- package/lib/design-source-registry.js +146 -0
- package/lib/save-current-design.js +790 -0
- package/lib/supervisor-review.js +1 -1
- package/lib/workflow-bootstrap.js +2 -13
- package/lib/workflow-persisted-state.js +3 -1
- package/lib/workflow-state.js +51 -3
- package/package.json +4 -2
- package/tui/catalog.js +1293 -0
- package/tui/index.js +2583 -0
|
@@ -31,7 +31,7 @@ PNG 只是审查产物,不是设计真相源。
|
|
|
31
31
|
Da Vinci 现在要求自治运行使用这组 session wrapper:
|
|
32
32
|
|
|
33
33
|
- `da-vinci pencil-session begin`
|
|
34
|
-
- `da-vinci
|
|
34
|
+
- `da-vinci save-current-design`
|
|
35
35
|
- `da-vinci pencil-session end`
|
|
36
36
|
|
|
37
37
|
这组 wrapper 的作用,是把下面三件事变成强制步骤:
|
|
@@ -77,18 +77,21 @@ Da Vinci 不会假设 live MCP 编辑已经被自动刷盘。
|
|
|
77
77
|
|
|
78
78
|
Da Vinci 不把 headless interactive `save()` 当作权威持久化真相。
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
主路径持久化步骤是:
|
|
81
81
|
|
|
82
|
-
1.
|
|
83
|
-
2.
|
|
84
|
-
3.
|
|
85
|
-
4.
|
|
86
|
-
5.
|
|
82
|
+
1. 执行 `da-vinci save-current-design --project <project-path>`
|
|
83
|
+
2. 明确读取结果包:`saved` / `blocked` / `unavailable`
|
|
84
|
+
3. 只有 `saved` 才表示持久化成功
|
|
85
|
+
4. `blocked` 表示保存时的来源/锁/载荷契约失败
|
|
86
|
+
5. `unavailable` 表示 MCP bridge 或 runtime 抓取不可达,不能当成“已保存”
|
|
87
87
|
|
|
88
88
|
相关命令:
|
|
89
89
|
|
|
90
|
-
-
|
|
91
|
-
-
|
|
90
|
+
- 高层主路径:`da-vinci save-current-design`
|
|
91
|
+
- 底层回退路径:`da-vinci pencil-session persist`、`da-vinci write-pen`、`da-vinci check-pen-sync`
|
|
92
|
+
|
|
93
|
+
MVP 安全保证仅覆盖“来源路径收敛”:registered `.pen`、session `penPath`、active editor path 必须收敛到同一文件。
|
|
94
|
+
在 MCP 暴露稳定 window/editor 标识前,精确窗口实例绑定仍是非目标。
|
|
92
95
|
|
|
93
96
|
`da-vinci snapshot-pen` 只用于 disk-to-disk,不是 live 编辑持久化路径。
|
|
94
97
|
|
|
@@ -253,7 +256,7 @@ Context Delta 相关审计期望都是告警级:
|
|
|
253
256
|
1. `da-vinci pencil-session begin --project <project-path> --pen <path>`
|
|
254
257
|
2. 如果存在外部/次要 `.pen`,在编辑前先运行 `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>`;若分叉,先把优先来源同步回 `<project-pen>`
|
|
255
258
|
3. Pencil MCP 编辑
|
|
256
|
-
4. `da-vinci
|
|
259
|
+
4. `da-vinci save-current-design --project <project-path>`
|
|
257
260
|
5. screenshot review + layout hygiene
|
|
258
261
|
6. design checkpoint
|
|
259
262
|
7. 如果配置了,就执行 design-supervisor review
|
|
@@ -280,13 +283,13 @@ flowchart TD
|
|
|
280
283
|
K -- 否 --> F
|
|
281
284
|
K -- 是 --> L{是否配置了 design-supervisor review?}
|
|
282
285
|
L -- 是 --> M[执行 design-supervisor review,结合 screenshots 与 theme inputs]
|
|
283
|
-
L -- 否 --> N[
|
|
286
|
+
L -- 否 --> N[save-current-design 把绑定的 live 快照写回 .pen]
|
|
284
287
|
M --> O{是否要求 Supervisor Review?}
|
|
285
288
|
O -- 否 --> N
|
|
286
289
|
O -- 是 --> P{review 为 PASS 或已接受 WARN?}
|
|
287
290
|
P -- 否 --> F
|
|
288
291
|
P -- 是 --> N
|
|
289
|
-
N --> Q[
|
|
292
|
+
N --> Q[save-current-design 返回 saved 或终态 blocked/unavailable]
|
|
290
293
|
Q --> R{design-source checkpoint 和 runtime gate 通过?}
|
|
291
294
|
R -- 否 --> F
|
|
292
295
|
R -- 是 --> S{是否还要继续设计?}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
4. 两者一起放进工作流设置
|
|
22
22
|
5. 只有在项目存在特殊真相源或平台约束时,再继续收紧提示词
|
|
23
23
|
6. 如果 Pencil MCP 可用,优先使用已经明确要求 MCP runtime gate 和 completion audit 的那版 redesign 提示词
|
|
24
|
-
7. 如果项目要在自治运行里把 `.pen` 真正持久化到本地,必须使用要求 `da-vinci pencil-session begin /
|
|
24
|
+
7. 如果项目要在自治运行里把 `.pen` 真正持久化到本地,必须使用要求 `da-vinci pencil-session begin / save-current-design / end` 的提示词;并明确区分 `saved` / `blocked` / `unavailable`,只有高层保存不可用时才回退到底层 payload 持久化链路
|
|
25
25
|
|
|
26
26
|
可用模板:
|
|
27
27
|
|
|
@@ -120,7 +120,7 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
|
120
120
|
如果同一个 anchor surface 连续两次回滚,就切到每批不超过 6 个操作的微批次,直到拿到干净的 schema-safe pass。
|
|
121
121
|
在第一次成功写入 Pencil 后、继续大范围扩展前,先运行 `da-vinci audit --mode integrity <project-path>`。
|
|
122
122
|
如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
|
|
123
|
-
在第一次 Pencil 编辑前,必须执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`;发生实质性 live edit
|
|
123
|
+
在第一次 Pencil 编辑前,必须执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`;发生实质性 live edit 后,优先执行 `da-vinci save-current-design --project <project-path>`。必须区分 `saved`、`blocked`、`unavailable` 三类结果;只有高层桥接返回 `unavailable` 时,才退回 `pencil-session persist --nodes-file/--variables-file` 这条底层链路。
|
|
124
124
|
截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
|
|
125
125
|
截图审查必须记录明确的 `PASS` / `WARN` / `BLOCK`、问题列表和是否回改;“看起来很好”不算审查记录。
|
|
126
126
|
如果 `DA-VINCI.md` 配置了 `Design-supervisor reviewers`,就在 screenshot review、layout hygiene 和 design checkpoint 之后再做 `design-supervisor review`,输入要同时包含 screenshots、Pencil variables 和设计 thesis。若 `Require Supervisor Review: true`,那么缺失、`BLOCK`、或未被接受的 review 结果都要视为阻断。
|
|
@@ -156,7 +156,7 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
|
156
156
|
For each anchor surface, explain how the new composition differs structurally from the current layout and whether it is primarily HTML-referenced, partially HTML-referenced, or inferred.
|
|
157
157
|
|
|
158
158
|
Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
|
|
159
|
-
Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci
|
|
159
|
+
Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes.
|
|
160
160
|
Run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
|
|
161
161
|
Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
|
|
162
162
|
Persist project-local Pencil files under .da-vinci/designs/.
|
|
@@ -190,7 +190,7 @@ $da-vinci use continue for this existing desktop-product redesign workflow.
|
|
|
190
190
|
Use the existing Da Vinci artifacts in this project.
|
|
191
191
|
Do not restart discovery unless an artifact is missing or clearly wrong.
|
|
192
192
|
选路先以当前工件和 checkpoint 真相为准,再把 Context Delta 作为辅助恢复信息;如果 Context Delta 与工件冲突,忽略冲突条目并记录冲突后继续。
|
|
193
|
-
把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。如果继续这一轮会做 Pencil 编辑,必须先执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`,发生实质性 live edit
|
|
193
|
+
把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。如果继续这一轮会做 Pencil 编辑,必须先执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`,发生实质性 live edit 后优先执行 `da-vinci save-current-design --project <project-path>`。必须区分 `saved`、`blocked`、`unavailable`;只有高层桥接返回 `unavailable` 时,才回退到底层 payload 持久化链路。
|
|
194
194
|
If the redesign is complex, continue from the approved anchor surfaces instead of restarting broad scaffolding.
|
|
195
195
|
如果 Pencil MCP 可用,且这一轮继续做了新的 Pencil 写入,就重新运行 MCP runtime gate,并把最新结果记录到 `pencil-design.md`。
|
|
196
196
|
在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
|
|
@@ -126,7 +126,7 @@ Use only Pencil-supported properties; do not use web-only props like flex or mar
|
|
|
126
126
|
Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
|
|
127
127
|
在第一次成功写入 Pencil 后、继续大范围扩展前,先运行 `da-vinci audit --mode integrity <project-path>`。
|
|
128
128
|
如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
|
|
129
|
-
在第一次 Pencil 编辑前,必须执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`;发生实质性 live edit
|
|
129
|
+
在第一次 Pencil 编辑前,必须执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`;发生实质性 live edit 后,优先执行 `da-vinci save-current-design --project <project-path>`。必须区分 `saved`、`blocked`、`unavailable` 三类结果;只有高层桥接返回 `unavailable` 时,才退回 `pencil-session persist --nodes-file/--variables-file` 这条底层链路。
|
|
130
130
|
Keep non-`.pen` workflow artifacts out of `.da-vinci/designs/`.
|
|
131
131
|
截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
|
|
132
132
|
截图审查必须记录明确的 `PASS` / `WARN` / `BLOCK`、问题列表和是否回改;“看起来很好”不算审查记录。
|
|
@@ -164,7 +164,7 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
|
164
164
|
For each anchor surface, explain how the new composition differs structurally from the current layout and whether it is primarily HTML-referenced, partially HTML-referenced, or inferred.
|
|
165
165
|
|
|
166
166
|
Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
|
|
167
|
-
Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci
|
|
167
|
+
Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes.
|
|
168
168
|
Run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
|
|
169
169
|
Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
|
|
170
170
|
Persist project-local Pencil files under .da-vinci/designs/.
|
|
@@ -198,7 +198,7 @@ $da-vinci use continue for this existing mobile-app redesign workflow.
|
|
|
198
198
|
Use the existing Da Vinci artifacts in this project.
|
|
199
199
|
Do not restart discovery unless an artifact is missing or clearly wrong.
|
|
200
200
|
选路先以当前工件和 checkpoint 真相为准,再把 Context Delta 作为辅助恢复信息;如果 Context Delta 与工件冲突,忽略冲突条目并记录冲突后继续。
|
|
201
|
-
把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。如果继续这一轮会做 Pencil 编辑,必须先执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`,发生实质性 live edit
|
|
201
|
+
把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。如果继续这一轮会做 Pencil 编辑,必须先执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`,发生实质性 live edit 后优先执行 `da-vinci save-current-design --project <project-path>`。必须区分 `saved`、`blocked`、`unavailable`;只有高层桥接返回 `unavailable` 时,才回退到底层 payload 持久化链路。
|
|
202
202
|
If the redesign is complex, keep the anchor-first flow until the design checkpoint passes.
|
|
203
203
|
如果 Pencil MCP 可用,且这一轮继续做了新的 Pencil 写入,就重新运行 MCP runtime gate,并把最新结果记录到 `pencil-design.md`。
|
|
204
204
|
在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
|
|
@@ -120,7 +120,7 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
|
120
120
|
如果同一个 anchor surface 连续两次回滚,就切到每批不超过 6 个操作的微批次,直到拿到干净的 schema-safe pass。
|
|
121
121
|
在第一次成功写入 Pencil 后、继续大范围扩展前,先运行 `da-vinci audit --mode integrity <project-path>`。
|
|
122
122
|
如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
|
|
123
|
-
在第一次 Pencil 编辑前,必须执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`;发生实质性 live edit
|
|
123
|
+
在第一次 Pencil 编辑前,必须执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`;发生实质性 live edit 后,优先执行 `da-vinci save-current-design --project <project-path>`。必须区分 `saved`、`blocked`、`unavailable` 三类结果;只有高层桥接返回 `unavailable` 时,才退回 `pencil-session persist --nodes-file/--variables-file` 这条底层链路。
|
|
124
124
|
截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
|
|
125
125
|
截图审查必须记录明确的 `PASS` / `WARN` / `BLOCK`、问题列表和是否回改;“看起来很好”不算审查记录。
|
|
126
126
|
如果 `DA-VINCI.md` 配置了 `Design-supervisor reviewers`,就在 screenshot review、layout hygiene 和 design checkpoint 之后再做 `design-supervisor review`,输入要同时包含 screenshots、Pencil variables 和设计 thesis。若 `Require Supervisor Review: true`,那么缺失、`BLOCK`、或未被接受的 review 结果都要视为阻断。
|
|
@@ -156,7 +156,7 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
|
156
156
|
For each anchor surface, explain how the new composition differs structurally from the current layout and whether it is primarily HTML-referenced, partially HTML-referenced, or inferred.
|
|
157
157
|
|
|
158
158
|
Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
|
|
159
|
-
Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci
|
|
159
|
+
Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes.
|
|
160
160
|
Run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
|
|
161
161
|
Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
|
|
162
162
|
Persist project-local Pencil files under .da-vinci/designs/.
|
|
@@ -190,7 +190,7 @@ $da-vinci use continue for this existing tablet-product redesign workflow.
|
|
|
190
190
|
Use the existing Da Vinci artifacts in this project.
|
|
191
191
|
Do not restart discovery unless an artifact is missing or clearly wrong.
|
|
192
192
|
选路先以当前工件和 checkpoint 真相为准,再把 Context Delta 作为辅助恢复信息;如果 Context Delta 与工件冲突,忽略冲突条目并记录冲突后继续。
|
|
193
|
-
把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。如果继续这一轮会做 Pencil 编辑,必须先执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`,发生实质性 live edit
|
|
193
|
+
把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。如果继续这一轮会做 Pencil 编辑,必须先执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`,发生实质性 live edit 后优先执行 `da-vinci save-current-design --project <project-path>`。必须区分 `saved`、`blocked`、`unavailable`;只有高层桥接返回 `unavailable` 时,才回退到底层 payload 持久化链路。
|
|
194
194
|
If the redesign is complex, continue from the approved anchor surfaces instead of restarting broad scaffolding.
|
|
195
195
|
如果 Pencil MCP 可用,且这一轮继续做了新的 Pencil 写入,就重新运行 MCP runtime gate,并把最新结果记录到 `pencil-design.md`。
|
|
196
196
|
在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
|
|
@@ -121,7 +121,7 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
|
121
121
|
如果同一个 anchor surface 连续两次回滚,就切到每批不超过 6 个操作的微批次,直到拿到干净的 schema-safe pass。
|
|
122
122
|
在第一次成功写入 Pencil 后、继续大范围扩展前,先运行 `da-vinci audit --mode integrity <project-path>`。
|
|
123
123
|
如果 Pencil MCP 可用,在第一次成功写入 Pencil 后运行 MCP runtime gate,并把结果记录到 `pencil-design.md`。
|
|
124
|
-
在第一次 Pencil 编辑前,必须执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`;发生实质性 live edit
|
|
124
|
+
在第一次 Pencil 编辑前,必须执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`;发生实质性 live edit 后,优先执行 `da-vinci save-current-design --project <project-path>`。必须区分 `saved`、`blocked`、`unavailable` 三类结果;只有高层桥接返回 `unavailable` 时,才退回 `pencil-session persist --nodes-file/--variables-file` 这条底层链路。
|
|
125
125
|
截图导出只能写到 `.da-vinci/changes/<change-id>/exports/`,不能写进 `.da-vinci/designs/`。
|
|
126
126
|
截图审查必须记录明确的 `PASS` / `WARN` / `BLOCK`、问题列表和是否回改;“看起来很好”不算审查记录。
|
|
127
127
|
如果 `DA-VINCI.md` 配置了 `Design-supervisor reviewers`,就在 screenshot review、layout hygiene 和 design checkpoint 之后再做 `design-supervisor review`,输入要同时包含 screenshots、Pencil variables 和设计 thesis。若 `Require Supervisor Review: true`,那么缺失、`BLOCK`、或未被接受的 review 结果都要视为阻断。
|
|
@@ -157,7 +157,7 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
|
157
157
|
For each anchor surface, explain how the new composition differs structurally from the current layout and whether it is primarily HTML-referenced, partially HTML-referenced, or inferred.
|
|
158
158
|
|
|
159
159
|
Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
|
|
160
|
-
Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci
|
|
160
|
+
Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes.
|
|
161
161
|
Run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
|
|
162
162
|
Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
|
|
163
163
|
Persist project-local Pencil files under .da-vinci/designs/.
|
|
@@ -191,7 +191,7 @@ $da-vinci use continue for this existing web-product redesign workflow.
|
|
|
191
191
|
Use the existing Da Vinci artifacts in this project.
|
|
192
192
|
Do not restart discovery unless an artifact is missing or clearly wrong.
|
|
193
193
|
选路先以当前工件和 checkpoint 真相为准,再把 Context Delta 作为辅助恢复信息;如果 Context Delta 与工件冲突,忽略冲突条目并记录冲突后继续。
|
|
194
|
-
把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。如果继续这一轮会做 Pencil 编辑,必须先执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`,发生实质性 live edit
|
|
194
|
+
把登记的项目内 Pencil 源保持在 `.da-vinci/designs/` 下,作为设计真相源。如果继续这一轮会做 Pencil 编辑,必须先执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`,发生实质性 live edit 后优先执行 `da-vinci save-current-design --project <project-path>`。必须区分 `saved`、`blocked`、`unavailable`;只有高层桥接返回 `unavailable` 时,才回退到底层 payload 持久化链路。
|
|
195
195
|
If the redesign is complex, continue from the approved anchor surfaces instead of restarting broad scaffolding.
|
|
196
196
|
如果 Pencil MCP 可用,且这一轮继续做了新的 Pencil 写入,就重新运行 MCP runtime gate,并把最新结果记录到 `pencil-design.md`。
|
|
197
197
|
在声明 `design complete` 或 `workflow complete` 之前,必须同时通过 MCP runtime gate 和 `da-vinci audit --mode completion --change <change-id> <project-path>`。
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Skill 使用说明
|
|
2
|
+
|
|
3
|
+
这份文档面向真正操作 Da Vinci 的人,而不是底层命令参考。
|
|
4
|
+
|
|
5
|
+
重点讲四件事:
|
|
6
|
+
|
|
7
|
+
- 第一次怎么进入 Da Vinci 工作流
|
|
8
|
+
- 需求、设计、任务、实现几段之间怎么衔接
|
|
9
|
+
- 中途退出后下次怎么安全恢复
|
|
10
|
+
- 如果不想记太多命令,怎么用 TUI
|
|
11
|
+
|
|
12
|
+
## 核心规则
|
|
13
|
+
|
|
14
|
+
Da Vinci 应该根据工件真相恢复,而不是根据聊天记忆恢复。
|
|
15
|
+
|
|
16
|
+
也就是说:
|
|
17
|
+
|
|
18
|
+
- `spec.md` 以及相关需求工件是行为真相
|
|
19
|
+
- 项目内 `.pen` 是设计真相
|
|
20
|
+
- `tasks.md`、`verification.md` 和 execution signals 负责说明哪些东西已经实现、哪些还没实现
|
|
21
|
+
|
|
22
|
+
## 第一次进入时怎么选入口
|
|
23
|
+
|
|
24
|
+
这三个入口各有分工:
|
|
25
|
+
|
|
26
|
+
- `intake`
|
|
27
|
+
- 适合项目复杂、mode 不明确、或有多个真相源的情况
|
|
28
|
+
- `prompt`
|
|
29
|
+
- 适合 mode 已明确,只需要一条高质量起始提示词的情况
|
|
30
|
+
- `continue`
|
|
31
|
+
- 适合仓库里已经有 `DA-VINCI.md` 或 `.da-vinci/`,需要恢复推进的情况
|
|
32
|
+
|
|
33
|
+
对 Codex,最常见的起手式是:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
$da-vinci use intake for <project situation>
|
|
37
|
+
$da-vinci use prompt for <known scenario>
|
|
38
|
+
$da-vinci use continue for <existing workflow state>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
默认建议:
|
|
42
|
+
|
|
43
|
+
1. 第一次进入复杂项目时先用 `intake`
|
|
44
|
+
2. 执行生成出来的主工作流提示词
|
|
45
|
+
3. 如果中途停下,下次回来用 `continue`
|
|
46
|
+
|
|
47
|
+
除非项目已经明显 implementation-ready,否则不要默认直接跳到 `build`。
|
|
48
|
+
|
|
49
|
+
## 实际流程怎么走
|
|
50
|
+
|
|
51
|
+
正常交付顺序通常是:
|
|
52
|
+
|
|
53
|
+
1. 选择 mode
|
|
54
|
+
2. 补 discovery 和 scope 工件
|
|
55
|
+
3. 登记首选项目内 `.pen`
|
|
56
|
+
4. 先做 1 到 3 个 anchor surfaces
|
|
57
|
+
5. 让 live Pencil 会话和登记 `.pen` 收敛
|
|
58
|
+
6. 写 `pencil-bindings.md`
|
|
59
|
+
7. 生成或整理 `tasks.md`
|
|
60
|
+
8. 实现
|
|
61
|
+
9. 验证
|
|
62
|
+
|
|
63
|
+
常见工件骨架一般是:
|
|
64
|
+
|
|
65
|
+
- `DA-VINCI.md`
|
|
66
|
+
- `.da-vinci/design-registry.md`
|
|
67
|
+
- `.da-vinci/page-map.md`
|
|
68
|
+
- `.da-vinci/changes/<change-id>/proposal.md`
|
|
69
|
+
- `.da-vinci/changes/<change-id>/specs/*/spec.md`
|
|
70
|
+
- `.da-vinci/changes/<change-id>/design.md`
|
|
71
|
+
- `.da-vinci/changes/<change-id>/pencil-design.md`
|
|
72
|
+
- `.da-vinci/changes/<change-id>/pencil-bindings.md`
|
|
73
|
+
- `.da-vinci/changes/<change-id>/tasks.md`
|
|
74
|
+
- `.da-vinci/changes/<change-id>/verification.md`
|
|
75
|
+
|
|
76
|
+
## 进入实现前怎么衔接
|
|
77
|
+
|
|
78
|
+
当设计大体完成,接下来准备实现时,建议按这个顺序看:
|
|
79
|
+
|
|
80
|
+
- `da-vinci workflow-status`
|
|
81
|
+
- 先确认当前阶段和 blocker
|
|
82
|
+
- `da-vinci next-step`
|
|
83
|
+
- 再确认下一步到底应该是 `design`、`tasks` 还是 `build`
|
|
84
|
+
- `da-vinci lint-spec`
|
|
85
|
+
- 当运行时 spec 质量还不够确定时使用
|
|
86
|
+
- `da-vinci scope-check`
|
|
87
|
+
- 当规划工件之间页面/状态传播关系还不清楚时使用
|
|
88
|
+
|
|
89
|
+
如果你已经在项目根目录里,`--project` 通常可以省略,因为 CLI 默认会回退到当前目录。
|
|
90
|
+
|
|
91
|
+
例如:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
da-vinci workflow-status
|
|
95
|
+
da-vinci next-step
|
|
96
|
+
da-vinci lint-spec
|
|
97
|
+
da-vinci scope-check
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## 中途退出后,下次怎么恢复
|
|
101
|
+
|
|
102
|
+
最稳妥的恢复顺序是:
|
|
103
|
+
|
|
104
|
+
1. `da-vinci workflow-status [--change <id>] --json`
|
|
105
|
+
2. `da-vinci next-step [--change <id>]`
|
|
106
|
+
3. 如果 spec 质量不确定,跑 `da-vinci lint-spec`
|
|
107
|
+
4. 如果规划传播关系不确定,跑 `da-vinci scope-check`
|
|
108
|
+
5. 如果 planning 工件相对上次稳定状态有变化,跑 `da-vinci generate-sidecars` 和 `da-vinci diff-spec`
|
|
109
|
+
6. 在终态前,跑 `da-vinci verify-bindings` 和 `da-vinci verify-coverage`
|
|
110
|
+
|
|
111
|
+
恢复时应该遵循工件,而不是旧聊天上下文:
|
|
112
|
+
|
|
113
|
+
- 如果设计工件已经有了,但 `tasks.md` 还没有,下一步应该回到 `tasks`
|
|
114
|
+
- 如果 `tasks.md` 已存在,但设计 gate 还没过,不要直接进 `build`
|
|
115
|
+
- 只有实现就绪度已经明确时,才把 `build` 当主恢复路径
|
|
116
|
+
|
|
117
|
+
## `change-id` 到底是什么
|
|
118
|
+
|
|
119
|
+
`change-id` 就是 `.da-vinci/changes/<change-id>/` 这个目录名。
|
|
120
|
+
|
|
121
|
+
实际使用规则:
|
|
122
|
+
|
|
123
|
+
- 如果项目里只有一个非空 change 目录,多数工作流命令都能自动推断
|
|
124
|
+
- 如果项目里有多个非空 change 目录,就显式传 `--change <id>`
|
|
125
|
+
- 尽量一条分支只维护一个 active change,这样续跑成本最低
|
|
126
|
+
|
|
127
|
+
如果你忘了当前活跃 change 是哪个,先跑 `da-vinci workflow-status`。在多 change 场景下,它会告诉你可用的 ids,还会给一个“仅供参考”的最新推断值。
|
|
128
|
+
|
|
129
|
+
## TUI 快速上手
|
|
130
|
+
|
|
131
|
+
如果真正的痛点是不想记那么多命令面,就直接用终端 TUI。
|
|
132
|
+
|
|
133
|
+
启动方式:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
da-vinci tui
|
|
137
|
+
da-vinci-tui
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
如果没有全局安装,也可以直接用 `npx`:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npx -p @xenonbyte/da-vinci-workflow da-vinci tui
|
|
144
|
+
npx -p @xenonbyte/da-vinci-workflow da-vinci-tui
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
TUI 提供这些能力:
|
|
148
|
+
|
|
149
|
+
- 首屏按场景组织:`安装与卸载`、`当前状态`、`切换工作项`、`设计操作`、`实施前检查`、`验收前检查`、`设置`
|
|
150
|
+
- 常用链路直接做成组合入口(续跑、实施前检查、验收前检查)
|
|
151
|
+
- `设计操作` 聚焦实用设计操作(`保存当前设计稿`、`同步图标库`、`Visual Assist 预设`)
|
|
152
|
+
- `安装与卸载` 提供三个动作:`状态`(查看 `da-vinci status`)、`安装`(一键安装所有支持平台)、`卸载`(一键卸载所有支持平台)
|
|
153
|
+
- 界面中英双语,但 Visual Assist 输出始终使用英文权威源
|
|
154
|
+
- 顶部只保留最小上下文(项目 + change)
|
|
155
|
+
- `设置` 仅保留 `语言` 和 `日志`
|
|
156
|
+
- `设置 > 日志` 提供项目内每日诊断日志(`.da-vinci/logs/YYYY-MM-DD.ndjson`)
|
|
157
|
+
|
|
158
|
+
### TUI 场景图
|
|
159
|
+
|
|
160
|
+
```mermaid
|
|
161
|
+
flowchart TD
|
|
162
|
+
A[启动 da-vinci tui] --> B[设置 project 和 change 上下文]
|
|
163
|
+
B --> C[安装与卸载<br/>状态 + 一键安装/卸载全部平台]
|
|
164
|
+
B --> D[当前状态<br/>workflow-status + next-step 总结]
|
|
165
|
+
B --> E[切换工作项<br/>选择已有 change]
|
|
166
|
+
B --> F[设计操作<br/>图标同步 + Visual Assist 预设]
|
|
167
|
+
B --> G[实施前检查<br/>实现前就绪度检查]
|
|
168
|
+
B --> H[验收前检查<br/>verify-* 链路]
|
|
169
|
+
B --> I[设置<br/>语言 + 日志]
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
你可以把它理解成这四条最实用的规则:
|
|
173
|
+
|
|
174
|
+
- 先选“当前时机”对应的场景
|
|
175
|
+
- 优先用场景入口完成常用检查
|
|
176
|
+
- 只要中途暂停或路由不清晰,就进入“当前状态”
|
|
177
|
+
- 只有“验收前检查”通过,才进入终态
|
|
178
|
+
|
|
179
|
+
Visual Assist 预设映射(`设计操作 > Visual Assist 预设`):
|
|
180
|
+
|
|
181
|
+
- `Masterpiece` => `required reviewer signoff`
|
|
182
|
+
- `High Quality` => `advisory reviewer`
|
|
183
|
+
- `Normal` => `adapter-only`
|
|
184
|
+
|
|
185
|
+
Visual Assist 受控写入规则:
|
|
186
|
+
|
|
187
|
+
- 先选平台,再从 3 档质量中选择(对应 Variant 1/2/3)
|
|
188
|
+
- 内容来自 `docs/visual-assist-presets/` 的英文权威源
|
|
189
|
+
- 只替换项目根 `DA-VINCI.md` 的 `## Visual Assist`
|
|
190
|
+
- 保留无关章节,避免重复 `## Visual Assist`
|
|
191
|
+
|
|
192
|
+
主要按键:
|
|
193
|
+
|
|
194
|
+
- `Up/Down` 或 `j/k`:移动选中项
|
|
195
|
+
- `Enter` 或 `r`:进入当前场景/动作
|
|
196
|
+
- `u/d`:长内容按页上下翻
|
|
197
|
+
- `g/G`:长内容跳到顶部/底部
|
|
198
|
+
- `p`:修改项目路径上下文
|
|
199
|
+
- `c`:修改或清空 change-id 上下文
|
|
200
|
+
- `l`:切换中英文
|
|
201
|
+
- `t`:主题识别不准时,手动切换主题模式
|
|
202
|
+
- `s`:切换 `--strict`
|
|
203
|
+
- `J`:切换 `--json`
|
|
204
|
+
- `e`:切换 `--continue-on-error`
|
|
205
|
+
- `?`:打开帮助
|
|
206
|
+
- `Ctrl-C`:紧急退出
|
|
207
|
+
|
|
208
|
+
推荐的 TUI 使用顺序:
|
|
209
|
+
|
|
210
|
+
1. 在项目根目录启动 TUI
|
|
211
|
+
2. 先选当前任务对应的场景
|
|
212
|
+
3. 再确认顶部的 project path 和 change-id
|
|
213
|
+
4. 优先执行场景入口(`切换工作项`、`实施前检查`、`安装与卸载`、`验收前检查`);需要续跑判断时进入 `当前状态`
|
|
214
|
+
5. 需要管理 Visual Assist 时,进入 `设计操作 > Visual Assist 预设`,完成“平台 + 质量”选择后自动写入
|
|
215
|
+
6. 需要查看安装态时进入 `安装与卸载 > 状态`;需要安装/卸载时进入 `安装与卸载 > 安装/卸载` 一键执行全部平台
|
|
216
|
+
7. 排查问题时到 `设置 > 日志` 查看/复制当天日志;日志只做诊断证据,不替代工件真相
|
|
217
|
+
|
|
218
|
+
## 实用简化规则
|
|
219
|
+
|
|
220
|
+
- 在项目根目录里,通常不需要写 `--project`
|
|
221
|
+
- 只有一个 active change 时,通常也不需要写 `--change`
|
|
222
|
+
- 每次暂停回来,默认先跑 `workflow-status` 和 `next-step`
|
|
223
|
+
- 觉得命令太散时,用 TUI
|
|
224
|
+
- 已经很清楚要跑哪条命令、而且在写脚本时,直接用 CLI 更快
|
|
@@ -110,17 +110,18 @@ $da-vinci use redesign-from-code to inventory the current app, identify current
|
|
|
110
110
|
11. 如果同一个 anchor surface 连续两次回滚,就切到每批不超过 6 个操作的微批次,直到拿到干净的 schema-safe pass
|
|
111
111
|
12. 如果这一轮开始时还没有登记的项目内 `.pen`,必须先执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`,先 seed 登记路径并拿到全局锁,再开始第一次 Pencil 编辑
|
|
112
112
|
13. 如果存在外部或历史 `.pen` 备份,在新一轮写入前先运行 `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>`;若 hash 不一致,先把选中的优先来源同步回 `<project-pen>`
|
|
113
|
-
14. 如果项目里原本已有登记的 `.pen`,继续设计时也必须先通过 `da-vinci pencil-session begin --project <project-path> --pen <path>` reopen
|
|
114
|
-
15.
|
|
115
|
-
16.
|
|
116
|
-
17.
|
|
117
|
-
18.
|
|
118
|
-
19.
|
|
119
|
-
20.
|
|
120
|
-
21.
|
|
121
|
-
22.
|
|
122
|
-
23.
|
|
123
|
-
24.
|
|
113
|
+
14. 如果项目里原本已有登记的 `.pen`,继续设计时也必须先通过 `da-vinci pencil-session begin --project <project-path> --pen <path>` reopen 它;发生实质性 live edit 后,优先执行 `da-vinci save-current-design --project <project-path>`
|
|
114
|
+
15. 必须区分 `saved` / `blocked` / `unavailable`,只有 `saved` 才代表保存成功;`unavailable` 时才能回退到底层 payload 持久化链路
|
|
115
|
+
16. 在第一次成功写入 Pencil 后,立即验证登记的项目内 `.pen` 路径已经成为 shell 可见文件
|
|
116
|
+
17. 紧接着运行 `da-vinci audit --mode integrity <project-path>`
|
|
117
|
+
18. 如果 Pencil MCP 可用,先运行 MCP runtime gate,并把结果记录到 `pencil-design.md`
|
|
118
|
+
19. 运行 `design-source checkpoint`,确认登记的项目内 `.pen` 路径、当前 Pencil 设计源和 shell 可见文件是一致的
|
|
119
|
+
20. 截图导出只放到 `.da-vinci/changes/<change-id>/exports/`,绝不能写进 `.da-vinci/designs/`
|
|
120
|
+
21. 在 broad expansion 前,先把 screenshot review 的 `PASS` / `WARN` / `BLOCK`、问题列表和回改结果记清楚
|
|
121
|
+
22. 绑定路由和 Pencil 页面
|
|
122
|
+
23. 生成和 redesign slice 对齐的任务
|
|
123
|
+
24. 在任何终态完成声明之前,先运行 `da-vinci audit --mode completion --change <change-id> <project-path>`
|
|
124
|
+
25. 只有在 completion gate 最终能通过时,才进入实现和验证
|
|
124
125
|
|
|
125
126
|
### 复杂 Android 页面示例
|
|
126
127
|
|
|
@@ -145,7 +146,8 @@ If the same anchor surface rolls back twice, switch to micro-batches of 6 or few
|
|
|
145
146
|
Use only Pencil-supported properties; do not use web-only props like flex or margin.
|
|
146
147
|
在第一次 Pencil 编辑前,必须执行 `da-vinci pencil-session begin --project <project-path> --pen <path>`,这样会先 seed 登记好的 `.pen` 并持有全局 Pencil 锁。
|
|
147
148
|
如果存在外部或历史 `.pen`,先运行 `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>`;若 hash 分叉,先确认来源优先级并把选中的来源同步回 `<project-pen>` 再继续。
|
|
148
|
-
如果项目里原本已有登记的 `.pen`,继续设计时先打开它,但实质性 live edit 后优先通过 `da-vinci
|
|
149
|
+
如果项目里原本已有登记的 `.pen`,继续设计时先打开它,但实质性 live edit 后优先通过 `da-vinci save-current-design --project <project-path>` 保存。
|
|
150
|
+
必须区分 `saved` / `blocked` / `unavailable`;只有 `saved` 才是保存成功,`unavailable` 才能触发底层回退。
|
|
149
151
|
Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
|
|
150
152
|
在第一次成功写入 Pencil 后、继续大范围扩展前,先运行 `da-vinci audit --mode integrity <project-path>`。
|
|
151
153
|
Keep `.da-vinci/designs/` reserved for `.pen` files only.
|
|
@@ -218,7 +220,7 @@ If frontend-skill is available, use it as the primary visual adapter.
|
|
|
218
220
|
If it is unavailable, fall back to native Da Vinci design rules and continue.
|
|
219
221
|
Persist project-local Pencil files under .da-vinci/designs/.
|
|
220
222
|
如果当前还没有登记的项目内 `.pen`,先在这里 seed 一个登记好的 `.pen`,再开始第一次 Pencil 编辑,并把后续 live 编辑持续绑定到这个路径。
|
|
221
|
-
如果项目里原本已有 `.pen
|
|
223
|
+
如果项目里原本已有 `.pen`,继续设计后优先执行 `da-vinci save-current-design --project <project-path>` 持久化;只有高层保存返回 `unavailable` 时才回退到底层 payload 持久化。
|
|
222
224
|
```
|
|
223
225
|
|
|
224
226
|
## 图标库辅助示例
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
如果你想看逐个 `dv:` 命令的职责、下一步推荐和 `verify` 回退规则,请看 [dv-command-reference.md](/Users/xubo/x-skills/da-vinci/docs/zh-CN/dv-command-reference.md)。
|
|
17
17
|
如果你想看约束文件总览(哪些字段是硬门禁、哪些是指导项),请看 [constraint-files.md](/Users/xubo/x-skills/da-vinci/docs/zh-CN/constraint-files.md)。
|
|
18
18
|
如果你想看 sidecar、enforcement、persisted-state 回退和 scaffold 约束,请看 [execution-chain-migration.md](/Users/xubo/x-skills/da-vinci/docs/zh-CN/execution-chain-migration.md)。
|
|
19
|
+
如果你想看更偏操作手册的说明,比如第一次怎么进、暂停后怎么续跑、TUI 怎么用,请看 [skill-usage.md](/Users/xubo/x-skills/da-vinci/docs/zh-CN/skill-usage.md)。
|
|
19
20
|
|
|
20
21
|
## 核心契约
|
|
21
22
|
|
|
@@ -158,6 +159,7 @@ anchor 通过后,再抽 shared primitives,然后再扩更多页面。
|
|
|
158
159
|
|
|
159
160
|
- `design-source checkpoint`
|
|
160
161
|
- 如果启用了 Pencil MCP,则跑 `MCP runtime gate`
|
|
162
|
+
- 发生实质性 live edit 后执行 `da-vinci save-current-design --project <project-path>`(高层绑定源保存路径)
|
|
161
163
|
- 工作中期跑 `da-vinci audit --mode integrity <project-path>`
|
|
162
164
|
- 在现有 change 工件里记录 checkpoint 邻近的 `Context Delta`
|
|
163
165
|
|
|
@@ -167,6 +169,7 @@ anchor 通过后,再抽 shared primitives,然后再扩更多页面。
|
|
|
167
169
|
- active editor 是正确的设计源
|
|
168
170
|
- shell 上确实有 `.pen`
|
|
169
171
|
- live snapshot 和 persisted snapshot 已同步
|
|
172
|
+
- 高层保存结果被诚实处理(`saved` / `blocked` / `unavailable`)
|
|
170
173
|
- 最近关键执行上下文可恢复,但不会替代工件真相的选路权
|
|
171
174
|
|
|
172
175
|
### 6. Mapping
|
package/examples/greenfield-spec-markupflow/.da-vinci/state/execution-signals/demo__lint-tasks.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"surface": "lint-tasks",
|
|
4
|
+
"status": "WARN",
|
|
5
|
+
"advisory": true,
|
|
6
|
+
"strict": false,
|
|
7
|
+
"failures": [
|
|
8
|
+
"Missing `.da-vinci/` directory."
|
|
9
|
+
],
|
|
10
|
+
"warnings": [],
|
|
11
|
+
"notes": [
|
|
12
|
+
"lint-tasks defaults to advisory mode; pass `--strict` to block on findings."
|
|
13
|
+
],
|
|
14
|
+
"timestamp": "2026-03-31T16:22:40.193Z",
|
|
15
|
+
"changeId": "demo"
|
|
16
|
+
}
|
package/lib/audit-parsers.js
CHANGED
|
@@ -244,18 +244,27 @@ function normalizeCheckpointLabel(value) {
|
|
|
244
244
|
|
|
245
245
|
function parseCheckpointStatusMap(markdownText) {
|
|
246
246
|
const section = getMarkdownSection(markdownText, "Checkpoint Status");
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
const statuses = {};
|
|
248
|
+
|
|
249
|
+
if (section) {
|
|
250
|
+
const matches = section.matchAll(/(?:^|\n)\s*-\s*`?([^`:\n]+?)`?\s*:\s*(PASS|WARN|BLOCK)\b/gi);
|
|
251
|
+
for (const match of matches) {
|
|
252
|
+
const label = normalizeCheckpointLabel(match[1]);
|
|
253
|
+
if (!label) {
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
statuses[label] = String(match[2]).toUpperCase();
|
|
257
|
+
}
|
|
249
258
|
}
|
|
250
259
|
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
260
|
+
const runtimeGateSection = getMarkdownSection(markdownText, "MCP Runtime Gate");
|
|
261
|
+
if (runtimeGateSection) {
|
|
262
|
+
const runtimeGateMatch = String(runtimeGateSection).match(
|
|
263
|
+
/(?:^|\n)\s*-\s*(?:Final runtime gate status|Status|状态)\s*:\s*`?(PASS|WARN|BLOCK)`?\b/i
|
|
264
|
+
);
|
|
265
|
+
if (runtimeGateMatch) {
|
|
266
|
+
statuses[normalizeCheckpointLabel("mcp runtime gate")] = String(runtimeGateMatch[1]).toUpperCase();
|
|
257
267
|
}
|
|
258
|
-
statuses[label] = String(match[2]).toUpperCase();
|
|
259
268
|
}
|
|
260
269
|
|
|
261
270
|
return statuses;
|
package/lib/audit.js
CHANGED
|
@@ -8,7 +8,8 @@ const {
|
|
|
8
8
|
assertPenDocumentShape
|
|
9
9
|
} = require("./pen-persistence");
|
|
10
10
|
const { getSessionStatePath, readSessionState } = require("./pencil-session");
|
|
11
|
-
const {
|
|
11
|
+
const { listFilesRecursiveSafe } = require("./fs-safety");
|
|
12
|
+
const { collectRegisteredPenPaths } = require("./design-source-registry");
|
|
12
13
|
const { pathExists, readTextIfExists } = require("./utils");
|
|
13
14
|
const { runModuleExportInWorker } = require("./async-offload");
|
|
14
15
|
const { readExecutionSignals, summarizeSignalsBySurface } = require("./execution-signals");
|
|
@@ -69,30 +70,6 @@ function relativeTo(projectRoot, targetPath) {
|
|
|
69
70
|
return path.relative(projectRoot, targetPath) || ".";
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
function collectRegisteredPenPaths(projectRoot, designRegistryPath) {
|
|
73
|
-
const registryText = readTextIfExists(designRegistryPath);
|
|
74
|
-
const matches = registryText.match(/\.da-vinci\/designs\/[^\s`]+\.pen/g) || [];
|
|
75
|
-
const validPaths = [];
|
|
76
|
-
const escapedPaths = [];
|
|
77
|
-
|
|
78
|
-
for (const relativePath of [...new Set(matches)]) {
|
|
79
|
-
const resolvedPath = path.resolve(projectRoot, relativePath);
|
|
80
|
-
if (!isPathInside(projectRoot, resolvedPath)) {
|
|
81
|
-
escapedPaths.push({
|
|
82
|
-
relativePath,
|
|
83
|
-
resolvedPath
|
|
84
|
-
});
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
validPaths.push(resolvedPath);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return {
|
|
91
|
-
validPaths,
|
|
92
|
-
escapedPaths
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
73
|
function getNonEmptyChangeDirs(changesDir) {
|
|
97
74
|
return listChildDirs(changesDir).filter((changeDir) => {
|
|
98
75
|
const scan = listFilesRecursive(changeDir, CHANGE_SCAN_LIMITS);
|
|
@@ -368,7 +345,7 @@ function auditProject(projectPathInput, options = {}) {
|
|
|
368
345
|
const {
|
|
369
346
|
validPaths: registeredPenPaths,
|
|
370
347
|
escapedPaths: escapedRegisteredPenPaths
|
|
371
|
-
} = collectRegisteredPenPaths(projectRoot, designRegistryPath);
|
|
348
|
+
} = collectRegisteredPenPaths(projectRoot, readTextIfExists(designRegistryPath));
|
|
372
349
|
for (const escapedPath of escapedRegisteredPenPaths) {
|
|
373
350
|
const message =
|
|
374
351
|
`Registered design source escapes project root and will be ignored: ${escapedPath.relativePath} ` +
|