@xenonbyte/da-vinci-workflow 0.1.20 → 0.1.22

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +40 -54
  3. package/README.zh-CN.md +40 -54
  4. package/commands/claude/dv/build.md +6 -0
  5. package/commands/claude/dv/continue.md +1 -0
  6. package/commands/codex/prompts/dv-build.md +4 -0
  7. package/commands/codex/prompts/dv-continue.md +1 -0
  8. package/commands/gemini/dv/build.toml +4 -0
  9. package/commands/gemini/dv/continue.toml +1 -0
  10. package/docs/constraint-files.md +109 -0
  11. package/docs/dv-command-reference.md +24 -0
  12. package/docs/visual-adapters.md +24 -80
  13. package/docs/visual-assist-presets/desktop-app.md +20 -68
  14. package/docs/visual-assist-presets/mobile-app.md +20 -68
  15. package/docs/visual-assist-presets/tablet-app.md +20 -68
  16. package/docs/visual-assist-presets/web-app.md +20 -68
  17. package/docs/workflow-examples.md +29 -13
  18. package/docs/workflow-overview.md +2 -0
  19. package/docs/zh-CN/constraint-files.md +111 -0
  20. package/docs/zh-CN/dv-command-reference.md +24 -0
  21. package/docs/zh-CN/visual-adapters.md +24 -80
  22. package/docs/zh-CN/visual-assist-presets/desktop-app.md +20 -68
  23. package/docs/zh-CN/visual-assist-presets/mobile-app.md +20 -68
  24. package/docs/zh-CN/visual-assist-presets/tablet-app.md +20 -68
  25. package/docs/zh-CN/visual-assist-presets/web-app.md +20 -68
  26. package/docs/zh-CN/workflow-examples.md +29 -13
  27. package/docs/zh-CN/workflow-overview.md +2 -0
  28. package/examples/greenfield-spec-markupflow/DA-VINCI.md +13 -13
  29. package/examples/greenfield-spec-markupflow/README.md +7 -0
  30. package/examples/greenfield-spec-markupflow/pencil-design.md +5 -0
  31. package/lib/cli.js +194 -2
  32. package/lib/icon-aliases.js +165 -0
  33. package/lib/icon-search.js +370 -0
  34. package/lib/icon-sync.js +361 -0
  35. package/lib/pencil-session.js +6 -0
  36. package/package.json +5 -2
  37. package/references/artifact-templates.md +24 -0
  38. package/references/icon-aliases.example.json +12 -0
  39. package/scripts/fixtures/mock-pencil.js +49 -0
  40. package/scripts/test-icon-aliases.js +87 -0
  41. package/scripts/test-icon-search.js +72 -0
  42. package/scripts/test-icon-sync.js +178 -0
  43. package/scripts/test-mode-consistency.js +50 -0
  44. package/scripts/test-pen-persistence.js +7 -3
  45. package/scripts/test-pencil-session.js +40 -0
  46. package/scripts/test-persistence-flows.js +31 -1
@@ -21,20 +21,10 @@ Use when:
21
21
 
22
22
  ```md
23
23
  ## Visual Assist
24
- - Preferred adapters:
25
- - ui-ux-pro-max
26
- - frontend-skill
27
- - Scope:
28
- - visual contract refinement
29
- - workspace composition
30
- - hierarchy and spacing
31
- - motion guidance
32
- - anchor-surface composition
33
- - Pencil design refinement
34
- - Fallback:
35
- - native-da-vinci
36
- - Require Adapter:
37
- - false
24
+ - Preferred adapters: ui-ux-pro-max, frontend-skill
25
+ - Scope: visual contract refinement, workspace composition, hierarchy and spacing, motion guidance, anchor-surface composition, Pencil design refinement
26
+ - Fallback: native-da-vinci
27
+ - Require Adapter: false
38
28
  ```
39
29
 
40
30
  ### Variant 2: Advisory Supervisor Review
@@ -46,33 +36,14 @@ Use when:
46
36
 
47
37
  ```md
48
38
  ## Visual Assist
49
- - Preferred adapters:
50
- - ui-ux-pro-max
51
- - frontend-skill
52
- - Design-supervisor reviewers:
53
- - frontend-skill
54
- - ui-ux-pro-max
55
- - Design-supervisor review mode:
56
- - screenshot-and-theme
57
- - Design-supervisor review inputs:
58
- - screenshots
59
- - pencil variables
60
- - visual thesis
61
- - content plan
62
- - interaction thesis
63
- - Scope:
64
- - visual contract refinement
65
- - workspace composition
66
- - hierarchy and spacing
67
- - motion guidance
68
- - anchor-surface composition
69
- - Pencil design refinement
70
- - Fallback:
71
- - native-da-vinci
72
- - Require Adapter:
73
- - false
74
- - Require Supervisor Review:
75
- - false
39
+ - Preferred adapters: ui-ux-pro-max, frontend-skill
40
+ - Design-supervisor reviewers: frontend-skill, ui-ux-pro-max
41
+ - Design-supervisor review mode: screenshot-and-theme
42
+ - Design-supervisor review inputs: screenshots, pencil variables, visual thesis, content plan, interaction thesis
43
+ - Scope: visual contract refinement, workspace composition, hierarchy and spacing, motion guidance, anchor-surface composition, Pencil design refinement
44
+ - Fallback: native-da-vinci
45
+ - Require Adapter: false
46
+ - Require Supervisor Review: false
76
47
  ```
77
48
 
78
49
  ### Variant 3: Required Supervisor Signoff
@@ -85,33 +56,14 @@ Use when:
85
56
 
86
57
  ```md
87
58
  ## Visual Assist
88
- - Preferred adapters:
89
- - frontend-skill
90
- - ui-ux-pro-max
91
- - Design-supervisor reviewers:
92
- - frontend-skill
93
- - ui-ux-pro-max
94
- - Design-supervisor review mode:
95
- - screenshot-and-theme
96
- - Design-supervisor review inputs:
97
- - screenshots
98
- - pencil variables
99
- - visual thesis
100
- - content plan
101
- - interaction thesis
102
- - Scope:
103
- - visual contract refinement
104
- - workspace composition
105
- - hierarchy and spacing
106
- - motion guidance
107
- - anchor-surface composition
108
- - Pencil design refinement
109
- - Fallback:
110
- - native-da-vinci
111
- - Require Adapter:
112
- - true
113
- - Require Supervisor Review:
114
- - true
59
+ - Preferred adapters: frontend-skill, ui-ux-pro-max
60
+ - Design-supervisor reviewers: frontend-skill, ui-ux-pro-max
61
+ - Design-supervisor review mode: screenshot-and-theme
62
+ - Design-supervisor review inputs: screenshots, pencil variables, visual thesis, content plan, interaction thesis
63
+ - Scope: visual contract refinement, workspace composition, hierarchy and spacing, motion guidance, anchor-surface composition, Pencil design refinement
64
+ - Fallback: native-da-vinci
65
+ - Require Adapter: true
66
+ - Require Supervisor Review: true
115
67
  ```
116
68
 
117
69
  Notes for all variants:
@@ -21,20 +21,10 @@ Use when:
21
21
 
22
22
  ```md
23
23
  ## Visual Assist
24
- - Preferred adapters:
25
- - ui-ux-pro-max
26
- - frontend-skill
27
- - Scope:
28
- - visual contract refinement
29
- - mobile page composition
30
- - hierarchy and spacing
31
- - touch-first motion guidance
32
- - anchor-surface composition
33
- - Pencil design refinement
34
- - Fallback:
35
- - native-da-vinci
36
- - Require Adapter:
37
- - false
24
+ - Preferred adapters: ui-ux-pro-max, frontend-skill
25
+ - Scope: visual contract refinement, mobile page composition, hierarchy and spacing, touch-first motion guidance, anchor-surface composition, Pencil design refinement
26
+ - Fallback: native-da-vinci
27
+ - Require Adapter: false
38
28
  ```
39
29
 
40
30
  ### Variant 2: Advisory Supervisor Review
@@ -47,33 +37,14 @@ Use when:
47
37
 
48
38
  ```md
49
39
  ## Visual Assist
50
- - Preferred adapters:
51
- - ui-ux-pro-max
52
- - frontend-skill
53
- - Design-supervisor reviewers:
54
- - frontend-skill
55
- - ui-ux-pro-max
56
- - Design-supervisor review mode:
57
- - screenshot-and-theme
58
- - Design-supervisor review inputs:
59
- - screenshots
60
- - pencil variables
61
- - visual thesis
62
- - content plan
63
- - interaction thesis
64
- - Scope:
65
- - visual contract refinement
66
- - mobile page composition
67
- - hierarchy and spacing
68
- - touch-first motion guidance
69
- - anchor-surface composition
70
- - Pencil design refinement
71
- - Fallback:
72
- - native-da-vinci
73
- - Require Adapter:
74
- - false
75
- - Require Supervisor Review:
76
- - false
40
+ - Preferred adapters: ui-ux-pro-max, frontend-skill
41
+ - Design-supervisor reviewers: frontend-skill, ui-ux-pro-max
42
+ - Design-supervisor review mode: screenshot-and-theme
43
+ - Design-supervisor review inputs: screenshots, pencil variables, visual thesis, content plan, interaction thesis
44
+ - Scope: visual contract refinement, mobile page composition, hierarchy and spacing, touch-first motion guidance, anchor-surface composition, Pencil design refinement
45
+ - Fallback: native-da-vinci
46
+ - Require Adapter: false
47
+ - Require Supervisor Review: false
77
48
  ```
78
49
 
79
50
  ### Variant 3: Required Supervisor Signoff
@@ -86,33 +57,14 @@ Use when:
86
57
 
87
58
  ```md
88
59
  ## Visual Assist
89
- - Preferred adapters:
90
- - frontend-skill
91
- - ui-ux-pro-max
92
- - Design-supervisor reviewers:
93
- - frontend-skill
94
- - ui-ux-pro-max
95
- - Design-supervisor review mode:
96
- - screenshot-and-theme
97
- - Design-supervisor review inputs:
98
- - screenshots
99
- - pencil variables
100
- - visual thesis
101
- - content plan
102
- - interaction thesis
103
- - Scope:
104
- - visual contract refinement
105
- - mobile page composition
106
- - hierarchy and spacing
107
- - touch-first motion guidance
108
- - anchor-surface composition
109
- - Pencil design refinement
110
- - Fallback:
111
- - native-da-vinci
112
- - Require Adapter:
113
- - true
114
- - Require Supervisor Review:
115
- - true
60
+ - Preferred adapters: frontend-skill, ui-ux-pro-max
61
+ - Design-supervisor reviewers: frontend-skill, ui-ux-pro-max
62
+ - Design-supervisor review mode: screenshot-and-theme
63
+ - Design-supervisor review inputs: screenshots, pencil variables, visual thesis, content plan, interaction thesis
64
+ - Scope: visual contract refinement, mobile page composition, hierarchy and spacing, touch-first motion guidance, anchor-surface composition, Pencil design refinement
65
+ - Fallback: native-da-vinci
66
+ - Require Adapter: true
67
+ - Require Supervisor Review: true
116
68
  ```
117
69
 
118
70
  Notes for all variants:
@@ -21,20 +21,10 @@ Use when:
21
21
 
22
22
  ```md
23
23
  ## Visual Assist
24
- - Preferred adapters:
25
- - ui-ux-pro-max
26
- - frontend-skill
27
- - Scope:
28
- - visual contract refinement
29
- - tablet page composition
30
- - hierarchy and spacing
31
- - touch-aware motion guidance
32
- - anchor-surface composition
33
- - Pencil design refinement
34
- - Fallback:
35
- - native-da-vinci
36
- - Require Adapter:
37
- - false
24
+ - Preferred adapters: ui-ux-pro-max, frontend-skill
25
+ - Scope: visual contract refinement, tablet page composition, hierarchy and spacing, touch-aware motion guidance, anchor-surface composition, Pencil design refinement
26
+ - Fallback: native-da-vinci
27
+ - Require Adapter: false
38
28
  ```
39
29
 
40
30
  ### Variant 2: Advisory Supervisor Review
@@ -46,33 +36,14 @@ Use when:
46
36
 
47
37
  ```md
48
38
  ## Visual Assist
49
- - Preferred adapters:
50
- - ui-ux-pro-max
51
- - frontend-skill
52
- - Design-supervisor reviewers:
53
- - frontend-skill
54
- - ui-ux-pro-max
55
- - Design-supervisor review mode:
56
- - screenshot-and-theme
57
- - Design-supervisor review inputs:
58
- - screenshots
59
- - pencil variables
60
- - visual thesis
61
- - content plan
62
- - interaction thesis
63
- - Scope:
64
- - visual contract refinement
65
- - tablet page composition
66
- - hierarchy and spacing
67
- - touch-aware motion guidance
68
- - anchor-surface composition
69
- - Pencil design refinement
70
- - Fallback:
71
- - native-da-vinci
72
- - Require Adapter:
73
- - false
74
- - Require Supervisor Review:
75
- - false
39
+ - Preferred adapters: ui-ux-pro-max, frontend-skill
40
+ - Design-supervisor reviewers: frontend-skill, ui-ux-pro-max
41
+ - Design-supervisor review mode: screenshot-and-theme
42
+ - Design-supervisor review inputs: screenshots, pencil variables, visual thesis, content plan, interaction thesis
43
+ - Scope: visual contract refinement, tablet page composition, hierarchy and spacing, touch-aware motion guidance, anchor-surface composition, Pencil design refinement
44
+ - Fallback: native-da-vinci
45
+ - Require Adapter: false
46
+ - Require Supervisor Review: false
76
47
  ```
77
48
 
78
49
  ### Variant 3: Required Supervisor Signoff
@@ -85,33 +56,14 @@ Use when:
85
56
 
86
57
  ```md
87
58
  ## Visual Assist
88
- - Preferred adapters:
89
- - frontend-skill
90
- - ui-ux-pro-max
91
- - Design-supervisor reviewers:
92
- - frontend-skill
93
- - ui-ux-pro-max
94
- - Design-supervisor review mode:
95
- - screenshot-and-theme
96
- - Design-supervisor review inputs:
97
- - screenshots
98
- - pencil variables
99
- - visual thesis
100
- - content plan
101
- - interaction thesis
102
- - Scope:
103
- - visual contract refinement
104
- - tablet page composition
105
- - hierarchy and spacing
106
- - touch-aware motion guidance
107
- - anchor-surface composition
108
- - Pencil design refinement
109
- - Fallback:
110
- - native-da-vinci
111
- - Require Adapter:
112
- - true
113
- - Require Supervisor Review:
114
- - true
59
+ - Preferred adapters: frontend-skill, ui-ux-pro-max
60
+ - Design-supervisor reviewers: frontend-skill, ui-ux-pro-max
61
+ - Design-supervisor review mode: screenshot-and-theme
62
+ - Design-supervisor review inputs: screenshots, pencil variables, visual thesis, content plan, interaction thesis
63
+ - Scope: visual contract refinement, tablet page composition, hierarchy and spacing, touch-aware motion guidance, anchor-surface composition, Pencil design refinement
64
+ - Fallback: native-da-vinci
65
+ - Require Adapter: true
66
+ - Require Supervisor Review: true
115
67
  ```
116
68
 
117
69
  Notes for all variants:
@@ -21,20 +21,10 @@ Use when:
21
21
 
22
22
  ```md
23
23
  ## Visual Assist
24
- - Preferred adapters:
25
- - ui-ux-pro-max
26
- - frontend-skill
27
- - Scope:
28
- - visual contract refinement
29
- - page composition
30
- - hierarchy and spacing
31
- - responsive motion guidance
32
- - anchor-surface composition
33
- - Pencil design refinement
34
- - Fallback:
35
- - native-da-vinci
36
- - Require Adapter:
37
- - false
24
+ - Preferred adapters: ui-ux-pro-max, frontend-skill
25
+ - Scope: visual contract refinement, page composition, hierarchy and spacing, responsive motion guidance, anchor-surface composition, Pencil design refinement
26
+ - Fallback: native-da-vinci
27
+ - Require Adapter: false
38
28
  ```
39
29
 
40
30
  ### Variant 2: Advisory Supervisor Review
@@ -46,33 +36,14 @@ Use when:
46
36
 
47
37
  ```md
48
38
  ## Visual Assist
49
- - Preferred adapters:
50
- - ui-ux-pro-max
51
- - frontend-skill
52
- - Design-supervisor reviewers:
53
- - frontend-skill
54
- - ui-ux-pro-max
55
- - Design-supervisor review mode:
56
- - screenshot-and-theme
57
- - Design-supervisor review inputs:
58
- - screenshots
59
- - pencil variables
60
- - visual thesis
61
- - content plan
62
- - interaction thesis
63
- - Scope:
64
- - visual contract refinement
65
- - page composition
66
- - hierarchy and spacing
67
- - responsive motion guidance
68
- - anchor-surface composition
69
- - Pencil design refinement
70
- - Fallback:
71
- - native-da-vinci
72
- - Require Adapter:
73
- - false
74
- - Require Supervisor Review:
75
- - false
39
+ - Preferred adapters: ui-ux-pro-max, frontend-skill
40
+ - Design-supervisor reviewers: frontend-skill, ui-ux-pro-max
41
+ - Design-supervisor review mode: screenshot-and-theme
42
+ - Design-supervisor review inputs: screenshots, pencil variables, visual thesis, content plan, interaction thesis
43
+ - Scope: visual contract refinement, page composition, hierarchy and spacing, responsive motion guidance, anchor-surface composition, Pencil design refinement
44
+ - Fallback: native-da-vinci
45
+ - Require Adapter: false
46
+ - Require Supervisor Review: false
76
47
  ```
77
48
 
78
49
  ### Variant 3: Required Supervisor Signoff
@@ -85,33 +56,14 @@ Use when:
85
56
 
86
57
  ```md
87
58
  ## Visual Assist
88
- - Preferred adapters:
89
- - frontend-skill
90
- - ui-ux-pro-max
91
- - Design-supervisor reviewers:
92
- - frontend-skill
93
- - ui-ux-pro-max
94
- - Design-supervisor review mode:
95
- - screenshot-and-theme
96
- - Design-supervisor review inputs:
97
- - screenshots
98
- - pencil variables
99
- - visual thesis
100
- - content plan
101
- - interaction thesis
102
- - Scope:
103
- - visual contract refinement
104
- - page composition
105
- - hierarchy and spacing
106
- - responsive motion guidance
107
- - anchor-surface composition
108
- - Pencil design refinement
109
- - Fallback:
110
- - native-da-vinci
111
- - Require Adapter:
112
- - true
113
- - Require Supervisor Review:
114
- - true
59
+ - Preferred adapters: frontend-skill, ui-ux-pro-max
60
+ - Design-supervisor reviewers: frontend-skill, ui-ux-pro-max
61
+ - Design-supervisor review mode: screenshot-and-theme
62
+ - Design-supervisor review inputs: screenshots, pencil variables, visual thesis, content plan, interaction thesis
63
+ - Scope: visual contract refinement, page composition, hierarchy and spacing, responsive motion guidance, anchor-surface composition, Pencil design refinement
64
+ - Fallback: native-da-vinci
65
+ - Require Adapter: true
66
+ - Require Supervisor Review: true
115
67
  ```
116
68
 
117
69
  Notes for all variants:
@@ -85,19 +85,20 @@ Expected flow:
85
85
  7. write the visual thesis, content plan, interaction thesis, and structural-delta notes for the anchor surfaces
86
86
  8. create new or updated Pencil pages from fresh composition rather than a recolor of the old UI, preferring persistence under `.da-vinci/designs/`
87
87
  9. preflight non-trivial `batch_design` operation strings before sending them to Pencil, and keep anchor-surface batches small
88
- 10. if the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds
89
- 11. require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit so the registered `.pen` is seeded and the global Pencil lock is held
90
- 12. during live design work, use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material edits, then end with `da-vinci pencil-session end ...`
91
- 13. verify the registered project-local `.pen` path becomes shell-visible immediately after the first successful Pencil write
92
- 14. run `da-vinci audit --mode integrity <project-path>` immediately after that first successful write
93
- 15. if Pencil MCP is active, run the MCP runtime gate and record it in `pencil-design.md`
94
- 16. run `design-source checkpoint` to confirm the registered project-local `.pen` path, the active Pencil source, and the shell-visible file all agree
95
- 17. export screenshots only under `.da-vinci/changes/<change-id>/exports/`, never into `.da-vinci/designs/`
96
- 18. record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome before broad expansion
97
- 19. bind routes and pages to Pencil screens
98
- 20. generate tasks aligned to the redesign slices
99
- 21. run `da-vinci audit --mode completion --change <change-id> <project-path>` before any terminal completion claim
100
- 22. build and verify only after the completion gate can eventually pass
88
+ 10. for functional icons, run `da-vinci icon-sync` then `da-vinci icon-search --query "<intent>"` to pick `icon_font` names before writing icon nodes
89
+ 11. if the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds
90
+ 12. require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit so the registered `.pen` is seeded and the global Pencil lock is held
91
+ 13. during live design work, use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material edits, then end with `da-vinci pencil-session end ...`
92
+ 14. verify the registered project-local `.pen` path becomes shell-visible immediately after the first successful Pencil write
93
+ 15. run `da-vinci audit --mode integrity <project-path>` immediately after that first successful write
94
+ 16. if Pencil MCP is active, run the MCP runtime gate and record it in `pencil-design.md`
95
+ 17. run `design-source checkpoint` to confirm the registered project-local `.pen` path, the active Pencil source, and the shell-visible file all agree
96
+ 18. export screenshots only under `.da-vinci/changes/<change-id>/exports/`, never into `.da-vinci/designs/`
97
+ 19. record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome before broad expansion
98
+ 20. bind routes and pages to Pencil screens
99
+ 21. generate tasks aligned to the redesign slices
100
+ 22. run `da-vinci audit --mode completion --change <change-id> <project-path>` before any terminal completion claim
101
+ 23. build and verify only after the completion gate can eventually pass
101
102
 
102
103
  ### Complex Android example
103
104
 
@@ -191,6 +192,21 @@ If no registered project-local `.pen` exists yet, seed it there before the first
191
192
  If a registered project-local `.pen` already exists, reopen it for continuity but overwrite it from the current MCP snapshot after material live edits.
192
193
  ```
193
194
 
195
+ ## Icon-library helper example
196
+
197
+ Use:
198
+
199
+ ```text
200
+ da-vinci icon-sync
201
+ cp references/icon-aliases.example.json ~/.da-vinci/icon-aliases.json
202
+ da-vinci icon-search --query "保险箱 解密 重试" --family material --top 8
203
+ ```
204
+
205
+ Notes:
206
+
207
+ - use `icon-sync --strict` only in CI or explicit hard-gate workflows
208
+ - keep icon-family consistency per anchor surface unless there is a deliberate rationale
209
+
194
210
  ## Cross-mode rule
195
211
 
196
212
  In every mode:
@@ -12,6 +12,7 @@ Use it when you need the high-level delivery chain:
12
12
 
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
+ 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.
15
16
 
16
17
  ## Core Contract
17
18
 
@@ -115,6 +116,7 @@ Anchor surfaces must:
115
116
  - include structural-delta notes for redesign-from-code
116
117
  - stay aligned with the approved `migration-contract.md`, `page-map.md`, and new `specs/` when the active mode is `overhaul-from-code`
117
118
  - go through screenshot review
119
+ - resolve functional icon names with `da-vinci icon-sync` + `da-vinci icon-search` when shell access is available
118
120
  - satisfy the active form-factor layout-hygiene profile
119
121
  - pass the design checkpoint before broad expansion
120
122
  - run `design-supervisor review` when `DA-VINCI.md` configures `Design-supervisor reviewers`, and treat it as blocking only when `Require Supervisor Review: true`
@@ -0,0 +1,111 @@
1
+ # 约束文件说明
2
+
3
+ > 中文配套文档。若与英文原文存在差异,请以 `docs/constraint-files.md` 为准。
4
+
5
+ 这份文档用于统一说明 Da Vinci 的约束文件,以及哪些字段是机器硬门禁,哪些只是设计指导。
6
+
7
+ 适合在你需要确认下面问题时阅读:
8
+
9
+ - 约束写在哪些文件
10
+ - 哪些内容可以自由定制
11
+ - 哪些字段会阻断 completion
12
+
13
+ ## 约束文件地图
14
+
15
+ - `DA-VINCI.md`:项目级视觉与工作流契约
16
+ - `.da-vinci/design-registry.md`:项目内优先 `.pen` 路径与设计源归属
17
+ - `.da-vinci/changes/<change-id>/design-brief.md`:form-factor、视觉方向、layout-hygiene 重点
18
+ - `.da-vinci/changes/<change-id>/design.md`:设计计划与构图决策
19
+ - `.da-vinci/changes/<change-id>/pencil-design.md`:实时设计记录、截图评审、门禁证据
20
+ - `.da-vinci/changes/<change-id>/pencil-bindings.md`:实现页面到 Pencil 页面的绑定
21
+ - `.da-vinci/changes/<change-id>/tasks.md`:实现任务拆分
22
+ - `.da-vinci/changes/<change-id>/verification.md`:验证与漂移总结
23
+
24
+ ## 硬门禁字段(机器解析)
25
+
26
+ 当前审计会解析特定字段名。以下字段建议保持稳定。
27
+
28
+ ### `DA-VINCI.md` -> `## Visual Assist`
29
+
30
+ - `Preferred adapters`
31
+ - `Design-supervisor reviewers`
32
+ - `Design-supervisor review mode`
33
+ - `Design-supervisor review inputs`
34
+ - `Scope`
35
+ - `Fallback`
36
+ - `Require Adapter`
37
+ - `Require Supervisor Review`
38
+
39
+ 当 `Require Supervisor Review: true` 时,缺失或阻断的 supervisor review 会卡住 completion。
40
+
41
+ ### `pencil-design.md` -> `## Design-Supervisor Review`
42
+
43
+ - `Status`
44
+ - `Issue list`
45
+ - `Revision outcome`
46
+
47
+ 当 supervisor review 是必需时,缺失或 `BLOCK` 的评审证据会阻断 completion。
48
+
49
+ ## 指导型约束段(可定制)
50
+
51
+ 你可以增加任意自定义段作为项目指导。默认不会成为硬门禁,除非你额外实现自定义检查。
52
+
53
+ 图标指导当前也属于这个层级:`dv:` 路由本身没有独立的 Pencil 图标检索 API,通常通过显式 `icon_font` 约束 + 截图复核来收敛质量,再配合 CLI 图标检索能力。
54
+ 如果有 shell 能力,建议先运行 `da-vinci icon-sync` 同步官方图标名,再运行 `da-vinci icon-search --query "<关键词>"`,先收敛 `iconFontFamily` + `iconFontName`,再写入 `batch_design`。`icon-sync` 默认对上游部分失败不阻塞(会显示 `Status: DEGRADED`);只有在 CI 里确实需要强门禁时再加 `--strict`。
55
+ 如果有业务语义词,建议补充 `~/.da-vinci/icon-aliases.json`(可用 `references/icon-aliases.example.json` 作为起点),让 `保险箱`、`解密`、`重试` 这类词自动扩展成更稳定的图标检索词。
56
+
57
+ 推荐示例:
58
+
59
+ ```md
60
+ ## Icon System Guidance (Advisory)
61
+ - Goal: improve icon consistency and visual quality without blocking delivery.
62
+ - Source: functional icons should prefer `icon_font`.
63
+ - Allowed families: `Material Symbols Rounded`, `lucide`, `feather`, `phosphor`.
64
+ - Default family: `Material Symbols Rounded`.
65
+ - Default spec: `24x24`, `weight 700` (when supported), unified color token per surface.
66
+ - Reuse rule: prefer reusable `Icon/*` components, then `ref` reuse.
67
+ - Placeholder policy: avoid placeholder geometry for functional icons.
68
+ - Review requirement: each anchor screenshot review should include an `icon consistency` note.
69
+ - Checkpoint policy: icon inconsistency => `WARN` (not `BLOCK`), then fix in next visual pass.
70
+ ```
71
+
72
+ 落地使用建议:
73
+
74
+ 1. 把这一段直接复制到项目根目录 `DA-VINCI.md`。
75
+ 2. 默认先保持指导型(`WARN`),只有明确签收流程才升级成硬门禁。
76
+ 3. `da-vinci icon-sync` 作为周期性缓存刷新使用,不需要每次 design 都执行。
77
+ 4. 只有在图标语义不明确、图标质量漂移、或出现新业务词时,再执行 `da-vinci icon-search`。
78
+ 5. 每个 anchor 的截图评审在 `pencil-design.md` 里至少记录一条 `icon consistency` 结论。
79
+
80
+ 字段解释:
81
+
82
+ - `Goal`:本项目希望达到的图标质量目标。
83
+ - `Source`:功能图标的来源约束,通常要求优先 `icon_font`。
84
+ - `Allowed families`:项目允许的图标家族范围。
85
+ - `Default family`:默认首选家族,用于避免混用漂移。
86
+ - `Default spec`:默认尺寸、字重、颜色 token 规则。
87
+ - `Reuse rule`:是否要求先沉淀可复用 Icon 组件再扩屏。
88
+ - `Placeholder policy`:哪些占位图标行为不可接受。
89
+ - `Review requirement`:评审时必须显式检查什么。
90
+ - `Checkpoint policy`:问题严重度(`WARN` / `BLOCK`)和回改预期。
91
+
92
+ 最小模板(推荐默认):
93
+
94
+ ```md
95
+ ## Icon System Guidance (Advisory)
96
+ - Goal: improve icon consistency and visual quality without blocking delivery.
97
+ - Source: functional icons should prefer `icon_font`.
98
+ - Allowed families: `Material Symbols Rounded`, `lucide`, `feather`, `phosphor`.
99
+ - Default family: `Material Symbols Rounded`.
100
+ - Default spec: `24x24`, `weight 700` (when supported), unified color token per surface.
101
+ - Reuse rule: prefer reusable `Icon/*` components, then `ref` reuse.
102
+ - Placeholder policy: avoid placeholder geometry for functional icons.
103
+ - Review requirement: each anchor screenshot review should include an `icon consistency` note.
104
+ - Checkpoint policy: icon inconsistency => `WARN` (not `BLOCK`), then fix in next visual pass.
105
+ ```
106
+
107
+ ## 推荐默认值
108
+
109
+ - 除非确实需要 reviewer 签字,否则保持 `Require Supervisor Review: false`
110
+ - 默认把图标策略作为指导型约束(`WARN`)
111
+ - 只有在明确签收流程里,才把图标问题升级成硬门禁
@@ -35,6 +35,23 @@ Da Vinci 期望它们遵循工作流状态。
35
35
 
36
36
  这些辅助入口负责选路和续跑,不是主状态机本身。
37
37
 
38
+ ## 路由外的辅助 CLI 能力
39
+
40
+ 这些命令不会替代 `dv:` 选路,但能显著提升设计执行质量:
41
+
42
+ - `da-vinci icon-sync`
43
+ - 同步官方图标名(Material Symbols、Lucide、Feather、Phosphor)到 `~/.da-vinci/icon-catalog.json`
44
+ - 默认是用户级范围(当前 HOME),同一用户可跨项目复用
45
+ - 当上游图标库更新或需要最新新增图标时,应重新执行
46
+ - 默认对上游部分失败不阻塞(`Status: DEGRADED`)
47
+ - 只有在 CI 需要强门禁时才加 `--strict`
48
+ - 需要项目隔离时可用 `--catalog <path>` 指定项目级 catalog
49
+ - `da-vinci icon-search --query "<关键词>" [--family ...] [--top ...] [--aliases ...]`
50
+ - 在写 Pencil `batch_design` 前先收敛可用的 `icon_font` 名称
51
+ - 支持中英文混合词,并可通过 `~/.da-vinci/icon-aliases.json` 做语义扩展
52
+
53
+ 建议在 `/dv:design` 阶段使用,尤其是在 anchor surface 的图标定稿前。
54
+
38
55
  ## 每个路由的含义
39
56
 
40
57
  ### `/dv:intake`
@@ -85,6 +102,7 @@ Da Vinci 期望它们遵循工作流状态。
85
102
  - 这时候不应该把 `build` 当成同级主推荐
86
103
  - 选路必须先基于工件和 checkpoint 真相,再参考 Context Delta
87
104
  - 如果 Context Delta 与当前工件冲突,选路时应忽略冲突条目并记录冲突
105
+ - 当设计门禁还未收敛时,不应路由到 `build`:包括缺少 shell 可见的项目本地 `.pen`、Pencil session 仍为 active/unclosed、runtime 或 design-source checkpoint 仍是 `BLOCK`、或必需的 design-supervisor review 仍是 `BLOCK`/未接受
88
106
 
89
107
  ### `/dv:breakdown`
90
108
 
@@ -154,6 +172,12 @@ Da Vinci 期望它们遵循工作流状态。
154
172
 
155
173
  这一层才是真正的执行阶段。
156
174
 
175
+ 完成判定规则:
176
+
177
+ - `BUILD SUCCESSFUL` 只代表可编译,不代表 workflow 完成
178
+ - 只要 in-scope task groups 还没做完,就不能宣告 `design complete` 或 `workflow complete`
179
+ - 任何终态声明前都要运行 `da-vinci audit --mode completion --change <change-id> <project-path>` 并通过
180
+
157
181
  ### `/dv:verify`
158
182
 
159
183
  适合: