@xenonbyte/da-vinci-workflow 0.1.20 → 0.1.21
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 +12 -0
- package/README.md +21 -54
- package/README.zh-CN.md +21 -54
- package/commands/claude/dv/build.md +6 -0
- package/commands/claude/dv/continue.md +1 -0
- package/commands/codex/prompts/dv-build.md +4 -0
- package/commands/codex/prompts/dv-continue.md +1 -0
- package/commands/gemini/dv/build.toml +4 -0
- package/commands/gemini/dv/continue.toml +1 -0
- package/docs/dv-command-reference.md +7 -0
- package/docs/visual-adapters.md +24 -80
- package/docs/visual-assist-presets/desktop-app.md +20 -68
- package/docs/visual-assist-presets/mobile-app.md +20 -68
- package/docs/visual-assist-presets/tablet-app.md +20 -68
- package/docs/visual-assist-presets/web-app.md +20 -68
- package/docs/zh-CN/dv-command-reference.md +7 -0
- package/docs/zh-CN/visual-adapters.md +24 -80
- package/docs/zh-CN/visual-assist-presets/desktop-app.md +20 -68
- package/docs/zh-CN/visual-assist-presets/mobile-app.md +20 -68
- package/docs/zh-CN/visual-assist-presets/tablet-app.md +20 -68
- package/docs/zh-CN/visual-assist-presets/web-app.md +20 -68
- package/examples/greenfield-spec-markupflow/DA-VINCI.md +4 -13
- package/lib/cli.js +6 -1
- package/lib/pencil-session.js +6 -0
- package/package.json +1 -1
- package/scripts/test-mode-consistency.js +50 -0
- package/scripts/test-pencil-session.js +40 -0
- package/scripts/test-persistence-flows.js +31 -1
|
@@ -18,20 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
```md
|
|
20
20
|
## Visual Assist
|
|
21
|
-
- Preferred adapters:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
- visual contract refinement
|
|
26
|
-
- page composition
|
|
27
|
-
- hierarchy and spacing
|
|
28
|
-
- responsive motion guidance
|
|
29
|
-
- anchor-surface composition
|
|
30
|
-
- Pencil design refinement
|
|
31
|
-
- Fallback:
|
|
32
|
-
- native-da-vinci
|
|
33
|
-
- Require Adapter:
|
|
34
|
-
- false
|
|
21
|
+
- Preferred adapters: ui-ux-pro-max, frontend-skill
|
|
22
|
+
- Scope: visual contract refinement, page composition, hierarchy and spacing, responsive motion guidance, anchor-surface composition, Pencil design refinement
|
|
23
|
+
- Fallback: native-da-vinci
|
|
24
|
+
- Require Adapter: false
|
|
35
25
|
```
|
|
36
26
|
|
|
37
27
|
### 变体 2:reviewer 建议性审查
|
|
@@ -43,33 +33,14 @@
|
|
|
43
33
|
|
|
44
34
|
```md
|
|
45
35
|
## Visual Assist
|
|
46
|
-
- Preferred adapters:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- Design-supervisor
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
- Design-supervisor review inputs:
|
|
55
|
-
- screenshots
|
|
56
|
-
- pencil variables
|
|
57
|
-
- visual thesis
|
|
58
|
-
- content plan
|
|
59
|
-
- interaction thesis
|
|
60
|
-
- Scope:
|
|
61
|
-
- visual contract refinement
|
|
62
|
-
- page composition
|
|
63
|
-
- hierarchy and spacing
|
|
64
|
-
- responsive motion guidance
|
|
65
|
-
- anchor-surface composition
|
|
66
|
-
- Pencil design refinement
|
|
67
|
-
- Fallback:
|
|
68
|
-
- native-da-vinci
|
|
69
|
-
- Require Adapter:
|
|
70
|
-
- false
|
|
71
|
-
- Require Supervisor Review:
|
|
72
|
-
- false
|
|
36
|
+
- Preferred adapters: ui-ux-pro-max, frontend-skill
|
|
37
|
+
- Design-supervisor reviewers: frontend-skill, ui-ux-pro-max
|
|
38
|
+
- Design-supervisor review mode: screenshot-and-theme
|
|
39
|
+
- Design-supervisor review inputs: screenshots, pencil variables, visual thesis, content plan, interaction thesis
|
|
40
|
+
- Scope: visual contract refinement, page composition, hierarchy and spacing, responsive motion guidance, anchor-surface composition, Pencil design refinement
|
|
41
|
+
- Fallback: native-da-vinci
|
|
42
|
+
- Require Adapter: false
|
|
43
|
+
- Require Supervisor Review: false
|
|
73
44
|
```
|
|
74
45
|
|
|
75
46
|
### 变体 3:reviewer 硬签字
|
|
@@ -82,33 +53,14 @@
|
|
|
82
53
|
|
|
83
54
|
```md
|
|
84
55
|
## Visual Assist
|
|
85
|
-
- Preferred adapters:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
- Design-supervisor
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
- Design-supervisor review inputs:
|
|
94
|
-
- screenshots
|
|
95
|
-
- pencil variables
|
|
96
|
-
- visual thesis
|
|
97
|
-
- content plan
|
|
98
|
-
- interaction thesis
|
|
99
|
-
- Scope:
|
|
100
|
-
- visual contract refinement
|
|
101
|
-
- page composition
|
|
102
|
-
- hierarchy and spacing
|
|
103
|
-
- responsive motion guidance
|
|
104
|
-
- anchor-surface composition
|
|
105
|
-
- Pencil design refinement
|
|
106
|
-
- Fallback:
|
|
107
|
-
- native-da-vinci
|
|
108
|
-
- Require Adapter:
|
|
109
|
-
- true
|
|
110
|
-
- Require Supervisor Review:
|
|
111
|
-
- true
|
|
56
|
+
- Preferred adapters: frontend-skill, ui-ux-pro-max
|
|
57
|
+
- Design-supervisor reviewers: frontend-skill, ui-ux-pro-max
|
|
58
|
+
- Design-supervisor review mode: screenshot-and-theme
|
|
59
|
+
- Design-supervisor review inputs: screenshots, pencil variables, visual thesis, content plan, interaction thesis
|
|
60
|
+
- Scope: visual contract refinement, page composition, hierarchy and spacing, responsive motion guidance, anchor-surface composition, Pencil design refinement
|
|
61
|
+
- Fallback: native-da-vinci
|
|
62
|
+
- Require Adapter: true
|
|
63
|
+
- Require Supervisor Review: true
|
|
112
64
|
```
|
|
113
65
|
|
|
114
66
|
通用说明:
|
|
@@ -35,19 +35,10 @@
|
|
|
35
35
|
- CTA regions should preserve the same dark product language
|
|
36
36
|
|
|
37
37
|
## Visual Assist
|
|
38
|
-
- Preferred adapters:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
- visual contract refinement
|
|
43
|
-
- page composition
|
|
44
|
-
- hierarchy and spacing
|
|
45
|
-
- anchor-surface composition
|
|
46
|
-
- Pencil design refinement
|
|
47
|
-
- Fallback:
|
|
48
|
-
- native-da-vinci
|
|
49
|
-
- Require Adapter:
|
|
50
|
-
- false
|
|
38
|
+
- Preferred adapters: frontend-skill, ui-ux-pro-max
|
|
39
|
+
- Scope: visual contract refinement, page composition, hierarchy and spacing, anchor-surface composition, Pencil design refinement
|
|
40
|
+
- Fallback: native-da-vinci
|
|
41
|
+
- Require Adapter: false
|
|
51
42
|
|
|
52
43
|
## Do
|
|
53
44
|
- keep page sections clearly bounded
|
package/lib/cli.js
CHANGED
|
@@ -100,7 +100,7 @@ function printHelp() {
|
|
|
100
100
|
" da-vinci pencil-lock status",
|
|
101
101
|
" da-vinci pencil-session begin --project <path> --pen <path>",
|
|
102
102
|
" da-vinci pencil-session persist --project <path> --pen <path> --nodes-file <path> [--variables-file <path>]",
|
|
103
|
-
" da-vinci pencil-session end --project <path> --pen <path>
|
|
103
|
+
" da-vinci pencil-session end --project <path> --pen <path> --nodes-file <path> [--variables-file <path>]",
|
|
104
104
|
" da-vinci pencil-session status --project <path>",
|
|
105
105
|
" da-vinci --version",
|
|
106
106
|
"",
|
|
@@ -456,6 +456,11 @@ async function runCli(argv) {
|
|
|
456
456
|
if (!penPath) {
|
|
457
457
|
throw new Error("`pencil-session end` requires `--pen <path>`.");
|
|
458
458
|
}
|
|
459
|
+
if (!nodesFile && !force) {
|
|
460
|
+
throw new Error(
|
|
461
|
+
"`pencil-session end` requires `--nodes-file <path>` (and `--variables-file <path>` when available). Use `--force` only for emergency lock release."
|
|
462
|
+
);
|
|
463
|
+
}
|
|
459
464
|
|
|
460
465
|
const result = endPencilSession({
|
|
461
466
|
projectPath,
|
package/lib/pencil-session.js
CHANGED
|
@@ -168,6 +168,12 @@ function endPencilSession(options) {
|
|
|
168
168
|
throw new Error("A registered `.pen` path is required for session shutdown.");
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
if (!options.nodesFile && !options.force) {
|
|
172
|
+
throw new Error(
|
|
173
|
+
"Cannot end Pencil session without a live MCP snapshot. Provide `--nodes-file` (and `--variables-file` when available), or use `--force` for emergency shutdown."
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
171
177
|
let syncResult = null;
|
|
172
178
|
if (options.nodesFile) {
|
|
173
179
|
syncResult = comparePenSync({
|
package/package.json
CHANGED
|
@@ -286,4 +286,54 @@ runTest("design-supervisor review stays distinct from preferred adapters and is
|
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
288
|
|
|
289
|
+
runTest("build prompts require completion audit and do not treat compile success as workflow completion", () => {
|
|
290
|
+
const buildPrompts = [
|
|
291
|
+
"commands/claude/dv/build.md",
|
|
292
|
+
"commands/codex/prompts/dv-build.md",
|
|
293
|
+
"commands/gemini/dv/build.toml"
|
|
294
|
+
];
|
|
295
|
+
|
|
296
|
+
for (const file of buildPrompts) {
|
|
297
|
+
const content = read(file);
|
|
298
|
+
assert.match(content, /BUILD SUCCESSFUL/, `${file} should explicitly treat build success as compile-only evidence`);
|
|
299
|
+
assert.match(
|
|
300
|
+
content,
|
|
301
|
+
/da-vinci audit --mode completion --change <change-id> <project-path>/,
|
|
302
|
+
`${file} should require completion audit before terminal completion claims`
|
|
303
|
+
);
|
|
304
|
+
assert.match(
|
|
305
|
+
content,
|
|
306
|
+
/do not report `design complete` or `workflow complete`/i,
|
|
307
|
+
`${file} should prevent terminal completion claims while in-scope tasks remain`
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
runTest("continue prompts keep build routing blocked while design gates are unresolved", () => {
|
|
313
|
+
const continuePrompts = [
|
|
314
|
+
"commands/claude/dv/continue.md",
|
|
315
|
+
"commands/codex/prompts/dv-continue.md",
|
|
316
|
+
"commands/gemini/dv/continue.toml"
|
|
317
|
+
];
|
|
318
|
+
|
|
319
|
+
for (const file of continuePrompts) {
|
|
320
|
+
const content = read(file);
|
|
321
|
+
assert.match(
|
|
322
|
+
content,
|
|
323
|
+
/missing shell-visible project-local `.pen`/,
|
|
324
|
+
`${file} should block build routing when project-local .pen persistence is unresolved`
|
|
325
|
+
);
|
|
326
|
+
assert.match(
|
|
327
|
+
content,
|
|
328
|
+
/active\/unclosed Pencil session/,
|
|
329
|
+
`${file} should block build routing when Pencil session is still active`
|
|
330
|
+
);
|
|
331
|
+
assert.match(
|
|
332
|
+
content,
|
|
333
|
+
/design-supervisor review still BLOCK\/unaccepted/,
|
|
334
|
+
`${file} should block build routing when required design-supervisor review has not cleared`
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
|
|
289
339
|
console.log("All mode consistency tests passed.");
|
|
@@ -149,4 +149,44 @@ runTest("pencil-session end fails when live payload is stale", () => {
|
|
|
149
149
|
});
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
+
runTest("pencil-session end requires live payload unless force is used", () => {
|
|
153
|
+
const fixture = JSON.parse(fs.readFileSync(fixturePath, "utf8"));
|
|
154
|
+
const tempDir = createTempDir();
|
|
155
|
+
const projectRoot = path.join(tempDir, "project");
|
|
156
|
+
const homeDir = path.join(tempDir, "home");
|
|
157
|
+
const penPath = path.join(projectRoot, ".da-vinci", "designs", "cipher.pen");
|
|
158
|
+
const { nodesFile, variablesFile } = writePayloadFiles(tempDir, fixture);
|
|
159
|
+
|
|
160
|
+
beginPencilSession({
|
|
161
|
+
projectPath: projectRoot,
|
|
162
|
+
penPath,
|
|
163
|
+
homeDir
|
|
164
|
+
});
|
|
165
|
+
persistPencilSession({
|
|
166
|
+
projectPath: projectRoot,
|
|
167
|
+
penPath,
|
|
168
|
+
nodesFile,
|
|
169
|
+
variablesFile,
|
|
170
|
+
version: fixture.version,
|
|
171
|
+
homeDir
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
assert.throws(
|
|
175
|
+
() =>
|
|
176
|
+
endPencilSession({
|
|
177
|
+
projectPath: projectRoot,
|
|
178
|
+
penPath,
|
|
179
|
+
homeDir
|
|
180
|
+
}),
|
|
181
|
+
/without a live MCP snapshot/i
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
endPencilSession({
|
|
185
|
+
projectPath: projectRoot,
|
|
186
|
+
penPath,
|
|
187
|
+
homeDir,
|
|
188
|
+
force: true
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
|
|
152
192
|
console.log("All Pencil session tests passed.");
|
|
@@ -241,9 +241,39 @@ runTest("parallel mixed projects are serialized by the global Pencil lock", () =
|
|
|
241
241
|
runCli(harness, ["pencil-session", "begin", "--project", existing.root, "--pen", existing.penPath]),
|
|
242
242
|
/lock is already held/i
|
|
243
243
|
);
|
|
244
|
+
expectOk(
|
|
245
|
+
"parallel A persist",
|
|
246
|
+
runCli(harness, [
|
|
247
|
+
"pencil-session",
|
|
248
|
+
"persist",
|
|
249
|
+
"--project",
|
|
250
|
+
freshA.root,
|
|
251
|
+
"--pen",
|
|
252
|
+
freshA.penPath,
|
|
253
|
+
"--nodes-file",
|
|
254
|
+
freshA.nodesFile,
|
|
255
|
+
"--variables-file",
|
|
256
|
+
freshA.variablesFile,
|
|
257
|
+
"--version",
|
|
258
|
+
fixture.version
|
|
259
|
+
])
|
|
260
|
+
);
|
|
244
261
|
expectOk(
|
|
245
262
|
"parallel A end",
|
|
246
|
-
runCli(harness, [
|
|
263
|
+
runCli(harness, [
|
|
264
|
+
"pencil-session",
|
|
265
|
+
"end",
|
|
266
|
+
"--project",
|
|
267
|
+
freshA.root,
|
|
268
|
+
"--pen",
|
|
269
|
+
freshA.penPath,
|
|
270
|
+
"--nodes-file",
|
|
271
|
+
freshA.nodesFile,
|
|
272
|
+
"--variables-file",
|
|
273
|
+
freshA.variablesFile,
|
|
274
|
+
"--version",
|
|
275
|
+
fixture.version
|
|
276
|
+
])
|
|
247
277
|
);
|
|
248
278
|
|
|
249
279
|
expectOk(
|