@xenonbyte/da-vinci-workflow 0.1.3 → 0.1.4

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/README.md CHANGED
@@ -27,11 +27,12 @@ This workflow is intended for:
27
27
 
28
28
  Current npm release target:
29
29
 
30
- - `@xenonbyte/da-vinci-workflow@0.1.3`
30
+ - `@xenonbyte/da-vinci-workflow@0.1.4`
31
31
 
32
32
  Release highlights:
33
33
 
34
34
  - project-level visual contract support through `DA-VINCI.md`
35
+ - redesign-from-code now prefers redesign-slice specs over one oversized `ui-refresh/spec.md`
35
36
  - Node-first install, uninstall, status, and asset validation commands
36
37
  - repo-local forward-test example for a `greenfield-spec` workflow
37
38
 
@@ -75,19 +76,19 @@ Da Vinci runs in this order:
75
76
 
76
77
  Depending on the mode, the workflow may use these artifacts:
77
78
 
78
- - `brainstorm.md`
79
- - `project-inventory.md`
79
+ - `.da-vinci/changes/<change-id>/brainstorm.md`
80
+ - `.da-vinci/project-inventory.md`
80
81
  - `DA-VINCI.md`
81
- - `design-brief.md`
82
- - `design-registry.md`
83
- - `page-map.md`
84
- - `proposal.md`
85
- - `specs/<capability>/spec.md`
86
- - `design.md`
87
- - `pencil-design.md`
88
- - `pencil-bindings.md`
89
- - `tasks.md`
90
- - `verification.md`
82
+ - `.da-vinci/changes/<change-id>/design-brief.md`
83
+ - `.da-vinci/design-registry.md`
84
+ - `.da-vinci/page-map.md`
85
+ - `.da-vinci/changes/<change-id>/proposal.md`
86
+ - `.da-vinci/changes/<change-id>/specs/<capability>/spec.md`
87
+ - `.da-vinci/changes/<change-id>/design.md`
88
+ - `.da-vinci/changes/<change-id>/pencil-design.md`
89
+ - `.da-vinci/changes/<change-id>/pencil-bindings.md`
90
+ - `.da-vinci/changes/<change-id>/tasks.md`
91
+ - `.da-vinci/changes/<change-id>/verification.md`
91
92
 
92
93
  ### Artifact intent
93
94
 
@@ -105,6 +106,44 @@ Depending on the mode, the workflow may use these artifacts:
105
106
  - `tasks.md`: implementation order and task groups
106
107
  - `verification.md`: requirement coverage, design coverage, and drift findings
107
108
 
109
+ ### Spec granularity rule
110
+
111
+ Use specs as capability or redesign-slice boundaries, not as page counters.
112
+
113
+ For broad `redesign-from-code` work, prefer multiple `specs/<slice>/spec.md` files over one oversized `ui-refresh/spec.md`.
114
+
115
+ ## Artifact placement
116
+
117
+ Recommended project layout:
118
+
119
+ ```text
120
+ project/
121
+ ├── DA-VINCI.md
122
+ └── .da-vinci/
123
+ ├── project-inventory.md
124
+ ├── design-registry.md
125
+ ├── page-map.md
126
+ └── changes/
127
+ └── <change-id>/
128
+ ├── brainstorm.md
129
+ ├── design-brief.md
130
+ ├── proposal.md
131
+ ├── design.md
132
+ ├── pencil-design.md
133
+ ├── pencil-bindings.md
134
+ ├── tasks.md
135
+ ├── verification.md
136
+ └── specs/
137
+ └── <capability>/spec.md
138
+ ```
139
+
140
+ Placement rules:
141
+
142
+ - keep `DA-VINCI.md` at the project root
143
+ - keep project-wide workflow files in `.da-vinci/`
144
+ - keep change-specific workflow files in `.da-vinci/changes/<change-id>/`
145
+ - do not scatter `proposal.md`, `tasks.md`, and `verification.md` across the project root
146
+
108
147
  ## Checkpoints
109
148
 
110
149
  Da Vinci uses these checkpoints:
@@ -297,6 +336,7 @@ $da-vinci use feature-change to add a billing page, generate the relevant Pencil
297
336
  See:
298
337
 
299
338
  - `docs/workflow-examples.md`
339
+ - `docs/mode-use-cases.md`
300
340
 
301
341
  ## Repository layout
302
342
 
package/SKILL.md CHANGED
@@ -27,6 +27,15 @@ That means:
27
27
  - treat checkpoints as internal execution guards, not approval steps
28
28
  - stop only when a true blocking condition exists
29
29
 
30
+ Treat execution intent as `full-delivery` by default when the user asks to:
31
+
32
+ - complete development
33
+ - implement the generated design
34
+ - redesign the whole product UI
35
+ - finish the project or finish the refresh
36
+
37
+ Do not stop at `tasks.md` in those cases.
38
+
30
39
  Continue automatically through:
31
40
 
32
41
  - mode selection
@@ -41,6 +50,14 @@ Continue automatically through:
41
50
  - implementation
42
51
  - verification
43
52
 
53
+ If `tasks.md` exists and the active request is `full-delivery`:
54
+
55
+ - treat `task checkpoint` as the handoff into implementation, not as an end state
56
+ - start Task Group 1 automatically after a `PASS`
57
+ - start Task Group 1 automatically after a `WARN` unless the warning changes the truth of behavior, source mapping, or permissions
58
+ - do not emit "next recommended step: start Task Group 1" as a terminal outcome
59
+ - instead continue into code changes and report progress by task group
60
+
44
61
  Stop and ask only when:
45
62
 
46
63
  - the user explicitly interrupts
@@ -49,6 +66,14 @@ Stop and ask only when:
49
66
  - source artifacts conflict badly enough that continuing would guess the truth
50
67
  - a destructive action would change the project baseline significantly
51
68
 
69
+ Do not stop merely because:
70
+
71
+ - some pages are still out of scope
72
+ - a future follow-up spec may be needed for untouched behavior
73
+ - a design source should also be saved or exported for better traceability
74
+
75
+ Those are warnings unless they prevent safe implementation of the current in-scope work.
76
+
52
77
  ## Invocation Model
53
78
 
54
79
  Canonical workflow name is `da-vinci`.
@@ -135,6 +160,12 @@ Run the workflow in this order:
135
160
  10. Implement code from requirements plus Pencil data
136
161
  11. Verify behavior drift and design drift before closing the change
137
162
 
163
+ Default completion rule:
164
+
165
+ - if the request is `plan-only`, stop after planning artifacts
166
+ - if the request is `design-only`, stop after design artifacts and bindings
167
+ - otherwise assume `full-delivery` and continue through implementation and verification
168
+
138
169
  ## Load References On Demand
139
170
 
140
171
  Load only the reference that matches the current step:
@@ -151,19 +182,19 @@ Load only the reference that matches the current step:
151
182
 
152
183
  Use these artifacts unless the project defines a different schema:
153
184
 
154
- 1. `brainstorm.md`
155
- 2. `project-inventory.md`
185
+ 1. `.da-vinci/changes/<change-id>/brainstorm.md`
186
+ 2. `.da-vinci/project-inventory.md`
156
187
  3. `DA-VINCI.md`
157
- 4. `design-brief.md`
158
- 5. `design-registry.md`
159
- 6. `page-map.md`
160
- 7. `proposal.md`
161
- 8. `specs/<capability>/spec.md`
162
- 9. `design.md`
163
- 10. `pencil-design.md`
164
- 11. `pencil-bindings.md`
165
- 12. `tasks.md`
166
- 13. `verification.md`
188
+ 4. `.da-vinci/changes/<change-id>/design-brief.md`
189
+ 5. `.da-vinci/design-registry.md`
190
+ 6. `.da-vinci/page-map.md`
191
+ 7. `.da-vinci/changes/<change-id>/proposal.md`
192
+ 8. `.da-vinci/changes/<change-id>/specs/<capability>/spec.md`
193
+ 9. `.da-vinci/changes/<change-id>/design.md`
194
+ 10. `.da-vinci/changes/<change-id>/pencil-design.md`
195
+ 11. `.da-vinci/changes/<change-id>/pencil-bindings.md`
196
+ 12. `.da-vinci/changes/<change-id>/tasks.md`
197
+ 13. `.da-vinci/changes/<change-id>/verification.md`
167
198
 
168
199
  Not every mode requires every artifact.
169
200
 
@@ -198,25 +229,59 @@ Optional artifacts:
198
229
  - `tasks.md`: implementation order and deliverable task groups
199
230
  - `verification.md`: requirement coverage, Pencil coverage, and drift findings
200
231
 
232
+ ## Artifact Placement
233
+
234
+ Use this placement model inside the target project:
235
+
236
+ ### Project root
237
+
238
+ - `DA-VINCI.md`
239
+
240
+ Keep this file at the project root so the visual contract is easy to discover and reuse.
241
+
242
+ ### Project-level workflow directory
243
+
244
+ - `.da-vinci/project-inventory.md`
245
+ - `.da-vinci/design-registry.md`
246
+ - `.da-vinci/page-map.md`
247
+
248
+ These files describe project-wide facts that can outlive any one change.
249
+
250
+ ### Change-level workflow directory
251
+
252
+ - `.da-vinci/changes/<change-id>/brainstorm.md`
253
+ - `.da-vinci/changes/<change-id>/design-brief.md`
254
+ - `.da-vinci/changes/<change-id>/proposal.md`
255
+ - `.da-vinci/changes/<change-id>/design.md`
256
+ - `.da-vinci/changes/<change-id>/pencil-design.md`
257
+ - `.da-vinci/changes/<change-id>/pencil-bindings.md`
258
+ - `.da-vinci/changes/<change-id>/tasks.md`
259
+ - `.da-vinci/changes/<change-id>/verification.md`
260
+ - `.da-vinci/changes/<change-id>/specs/<capability>/spec.md`
261
+
262
+ These files belong to one concrete delivery effort and should not clutter the project root.
263
+
201
264
  ## Mode-Specific Artifact Flow
202
265
 
203
266
  Use these minimum flows:
204
267
 
205
268
  ### `greenfield-spec`
206
269
 
207
- `DA-VINCI` -> `design-brief` -> `proposal` -> `specs` -> `page-map` -> `design-registry` -> `design` -> `pencil-design` -> `pencil-bindings` -> `tasks` -> `verification`
270
+ `DA-VINCI` -> `.da-vinci/changes/<change-id>/design-brief` -> `.da-vinci/changes/<change-id>/proposal` -> `.da-vinci/changes/<change-id>/specs` -> `.da-vinci/page-map` -> `.da-vinci/design-registry` -> `.da-vinci/changes/<change-id>/design` -> `.da-vinci/changes/<change-id>/pencil-design` -> `.da-vinci/changes/<change-id>/pencil-bindings` -> `.da-vinci/changes/<change-id>/tasks` -> `.da-vinci/changes/<change-id>/verification`
208
271
 
209
272
  ### `greenfield-brainstorm`
210
273
 
211
- `brainstorm` -> `DA-VINCI` -> `design-brief` -> `proposal` -> `specs` -> `page-map` -> `design-registry` -> `design` -> `pencil-design` -> `pencil-bindings` -> `tasks` -> `verification`
274
+ `.da-vinci/changes/<change-id>/brainstorm` -> `DA-VINCI` -> `.da-vinci/changes/<change-id>/design-brief` -> `.da-vinci/changes/<change-id>/proposal` -> `.da-vinci/changes/<change-id>/specs` -> `.da-vinci/page-map` -> `.da-vinci/design-registry` -> `.da-vinci/changes/<change-id>/design` -> `.da-vinci/changes/<change-id>/pencil-design` -> `.da-vinci/changes/<change-id>/pencil-bindings` -> `.da-vinci/changes/<change-id>/tasks` -> `.da-vinci/changes/<change-id>/verification`
212
275
 
213
276
  ### `redesign-from-code`
214
277
 
215
- `project-inventory` -> `DA-VINCI` -> `design-registry` -> `proposal` -> `specs` -> `page-map` -> `design` -> `pencil-design` -> `pencil-bindings` -> `tasks` -> `verification`
278
+ `.da-vinci/project-inventory` -> `DA-VINCI` -> `.da-vinci/design-registry` -> `.da-vinci/changes/<change-id>/proposal` -> `.da-vinci/changes/<change-id>/specs` -> `.da-vinci/page-map` -> `.da-vinci/changes/<change-id>/design` -> `.da-vinci/changes/<change-id>/pencil-design` -> `.da-vinci/changes/<change-id>/pencil-bindings` -> `.da-vinci/changes/<change-id>/tasks` -> `.da-vinci/changes/<change-id>/verification`
279
+
280
+ For broad refreshes, treat `.da-vinci/changes/<change-id>/specs/` as a redesign-slice directory, not as a single-file location.
216
281
 
217
282
  ### `feature-change`
218
283
 
219
- `proposal` -> `specs` -> `page-map` for affected pages -> `DA-VINCI` -> `design-registry` -> `design` -> `pencil-design` delta -> `pencil-bindings` delta -> `tasks` -> `verification`
284
+ `.da-vinci/changes/<change-id>/proposal` -> `.da-vinci/changes/<change-id>/specs` -> `.da-vinci/page-map` for affected pages -> `DA-VINCI` -> `.da-vinci/design-registry` -> `.da-vinci/changes/<change-id>/design` -> `.da-vinci/changes/<change-id>/pencil-design` delta -> `.da-vinci/changes/<change-id>/pencil-bindings` delta -> `.da-vinci/changes/<change-id>/tasks` -> `.da-vinci/changes/<change-id>/verification`
220
285
 
221
286
  ## Requirement Breakdown Rules
222
287
 
@@ -237,6 +302,40 @@ If the active mode is `redesign-from-code`:
237
302
 
238
303
  - inventory current routes, pages, and modules before redefining page structure
239
304
  - distinguish preserved behavior from replaced presentation
305
+ - partition specs by redesign slice when one oversized `ui-refresh` spec would hide important implementation boundaries
306
+
307
+ ## Spec Partitioning Rules
308
+
309
+ Do not default to one oversized `ui-refresh` spec for broad redesign work.
310
+
311
+ For `redesign-from-code`:
312
+
313
+ - keep one overall `proposal.md`
314
+ - keep one project-level `DA-VINCI.md`
315
+ - keep one project-level `project-inventory.md`
316
+ - keep one project-level `design-registry.md`
317
+ - keep one project-level `page-map.md`
318
+ - split `specs/` by redesign slice when the refresh is broad
319
+
320
+ Preferred redesign slices:
321
+
322
+ - `shared-shell`
323
+ - `core-pages`
324
+ - `settings-and-secondary`
325
+ - `admin-or-restricted`
326
+ - `reference-gap-pages`
327
+
328
+ Split broad redesign work into multiple spec slices when one or more of these are true:
329
+
330
+ - the refresh covers more than five canonical pages
331
+ - the refresh spans more than two top-level route groups or page families
332
+ - the redesign includes both shared-shell changes and page-content changes
333
+ - prior HTML or Pencil references cover only part of the product surface
334
+ - different page groups carry different layout, density, or access constraints
335
+
336
+ One redesign spec is acceptable when the refresh is mostly cosmetic, narrow, or limited to a small product surface.
337
+
338
+ Do not split page-by-page unless the product is unusually fragmented. Prefer implementable redesign slices over raw page counts.
240
339
 
241
340
  ## Design Source Rules
242
341
 
@@ -0,0 +1,540 @@
1
+ # Da Vinci Mode Use Cases
2
+
3
+ This document shows how to use Da Vinci in each workflow mode with concrete project scenarios.
4
+
5
+ Use it when you need to decide:
6
+
7
+ - which mode fits the current job
8
+ - what inputs to provide first
9
+ - which artifacts Da Vinci should create
10
+ - how `DA-VINCI.md`, Pencil, and implementation should interact
11
+
12
+ ## Recommended output layout inside a project
13
+
14
+ Use this output structure:
15
+
16
+ ```text
17
+ project/
18
+ ├── DA-VINCI.md
19
+ └── .da-vinci/
20
+ ├── project-inventory.md
21
+ ├── design-registry.md
22
+ ├── page-map.md
23
+ └── changes/
24
+ └── <change-id>/
25
+ ├── brainstorm.md
26
+ ├── design-brief.md
27
+ ├── proposal.md
28
+ ├── design.md
29
+ ├── pencil-design.md
30
+ ├── pencil-bindings.md
31
+ ├── tasks.md
32
+ ├── verification.md
33
+ └── specs/
34
+ └── <capability>/spec.md
35
+ ```
36
+
37
+ Rule:
38
+
39
+ - only `DA-VINCI.md` belongs at the project root
40
+ - all other workflow outputs should stay under `.da-vinci/`
41
+
42
+ ## Quick mode selection
43
+
44
+ Choose the mode by project start condition:
45
+
46
+ 1. `greenfield-spec`
47
+ - new project
48
+ - requirements are already clear enough to write specs
49
+
50
+ 2. `greenfield-brainstorm`
51
+ - new project
52
+ - requirements are still spread across multiple rounds of ideation
53
+
54
+ 3. `redesign-from-code`
55
+ - project already exists
56
+ - current codebase is the behavior source of truth
57
+ - UI needs broad or global redesign
58
+
59
+ 4. `feature-change`
60
+ - project already exists
61
+ - a scoped feature, page, or flow needs to be added or updated
62
+
63
+ ---
64
+
65
+ ## 1. `greenfield-spec`
66
+
67
+ ### Typical scenario
68
+
69
+ You are starting a new desktop or web product. The product scope is already clear enough to write requirements. You want Da Vinci to:
70
+
71
+ 1. break requirements into pages and flows
72
+ 2. establish a visual baseline
73
+ 3. generate Pencil-backed pages
74
+ 4. create implementation tasks
75
+ 5. build from requirement plus Pencil data
76
+
77
+ ### Example case
78
+
79
+ Project:
80
+
81
+ - desktop software for annotated design delivery
82
+
83
+ Known inputs:
84
+
85
+ - the product converts HTML and Figma sources into annotated design output
86
+ - the output is also exposed as MCP-ready structured data
87
+ - launch needs a homepage and a product detail page
88
+
89
+ ### Recommended request
90
+
91
+ ```text
92
+ $da-vinci use greenfield-spec to break down a new desktop software product for annotated design delivery.
93
+ Generate DA-VINCI.md, proposal, specs, page map, Pencil-backed launch pages, bindings, and implementation tasks.
94
+ ```
95
+
96
+ ### What Da Vinci should do
97
+
98
+ 1. create `DA-VINCI.md`
99
+ - choose or infer a stable visual contract
100
+ - record theme, palette, typography direction, and component tone
101
+
102
+ 2. create `design-brief.md`
103
+ - confirm form factor and page-level design priorities
104
+
105
+ 3. create `proposal.md`
106
+ - define scope, non-goals, and success criteria
107
+
108
+ 4. create `specs/<capability>/spec.md`
109
+ - define behavior, states, acceptance, and edge cases
110
+
111
+ 5. create `page-map.md`
112
+ - define the canonical pages and page responsibilities
113
+
114
+ 6. create `design-registry.md`
115
+ - register the active `.pen` source once Pencil work starts
116
+
117
+ 7. create `design.md`
118
+ - define page structure and layout strategy
119
+
120
+ 8. create `pencil-design.md`
121
+ - record the generated Pencil screens
122
+
123
+ 9. create `pencil-bindings.md`
124
+ - map implementation pages to Pencil pages
125
+
126
+ 10. create `tasks.md`
127
+ - define implementation order
128
+
129
+ 11. build code from:
130
+ - requirements
131
+ - `DA-VINCI.md`
132
+ - Pencil page data
133
+
134
+ ### What should be true before implementation
135
+
136
+ - `DA-VINCI.md` exists and is stable
137
+ - every core page exists in `page-map.md`
138
+ - every implementation page has a Pencil counterpart or an explicit exception
139
+ - `task checkpoint` passes
140
+
141
+ ### Best fit
142
+
143
+ Use this mode when you do **not** need idea synthesis first and when the product scope is not primarily reverse-engineered from an existing codebase.
144
+
145
+ ---
146
+
147
+ ## 2. `greenfield-brainstorm`
148
+
149
+ ### Typical scenario
150
+
151
+ You are starting a new project, but the inputs are still rough. The user may have described:
152
+
153
+ - several possible features
154
+ - multiple product directions
155
+ - unclear page boundaries
156
+ - conflicting style preferences
157
+
158
+ The goal is to turn those messy inputs into a buildable workflow.
159
+
160
+ ### Example case
161
+
162
+ Project:
163
+
164
+ - AI writing workspace for product teams
165
+
166
+ User inputs across several rounds:
167
+
168
+ - “Need a docs editor”
169
+ - “Also maybe an AI copilot”
170
+ - “Maybe a dashboard”
171
+ - “Should feel professional, not playful”
172
+ - “Could be a web app or maybe a desktop tool”
173
+
174
+ ### Recommended request
175
+
176
+ ```text
177
+ $da-vinci use greenfield-brainstorm to turn product brainstorming into a stable delivery workflow.
178
+ First synthesize the product direction, then generate DA-VINCI.md, specs, page map, Pencil-backed pages, and implementation tasks.
179
+ ```
180
+
181
+ ### What Da Vinci should do
182
+
183
+ 1. create `brainstorm.md`
184
+ - collect recurring themes
185
+ - separate stable goals from open questions
186
+ - identify contradictions
187
+
188
+ 2. create or infer `DA-VINCI.md`
189
+ - once visual preferences are stable enough
190
+ - do not generate many unrelated pages before this exists
191
+
192
+ 3. create `design-brief.md`
193
+ - record form factor and design direction
194
+
195
+ 4. create `proposal.md`
196
+ - stabilize scope
197
+
198
+ 5. create `specs/<capability>/spec.md`
199
+ - convert brainstorm into testable behavior
200
+
201
+ 6. create `page-map.md`
202
+ - define real pages instead of vague product areas
203
+
204
+ 7. continue with:
205
+ - `design-registry.md`
206
+ - `design.md`
207
+ - `pencil-design.md`
208
+ - `pencil-bindings.md`
209
+ - `tasks.md`
210
+
211
+ ### Where this mode differs from `greenfield-spec`
212
+
213
+ The extra work is at the front:
214
+
215
+ - synthesize first
216
+ - design later
217
+ - code only after the idea set is stable enough
218
+
219
+ ### Common blockers
220
+
221
+ - product surface is still unclear: web app vs desktop app
222
+ - core user flow is still contradictory
223
+ - design preference is unstable enough that `DA-VINCI.md` would be noise instead of a baseline
224
+
225
+ ### Best fit
226
+
227
+ Use this mode when the biggest risk is not implementation, but ambiguity.
228
+
229
+ ---
230
+
231
+ ## 3. `redesign-from-code`
232
+
233
+ ### Typical scenario
234
+
235
+ You already have a working project. You want to redesign all or most of the UI while preserving behavior and routes.
236
+
237
+ This is the right mode for:
238
+
239
+ - full visual refresh
240
+ - broad UI cleanup
241
+ - migration from old interface style to a new product language
242
+ - redesign using existing design references
243
+
244
+ ### Example case A: redesign from current code only
245
+
246
+ Project:
247
+
248
+ - existing SaaS admin app
249
+
250
+ Goal:
251
+
252
+ - keep all routes and behavior
253
+ - replace the visual system with a dark, dense, desktop-tool style
254
+
255
+ Recommended request:
256
+
257
+ ```text
258
+ $da-vinci use redesign-from-code to redesign the whole product UI.
259
+ Keep current routes and behavior, inventory the existing pages and shared layouts, create DA-VINCI.md as the visual contract, generate a Pencil-backed design baseline, bind implementation pages to Pencil pages, and produce implementation tasks for a full UI refresh.
260
+ ```
261
+
262
+ ### Example case B: redesign from code plus existing design references
263
+
264
+ Project:
265
+
266
+ - existing product with some earlier design drafts
267
+
268
+ Goal:
269
+
270
+ - current code remains the behavior source of truth
271
+ - existing design drafts become the visual reference source
272
+ - missing pages should be designed to match the same style
273
+
274
+ Recommended request:
275
+
276
+ ```text
277
+ $da-vinci use redesign-from-code to redesign the whole product UI.
278
+ Current code is the behavior source of truth. Existing design drafts are the visual reference source.
279
+ Register the design sources, extract DA-VINCI.md from them, bind covered pages, generate Pencil designs for uncovered pages, and create implementation tasks.
280
+ ```
281
+
282
+ ### What Da Vinci should do
283
+
284
+ 1. create `project-inventory.md`
285
+ - inventory routes
286
+ - inventory pages
287
+ - inventory shared regions
288
+ - inventory current UI patterns
289
+
290
+ 2. detect or create `DA-VINCI.md`
291
+ - if prior design references exist, extract the baseline from them
292
+ - if not, infer the new visual contract from the redesign request
293
+
294
+ 3. create or update `design-registry.md`
295
+ - register old and new `.pen` sources
296
+
297
+ 4. create or update `page-map.md`
298
+ - identify canonical implementation pages
299
+
300
+ 5. create `design.md`
301
+ - define redesign layout strategy and component strategy
302
+
303
+ 6. create or update `pencil-design.md`
304
+ - build the new redesign baseline in Pencil
305
+
306
+ 7. create or update `pencil-bindings.md`
307
+ - bind pages to redesign screens
308
+
309
+ 8. create `tasks.md`
310
+ - group implementation by layout shell, shared components, and page slices
311
+
312
+ 9. continue directly into implementation when the request is a full redesign
313
+ - start Task Group 1 automatically
314
+ - preserve current behavior
315
+ - apply the redesign through code, not only through planning artifacts
316
+
317
+ ### Critical rule in this mode
318
+
319
+ For redesign work:
320
+
321
+ - current code decides behavior
322
+ - `DA-VINCI.md` decides the new visual contract
323
+ - Pencil decides page-by-page presentation
324
+
325
+ ### Spec partitioning rule
326
+
327
+ For broad refreshes, do not keep everything inside one `ui-refresh/spec.md` unless the project surface is genuinely small or the change is mostly cosmetic.
328
+
329
+ Preferred structure:
330
+
331
+ - keep one overall `proposal.md`
332
+ - keep one project-level `page-map.md`
333
+ - split `specs/` by redesign slice
334
+
335
+ Recommended redesign slices:
336
+
337
+ - `shared-shell`
338
+ - `core-pages`
339
+ - `settings-and-secondary`
340
+ - `admin-or-restricted`
341
+ - `reference-gap-pages`
342
+
343
+ This keeps implementation traceable without falling into one-spec-per-page fragmentation.
344
+
345
+ ### Important execution rule
346
+
347
+ For a request like:
348
+
349
+ - "redesign the whole product UI"
350
+ - "globally update all UI"
351
+ - "complete the refresh"
352
+
353
+ Da Vinci should treat the intent as `full-delivery`.
354
+
355
+ That means it should not stop after:
356
+
357
+ - `design.md`
358
+ - `pencil-design.md`
359
+ - `pencil-bindings.md`
360
+ - `tasks.md`
361
+
362
+ Instead it should:
363
+
364
+ 1. generate the redesign artifacts
365
+ 2. run `task checkpoint`
366
+ 3. if the result is `PASS` or non-blocking `WARN`, immediately enter Task Group 1
367
+ 4. modify code while preserving current behavior
368
+ 5. use `execution checkpoint` only after implementation starts
369
+
370
+ ### Example: redesign from code plus HTML design references
371
+
372
+ Project:
373
+
374
+ - existing application with complete functional code
375
+ - some HTML design drafts already exist
376
+ - those HTML drafts are visual references and suggestions, not 1:1 restoration targets
377
+
378
+ Recommended request:
379
+
380
+ ```text
381
+ $da-vinci use redesign-from-code to redesign the whole product UI.
382
+ Current code is the behavior source of truth.
383
+ Existing HTML design drafts are visual references and suggestions, not restoration targets.
384
+ Please inventory the current pages and shared layouts, register the HTML drafts as design references, extract DA-VINCI.md as the project visual contract, generate a unified Pencil design baseline, bind implementation pages to redesign screens, and continue implementation automatically unless a true blocker exists.
385
+ ```
386
+
387
+ Expected behavior:
388
+
389
+ 1. inventory current pages and shared regions
390
+ 2. register the HTML drafts as design references
391
+ 3. extract a stable `DA-VINCI.md`
392
+ 4. split broad redesign work into multiple spec slices when needed
393
+ 5. create or refine Pencil redesign screens
394
+ 6. bind implementation pages to redesign screens
395
+ 7. generate `tasks.md` aligned to the redesign slices
396
+ 8. continue into code changes without stopping at "next recommended step"
397
+
398
+ ### Best fit
399
+
400
+ Use this mode whenever the project already exists and the real work starts from discovery and redesign, not from a blank page.
401
+
402
+ ---
403
+
404
+ ## 4. `feature-change`
405
+
406
+ ### Typical scenario
407
+
408
+ The product already exists. You do not want a whole redesign. You want a single change to flow through requirements, Pencil, and code.
409
+
410
+ Examples:
411
+
412
+ - add a billing page
413
+ - redesign an onboarding flow
414
+ - add a settings subsection
415
+ - add a new dashboard tab
416
+
417
+ ### Example case
418
+
419
+ Project:
420
+
421
+ - existing product with current page system and visual contract
422
+
423
+ Change:
424
+
425
+ - add a billing center page and connect it to the existing settings area
426
+
427
+ ### Recommended request
428
+
429
+ ```text
430
+ $da-vinci use feature-change to add a billing center page.
431
+ Keep the current behavior and project style baseline, update the affected page map, generate the Pencil design delta, bind the new page, and create implementation tasks.
432
+ ```
433
+
434
+ ### What Da Vinci should do
435
+
436
+ 1. create or update `proposal.md`
437
+ - define the change scope
438
+
439
+ 2. create or update `specs/<capability>/spec.md`
440
+ - define the new behavior or updated behavior
441
+
442
+ 3. update `page-map.md`
443
+ - only for affected pages and related flows
444
+
445
+ 4. reuse `DA-VINCI.md`
446
+ - unless the change explicitly introduces a new product area or rebrand
447
+
448
+ 5. update `design-registry.md`
449
+ - if a new `.pen` source or screen is added
450
+
451
+ 6. create `pencil-design.md` delta
452
+ - only for the affected pages
453
+
454
+ 7. update `pencil-bindings.md`
455
+ - bind the new or changed page
456
+
457
+ 8. create `tasks.md`
458
+ - implementation order for the scoped change
459
+
460
+ 9. implement and verify
461
+
462
+ ### Why this mode matters
463
+
464
+ Without a dedicated change mode, AI tends to:
465
+
466
+ - redesign too much
467
+ - regenerate pages that are out of scope
468
+ - ignore the existing visual contract
469
+
470
+ This mode prevents that.
471
+
472
+ ---
473
+
474
+ ## How `DA-VINCI.md` should behave in every mode
475
+
476
+ `DA-VINCI.md` is not optional noise. It is the project-level visual contract.
477
+
478
+ Use it like this:
479
+
480
+ 1. if it exists
481
+ - reuse it
482
+ - avoid asking duplicate style questions
483
+ - avoid page-by-page style reinvention
484
+
485
+ 2. if it does not exist
486
+ - generate it from stable user preference, existing code signals, or prior design sources
487
+ - save it before broad Pencil generation
488
+
489
+ 3. if the project is rebranding
490
+ - update `DA-VINCI.md`
491
+ - then propagate the new baseline through Pencil and implementation
492
+
493
+ ---
494
+
495
+ ## How to choose between design sources
496
+
497
+ Use this source order:
498
+
499
+ 1. `DA-VINCI.md`
500
+ - project visual baseline
501
+
502
+ 2. `design-registry.md`
503
+ - which `.pen` sources are active
504
+
505
+ 3. `pencil-bindings.md`
506
+ - which page maps to which Pencil screen
507
+
508
+ 4. implementation code
509
+ - behavior truth for existing products
510
+
511
+ 5. user prompt
512
+ - high-level direction and scope
513
+
514
+ ---
515
+
516
+ ## Recommended request templates
517
+
518
+ ### New project with clear scope
519
+
520
+ ```text
521
+ $da-vinci use greenfield-spec to turn this new product into requirements, Pencil-backed pages, and implementation tasks.
522
+ ```
523
+
524
+ ### New project from rough ideation
525
+
526
+ ```text
527
+ $da-vinci use greenfield-brainstorm to synthesize the product idea, establish the visual baseline, and generate a buildable workflow.
528
+ ```
529
+
530
+ ### Existing project full redesign
531
+
532
+ ```text
533
+ $da-vinci use redesign-from-code to inventory the current product, establish or update DA-VINCI.md, generate a Pencil-backed redesign baseline, and prepare implementation tasks.
534
+ ```
535
+
536
+ ### Existing project scoped feature
537
+
538
+ ```text
539
+ $da-vinci use feature-change to add or update a page while preserving the current project visual contract and behavior baseline.
540
+ ```
@@ -61,11 +61,11 @@ Expected flow:
61
61
  1. scan the existing product into `project-inventory.md`
62
62
  2. register any current `.pen` sources in `design-registry.md`
63
63
  3. define redesign scope in `proposal.md`
64
- 4. write redesign constraints in `specs/<capability>/spec.md`
64
+ 4. split broad redesign work into `specs/<slice>/spec.md` files when one large `ui-refresh` spec would be too coarse
65
65
  5. rebuild or refine `page-map.md`
66
66
  6. create new or updated Pencil pages
67
67
  7. bind routes and pages to Pencil screens
68
- 8. generate tasks
68
+ 8. generate tasks aligned to the redesign slices
69
69
  9. build and verify
70
70
 
71
71
  ## 4. `feature-change`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenonbyte/da-vinci-workflow",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Requirement-to-design-to-code workflow skill for Codex, Claude, and Gemini",
5
5
  "bin": {
6
6
  "da-vinci": "bin/da-vinci.js"
@@ -4,6 +4,37 @@ Use these templates as the default artifact shapes for Da Vinci.
4
4
 
5
5
  Keep headings stable unless the project requires a different schema.
6
6
 
7
+ ## Placement Rule
8
+
9
+ Write artifacts into the target project using this rule:
10
+
11
+ - keep `DA-VINCI.md` at the project root
12
+ - keep project-level workflow files in `.da-vinci/`
13
+ - keep change-level workflow files in `.da-vinci/changes/<change-id>/`
14
+
15
+ Recommended placement:
16
+
17
+ ```text
18
+ project/
19
+ ├── DA-VINCI.md
20
+ └── .da-vinci/
21
+ ├── project-inventory.md
22
+ ├── design-registry.md
23
+ ├── page-map.md
24
+ └── changes/
25
+ └── <change-id>/
26
+ ├── brainstorm.md
27
+ ├── design-brief.md
28
+ ├── proposal.md
29
+ ├── design.md
30
+ ├── pencil-design.md
31
+ ├── pencil-bindings.md
32
+ ├── tasks.md
33
+ ├── verification.md
34
+ └── specs/
35
+ └── <capability>/spec.md
36
+ ```
37
+
7
38
  ## `brainstorm.md`
8
39
 
9
40
  Use this structure:
@@ -33,6 +64,10 @@ Use this structure:
33
64
 
34
65
  Use this artifact only when ideas are still being synthesized.
35
66
 
67
+ Recommended path:
68
+
69
+ - `.da-vinci/changes/<change-id>/brainstorm.md`
70
+
36
71
  ## `project-inventory.md`
37
72
 
38
73
  Use this structure:
@@ -63,6 +98,10 @@ Use this structure:
63
98
 
64
99
  Use this artifact when redesign starts from an existing codebase.
65
100
 
101
+ Recommended path:
102
+
103
+ - `.da-vinci/project-inventory.md`
104
+
66
105
  ## `DA-VINCI.md`
67
106
 
68
107
  Use this structure:
@@ -121,6 +160,10 @@ Use this structure:
121
160
 
122
161
  Use this artifact as a project-level visual contract. Generate it when the project does not already have one.
123
162
 
163
+ Recommended path:
164
+
165
+ - `DA-VINCI.md`
166
+
124
167
  ## `design-brief.md`
125
168
 
126
169
  Use this structure:
@@ -156,6 +199,10 @@ Use this structure:
156
199
 
157
200
  Use this artifact whenever the project is new or the design direction is not obvious from the existing product.
158
201
 
202
+ Recommended path:
203
+
204
+ - `.da-vinci/changes/<change-id>/design-brief.md`
205
+
159
206
  ## `design-registry.md`
160
207
 
161
208
  Use this structure:
@@ -182,6 +229,10 @@ Use this structure:
182
229
 
183
230
  Use this artifact whenever a project can have one or more Pencil sources.
184
231
 
232
+ Recommended path:
233
+
234
+ - `.da-vinci/design-registry.md`
235
+
185
236
  ## `page-map.md`
186
237
 
187
238
  Use this structure:
@@ -214,6 +265,10 @@ Use this structure:
214
265
 
215
266
  Use this artifact for every mode. It is the canonical page list.
216
267
 
268
+ Recommended path:
269
+
270
+ - `.da-vinci/page-map.md`
271
+
217
272
  ## `proposal.md`
218
273
 
219
274
  Use this structure:
@@ -249,6 +304,10 @@ Use this structure:
249
304
  - Observable outcomes
250
305
  ```
251
306
 
307
+ Recommended path:
308
+
309
+ - `.da-vinci/changes/<change-id>/proposal.md`
310
+
252
311
  ## `specs/<capability>/spec.md`
253
312
 
254
313
  Use this structure:
@@ -287,6 +346,10 @@ Use this structure:
287
346
 
288
347
  Write behavior in direct, testable language.
289
348
 
349
+ Recommended path:
350
+
351
+ - `.da-vinci/changes/<change-id>/specs/<capability>/spec.md`
352
+
290
353
  ## `design.md`
291
354
 
292
355
  Use this structure:
@@ -318,6 +381,10 @@ Use this structure:
318
381
  - Unresolved design decisions
319
382
  ```
320
383
 
384
+ Recommended path:
385
+
386
+ - `.da-vinci/changes/<change-id>/design.md`
387
+
321
388
  ## `pencil-design.md`
322
389
 
323
390
  Use this structure:
@@ -348,6 +415,10 @@ Use this structure:
348
415
  - Important layout or styling constraints to preserve in code
349
416
  ```
350
417
 
418
+ Recommended path:
419
+
420
+ - `.da-vinci/changes/<change-id>/pencil-design.md`
421
+
351
422
  ## `tasks.md`
352
423
 
353
424
  Use this structure:
@@ -374,6 +445,10 @@ Use this structure:
374
445
 
375
446
  Prefer top-level task groups. They are required for execution checkpoints.
376
447
 
448
+ Recommended path:
449
+
450
+ - `.da-vinci/changes/<change-id>/tasks.md`
451
+
377
452
  ## `pencil-bindings.md`
378
453
 
379
454
  Use this structure:
@@ -397,6 +472,10 @@ Use this structure:
397
472
 
398
473
  Use this artifact whenever implementation must trace back to Pencil pages.
399
474
 
475
+ Recommended path:
476
+
477
+ - `.da-vinci/changes/<change-id>/pencil-bindings.md`
478
+
400
479
  ## `verification.md`
401
480
 
402
481
  Use this structure:
@@ -420,3 +499,7 @@ Use this structure:
420
499
  - PASS / WARN / BLOCK
421
500
  - Next action
422
501
  ```
502
+
503
+ Recommended path:
504
+
505
+ - `.da-vinci/changes/<change-id>/verification.md`
@@ -14,6 +14,11 @@ Default handling:
14
14
 
15
15
  Do not pause the workflow just because a checkpoint ran.
16
16
 
17
+ Default execution intent:
18
+
19
+ - assume `full-delivery` unless the request explicitly says `plan-only`, `design-only`, or another partial-delivery goal
20
+ - in `full-delivery`, checkpoints do not end the workflow; they control whether the workflow continues safely
21
+
17
22
  ## Visual Contract Rule
18
23
 
19
24
  Before broad Pencil page generation:
@@ -57,6 +62,7 @@ Check:
57
62
  - important states are present
58
63
  - acceptance conditions are testable
59
64
  - risky areas are called out early
65
+ - redesign scope is not too broad for a single spec when the active mode is `redesign-from-code`
60
66
 
61
67
  Result meanings:
62
68
 
@@ -64,6 +70,13 @@ Result meanings:
64
70
  - `WARN`: continue, but update artifacts soon
65
71
  - `BLOCK`: update source artifacts before moving on
66
72
 
73
+ Spec partitioning guidance for `redesign-from-code`:
74
+
75
+ - one spec is acceptable for a small or mostly cosmetic refresh
76
+ - one spec is too coarse when the redesign spans many pages, multiple route groups, both shared shell and page content, or uneven design-reference coverage
77
+ - use `WARN` when the current spec is slightly too broad but tasks can still be corrected quickly
78
+ - use `BLOCK` when the current spec is so broad that implementation would lose traceability across redesign slices
79
+
67
80
  ## `design checkpoint`
68
81
 
69
82
  Run after Pencil pages exist and before implementation tasks are locked.
@@ -112,13 +125,33 @@ Check:
112
125
  - tasks cover behavior from specs
113
126
  - tasks cover integration and verification work
114
127
  - tasks are ordered by dependency
128
+ - top-level task groups map cleanly to the active spec slices when multiple redesign slices exist
115
129
 
116
130
  Result meanings:
117
131
 
118
- - `PASS`: safe to start implementation
119
- - `WARN`: implementation can start, but task quality is weak
132
+ - `PASS`: safe to start implementation immediately
133
+ - `WARN`: implementation can start immediately, but task quality is weak or follow-up artifact cleanup is still advisable
120
134
  - `BLOCK`: rewrite tasks before implementation
121
135
 
136
+ Automatic continuation rule:
137
+
138
+ - if the active intent is `full-delivery`, `PASS` must immediately continue into Task Group 1
139
+ - if the active intent is `full-delivery`, `WARN` must still continue into Task Group 1 unless the warning creates behavior ambiguity, mapping ambiguity, missing permissions, or a destructive-baseline risk
140
+ - only `BLOCK` is allowed to stop the workflow before implementation
141
+
142
+ Examples of `WARN`, not `BLOCK`:
143
+
144
+ - an additional follow-up spec may be needed for currently untouched behavior
145
+ - some legacy or out-of-scope surfaces remain intentionally excluded
146
+ - the active Pencil source should also be saved or exported for stronger repository traceability
147
+
148
+ Examples of `BLOCK`:
149
+
150
+ - the implementation would invent new behavior that has no spec support
151
+ - page-to-Pencil bindings are too weak to know which redesign screen to follow
152
+ - required permissions, environment access, or protected files are unavailable
153
+ - the implementation would overwrite the project baseline in a destructive way without an explicit go-ahead
154
+
122
155
  ## `execution checkpoint`
123
156
 
124
157
  Run after each top-level task group during implementation.
@@ -136,6 +169,10 @@ Result meanings:
136
169
  - `WARN`: continue, but record the issue
137
170
  - `BLOCK`: update artifacts before continuing
138
171
 
172
+ Do not downgrade `execution checkpoint` into a planning checkpoint.
173
+
174
+ Its job is to keep code aligned after implementation starts, not to justify stopping before Task Group 1.
175
+
139
176
  ## Reporting Format
140
177
 
141
178
  Use this reporting shape:
@@ -54,7 +54,7 @@ Entry artifacts:
54
54
  - `project-inventory.md`
55
55
  - `design-registry.md`
56
56
  - `proposal.md`
57
- - `specs/<capability>/spec.md`
57
+ - `specs/<capability-or-slice>/spec.md`
58
58
  - `page-map.md`
59
59
 
60
60
  Best for:
@@ -63,6 +63,13 @@ Best for:
63
63
  - layout modernization
64
64
  - design-system replacement
65
65
 
66
+ Spec guidance:
67
+
68
+ - keep one overall `proposal.md`
69
+ - keep one project-level `page-map.md`
70
+ - split `specs/` by redesign slice when the refresh is broad
71
+ - do not assume one `ui-refresh/spec.md` is enough for a large application
72
+
66
73
  ## `feature-change`
67
74
 
68
75
  Use when: