@xenonbyte/da-vinci-workflow 0.1.13 → 0.1.15
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 +21 -1
- package/README.md +23 -1
- package/README.zh-CN.md +23 -1
- package/SKILL.md +15 -0
- package/commands/claude/dv/design.md +2 -0
- package/commands/claude/dv/verify.md +2 -0
- package/commands/codex/prompts/dv-design.md +2 -0
- package/commands/codex/prompts/dv-verify.md +1 -0
- package/commands/gemini/dv/design.toml +2 -0
- package/commands/gemini/dv/verify.toml +1 -0
- package/docs/mcp-aware-gate-implementation.md +291 -0
- package/docs/mcp-aware-gate-tests.md +244 -0
- package/docs/mcp-aware-gate.md +246 -0
- package/docs/mode-use-cases.md +2 -0
- package/docs/prompt-presets/README.md +1 -0
- package/docs/prompt-presets/desktop-app.md +4 -0
- package/docs/prompt-presets/mobile-app.md +4 -0
- package/docs/prompt-presets/tablet-app.md +4 -0
- package/docs/prompt-presets/web-app.md +4 -0
- package/docs/visual-adapters.md +9 -0
- package/docs/visual-assist-presets/README.md +4 -2
- package/docs/visual-assist-presets/desktop-app.md +2 -0
- package/docs/visual-assist-presets/mobile-app.md +2 -0
- package/docs/visual-assist-presets/tablet-app.md +2 -0
- package/docs/visual-assist-presets/web-app.md +2 -0
- package/docs/workflow-examples.md +9 -4
- package/docs/zh-CN/mcp-aware-gate-implementation.md +290 -0
- package/docs/zh-CN/mcp-aware-gate-tests.md +244 -0
- package/docs/zh-CN/mcp-aware-gate.md +249 -0
- package/docs/zh-CN/mode-use-cases.md +3 -0
- package/docs/zh-CN/prompt-presets/README.md +1 -0
- package/docs/zh-CN/prompt-presets/desktop-app.md +4 -0
- package/docs/zh-CN/prompt-presets/mobile-app.md +4 -0
- package/docs/zh-CN/prompt-presets/tablet-app.md +4 -0
- package/docs/zh-CN/prompt-presets/web-app.md +4 -0
- package/docs/zh-CN/visual-adapters.md +9 -0
- package/docs/zh-CN/visual-assist-presets/README.md +5 -3
- package/docs/zh-CN/visual-assist-presets/desktop-app.md +2 -0
- package/docs/zh-CN/visual-assist-presets/mobile-app.md +2 -0
- package/docs/zh-CN/visual-assist-presets/tablet-app.md +2 -0
- package/docs/zh-CN/visual-assist-presets/web-app.md +2 -0
- package/docs/zh-CN/workflow-examples.md +9 -4
- package/examples/greenfield-spec-markupflow/DA-VINCI.md +1 -0
- package/examples/greenfield-spec-markupflow/README.md +3 -0
- package/examples/greenfield-spec-markupflow/design-registry.md +3 -0
- package/examples/greenfield-spec-markupflow/pencil-design.md +4 -0
- package/lib/audit.js +348 -0
- package/lib/cli.js +47 -1
- package/lib/mcp-runtime-gate.js +342 -0
- package/package.json +3 -2
- package/references/artifact-templates.md +35 -3
- package/references/checkpoints.md +69 -1
- package/references/design-inputs.md +9 -1
- package/references/layout-hygiene.md +117 -0
- package/references/pencil-design-to-code.md +8 -0
- package/scripts/test-mcp-runtime-gate.js +199 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# MCP-Aware Gate Test Design
|
|
2
|
+
|
|
3
|
+
This document defines how to test the future MCP-aware gate implementation.
|
|
4
|
+
|
|
5
|
+
It is a design for validation coverage, not a test implementation.
|
|
6
|
+
|
|
7
|
+
## Test Goal
|
|
8
|
+
|
|
9
|
+
Prove that the MCP-aware gate:
|
|
10
|
+
|
|
11
|
+
- blocks false runtime completion states
|
|
12
|
+
- does not replace filesystem audit
|
|
13
|
+
- does not misclassify healthy runtime design sessions
|
|
14
|
+
- behaves predictably when MCP runtime facts are incomplete
|
|
15
|
+
|
|
16
|
+
## Test Layers
|
|
17
|
+
|
|
18
|
+
The test plan should cover three layers.
|
|
19
|
+
|
|
20
|
+
### 1. Evaluator unit tests
|
|
21
|
+
|
|
22
|
+
Test the pure runtime-gate evaluator against synthetic snapshot inputs.
|
|
23
|
+
|
|
24
|
+
Why:
|
|
25
|
+
|
|
26
|
+
- fastest feedback
|
|
27
|
+
- deterministic
|
|
28
|
+
- does not depend on a live Pencil session
|
|
29
|
+
|
|
30
|
+
### 2. Runtime integration tests
|
|
31
|
+
|
|
32
|
+
Test the runtime-gate caller against real or fixture-backed MCP responses.
|
|
33
|
+
|
|
34
|
+
Why:
|
|
35
|
+
|
|
36
|
+
- proves that active editor and node reads are interpreted correctly
|
|
37
|
+
|
|
38
|
+
### 3. End-to-end workflow tests
|
|
39
|
+
|
|
40
|
+
Test that runtime gate and filesystem audit cooperate correctly in realistic workflow states.
|
|
41
|
+
|
|
42
|
+
Why:
|
|
43
|
+
|
|
44
|
+
- prevents regressions where runtime gate passes but completion still lies
|
|
45
|
+
|
|
46
|
+
## Core Test Categories
|
|
47
|
+
|
|
48
|
+
### A. Healthy runtime source convergence
|
|
49
|
+
|
|
50
|
+
Expected:
|
|
51
|
+
|
|
52
|
+
- active editor is a named project-local `.pen`
|
|
53
|
+
- registered `.pen` path matches
|
|
54
|
+
- shell-visible `.pen` exists
|
|
55
|
+
- result is `PASS`
|
|
56
|
+
|
|
57
|
+
### B. Live editor still `new`
|
|
58
|
+
|
|
59
|
+
Expected:
|
|
60
|
+
|
|
61
|
+
- source convergence is `BLOCK`
|
|
62
|
+
- completion is blocked even if screens exist in the live editor
|
|
63
|
+
|
|
64
|
+
### C. Registered `.pen` path missing on disk
|
|
65
|
+
|
|
66
|
+
Expected:
|
|
67
|
+
|
|
68
|
+
- source convergence or completion status becomes `BLOCK`
|
|
69
|
+
- runtime gate does not treat the live editor alone as sufficient
|
|
70
|
+
|
|
71
|
+
### D. Live screens exist but are not persisted
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
|
|
75
|
+
- active editor contains `Splash`, `Home`, `SafeBox`
|
|
76
|
+
- shell-visible `.pen` does not exist
|
|
77
|
+
|
|
78
|
+
Expected:
|
|
79
|
+
|
|
80
|
+
- runtime gate can prove screens exist
|
|
81
|
+
- source convergence is still `BLOCK`
|
|
82
|
+
|
|
83
|
+
### E. Claimed anchor id missing
|
|
84
|
+
|
|
85
|
+
Example:
|
|
86
|
+
|
|
87
|
+
- `pencil-design.md` claims `mCZ1G`
|
|
88
|
+
- current live editor does not contain `mCZ1G`
|
|
89
|
+
|
|
90
|
+
Expected:
|
|
91
|
+
|
|
92
|
+
- screen presence is `BLOCK`
|
|
93
|
+
|
|
94
|
+
### F. Screenshot target missing
|
|
95
|
+
|
|
96
|
+
Expected:
|
|
97
|
+
|
|
98
|
+
- review execution is `BLOCK`
|
|
99
|
+
|
|
100
|
+
### G. Review blockers ignored
|
|
101
|
+
|
|
102
|
+
Example:
|
|
103
|
+
|
|
104
|
+
- screenshot review records blocker-level layout-hygiene issues
|
|
105
|
+
- workflow still marks anchor as approved
|
|
106
|
+
|
|
107
|
+
Expected:
|
|
108
|
+
|
|
109
|
+
- review execution is `BLOCK`
|
|
110
|
+
|
|
111
|
+
### H. Source mismatch with explicit reconciliation
|
|
112
|
+
|
|
113
|
+
Example:
|
|
114
|
+
|
|
115
|
+
- active editor path and registered path differ
|
|
116
|
+
- `pencil-design.md` records a documented reconciliation
|
|
117
|
+
|
|
118
|
+
Expected:
|
|
119
|
+
|
|
120
|
+
- evaluator returns `WARN` or `PASS` only if the reconciliation rules are satisfied
|
|
121
|
+
|
|
122
|
+
### I. No new Pencil edits yet
|
|
123
|
+
|
|
124
|
+
Expected:
|
|
125
|
+
|
|
126
|
+
- runtime gate may return `WARN` or partial result
|
|
127
|
+
- must not fabricate full `PASS`
|
|
128
|
+
|
|
129
|
+
### J. Pencil MCP unavailable
|
|
130
|
+
|
|
131
|
+
Expected:
|
|
132
|
+
|
|
133
|
+
- runtime gate reports unavailable or skipped state
|
|
134
|
+
- workflow does not treat runtime gate as passed
|
|
135
|
+
- filesystem audit remains usable
|
|
136
|
+
|
|
137
|
+
## Required End-to-End Scenarios
|
|
138
|
+
|
|
139
|
+
### Scenario 1: Real failure pattern from Cipher
|
|
140
|
+
|
|
141
|
+
State:
|
|
142
|
+
|
|
143
|
+
- active editor is `new`
|
|
144
|
+
- live screens exist
|
|
145
|
+
- `.da-vinci/designs/` is polluted
|
|
146
|
+
- no shell-visible `.pen`
|
|
147
|
+
|
|
148
|
+
Expected:
|
|
149
|
+
|
|
150
|
+
- runtime gate blocks completion
|
|
151
|
+
- filesystem completion audit also fails
|
|
152
|
+
|
|
153
|
+
### Scenario 2: Healthy redesign completion
|
|
154
|
+
|
|
155
|
+
State:
|
|
156
|
+
|
|
157
|
+
- active editor is the registered `.pen`
|
|
158
|
+
- anchor ids exist
|
|
159
|
+
- screenshot review exists
|
|
160
|
+
- shell-visible `.pen` exists
|
|
161
|
+
- completion audit passes
|
|
162
|
+
|
|
163
|
+
Expected:
|
|
164
|
+
|
|
165
|
+
- runtime gate passes
|
|
166
|
+
- completion audit passes
|
|
167
|
+
- terminal completion is allowed
|
|
168
|
+
|
|
169
|
+
### Scenario 3: Runtime pass, filesystem fail
|
|
170
|
+
|
|
171
|
+
State:
|
|
172
|
+
|
|
173
|
+
- active editor is healthy
|
|
174
|
+
- shell-visible `.pen` exists
|
|
175
|
+
- but `.da-vinci/designs/` contains extra PNG or markdown files
|
|
176
|
+
|
|
177
|
+
Expected:
|
|
178
|
+
|
|
179
|
+
- runtime gate may pass
|
|
180
|
+
- filesystem completion audit fails
|
|
181
|
+
- terminal completion is blocked
|
|
182
|
+
|
|
183
|
+
### Scenario 4: Filesystem pass, runtime fail
|
|
184
|
+
|
|
185
|
+
State:
|
|
186
|
+
|
|
187
|
+
- shell-visible `.pen` exists
|
|
188
|
+
- files look healthy
|
|
189
|
+
- active editor is still `new` or points elsewhere
|
|
190
|
+
|
|
191
|
+
Expected:
|
|
192
|
+
|
|
193
|
+
- runtime gate fails
|
|
194
|
+
- completion is blocked
|
|
195
|
+
|
|
196
|
+
## Assertions That Must Exist
|
|
197
|
+
|
|
198
|
+
For every runtime-gate result, tests should assert:
|
|
199
|
+
|
|
200
|
+
- final status
|
|
201
|
+
- per-layer status
|
|
202
|
+
- which blocking condition fired
|
|
203
|
+
- whether completion would be allowed
|
|
204
|
+
- whether artifact recording shape stays stable
|
|
205
|
+
|
|
206
|
+
## Artifact Recording Tests
|
|
207
|
+
|
|
208
|
+
Verify that runtime gate output:
|
|
209
|
+
|
|
210
|
+
- appends to `pencil-design.md`
|
|
211
|
+
- does not create a new artifact family
|
|
212
|
+
- does not write into `.da-vinci/designs/`
|
|
213
|
+
- does not overwrite unrelated sections
|
|
214
|
+
|
|
215
|
+
## Regression Cases
|
|
216
|
+
|
|
217
|
+
These regressions should be covered:
|
|
218
|
+
|
|
219
|
+
1. runtime gate accidentally behaves like a CLI-only audit
|
|
220
|
+
2. runtime gate silently treats `new` as acceptable
|
|
221
|
+
3. runtime gate treats PNG exports as source evidence
|
|
222
|
+
4. runtime gate passes when anchor ids are missing
|
|
223
|
+
5. runtime gate is skipped but reported as passed
|
|
224
|
+
6. runtime gate writes ad hoc markdown files outside the allowed artifact path
|
|
225
|
+
|
|
226
|
+
## Recommended Test Matrix
|
|
227
|
+
|
|
228
|
+
Minimum matrix:
|
|
229
|
+
|
|
230
|
+
- form factor: mobile first
|
|
231
|
+
- design stage: first Pencil write / approved anchor / terminal completion
|
|
232
|
+
- source state: healthy / `new` / diverged / missing `.pen`
|
|
233
|
+
- screen state: present / missing / stale ids
|
|
234
|
+
- review state: reviewed / missing / blocker ignored
|
|
235
|
+
|
|
236
|
+
## Exit Criteria
|
|
237
|
+
|
|
238
|
+
The implementation should not be considered ready unless all of the following are true:
|
|
239
|
+
|
|
240
|
+
1. evaluator unit tests cover all blocker branches
|
|
241
|
+
2. at least one runtime integration test proves live editor detection works
|
|
242
|
+
3. the Cipher-like failure scenario is blocked
|
|
243
|
+
4. a healthy redesign scenario passes
|
|
244
|
+
5. runtime gate plus filesystem audit together prevent false terminal completion
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# MCP-Aware Gate Proposal
|
|
2
|
+
|
|
3
|
+
This document defines a proposed MCP-aware runtime gate for Da Vinci.
|
|
4
|
+
|
|
5
|
+
It is intentionally a design document, not an implementation commitment.
|
|
6
|
+
|
|
7
|
+
## Status
|
|
8
|
+
|
|
9
|
+
- Design status: proposed
|
|
10
|
+
- Validation status: partially validated from real runtime observations
|
|
11
|
+
- Implementation status: not started
|
|
12
|
+
|
|
13
|
+
## Why This Exists
|
|
14
|
+
|
|
15
|
+
The current filesystem audit closes one important gap:
|
|
16
|
+
|
|
17
|
+
- it can prove whether the project-local `.pen` file exists on disk
|
|
18
|
+
- it can prove whether `.da-vinci/designs/` is polluted
|
|
19
|
+
- it can prove whether exported screenshots were misplaced
|
|
20
|
+
|
|
21
|
+
But it cannot prove live MCP state such as:
|
|
22
|
+
|
|
23
|
+
- whether the active Pencil editor is still `new`
|
|
24
|
+
- whether the claimed anchor surfaces actually exist in the active editor
|
|
25
|
+
- whether the active editor and the registered project-local `.pen` source have converged
|
|
26
|
+
|
|
27
|
+
Those facts only exist at runtime inside the MCP-backed design session.
|
|
28
|
+
|
|
29
|
+
## Validated Feasibility
|
|
30
|
+
|
|
31
|
+
The following facts have already been validated as observable:
|
|
32
|
+
|
|
33
|
+
1. The active Pencil editor can be read through MCP.
|
|
34
|
+
2. The top-level live nodes can be read through MCP.
|
|
35
|
+
3. Specific screen node ids can be read through MCP.
|
|
36
|
+
4. The shell-visible project state can be read separately through normal filesystem access.
|
|
37
|
+
|
|
38
|
+
This means Da Vinci can already compare:
|
|
39
|
+
|
|
40
|
+
- live editor truth
|
|
41
|
+
- live screen truth
|
|
42
|
+
- filesystem truth
|
|
43
|
+
|
|
44
|
+
That comparison is enough to support a first MCP-aware runtime gate.
|
|
45
|
+
|
|
46
|
+
## Non-Goals
|
|
47
|
+
|
|
48
|
+
This proposal does not attempt to:
|
|
49
|
+
|
|
50
|
+
- replace the filesystem `da-vinci audit`
|
|
51
|
+
- expose MCP state directly through the CLI
|
|
52
|
+
- auto-repair live editor state into a persisted `.pen` file
|
|
53
|
+
- make implementation depend on undocumented Pencil session behavior
|
|
54
|
+
|
|
55
|
+
## Design Principles
|
|
56
|
+
|
|
57
|
+
1. MCP-aware gate is runtime-only.
|
|
58
|
+
2. Filesystem audit remains the terminal persistence gate.
|
|
59
|
+
3. Runtime gate blocks false progress; it does not auto-heal state.
|
|
60
|
+
4. The design should only rely on facts already observed to be readable.
|
|
61
|
+
5. The design should degrade cleanly when Pencil MCP is unavailable.
|
|
62
|
+
|
|
63
|
+
## Placement In The Workflow
|
|
64
|
+
|
|
65
|
+
The MCP-aware gate should sit in two places:
|
|
66
|
+
|
|
67
|
+
1. After the first successful Pencil write on a redesign pass.
|
|
68
|
+
2. Before any terminal `design complete` or `workflow complete` claim.
|
|
69
|
+
|
|
70
|
+
It should not run on every trivial design operation.
|
|
71
|
+
|
|
72
|
+
## Proposed Gate Layers
|
|
73
|
+
|
|
74
|
+
### 1. Source Convergence Gate
|
|
75
|
+
|
|
76
|
+
Purpose:
|
|
77
|
+
|
|
78
|
+
- determine whether the live editor, registered `.pen` path, and shell-visible `.pen` file agree well enough to treat the design source as traceable
|
|
79
|
+
|
|
80
|
+
Inputs:
|
|
81
|
+
|
|
82
|
+
- active Pencil editor state from MCP
|
|
83
|
+
- registered `.pen` path from `design-registry.md`
|
|
84
|
+
- shell-visible `.pen` path under `.da-vinci/designs/`
|
|
85
|
+
|
|
86
|
+
Blocking conditions:
|
|
87
|
+
|
|
88
|
+
- active editor is still an unnamed live editor such as `new`
|
|
89
|
+
- active editor does not match the registered project-local source and the mismatch is not explicitly reconciled
|
|
90
|
+
- shell-visible `.pen` file does not exist after live Pencil work has already happened
|
|
91
|
+
- runtime session appears to be using a different source than the registered project-local source
|
|
92
|
+
|
|
93
|
+
Result:
|
|
94
|
+
|
|
95
|
+
- `PASS`: source is converged
|
|
96
|
+
- `WARN`: source is intentionally deferred but still traceable
|
|
97
|
+
- `BLOCK`: source of truth is not stable enough to continue
|
|
98
|
+
|
|
99
|
+
### 2. Screen Presence Gate
|
|
100
|
+
|
|
101
|
+
Purpose:
|
|
102
|
+
|
|
103
|
+
- verify that claimed anchor surfaces actually exist in the active live editor
|
|
104
|
+
|
|
105
|
+
Inputs:
|
|
106
|
+
|
|
107
|
+
- node ids or screen ids recorded in `pencil-design.md`
|
|
108
|
+
- current top-level or targeted node reads from MCP
|
|
109
|
+
|
|
110
|
+
Blocking conditions:
|
|
111
|
+
|
|
112
|
+
- claimed anchor screen cannot be found in the active editor
|
|
113
|
+
- screenshot node id does not resolve in the current live document
|
|
114
|
+
- the design claims more approved anchor surfaces than the current editor can account for
|
|
115
|
+
|
|
116
|
+
Result:
|
|
117
|
+
|
|
118
|
+
- `PASS`: claimed screens exist
|
|
119
|
+
- `WARN`: some naming drift exists but mapping is still recoverable
|
|
120
|
+
- `BLOCK`: claimed design output cannot be traced to the live document
|
|
121
|
+
|
|
122
|
+
### 3. Review Execution Gate
|
|
123
|
+
|
|
124
|
+
Purpose:
|
|
125
|
+
|
|
126
|
+
- verify that screenshot review was performed on the live surfaces that are being treated as approved
|
|
127
|
+
|
|
128
|
+
Inputs:
|
|
129
|
+
|
|
130
|
+
- reviewed screen ids from `pencil-design.md`
|
|
131
|
+
- screenshot targets used in the current design session
|
|
132
|
+
- resolved form-factor layout hygiene profile
|
|
133
|
+
|
|
134
|
+
Blocking conditions:
|
|
135
|
+
|
|
136
|
+
- a surface is treated as approved without any live screenshot review
|
|
137
|
+
- screenshot review flagged blocker-level layout hygiene issues but the workflow still marked the surface as passed
|
|
138
|
+
- review artifacts refer to screens that are not present in the active editor
|
|
139
|
+
|
|
140
|
+
Result:
|
|
141
|
+
|
|
142
|
+
- `PASS`: reviewed surfaces match live runtime state
|
|
143
|
+
- `WARN`: review exists but needs follow-up before expansion
|
|
144
|
+
- `BLOCK`: approval claim is not trustworthy
|
|
145
|
+
|
|
146
|
+
## Runtime Output Shape
|
|
147
|
+
|
|
148
|
+
The gate should not invent a new artifact family.
|
|
149
|
+
|
|
150
|
+
Instead, it should append a short runtime section to `pencil-design.md` or another already valid change artifact:
|
|
151
|
+
|
|
152
|
+
```md
|
|
153
|
+
## MCP Runtime Gate
|
|
154
|
+
- Time:
|
|
155
|
+
- Active editor:
|
|
156
|
+
- Registered `.pen` path:
|
|
157
|
+
- Shell-visible `.pen` path:
|
|
158
|
+
- Reviewed screen ids:
|
|
159
|
+
- Source convergence: PASS | WARN | BLOCK
|
|
160
|
+
- Screen presence: PASS | WARN | BLOCK
|
|
161
|
+
- Review execution: PASS | WARN | BLOCK
|
|
162
|
+
- Notes:
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
This keeps runtime evidence attached to the design pass instead of scattering it into ad hoc files.
|
|
166
|
+
|
|
167
|
+
## Relationship To Filesystem Audit
|
|
168
|
+
|
|
169
|
+
The two systems have different jobs.
|
|
170
|
+
|
|
171
|
+
### MCP-aware runtime gate
|
|
172
|
+
|
|
173
|
+
- checks live editor truth
|
|
174
|
+
- checks live screen truth
|
|
175
|
+
- checks runtime/source convergence before false progress spreads
|
|
176
|
+
|
|
177
|
+
### Filesystem audit
|
|
178
|
+
|
|
179
|
+
- checks persisted project truth
|
|
180
|
+
- checks directory hygiene
|
|
181
|
+
- checks completion integrity
|
|
182
|
+
|
|
183
|
+
Expected terminal rule:
|
|
184
|
+
|
|
185
|
+
- do not report completion unless MCP-aware runtime gate passes and filesystem completion audit passes
|
|
186
|
+
|
|
187
|
+
## Why This Should Not Be A CLI Feature First
|
|
188
|
+
|
|
189
|
+
The current CLI can only read filesystem state.
|
|
190
|
+
|
|
191
|
+
It has no MCP transport, no session identity, and no direct access to the live Pencil editor.
|
|
192
|
+
|
|
193
|
+
That makes a CLI-only MCP-aware gate structurally unreliable.
|
|
194
|
+
|
|
195
|
+
For now, the MCP-aware gate should be treated as an agent-executed runtime checkpoint, not a standalone CLI audit mode.
|
|
196
|
+
|
|
197
|
+
## Failure Modes To Avoid
|
|
198
|
+
|
|
199
|
+
1. Treating `new` as if it were a persisted `.pen` path.
|
|
200
|
+
2. Treating exported PNG files as design-source evidence.
|
|
201
|
+
3. Treating node ids from an old live document as if they still describe the current active editor.
|
|
202
|
+
4. Silently reconciling runtime/source mismatches without recording that reconciliation.
|
|
203
|
+
5. Auto-writing a `.pen` file from live state without an explicit workflow rule.
|
|
204
|
+
|
|
205
|
+
## Minimum Viable Implementation Scope
|
|
206
|
+
|
|
207
|
+
The first implementation should stay narrow.
|
|
208
|
+
|
|
209
|
+
It should only:
|
|
210
|
+
|
|
211
|
+
1. read active editor state
|
|
212
|
+
2. read claimed anchor screen ids
|
|
213
|
+
3. compare those facts against `design-registry.md` and the shell-visible `.pen` file
|
|
214
|
+
4. record structured PASS/WARN/BLOCK output
|
|
215
|
+
5. block completion when runtime truth and filesystem truth diverge
|
|
216
|
+
|
|
217
|
+
It should not:
|
|
218
|
+
|
|
219
|
+
- attempt automatic reconstruction
|
|
220
|
+
- mutate design files on its own beyond structured checkpoint recording
|
|
221
|
+
- add a new CLI command for live runtime state
|
|
222
|
+
|
|
223
|
+
## Open Questions
|
|
224
|
+
|
|
225
|
+
These questions remain open and should be answered during implementation design, not before:
|
|
226
|
+
|
|
227
|
+
1. Which existing command route should own the runtime gate call?
|
|
228
|
+
2. Should the runtime evidence live in `pencil-design.md` only, or also in `design-registry.md`?
|
|
229
|
+
3. How should a reconciled editor-path mismatch be recorded without encouraging drift?
|
|
230
|
+
4. Should the gate run once per approved anchor or once per design phase?
|
|
231
|
+
|
|
232
|
+
## Recommendation
|
|
233
|
+
|
|
234
|
+
Proceed only with a narrow agent-executed MCP-aware runtime gate.
|
|
235
|
+
|
|
236
|
+
Do not expand it into:
|
|
237
|
+
|
|
238
|
+
- CLI transport work
|
|
239
|
+
- automatic persistence repair
|
|
240
|
+
- generalized MCP session management
|
|
241
|
+
|
|
242
|
+
The validated path is:
|
|
243
|
+
|
|
244
|
+
1. keep filesystem `audit` as the persistence and completion backstop
|
|
245
|
+
2. add a runtime MCP-aware gate for source convergence and live screen presence
|
|
246
|
+
3. require both layers before terminal completion is allowed
|
package/docs/mode-use-cases.md
CHANGED
|
@@ -139,6 +139,7 @@ Generate DA-VINCI.md, proposal, specs, page map, Pencil-backed launch pages, bin
|
|
|
139
139
|
8. create `pencil-design.md`
|
|
140
140
|
- record the generated Pencil screens
|
|
141
141
|
- ensure the active design is materialized into the registered `.pen` path under `.da-vinci/designs/`
|
|
142
|
+
- keep screenshot exports under `.da-vinci/changes/<change-id>/exports/` rather than `.da-vinci/designs/`
|
|
142
143
|
|
|
143
144
|
9. create `pencil-bindings.md`
|
|
144
145
|
- map implementation pages to Pencil pages
|
|
@@ -156,6 +157,7 @@ Generate DA-VINCI.md, proposal, specs, page map, Pencil-backed launch pages, bin
|
|
|
156
157
|
- `DA-VINCI.md` exists and is stable
|
|
157
158
|
- every core page exists in `page-map.md`
|
|
158
159
|
- every implementation page has a Pencil counterpart or an explicit exception
|
|
160
|
+
- the registered project-local `.pen` file is shell-visible and not just a live editor session
|
|
159
161
|
- `task checkpoint` passes
|
|
160
162
|
|
|
161
163
|
### Best fit
|
|
@@ -25,6 +25,7 @@ Design rule:
|
|
|
25
25
|
|
|
26
26
|
- prompt presets define workflow intent, decomposition rules, and truth-source handling
|
|
27
27
|
- visual-assist presets define UI-design helper preferences
|
|
28
|
+
- form-factor-specific layout hygiene remains a separate hard gate that screenshot review must apply before a screen passes
|
|
28
29
|
- use both together for the strongest result
|
|
29
30
|
|
|
30
31
|
Each scene preset should now include:
|
|
@@ -41,11 +41,15 @@ Existing code is the behavior source of truth, not the layout truth.
|
|
|
41
41
|
Preserve current behavior, flows, integrations, and validation rules unless explicitly required otherwise.
|
|
42
42
|
Inventory primary workspaces, side panels, inspectors, dialogs, settings flows, overlays, and materially different states before broad Pencil work.
|
|
43
43
|
Decompose complex screens into primary surfaces, secondary surfaces, overlays, and implementation surfaces.
|
|
44
|
+
Create the required discovery and design-source artifacts in their standard locations before the first anchor surface.
|
|
44
45
|
Use the Visual Assist preferences declared in DA-VINCI.md.
|
|
45
46
|
Treat the resolved primary visual adapter as the first-pass design lead.
|
|
46
47
|
Use Pencil guides only as workspace constraints, not as the design direction.
|
|
47
48
|
Do not start with broad multi-screen scaffolding.
|
|
48
49
|
Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
50
|
+
Apply the form-factor-specific layout hygiene rules for desktop before passing screenshot review.
|
|
51
|
+
Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
|
|
52
|
+
Do not report completion if the registered `.pen` source exists only in memory or only as exported PNGs.
|
|
49
53
|
Do not pass design checkpoint if the result is a repeated placeholder scaffold, flat panel soup, or a recolor of the old desktop shell.
|
|
50
54
|
Persist project-local Pencil files under .da-vinci/designs/.
|
|
51
55
|
```
|
|
@@ -41,6 +41,7 @@ Existing code is the behavior source of truth, not the layout truth.
|
|
|
41
41
|
Preserve business logic, navigation, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
|
|
42
42
|
Inventory activities, fragments, tabs, dialogs, bottom sheets, nested flows, overlays, and materially different states before broad Pencil work.
|
|
43
43
|
Decompose complex screens into subpages, overlays, materially different states, and implementation surfaces.
|
|
44
|
+
Create the required discovery and design-source artifacts in their standard locations before the first anchor surface.
|
|
44
45
|
Use the Visual Assist preferences declared in DA-VINCI.md.
|
|
45
46
|
Treat the resolved primary visual adapter as the first-pass design lead.
|
|
46
47
|
State the resolved primary visual adapter explicitly in the log and name any requested adapters that are unavailable.
|
|
@@ -50,9 +51,12 @@ Do not start with broad multi-screen scaffolding.
|
|
|
50
51
|
Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
51
52
|
For each anchor surface, explain how the new composition differs structurally from the current layout.
|
|
52
53
|
Do not treat screenshot analysis as an automatic pass if it reports hierarchy, spacing, clarity, or inconsistency issues.
|
|
54
|
+
Apply the form-factor-specific layout hygiene rules for mobile before passing screenshot review.
|
|
53
55
|
Use only Pencil-supported properties; do not use web-only props like flex or margin.
|
|
54
56
|
Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
|
|
55
57
|
Keep non-`.pen` workflow artifacts out of `.da-vinci/designs/`.
|
|
58
|
+
Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
|
|
59
|
+
Do not report completion if the registered `.pen` source exists only in memory or only as exported PNGs.
|
|
56
60
|
Define shared primitives from the approved anchor surfaces before broad page expansion.
|
|
57
61
|
Do not pass design checkpoint if the result is a skin-swap of the old UI, a generic card grid, repeated placeholder templates, or weak visual anchors.
|
|
58
62
|
Persist project-local Pencil files under .da-vinci/designs/.
|
|
@@ -41,11 +41,15 @@ Existing code is the behavior source of truth, not the layout truth.
|
|
|
41
41
|
Preserve current behavior, permissions, integrations, validations, and state transitions unless explicitly required otherwise.
|
|
42
42
|
Inventory split-pane regions, sidebars, expanded canvases, dialogs, sheets, orientation-driven changes, and materially different states before broad Pencil work.
|
|
43
43
|
Decompose complex pages into multi-region surfaces, overlays, materially different states, and implementation surfaces.
|
|
44
|
+
Create the required discovery and design-source artifacts in their standard locations before the first anchor surface.
|
|
44
45
|
Use the Visual Assist preferences declared in DA-VINCI.md.
|
|
45
46
|
Treat the resolved primary visual adapter as the first-pass design lead.
|
|
46
47
|
Use Pencil guides only as tablet-layout constraints, not as the design direction.
|
|
47
48
|
Do not start with broad multi-screen scaffolding.
|
|
48
49
|
Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
50
|
+
Apply the form-factor-specific layout hygiene rules for tablet before passing screenshot review.
|
|
51
|
+
Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
|
|
52
|
+
Do not report completion if the registered `.pen` source exists only in memory or only as exported PNGs.
|
|
49
53
|
Do not pass design checkpoint if the result collapses into a stretched phone layout, repeated placeholders, or weak multi-region hierarchy.
|
|
50
54
|
Persist project-local Pencil files under .da-vinci/designs/.
|
|
51
55
|
```
|
|
@@ -42,11 +42,15 @@ Preserve current business logic, routes, permissions, integrations, validations,
|
|
|
42
42
|
Inventory responsive product surfaces, marketing surfaces, authenticated areas, settings pages, dialogs, drawers, overlays, and materially different states before broad Pencil work.
|
|
43
43
|
Separate marketing-style surfaces from product-workflow surfaces when they require different visual treatment.
|
|
44
44
|
Decompose complex pages into subpages, overlays, materially different states, and implementation surfaces.
|
|
45
|
+
Create the required discovery and design-source artifacts in their standard locations before the first anchor surface.
|
|
45
46
|
Use the Visual Assist preferences declared in DA-VINCI.md.
|
|
46
47
|
Treat the resolved primary visual adapter as the first-pass design lead.
|
|
47
48
|
Use Pencil guides only as responsive layout constraints, not as the design direction.
|
|
48
49
|
Do not start with broad multi-screen scaffolding.
|
|
49
50
|
Design 1-3 anchor surfaces first, review screenshots, then expand.
|
|
51
|
+
Apply the form-factor-specific layout hygiene rules for web before passing screenshot review.
|
|
52
|
+
Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
|
|
53
|
+
Do not report completion if the registered `.pen` source exists only in memory or only as exported PNGs.
|
|
50
54
|
Do not pass design checkpoint if the result is a generic SaaS card grid, repeated placeholder scaffolds, or a recolor of the old interface.
|
|
51
55
|
Persist project-local Pencil files under .da-vinci/designs/.
|
|
52
56
|
```
|
package/docs/visual-adapters.md
CHANGED
|
@@ -24,6 +24,11 @@ It must not redefine:
|
|
|
24
24
|
|
|
25
25
|
Those still come from requirements, existing code, `page-map.md`, and `pencil-bindings.md`.
|
|
26
26
|
|
|
27
|
+
Visual adapters also do not replace form-factor-specific layout-hygiene rules.
|
|
28
|
+
|
|
29
|
+
- adapters shape art direction
|
|
30
|
+
- layout hygiene decides whether a reviewed screen is structurally sound for its form factor
|
|
31
|
+
|
|
27
32
|
## Where To Configure It
|
|
28
33
|
|
|
29
34
|
Configure visual-adapter preferences inside `DA-VINCI.md`.
|
|
@@ -49,6 +54,7 @@ Recommended shape:
|
|
|
49
54
|
- page composition
|
|
50
55
|
- hierarchy and spacing
|
|
51
56
|
- motion guidance
|
|
57
|
+
- anchor-surface composition
|
|
52
58
|
- Pencil design refinement
|
|
53
59
|
- Fallback:
|
|
54
60
|
- native-da-vinci
|
|
@@ -71,6 +77,7 @@ Balanced default:
|
|
|
71
77
|
- visual contract refinement
|
|
72
78
|
- page composition
|
|
73
79
|
- hierarchy and spacing
|
|
80
|
+
- anchor-surface composition
|
|
74
81
|
- Pencil design refinement
|
|
75
82
|
- Fallback:
|
|
76
83
|
- native-da-vinci
|
|
@@ -95,6 +102,7 @@ Quality-first redesign:
|
|
|
95
102
|
- page composition
|
|
96
103
|
- hierarchy and spacing
|
|
97
104
|
- motion guidance
|
|
105
|
+
- anchor-surface composition
|
|
98
106
|
- Pencil design refinement
|
|
99
107
|
- Fallback:
|
|
100
108
|
- native-da-vinci
|
|
@@ -120,6 +128,7 @@ Use the fields like this:
|
|
|
120
128
|
- `Scope`
|
|
121
129
|
- the only areas where adapters are allowed to influence the workflow
|
|
122
130
|
- keep this limited to presentation-quality work such as composition, spacing, and Pencil refinement
|
|
131
|
+
- include anchor-surface composition when the redesign depends on a strong first-pass visual direction
|
|
123
132
|
- do not use this field to delegate behavior, routes, or state truth
|
|
124
133
|
- `Fallback`
|
|
125
134
|
- what Da Vinci should do if the preferred adapters are unavailable locally
|
|
@@ -20,6 +20,7 @@ If the project is design-critical or previous outputs were weak, generic, or too
|
|
|
20
20
|
- consider `Require Adapter: true`
|
|
21
21
|
- raise the design checkpoint bar before broad Pencil generation
|
|
22
22
|
- switch to anchor-first generation: design 1-3 anchor surfaces, review screenshots, then expand
|
|
23
|
+
- update `Preferred adapters` to the actual installed names for the current environment instead of assuming cross-platform aliases
|
|
23
24
|
|
|
24
25
|
Available presets:
|
|
25
26
|
|
|
@@ -33,5 +34,6 @@ How to use them:
|
|
|
33
34
|
1. choose the preset closest to the product surface
|
|
34
35
|
2. copy the `## Visual Assist` block into `DA-VINCI.md`
|
|
35
36
|
3. adjust adapter order only if the project clearly needs a different visual bias
|
|
36
|
-
4.
|
|
37
|
-
5.
|
|
37
|
+
4. replace adapter names with the actual installed names for the current environment when they differ
|
|
38
|
+
5. keep `Require Adapter: false` unless the project truly must stop without a specific local skill
|
|
39
|
+
6. for complex redesigns, do not treat the preset alone as enough; pair it with anchor-first Pencil generation and screenshot review
|
|
@@ -21,6 +21,7 @@ Recommended `DA-VINCI.md` block:
|
|
|
21
21
|
- workspace composition
|
|
22
22
|
- hierarchy and spacing
|
|
23
23
|
- motion guidance
|
|
24
|
+
- anchor-surface composition
|
|
24
25
|
- Pencil design refinement
|
|
25
26
|
- Fallback:
|
|
26
27
|
- native-da-vinci
|
|
@@ -31,6 +32,7 @@ Recommended `DA-VINCI.md` block:
|
|
|
31
32
|
Notes:
|
|
32
33
|
|
|
33
34
|
- prefer `ui-ux-pro-max` first for dense app layout decisions
|
|
35
|
+
- replace adapter names with the actual installed names for the current environment when they differ
|
|
34
36
|
- keep section hierarchy stronger than decorative treatment
|
|
35
37
|
- use `frontend-skill` only as a secondary visual-quality helper, not as a marketing-style override
|
|
36
38
|
- if the result looks flat, over-boxed, or too generic, move `frontend-skill` to the first slot and raise the design checkpoint bar
|
|
@@ -21,6 +21,7 @@ Recommended `DA-VINCI.md` block:
|
|
|
21
21
|
- mobile page composition
|
|
22
22
|
- hierarchy and spacing
|
|
23
23
|
- touch-first motion guidance
|
|
24
|
+
- anchor-surface composition
|
|
24
25
|
- Pencil design refinement
|
|
25
26
|
- Fallback:
|
|
26
27
|
- native-da-vinci
|
|
@@ -31,6 +32,7 @@ Recommended `DA-VINCI.md` block:
|
|
|
31
32
|
Notes:
|
|
32
33
|
|
|
33
34
|
- prefer `ui-ux-pro-max` first for app-surface density and control balance
|
|
35
|
+
- replace adapter names with the actual installed names for the current environment when they differ
|
|
34
36
|
- keep motion guidance light and purposeful
|
|
35
37
|
- do not let the adapter turn routine mobile product UI into a marketing page
|
|
36
38
|
- if the output keeps collapsing into generic cards or weak hierarchy, move `frontend-skill` to the first slot and consider `Require Adapter: true`
|