@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.
- package/CHANGELOG.md +31 -0
- package/README.md +28 -65
- package/README.zh-CN.md +28 -65
- package/bin/da-vinci-tui.js +8 -0
- package/commands/claude/dv/continue.md +5 -0
- package/commands/codex/prompts/dv-continue.md +6 -1
- package/commands/gemini/dv/continue.toml +5 -0
- package/commands/templates/dv-continue.shared.md +33 -0
- package/docs/dv-command-reference.md +35 -0
- package/docs/execution-chain-migration.md +46 -0
- package/docs/execution-chain-plan.md +125 -0
- package/docs/prompt-entrypoints.md +8 -0
- package/docs/skill-usage.md +217 -0
- package/docs/workflow-examples.md +10 -0
- package/docs/workflow-overview.md +26 -0
- package/docs/zh-CN/dv-command-reference.md +35 -0
- package/docs/zh-CN/execution-chain-migration.md +46 -0
- package/docs/zh-CN/prompt-entrypoints.md +8 -0
- package/docs/zh-CN/skill-usage.md +217 -0
- package/docs/zh-CN/workflow-examples.md +10 -0
- package/docs/zh-CN/workflow-overview.md +26 -0
- package/lib/artifact-parsers.js +120 -0
- package/lib/audit.js +61 -0
- package/lib/cli.js +351 -13
- package/lib/diff-spec.js +242 -0
- package/lib/execution-signals.js +136 -0
- package/lib/lint-bindings.js +143 -0
- package/lib/lint-spec.js +408 -0
- package/lib/lint-tasks.js +176 -0
- package/lib/planning-parsers.js +567 -0
- package/lib/scaffold.js +193 -0
- package/lib/scope-check.js +603 -0
- package/lib/sidecars.js +369 -0
- package/lib/supervisor-review.js +28 -3
- package/lib/utils.js +10 -2
- package/lib/verify.js +652 -0
- package/lib/workflow-contract.js +107 -0
- package/lib/workflow-persisted-state.js +297 -0
- package/lib/workflow-state.js +785 -0
- package/package.json +13 -3
- package/references/artifact-templates.md +26 -0
- package/references/checkpoints.md +14 -0
- package/references/modes.md +10 -0
- package/tui/catalog.js +1190 -0
- package/tui/index.js +727 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Skill Usage Guide
|
|
2
|
+
|
|
3
|
+
Use this document when you want the operator-facing workflow rather than the lower-level command reference.
|
|
4
|
+
|
|
5
|
+
This guide focuses on:
|
|
6
|
+
|
|
7
|
+
- how to enter the Da Vinci workflow the first time
|
|
8
|
+
- how to move between requirement, design, task, and implementation phases
|
|
9
|
+
- how to resume safely after pausing midway
|
|
10
|
+
- how to use the TUI instead of memorizing many CLI surfaces
|
|
11
|
+
|
|
12
|
+
## Core Rule
|
|
13
|
+
|
|
14
|
+
Da Vinci should be resumed from artifact truth, not from chat memory.
|
|
15
|
+
|
|
16
|
+
That means:
|
|
17
|
+
|
|
18
|
+
- `spec.md` and related requirement artifacts stay the behavior truth
|
|
19
|
+
- the project-local `.pen` stays the design truth
|
|
20
|
+
- `tasks.md`, `verification.md`, and execution signals explain what has or has not been implemented yet
|
|
21
|
+
|
|
22
|
+
## First Entry
|
|
23
|
+
|
|
24
|
+
Use these entry helpers:
|
|
25
|
+
|
|
26
|
+
- `intake`
|
|
27
|
+
- choose this when the project is complex, the mode is unclear, or there are multiple truth sources
|
|
28
|
+
- `prompt`
|
|
29
|
+
- choose this when the mode is already known and you only need a good executable starting prompt
|
|
30
|
+
- `continue`
|
|
31
|
+
- choose this when `DA-VINCI.md` or `.da-vinci/` artifacts already exist and you are resuming work
|
|
32
|
+
|
|
33
|
+
For Codex, the usual first requests are:
|
|
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
|
+
Default recommendation:
|
|
42
|
+
|
|
43
|
+
1. use `intake` on the first pass through a non-trivial project
|
|
44
|
+
2. execute the generated main workflow prompt
|
|
45
|
+
3. when work pauses, come back through `continue`
|
|
46
|
+
|
|
47
|
+
Do not default directly to `build` unless the project is already implementation-ready.
|
|
48
|
+
|
|
49
|
+
## Real Workflow
|
|
50
|
+
|
|
51
|
+
The normal delivery flow is:
|
|
52
|
+
|
|
53
|
+
1. choose the mode
|
|
54
|
+
2. create or stabilize discovery and scope artifacts
|
|
55
|
+
3. register the preferred project-local `.pen` source
|
|
56
|
+
4. design 1 to 3 anchor surfaces first
|
|
57
|
+
5. reconcile the live Pencil session with the registered `.pen`
|
|
58
|
+
6. write `pencil-bindings.md`
|
|
59
|
+
7. generate or refine `tasks.md`
|
|
60
|
+
8. implement
|
|
61
|
+
9. verify
|
|
62
|
+
|
|
63
|
+
The artifact spine usually looks like this:
|
|
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
|
+
## Before Implementation
|
|
77
|
+
|
|
78
|
+
When design is mostly ready and implementation is next, use these checks:
|
|
79
|
+
|
|
80
|
+
- `da-vinci workflow-status`
|
|
81
|
+
- confirm the active stage and blockers first
|
|
82
|
+
- `da-vinci next-step`
|
|
83
|
+
- confirm whether the next move should still be `design`, `tasks`, or `build`
|
|
84
|
+
- `da-vinci lint-spec`
|
|
85
|
+
- use this when runtime spec quality is still uncertain
|
|
86
|
+
- `da-vinci scope-check`
|
|
87
|
+
- use this when page/state propagation across planning artifacts looks ambiguous
|
|
88
|
+
|
|
89
|
+
If you are already inside the project root directory, `--project` is optional because the CLI falls back to `cwd`.
|
|
90
|
+
|
|
91
|
+
Examples:
|
|
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
|
+
## After Pausing Midway
|
|
101
|
+
|
|
102
|
+
The safest resume order is:
|
|
103
|
+
|
|
104
|
+
1. `da-vinci workflow-status [--change <id>] --json`
|
|
105
|
+
2. `da-vinci next-step [--change <id>]`
|
|
106
|
+
3. if spec quality is unclear, run `da-vinci lint-spec`
|
|
107
|
+
4. if planning propagation is unclear, run `da-vinci scope-check`
|
|
108
|
+
5. if planning artifacts changed since the last stable snapshot, run `da-vinci generate-sidecars` and `da-vinci diff-spec`
|
|
109
|
+
6. before terminal completion, run `da-vinci verify-bindings` and `da-vinci verify-coverage`
|
|
110
|
+
|
|
111
|
+
Resume should follow the artifacts, not old conversation state:
|
|
112
|
+
|
|
113
|
+
- if design artifacts exist but `tasks.md` does not, resume into `tasks`
|
|
114
|
+
- if `tasks.md` exists but design gates are still unresolved, resume into design cleanup rather than `build`
|
|
115
|
+
- only resume into `build` when implementation readiness is already clear
|
|
116
|
+
|
|
117
|
+
## How `change-id` Works
|
|
118
|
+
|
|
119
|
+
`change-id` is the directory name under `.da-vinci/changes/<change-id>/`.
|
|
120
|
+
|
|
121
|
+
Practical rules:
|
|
122
|
+
|
|
123
|
+
- if the project only has one non-empty change directory, most workflow commands can infer it automatically
|
|
124
|
+
- if the project has multiple non-empty change directories, pass `--change <id>` explicitly
|
|
125
|
+
- keep one active change per branch when possible to reduce routing friction
|
|
126
|
+
|
|
127
|
+
Use `da-vinci workflow-status` when you forget which change is active. In multi-change cases it reports the available ids and the latest inferred one for context.
|
|
128
|
+
|
|
129
|
+
## TUI Quick Start
|
|
130
|
+
|
|
131
|
+
If remembering many command surfaces is the main friction, use the terminal UI instead of typing commands from memory.
|
|
132
|
+
|
|
133
|
+
Launch it with either:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
da-vinci tui
|
|
137
|
+
da-vinci-tui
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Or through `npx` without installing globally:
|
|
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
|
+
The TUI provides:
|
|
148
|
+
|
|
149
|
+
- command grouping by workflow phase
|
|
150
|
+
- English and Chinese UI descriptions
|
|
151
|
+
- current project path and change-id context at the top
|
|
152
|
+
- preview commands before execution
|
|
153
|
+
- one-key toggles for `--strict`, `--json`, and `--continue-on-error`
|
|
154
|
+
- placeholder-aware editing for commands that still need specific paths like `<pen-path>`
|
|
155
|
+
|
|
156
|
+
### TUI Phase Map
|
|
157
|
+
|
|
158
|
+
```mermaid
|
|
159
|
+
flowchart TD
|
|
160
|
+
A[Launch da-vinci tui] --> B[Set project path and change-id context]
|
|
161
|
+
B --> C[Routing & Resume<br/>workflow-status / next-step]
|
|
162
|
+
C --> D{Which phase is active?}
|
|
163
|
+
|
|
164
|
+
D --> E[Planning & Drift<br/>lint-spec / scope-check / lint-tasks / lint-bindings / generate-sidecars / diff-spec / scaffold]
|
|
165
|
+
D --> F[Visual & Review<br/>icon-sync / icon-search / supervisor-review]
|
|
166
|
+
D --> G[Pen Files & Sync<br/>preflight-pencil / ensure-pen / write-pen / check-pen-sync / check-pen-baseline / sync-pen-source / snapshot-pen]
|
|
167
|
+
D --> H[Pencil Session<br/>pencil-lock * / pencil-session begin|persist|end|status]
|
|
168
|
+
D --> I[Verification & Completion<br/>verify-bindings / verify-implementation / verify-structure / verify-coverage / audit]
|
|
169
|
+
D --> J[Setup & Tooling<br/>install / uninstall / status / validate-assets / bootstrap-project]
|
|
170
|
+
|
|
171
|
+
E --> I
|
|
172
|
+
F --> G
|
|
173
|
+
G --> H
|
|
174
|
+
H --> E
|
|
175
|
+
I --> K{Ready to finish?}
|
|
176
|
+
K -->|No| C
|
|
177
|
+
K -->|Yes| L[Completion audit and terminal claim]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Use this as the quick mental model:
|
|
181
|
+
|
|
182
|
+
- start from `Routing & Resume`
|
|
183
|
+
- move into the phase that matches the current blockers
|
|
184
|
+
- return to `Routing & Resume` whenever the workflow pauses or artifacts changed materially
|
|
185
|
+
- only finish after the verification lane and completion audit are both clear
|
|
186
|
+
|
|
187
|
+
Main keys:
|
|
188
|
+
|
|
189
|
+
- `Up/Down` or `j/k`: move selection
|
|
190
|
+
- `Enter` or `r`: run the selected command
|
|
191
|
+
- `h`: inspect parameters for the selected command
|
|
192
|
+
- `m`: edit the preview command first
|
|
193
|
+
- `p`: change project path context
|
|
194
|
+
- `c`: change or clear change-id context
|
|
195
|
+
- `l`: toggle English / Chinese
|
|
196
|
+
- `s`: toggle `--strict`
|
|
197
|
+
- `J`: toggle `--json`
|
|
198
|
+
- `e`: toggle `--continue-on-error`
|
|
199
|
+
- `?`: open help
|
|
200
|
+
- `q`: quit
|
|
201
|
+
|
|
202
|
+
Recommended TUI usage:
|
|
203
|
+
|
|
204
|
+
1. launch the TUI from the project root
|
|
205
|
+
2. set or confirm project path and change-id in the header
|
|
206
|
+
3. start with `workflow-status`
|
|
207
|
+
4. run `next-step`
|
|
208
|
+
5. move into `lint-spec` / `scope-check` / `tasks` / `verify-*` as needed
|
|
209
|
+
6. for specialized Pencil commands, press `m` and fill the remaining placeholders before execution
|
|
210
|
+
|
|
211
|
+
## Practical Shortcuts
|
|
212
|
+
|
|
213
|
+
- inside the project root, you usually do not need `--project`
|
|
214
|
+
- with one active change, you often do not need `--change`
|
|
215
|
+
- use `workflow-status` and `next-step` as the standard re-entry pair after any pause
|
|
216
|
+
- use the TUI when command recall is the main problem
|
|
217
|
+
- use direct CLI commands when you already know the exact surface and want faster scripting
|
|
@@ -17,6 +17,16 @@ Common rule:
|
|
|
17
17
|
- `continue` should pick routes from artifact/checkpoint truth first, then use contextual deltas as auxiliary recovery notes
|
|
18
18
|
- if contextual deltas conflict with current artifacts, ignore them for routing and record the conflict
|
|
19
19
|
|
|
20
|
+
Execution-chain command bundle (before terminal completion):
|
|
21
|
+
|
|
22
|
+
- `da-vinci workflow-status --project <path> [--change <id>] --json`
|
|
23
|
+
- `da-vinci next-step --project <path> [--change <id>]`
|
|
24
|
+
- `da-vinci lint-spec|lint-tasks|lint-bindings --project <path> [--change <id>]`
|
|
25
|
+
- `da-vinci scope-check --project <path> [--change <id>]`
|
|
26
|
+
- `da-vinci generate-sidecars --project <path> [--change <id>]`
|
|
27
|
+
- `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>]`
|
|
28
|
+
- `da-vinci diff-spec --project <path> [--change <id>]`
|
|
29
|
+
|
|
20
30
|
## 1. `greenfield-spec`
|
|
21
31
|
|
|
22
32
|
Use when a new project already has a stable requirement set.
|
|
@@ -13,6 +13,8 @@ Use it when you need the high-level delivery chain:
|
|
|
13
13
|
Use [pencil-rendering-workflow.md](/Users/xubo/x-skills/da-vinci/docs/pencil-rendering-workflow.md) when you need the lower-level Pencil session, persistence, gate, and audit details.
|
|
14
14
|
Use [dv-command-reference.md](/Users/xubo/x-skills/da-vinci/docs/dv-command-reference.md) when you need route-by-route `dv:` command behavior, next-step recommendations, and verify rollback handling.
|
|
15
15
|
Use [constraint-files.md](/Users/xubo/x-skills/da-vinci/docs/constraint-files.md) when you need a single map for project constraint files, hard-gate fields, and advisory guidance sections.
|
|
16
|
+
Use [execution-chain-migration.md](/Users/xubo/x-skills/da-vinci/docs/execution-chain-migration.md) for sidecar, enforcement, persisted-state fallback, and scaffold migration guidance.
|
|
17
|
+
Use [skill-usage.md](/Users/xubo/x-skills/da-vinci/docs/skill-usage.md) for an operator-facing guide to starting, pausing, resuming, and using the TUI.
|
|
16
18
|
|
|
17
19
|
## Core Contract
|
|
18
20
|
|
|
@@ -40,6 +42,30 @@ This means:
|
|
|
40
42
|
8. Implement.
|
|
41
43
|
9. Verify requirement drift and design drift.
|
|
42
44
|
|
|
45
|
+
## Workflow-State Surfaces
|
|
46
|
+
|
|
47
|
+
Use these command surfaces to inspect route readiness before selecting the next `dv:` stage:
|
|
48
|
+
|
|
49
|
+
- `da-vinci workflow-status --project <path> [--change <id>] [--json]`
|
|
50
|
+
- summarizes current stage, blockers, handoff gates, and route recommendation from artifact truth plus selected audit-visible evidence
|
|
51
|
+
- `da-vinci next-step --project <path> [--change <id>] [--json]`
|
|
52
|
+
- emits the first continuation action from the same derived workflow-state model
|
|
53
|
+
- `da-vinci lint-spec --project <path> [--change <id>] [--strict] [--json]`
|
|
54
|
+
- validates runtime `spec.md` schema quality before implementation planning or execution
|
|
55
|
+
- default behavior is advisory; `--strict` is explicit opt-in for blocking behavior
|
|
56
|
+
- `da-vinci scope-check --project <path> [--change <id>] [--strict] [--json]`
|
|
57
|
+
- validates page and state propagation across proposal, page-map, runtime specs, pencil-design, and tasks
|
|
58
|
+
- emits a machine-readable page/state coverage matrix for later verify and status consumers
|
|
59
|
+
- `da-vinci generate-sidecars --project <path> [--change <id>] [--json]`
|
|
60
|
+
- explicitly generates deterministic planning sidecars used by diff and downstream tooling
|
|
61
|
+
- `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>] [--strict] [--json]`
|
|
62
|
+
- validates execution-chain evidence from bindings through implementation and structural coverage
|
|
63
|
+
- `da-vinci diff-spec --project <path> [--change <id>] [--from <sidecars-dir>] [--json]`
|
|
64
|
+
- reports normalized planning deltas for spec/tasks/page-map/bindings sidecars to support safe continuation
|
|
65
|
+
|
|
66
|
+
These surfaces do not replace `da-vinci audit --mode integrity|completion`.
|
|
67
|
+
`audit` remains the formal integrity and completion truth surface.
|
|
68
|
+
|
|
43
69
|
## Standard Artifact Spine
|
|
44
70
|
|
|
45
71
|
Depending on mode, Da Vinci typically builds this spine:
|
|
@@ -39,6 +39,40 @@ Da Vinci 期望它们遵循工作流状态。
|
|
|
39
39
|
|
|
40
40
|
这些命令不会替代 `dv:` 选路,但能显著提升设计执行质量:
|
|
41
41
|
|
|
42
|
+
- `da-vinci tui [--project <path>] [--change <id>] [--lang en|zh]`
|
|
43
|
+
- 打开面向工作流的终端 UI,按阶段组织命令,并在执行前先展示生成出的 CLI 预览
|
|
44
|
+
- 也可以用独立 bin `da-vinci-tui`,或在没全局安装时用 `npx -p @xenonbyte/da-vinci-workflow da-vinci tui`
|
|
45
|
+
- 当真正难记的是命令面而不是流程本身时,优先用它
|
|
46
|
+
- `da-vinci workflow-status --project <path> [--change <id>] [--json]`
|
|
47
|
+
- 从工件和 checkpoint 真相推导当前 workflow 阶段
|
|
48
|
+
- 报告 blocker、warning、handoff gate 状态,以及主推荐路由
|
|
49
|
+
- 它和 `audit` 职责不同:它负责选路,不是终态审计真相
|
|
50
|
+
- `da-vinci next-step --project <path> [--change <id>] [--json]`
|
|
51
|
+
- 基于同一套 workflow-state 推导,给出 route-first 的续跑建议
|
|
52
|
+
- 在自由扫描工件之前,优先把它作为第一路由信号
|
|
53
|
+
- `da-vinci lint-spec --project <path> [--change <id>] [--strict] [--json]`
|
|
54
|
+
- 校验 Da Vinci 运行时 `spec.md` 的核心章节(`Behavior`、`States`、`Inputs`、`Outputs`、`Acceptance`、`Edge Cases`)
|
|
55
|
+
- 默认 advisory(有发现给 `WARN` 且不阻断);显式 `--strict` 才升级为阻断
|
|
56
|
+
- 不会把 OpenSpec 规划用的 `ADDED Requirements` 结构当成运行时 spec 合法结构
|
|
57
|
+
- `da-vinci scope-check --project <path> [--change <id>] [--strict] [--json]`
|
|
58
|
+
- 检查 proposal、page-map、运行时 spec、pencil-design 状态和 tasks 之间的 scope 传播一致性
|
|
59
|
+
- 输出页面与状态两条线的机器可读覆盖矩阵
|
|
60
|
+
- 默认 advisory(有发现给 `WARN` 且不阻断);显式 `--strict` 才升级为阻断
|
|
61
|
+
- `da-vinci lint-tasks --project <path> [--change <id>] [--strict] [--json]`
|
|
62
|
+
- 校验顶层 task groups、编号顺序、verification 动作和 behavior 覆盖提示
|
|
63
|
+
- 默认 advisory(有发现给 `WARN` 且不阻断);显式 `--strict` 才升级为阻断
|
|
64
|
+
- `da-vinci lint-bindings --project <path> [--change <id>] [--strict] [--json]`
|
|
65
|
+
- 校验实现到 Pencil 的映射是否可解析、source 形态是否合理、实现落点是否可定位
|
|
66
|
+
- 默认 advisory(有发现给 `WARN` 且不阻断);显式 `--strict` 才升级为阻断
|
|
67
|
+
- `da-vinci generate-sidecars --project <path> [--change <id>] [--json]`
|
|
68
|
+
- 显式生成确定性的 planning sidecars:`spec.index.json`、`tasks.index.json`、`page-map.index.json`、`bindings.index.json`
|
|
69
|
+
- sidecar 只允许通过这个命令写入;lint/status/verify 不应静默重写
|
|
70
|
+
- `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>] [--strict] [--json]`
|
|
71
|
+
- 校验代码落点、计划状态实现证据、以及绑定驱动的结构一致性
|
|
72
|
+
- `verify-structure` 会明确报告是 markup-backed 还是 heuristic fallback,并给出置信度
|
|
73
|
+
- `da-vinci diff-spec --project <path> [--change <id>] [--from <sidecars-dir>] [--json]`
|
|
74
|
+
- 比较规范化 planning sidecars,报告新增/删除/修改的规划项
|
|
75
|
+
- 在同一 surface 下提供 spec 差异以及 tasks/page-map/bindings 摘要差异
|
|
42
76
|
- `da-vinci icon-sync`
|
|
43
77
|
- 同步官方图标名(Material Symbols、Lucide、Feather、Phosphor)到 `~/.da-vinci/icon-catalog.json`
|
|
44
78
|
- 默认是用户级范围(当前 HOME),同一用户可跨项目复用
|
|
@@ -116,6 +150,7 @@ Da Vinci 期望它们遵循工作流状态。
|
|
|
116
150
|
|
|
117
151
|
重要规则:
|
|
118
152
|
|
|
153
|
+
- 有 shell 能力时,先跑 `da-vinci workflow-status --project <path> [--change <id>] --json`,再用 `da-vinci next-step --project <path> [--change <id>]` 作为第一选路信号
|
|
119
154
|
- 如果设计已经有了,但 `tasks.md` 还没有,`continue` 通常应该把你送到 `tasks`
|
|
120
155
|
- 这时候不应该把 `build` 当成同级主推荐
|
|
121
156
|
- 选路必须先基于工件和 checkpoint 真相,再参考 Context Delta
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Execution-Chain 升级迁移指南
|
|
2
|
+
|
|
3
|
+
当你要在已有项目上启用 execution-chain 升级能力时,使用这份指南。
|
|
4
|
+
|
|
5
|
+
## 1. Sidecar 生成生命周期
|
|
6
|
+
|
|
7
|
+
Planning sidecar 是显式工件,不是隐式副产物。
|
|
8
|
+
|
|
9
|
+
- 用 `da-vinci generate-sidecars --project <path> [--change <id>]` 生成
|
|
10
|
+
- sidecar 写入 `.da-vinci/changes/<change-id>/sidecars/`
|
|
11
|
+
- lint/status/verify 不应静默改写 sidecar
|
|
12
|
+
- proposal/spec/page-map/tasks/bindings 有实质改动后应重新生成
|
|
13
|
+
|
|
14
|
+
## 2. Advisory 与 Strict 推广策略
|
|
15
|
+
|
|
16
|
+
默认策略:
|
|
17
|
+
|
|
18
|
+
- `lint-spec`、`scope-check`、`lint-tasks`、`lint-bindings` 默认 advisory(`WARN` 不硬阻断)
|
|
19
|
+
- 传 `--strict` 才把 warning 升级为阻断退出
|
|
20
|
+
- 只有在 warning 基线稳定后,才在 CI 打开 strict
|
|
21
|
+
|
|
22
|
+
Audit 集成:
|
|
23
|
+
|
|
24
|
+
- integrity audit 把 planning-signal 的 `BLOCK` 当 warning 级信号
|
|
25
|
+
- completion audit 把 verification-signal 的 `BLOCK` 当 failure 级信号
|
|
26
|
+
|
|
27
|
+
## 3. 持久化工作流状态回退
|
|
28
|
+
|
|
29
|
+
`workflow-status` 只有在以下条件全部满足时才会使用 `.da-vinci/state/workflow.json`:
|
|
30
|
+
|
|
31
|
+
- schema 版本可识别
|
|
32
|
+
- change 条目存在
|
|
33
|
+
- 时间戳未过期
|
|
34
|
+
- 指纹与当前工件真相一致
|
|
35
|
+
|
|
36
|
+
任一条件不满足时,会自动回退到基于工件的派生状态,并记录 reconciliation 说明。
|
|
37
|
+
|
|
38
|
+
## 4. Scaffold 约束
|
|
39
|
+
|
|
40
|
+
`da-vinci scaffold` 是 MVP 脚手架能力,约束如下:
|
|
41
|
+
|
|
42
|
+
- 输出只用于 TODO 标记和人工审阅
|
|
43
|
+
- 不是最终代码生成
|
|
44
|
+
- MVP 不做多框架扩展
|
|
45
|
+
- scaffold 边界来自 `pencil-bindings.md` 映射
|
|
46
|
+
- 接受前需跑 `verify-bindings`、`verify-implementation`、`verify-structure`
|
|
@@ -65,6 +65,12 @@
|
|
|
65
65
|
|
|
66
66
|
继续规则优先级:
|
|
67
67
|
|
|
68
|
+
- 有 shell 能力时,先运行 `da-vinci workflow-status --project <path> [--change <id>] --json`
|
|
69
|
+
- 再用 `da-vinci next-step --project <path> [--change <id>]` 作为第一续跑路由信号
|
|
70
|
+
- 如果运行时 spec 质量还不确定,进入 `build` 前先运行 `da-vinci lint-spec --project <path> [--change <id>]`
|
|
71
|
+
- 如果页面或状态在规划工件中的传播关系不确定,进入 `build` 前先运行 `da-vinci scope-check --project <path> [--change <id>]`
|
|
72
|
+
- 进入终态前先运行 `da-vinci verify-bindings --project <path> [--change <id>]` 与 `da-vinci verify-coverage --project <path> [--change <id>]`
|
|
73
|
+
- 当规划切片有改动且需要恢复判断时,运行 `da-vinci diff-spec --project <path> [--change <id>]`
|
|
68
74
|
- 先根据工件和 checkpoint 真相决定路由
|
|
69
75
|
- Context Delta 只用于恢复和解释,不用于覆盖选路
|
|
70
76
|
- 如果 Context Delta 与当前工件冲突,选路时忽略冲突内容并标记冲突
|
|
@@ -80,6 +86,8 @@
|
|
|
80
86
|
|
|
81
87
|
默认不要把这个流程改成 `build`。
|
|
82
88
|
|
|
89
|
+
如果真正的阻力变成“命令太多记不住”,就启动 `da-vinci tui`,直接在终端 UI 里按阶段选择命令,而不是手动记每个 CLI surface。
|
|
90
|
+
|
|
83
91
|
`build` 仍然有效,但它更适合已经明确进入实现阶段的高级直接调用。
|
|
84
92
|
|
|
85
93
|
状态规则:
|
|
@@ -0,0 +1,217 @@
|
|
|
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
|
+
- 顶部显示当前项目路径和 change-id 上下文
|
|
152
|
+
- 执行前可先看命令预览
|
|
153
|
+
- 一键切换 `--strict`、`--json`、`--continue-on-error`
|
|
154
|
+
- 对 `<pen-path>` 这类还没补具体路径的命令,支持先编辑预览再执行
|
|
155
|
+
|
|
156
|
+
### TUI 阶段图
|
|
157
|
+
|
|
158
|
+
```mermaid
|
|
159
|
+
flowchart TD
|
|
160
|
+
A[启动 da-vinci tui] --> B[设置 project path 和 change-id 上下文]
|
|
161
|
+
B --> C[选路与续跑<br/>workflow-status / next-step]
|
|
162
|
+
C --> D{当前处于哪个阶段?}
|
|
163
|
+
|
|
164
|
+
D --> E[规划与漂移检查<br/>lint-spec / scope-check / lint-tasks / lint-bindings / generate-sidecars / diff-spec / scaffold]
|
|
165
|
+
D --> F[视觉与审查<br/>icon-sync / icon-search / supervisor-review]
|
|
166
|
+
D --> G[Pen 文件与同步<br/>preflight-pencil / ensure-pen / write-pen / check-pen-sync / check-pen-baseline / sync-pen-source / snapshot-pen]
|
|
167
|
+
D --> H[Pencil 会话<br/>pencil-lock * / pencil-session begin|persist|end|status]
|
|
168
|
+
D --> I[验证与完成<br/>verify-bindings / verify-implementation / verify-structure / verify-coverage / audit]
|
|
169
|
+
D --> J[初始化与工具<br/>install / uninstall / status / validate-assets / bootstrap-project]
|
|
170
|
+
|
|
171
|
+
E --> I
|
|
172
|
+
F --> G
|
|
173
|
+
G --> H
|
|
174
|
+
H --> E
|
|
175
|
+
I --> K{可以收尾了吗?}
|
|
176
|
+
K -->|还不行| C
|
|
177
|
+
K -->|可以| L[跑 completion audit 并做终态声明]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
你可以把它理解成这四条最实用的规则:
|
|
181
|
+
|
|
182
|
+
- 先从“选路与续跑”开始
|
|
183
|
+
- 再进入当前 blocker 所在的阶段
|
|
184
|
+
- 只要中途暂停,或者工件发生了实质变化,就回到“选路与续跑”
|
|
185
|
+
- 只有验证链和 completion audit 都通过了,才进入终态
|
|
186
|
+
|
|
187
|
+
主要按键:
|
|
188
|
+
|
|
189
|
+
- `Up/Down` 或 `j/k`:移动选中项
|
|
190
|
+
- `Enter` 或 `r`:执行当前命令
|
|
191
|
+
- `h`:查看当前命令参数
|
|
192
|
+
- `m`:先编辑预览命令
|
|
193
|
+
- `p`:修改项目路径上下文
|
|
194
|
+
- `c`:修改或清空 change-id 上下文
|
|
195
|
+
- `l`:切换中英文
|
|
196
|
+
- `s`:切换 `--strict`
|
|
197
|
+
- `J`:切换 `--json`
|
|
198
|
+
- `e`:切换 `--continue-on-error`
|
|
199
|
+
- `?`:打开帮助
|
|
200
|
+
- `q`:退出
|
|
201
|
+
|
|
202
|
+
推荐的 TUI 使用顺序:
|
|
203
|
+
|
|
204
|
+
1. 在项目根目录启动 TUI
|
|
205
|
+
2. 先确认顶部的 project path 和 change-id
|
|
206
|
+
3. 先跑 `workflow-status`
|
|
207
|
+
4. 再跑 `next-step`
|
|
208
|
+
5. 根据情况进入 `lint-spec`、`scope-check`、`tasks`、`verify-*`
|
|
209
|
+
6. 如果是 Pencil 相关特殊命令,按 `m` 先把剩余占位符补全后再执行
|
|
210
|
+
|
|
211
|
+
## 实用简化规则
|
|
212
|
+
|
|
213
|
+
- 在项目根目录里,通常不需要写 `--project`
|
|
214
|
+
- 只有一个 active change 时,通常也不需要写 `--change`
|
|
215
|
+
- 每次暂停回来,默认先跑 `workflow-status` 和 `next-step`
|
|
216
|
+
- 觉得命令太散时,用 TUI
|
|
217
|
+
- 已经很清楚要跑哪条命令、而且在写脚本时,直接用 CLI 更快
|
|
@@ -19,6 +19,16 @@
|
|
|
19
19
|
- `continue` 选路先看工件/checkpoint 真相,再把 Context Delta 当作辅助恢复信息
|
|
20
20
|
- 如果 Context Delta 与当前工件冲突,选路时应忽略冲突内容并记录冲突
|
|
21
21
|
|
|
22
|
+
execution-chain 命令组合(终态前建议):
|
|
23
|
+
|
|
24
|
+
- `da-vinci workflow-status --project <path> [--change <id>] --json`
|
|
25
|
+
- `da-vinci next-step --project <path> [--change <id>]`
|
|
26
|
+
- `da-vinci lint-spec|lint-tasks|lint-bindings --project <path> [--change <id>]`
|
|
27
|
+
- `da-vinci scope-check --project <path> [--change <id>]`
|
|
28
|
+
- `da-vinci generate-sidecars --project <path> [--change <id>]`
|
|
29
|
+
- `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>]`
|
|
30
|
+
- `da-vinci diff-spec --project <path> [--change <id>]`
|
|
31
|
+
|
|
22
32
|
## 1. `greenfield-spec`
|
|
23
33
|
|
|
24
34
|
适用:
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
如果你想看 Pencil 渲染、持久化、门禁和审计的专门说明,请看 [pencil-rendering-workflow.md](/Users/xubo/x-skills/da-vinci/docs/zh-CN/pencil-rendering-workflow.md)。
|
|
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
|
+
如果你想看 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)。
|
|
18
20
|
|
|
19
21
|
## 核心契约
|
|
20
22
|
|
|
@@ -42,6 +44,30 @@ Da Vinci 围绕一个固定契约工作:
|
|
|
42
44
|
8. 实现。
|
|
43
45
|
9. 验证需求漂移和设计漂移。
|
|
44
46
|
|
|
47
|
+
## Workflow-State 命令面
|
|
48
|
+
|
|
49
|
+
在选择下一步 `dv:` 路由前,可先使用这些命令判断当前阶段就绪度:
|
|
50
|
+
|
|
51
|
+
- `da-vinci workflow-status --project <path> [--change <id>] [--json]`
|
|
52
|
+
- 从工件真相和部分 audit 可见证据推导阶段、blocker、handoff gate 与路由建议
|
|
53
|
+
- `da-vinci next-step --project <path> [--change <id>] [--json]`
|
|
54
|
+
- 基于同一 workflow-state 模型,给出优先续跑动作
|
|
55
|
+
- `da-vinci lint-spec --project <path> [--change <id>] [--strict] [--json]`
|
|
56
|
+
- 在进入实现规划或实现前,校验运行时 `spec.md` 结构质量
|
|
57
|
+
- 默认 advisory;显式 `--strict` 才会把发现升级为阻断
|
|
58
|
+
- `da-vinci scope-check --project <path> [--change <id>] [--strict] [--json]`
|
|
59
|
+
- 校验 proposal、page-map、运行时 spec、pencil-design、tasks 之间页面/状态传播是否一致
|
|
60
|
+
- 输出页面和状态的机器可读覆盖矩阵,供后续 verify/status 消费
|
|
61
|
+
- `da-vinci generate-sidecars --project <path> [--change <id>] [--json]`
|
|
62
|
+
- 显式生成确定性的 planning sidecars,供 diff 和下游工具消费
|
|
63
|
+
- `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>] [--strict] [--json]`
|
|
64
|
+
- 校验从 bindings 到实现与结构覆盖的执行链证据
|
|
65
|
+
- `da-vinci diff-spec --project <path> [--change <id>] [--from <sidecars-dir>] [--json]`
|
|
66
|
+
- 报告 spec/tasks/page-map/bindings sidecars 的规范化差异,支持安全续跑
|
|
67
|
+
|
|
68
|
+
这些命令不替代 `da-vinci audit --mode integrity|completion`。
|
|
69
|
+
`audit` 仍是 integrity/completion 的正式真相面。
|
|
70
|
+
|
|
45
71
|
## 标准工件骨架
|
|
46
72
|
|
|
47
73
|
根据 mode 的不同,Da Vinci 一般会围绕这组工件推进:
|