architext 0.0.4 → 0.0.5

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 (56) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/README.md +84 -7
  3. package/README.zh-CN.md +84 -7
  4. package/dist/index.js +38 -38
  5. package/dist/templates/en/briefs/_base.md +44 -11
  6. package/dist/templates/en/briefs/_modules.md +31 -4
  7. package/dist/templates/en/docs/prompts/audit.md +80 -94
  8. package/dist/templates/en/docs/prompts/code.md +87 -89
  9. package/dist/templates/en/docs/prompts/edit.md +47 -51
  10. package/dist/templates/en/docs/prompts/fix.md +49 -42
  11. package/dist/templates/en/docs/prompts/help.md +23 -31
  12. package/dist/templates/en/docs/prompts/inherit.md +91 -116
  13. package/dist/templates/en/docs/prompts/map.md +47 -69
  14. package/dist/templates/en/docs/prompts/plan.md +134 -239
  15. package/dist/templates/en/docs/prompts/recover.md +19 -34
  16. package/dist/templates/en/docs/prompts/ref.md +43 -138
  17. package/dist/templates/en/docs/prompts/remove.md +55 -107
  18. package/dist/templates/en/docs/prompts/revise.md +63 -106
  19. package/dist/templates/en/docs/prompts/scope.md +77 -117
  20. package/dist/templates/en/docs/prompts/start.md +89 -129
  21. package/dist/templates/en/rules/00_system.md +36 -79
  22. package/dist/templates/en/rules/01_workflow.md +59 -57
  23. package/dist/templates/en/rules/03_data_governance.md +46 -42
  24. package/dist/templates/en/skills/archi-data-sync/SKILL.md +12 -12
  25. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +3 -34
  26. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +1 -0
  27. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +4 -4
  28. package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -1
  29. package/dist/templates/en/skills/archi-plan-options/SKILL.md +4 -3
  30. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +20 -20
  31. package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
  32. package/dist/templates/zh/briefs/_base.md +44 -12
  33. package/dist/templates/zh/briefs/_modules.md +27 -0
  34. package/dist/templates/zh/docs/prompts/audit.md +42 -56
  35. package/dist/templates/zh/docs/prompts/code.md +47 -49
  36. package/dist/templates/zh/docs/prompts/edit.md +38 -42
  37. package/dist/templates/zh/docs/prompts/fix.md +30 -29
  38. package/dist/templates/zh/docs/prompts/help.md +13 -21
  39. package/dist/templates/zh/docs/prompts/inherit.md +59 -83
  40. package/dist/templates/zh/docs/prompts/map.md +24 -47
  41. package/dist/templates/zh/docs/prompts/plan.md +92 -197
  42. package/dist/templates/zh/docs/prompts/recover.md +9 -24
  43. package/dist/templates/zh/docs/prompts/ref.md +11 -106
  44. package/dist/templates/zh/docs/prompts/remove.md +31 -71
  45. package/dist/templates/zh/docs/prompts/revise.md +37 -86
  46. package/dist/templates/zh/docs/prompts/scope.md +51 -91
  47. package/dist/templates/zh/docs/prompts/start.md +67 -106
  48. package/dist/templates/zh/rules/00_system.md +18 -91
  49. package/dist/templates/zh/rules/01_workflow.md +60 -59
  50. package/dist/templates/zh/rules/03_data_governance.md +41 -68
  51. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +2 -33
  52. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +1 -0
  53. package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
  54. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +1 -0
  55. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
  56. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: archi-ui-wireframe
3
- description: UI concept design expert. Generates ui_concept.html in two phases — Phase 1 outputs a grayscale wireframe (validates information architecture and screen coverage); Phase 2 applies visual styling from design_tokens.json (colors / typography / motion / illustration). The output is the single visual source of truth for the entire project UI; all Task-level ui.md files reference this file for their screen scope.
3
+ type: subagent
4
+ description: UI concept design expert. Generates hi-fi ui_concept.html — when tokens are sufficient, outputs colored hi-fi design directly; when tokens are incomplete, guides user to fill them first. Supports adopt mode to reverse-capture UI state from existing code. The output is the single visual source of truth for the entire project UI; all Task-level ui.md files reference this file for their screen scope.
4
5
  ---
5
6
 
6
7
  # UI Concept Design
@@ -14,6 +15,12 @@ description: UI concept design expert. Generates ui_concept.html in two phases
14
15
  reads: vision.md + roadmap.json + design_tokens.json + 02_tech_stack.md
15
16
  writes: [[__DOCS_DIR__]]/global/ui_concept.html
16
17
 
18
+ /archi.inherit → code analysis + design_tokens.json
19
+
20
+ [This Skill] archi-ui-wireframe (adopt mode)
21
+ reads: code routes/components/layouts + design_tokens.json
22
+ writes: [[__DOCS_DIR__]]/global/ui_concept.html
23
+
17
24
  /archi.plan <ID>
18
25
  reads: ui_concept.html (locates screens/components this task covers)
19
26
  writes: ui.md (scope declaration only — no global layout duplication)
@@ -32,311 +39,349 @@ description: UI concept design expert. Generates ui_concept.html in two phases
32
39
  | Mode | Trigger source | Scope |
33
40
  |:---|:---|:---|
34
41
  | Initial generation | After `/archi.start` completes | Full generation — all screens |
42
+ | Reverse adoption | After `/archi.inherit` completes | Reverse-generate all screens from code routes/components |
35
43
  | Regeneration | Manual user invocation | Full rewrite (global UI redesign) |
36
44
  | Append screens | After `/archi.scope` adds new tasks | Add new pages only; existing pages untouched |
37
45
  | Plan refinement | `/archi.plan` discovers UI divergence | Update only the affected screen (new states / sub-screens / layout corrections) |
38
46
  | Modify screens | After `/archi.edit` changes a task | Update only affected screens; leave others intact |
39
47
  | Remove screens | After `/archi.remove` retires a task | Remove corresponding screens and control bar entries |
40
48
 
41
- > **Phase 2 (visual styling) timing**: Phase 2 does not need to immediately follow Phase 1. Recommended to run after core tasks (≥ 50% of Roadmap tasks) have completed planning, ensuring the styled prototype is based on a stable screen structure. If a screen is updated by Plan Refinement after Phase 2, only that screen needs re-styling — a full Phase 2 rerun is not required.
42
-
43
49
  ---
44
50
 
45
- ## Two-Phase Protocol
51
+ ## Generation Protocol
46
52
 
47
- ### Phase 1 — Wireframe (Low-fi)
53
+ ### Step 1 — Load Context
48
54
 
49
- **Role**: Information Architect
55
+ **Action**:
56
+ - `vision.md` → extract: target platform, user roles, north-star metric
57
+ - `roadmap.json` → extract: all UI tasks, map to screen/state list
58
+ - `design_tokens.json` → extract: `mode.default`, `illustration.iconLibrary`, aesthetic direction
59
+ - Rule file `02_tech_stack` → extract: target platform (Web/Mobile/Desktop), navigation framework
50
60
 
51
- **Goal**: Validate screen coverage completeness and navigation structure; visual details deferred to Phase 2.
61
+ ### Step 2 Plan Screen Inventory
52
62
 
53
- **Action**:
63
+ (Internal step, do not output to user):
54
64
 
55
- 1. **Load context**:
56
- - `[[__DOCS_DIR__]]/global/vision.md` → extract: target platform, user roles, north-star metric
57
- - `[[__DOCS_DIR__]]/global/roadmap.json` extract: all [?UI] tasks, map to screen/state list
58
- - `[[__DOCS_DIR__]]/global/design_tokens.json` extract: `mode.default`, `illustration.iconLibrary`
59
- - Rule file `02_tech_stack` → extract: target platform (Web/Mobile/Desktop), navigation framework
60
-
61
- 2. **Plan screen inventory** (internal step, do not output to user):
62
-
63
- | Screen ID | Screen name | Roadmap task | State list |
64
- |:---|:---|:---|:---|
65
- | S-01 | [name] | [task ID] | default, loading, empty, error |
66
- | ... | | | |
67
-
68
- > **Screen ID Stability Rule** (CRITICAL): Screen IDs are permanent once assigned. Deleted screen IDs are retired — new screens must use new IDs (e.g., after S-07 is deleted, the next screen is S-08, not S-07). Never reuse or renumber existing IDs. All `ui.md` files reference screens by ID; any ID change will break those references.
69
-
70
- 3. **Select HTML skeleton spec** (auto-adapt by target platform):
71
-
72
- | Platform | Viewport | Top bar | Navigation |
73
- |:---|:---|:---|:---|
74
- | Web / Desktop SaaS | 1280×800px | Fixed header | Left sidebar |
75
- | Web / Marketing | 1440×900px | Transparent→fixed header | Top horizontal nav |
76
- | Mobile Web / Mini-app | 390×844px | Status bar + nav bar | Bottom TabBar |
77
- | Tablet / Dashboard | 1024×768px | Fixed header | Collapsible sidebar |
78
-
79
- > Platform inferred from `02_tech_stack` or vision.md target device; default to Web / Desktop SaaS if unclear.
80
-
81
- 4. **Generate wireframe HTML** — write to `[[__DOCS_DIR__]]/global/ui_concept.html`:
82
-
83
- **HTML structure spec**:
84
- ```
85
- <html>
86
- <head>
87
- <!-- Inline CSS: wireframe style (grayscale, no brand colors) -->
88
- <!-- Wireframe palette: bg=#f5f5f5, surface=#fff, border=#d0d0d0,
89
- text=#333, muted=#888, accent=#555 -->
90
- </head>
91
- <body style="margin:0; display:flex; flex-direction:column; height:100vh; overflow:hidden;">
92
- <!-- Top bar: project name + current screen path (fixed, not scrollable) -->
93
- <header class="wf-topbar">...</header>
94
-
95
- <!-- Content area: scrollable, renders currently active screen -->
96
- <main class="wf-content" style="flex:1; overflow:auto;">
97
- <!-- Each screen: <section class="wf-screen" id="S-XX" data-states="default,loading,empty,error"> -->
98
- <!-- Each state: <div class="wf-state" data-state="default"> -->
99
- </main>
100
-
101
- <!-- Control bar: left=state switch, center=file label, right=page switch (fixed bottom, wireframe style) -->
102
- <footer class="wf-ctrl-bar">
103
- <div class="ctrl-group">
104
- <span class="ctrl-lbl">STATE</span>
105
- <!-- State pills for current screen, rendered by JS -->
106
- </div>
107
- <div class="wf-file-label">Low-fi Wireframe · [Project Name]</div>
108
- <div class="ctrl-group">
109
- <span class="ctrl-lbl">PAGE</span>
110
- <!-- All screen page pills, rendered by JS -->
111
- </div>
112
- </footer>
113
- </body>
114
- </html>
115
- ```
116
-
117
- **Element labeling spec** (`data-el` attribute):
118
- - Every interactive element or semantic block must have `data-el="[user-language label]"`
119
- - Label language = Brief's primary language (Chinese project → Chinese labels, English project → English)
120
- - Labels shown on hover via CSS `::before`, hidden by default
121
- - When a parent is hovered, child labels auto-hide via `:has([data-el]:hover)::before { opacity:0 }`
122
-
123
- **Interaction spec** (CSS + minimal JS, no external dependencies):
124
- - Page switch: click PAGE pill → toggle `.wf-screen` display; JS syncs STATE pills
125
- - State switch: click STATE pill → toggle `.wf-state` display within current screen
126
- - Active style: `.pill.on-page` / `.pill.on-state` → `background:#444; color:#fff`
127
- - Control bar must stay wireframe-style (grayscale, uppercase label, dashed border-top); no color
128
-
129
- **Wireframe content rules** (Content Wireframe — grayscale with real-feeling content):
130
- - Full grayscale; brand colors deferred to Phase 2
131
- - **No pure gray rectangle placeholders** — use realistic placeholder content so users can genuinely evaluate whether the layout works:
132
-
133
- | Element type | Rule |
134
- |:---|:---|
135
- | Headings / nav labels | Use real business names from roadmap task titles, e.g. "Dashboard", "Project List", "Settings" |
136
- | Buttons | Write specific action text, e.g. "Create Project", "Sign In", "Save Changes" — never write "[Button]" |
137
- | Inputs | Write placeholder text, e.g. "Search project name…", "Enter email address" |
138
- | Lists / tables | Generate at least 3–4 rows of example data (realistic fake data in the project's domain: names, dates, statuses) |
139
- | Chart / image areas | Use labeled rectangles, but label with the actual content type, e.g. "Line chart: visits last 7 days" not "[Chart]" |
140
- | Empty state | Write specific empty state copy, e.g. "No projects yet — click 'Create Project' to get started" |
141
- | Error state | Write specific error copy, e.g. "Connection failed. Please check your network and try again" |
142
-
143
- - Typography must have hierarchy: page title large (20–24px) → section heading medium (16px) → body small (14px) → caption smaller (12px)
144
- - Spacing must breathe: component gap > element gap > line height (no crowding)
145
- - Each screen must include all core interaction entry points from its Roadmap task
146
-
147
- 5. **Generate AI Index** — write `[[__DOCS_DIR__]]/global/ui_context.md`:
148
-
149
- Extract a structured navigation index from the screen plan in step 2 (the sole AI entry point for UI structure):
150
-
151
- ```markdown
152
- # UI Context
153
- > Platform: [platform] | Phase: Phase 1 Wireframe (updated after Phase 2 coloring)
154
- > Updated: YYYY-MM-DD | Generated by archi-ui-wireframe Skill — do not edit manually
155
-
156
- ## Screen Inventory
157
- | ID | Name | Route | States |
158
- |:---|:---|:---|:---|
159
- | S-01 | [name] | [route] | default, loading, ... |
160
-
161
- ## Navigation Graph
162
- S-XX →([trigger])→ S-YY
163
-
164
- ## Global Shared Components
165
- | Component | Appears On |
166
- |:---|:---|
167
- | [component] | S-XX, S-YY |
168
-
169
- ## Screen Structure Summary
170
- > Extracted from wireframe data-el in Phase 1; refreshed to final layout after Phase 2 coloring.
171
- > When writing ui.md Section 2, align with this section — do not invent layout that diverges from confirmed structure.
172
-
173
- ### S-XX · [Screen name]
174
- **Layout**: [e.g. "centered single-column max-w-400px" or "240px left sidebar + right content area"]
175
- **States**: default ([core entry points]) | loading (skeleton) | empty / error (if applicable)
176
- **Key regions**: [semantic blocks + interactive elements from data-el, e.g.: top nav bar, main form area, submit button, error message area]
177
- ```
178
-
179
- > `ui_context.md` is the sole entry point for all AI commands reading UI structure; `ui_concept.html` is for human browser preview only.
180
-
181
- 6. **Output Gate**:
182
-
183
- After generating the wireframe, output screen coverage summary:
184
- ```
185
- ### ui_concept.html generated (Phase 1 Wireframe)
186
- ### ui_context.md generated (AI screen index)
187
-
188
- **Screen coverage** (N screens total):
189
- | Screen | Name | States |
190
- |:---|:---|:---|
191
- | S-01 | [name] | N |
192
- | ... | | |
193
-
194
- **Navigation structure**: [e.g. "Left sidebar + top breadcrumb"]
195
- **Platform**: [Web Desktop 1280px / Mobile 390px / ...]
196
-
197
- > Open `[[__DOCS_DIR__]]/global/ui_concept.html` in a browser to verify information architecture.
198
- > Reply **OK** to proceed to Phase 2 visual styling; or describe layout/screen adjustments needed.
199
- ```
200
-
201
- **Gate**: Phase 2 starts only after user replies **OK**; no styling until confirmed.
65
+ | Screen ID | Screen name | Roadmap task | State list |
66
+ |:---|:---|:---|:---|
67
+ | S-01 | [name] | [task ID] | default, loading, empty, error |
68
+ | ... | | | |
202
69
 
203
- ---
70
+ > **Screen ID Stability Rule** (CRITICAL): Screen IDs are permanent once assigned. Deleted screen IDs are retired — new screens must use new IDs (e.g., after S-07 is deleted, the next screen is S-08, not S-07). Never reuse or renumber existing IDs. All `ui.md` files reference screens by ID; any ID change will break those references.
204
71
 
205
- ### Phase 1.5Wireframe Refinement (optional)
72
+ ### Step 3Select HTML Skeleton Spec
206
73
 
207
- **Role**: Consulting Advisor
208
- **Trigger**: User reply is not OK — contains layout adjustments, screen additions/removals, navigation changes.
209
- **Action**: Incorporate feedback, update only the affected parts of `ui_concept.html` (no full rewrite), sync `ui_context.md` (keep screen index consistent with `ui_concept.html`), re-display summary, await confirmation.
74
+ (Auto-adapt by target platform):
210
75
 
211
- ---
76
+ | Platform | Viewport | Top bar | Navigation |
77
+ |:---|:---|:---|:---|
78
+ | Web / Desktop SaaS | 1280×800px | Fixed header | Left sidebar |
79
+ | Web / Marketing | 1440×900px | Transparent→fixed header | Top horizontal nav |
80
+ | Mobile Web / Mini-app | 390×844px | Status bar + nav bar | Bottom TabBar |
81
+ | Tablet / Dashboard | 1024×768px | Fixed header | Collapsible sidebar |
82
+
83
+ > Platform inferred from `02_tech_stack` or vision.md target device; default to Web / Desktop SaaS if unclear.
84
+
85
+ ### Step 4 — Tokens Prerequisite Check + Guidance
86
+
87
+ Read `design_tokens.json` and check key field completeness:
212
88
 
213
- ### Phase 2 Visual Styling (Hi-fi Coloring)
89
+ | Field path | Pass condition | When insufficient |
90
+ |:---|:---|:---|
91
+ | `aestheticDirection.preset` | Non-empty | Include in guidance Q1 |
92
+ | `primitivePalette.brand` | At least 1 non-empty color value | Include in guidance Q2 |
93
+ | `semanticTokens.colors` | At least `bg`/`surface`/`text` semantic mappings | Include in guidance Q2 |
94
+ | `semanticTokens.typography` | At least 1 font family declaration | AI picks from aesthetic direction (non-blocking) |
95
+ | `motion.preference` | Non-empty | Defaults to `subtle` (non-blocking) |
96
+ | `illustration.iconLibrary` | Non-empty | Fall back to self-drawn inline SVG (non-blocking); emoji substitution forbidden |
214
97
 
215
- **Role**: You are a visual designer with a strong personal style. You don't follow conventions — you think in feelings, textures, and rhythm, not components and layouts. You pursue not "correct" but "makes someone stop and look twice." Every decision is intentional: spacing is never arbitrary, colors are never defaults, fonts are never the first in the list. You combine an artist's intuition with an engineer's precision.
98
+ **Tokens sufficient** proceed directly to Step 5 hi-fi generation.
216
99
 
217
- **Goal**: Style the confirmed wireframe into a hi-fi prototype that has identity opening it should immediately signal this was designed for THIS project, not generated from a template.
100
+ **Tokens insufficient** output structured guidance questions (max 3), then AI auto-fills tokens after user answers:
218
101
 
219
- **Prerequisite check** (must validate before styling):
102
+ ```
103
+ ### Visual Style Confirmation
220
104
 
221
- | Field path | Pass condition | Blocking action |
105
+ **[Q1] Aesthetic direction**
106
+ | ID | Option | Reference products |
222
107
  |:---|:---|:---|
223
- | `aestheticDirection.preset` | Non-empty | Warning (non-blocking) — AI infers from project context, notes inference in output |
224
- | `primitivePalette.brand` | At least 1 non-empty color value | Blocking prompt user to fill brand color |
225
- | `semanticTokens.colors` | At least `bg`/`surface`/`text` semantic mappings | Blocking prompt user to define base semantic colors |
226
- | `semanticTokens.typography` | At least 1 font family declaration | Warning (non-blocking) — AI picks from aesthetic direction |
227
- | `motion.preference` | Non-empty | Warning (non-blocking) — defaults to `subtle` |
228
- | `illustration.iconLibrary` | Non-empty | Warning (non-blocking) — no icon library imported |
108
+ | A | saas-dark | Linear, Vercel |
109
+ | B | saas-light [Recommended] | Notion, Stripe |
110
+ | C | dashboard | Grafana, Datadog |
111
+ | D | Other | (Please describe) |
112
+
113
+ **[Q2] Brand primary color**
114
+ > Enter Hex value (e.g. #4F46E5), or reply "no preference" for AI to generate based on aesthetic direction
115
+
116
+ **[Q3] Information density**
117
+ | ID | Option |
118
+ |:---|:---|
119
+ | A | Generous whitespace / immersive |
120
+ | B | Moderate [Recommended] |
121
+ | C | Information-dense / dashboard style |
122
+
123
+ **INPUT**: `Q1 answer | Q2 answer | Q3 answer`
124
+ ```
229
125
 
230
- > On any blocking item: stop immediately, output the list of missing fields, and wait for the user to fill them before re-running.
126
+ AI fills `design_tokens.json` (writes to file) based on answers, then continues generation. Fields already extracted from code CSS variables/theme are preserved, not overwritten.
231
127
 
232
- **Action**:
128
+ ### Step 5 — Generate Hi-fi HTML
129
+
130
+ Write to `[[__DOCS_DIR__]]/global/ui_concept.html`:
131
+
132
+ **HTML structure spec**:
133
+ ```
134
+ <html>
135
+ <head>
136
+ <!-- Inline CSS: hi-fi visual style based on design_tokens.json -->
137
+ </head>
138
+ <body style="margin:0; display:flex; flex-direction:column; height:100vh; overflow:hidden;">
139
+ <!-- Top bar: project name + current screen path (fixed, not scrollable) -->
140
+ <header class="wf-topbar">...</header>
141
+
142
+ <!-- Content area: scrollable, renders currently active screen -->
143
+ <main class="wf-content" style="flex:1; overflow:auto;">
144
+ <!-- Each screen: <section class="wf-screen" id="S-XX" data-states="default,loading,empty,error"> -->
145
+ <!-- Each state: <div class="wf-state" data-state="default"> -->
146
+ </main>
147
+
148
+ <!-- Control bar: left=state switch, center=file label, right=page switch (fixed bottom, wireframe style) -->
149
+ <footer class="wf-ctrl-bar">
150
+ <div class="ctrl-group">
151
+ <span class="ctrl-lbl">STATE</span>
152
+ <!-- State pills for current screen, rendered by JS -->
153
+ </div>
154
+ <div class="wf-file-label">UI Concept · [Project Name]</div>
155
+ <div class="ctrl-group">
156
+ <span class="ctrl-lbl">PAGE</span>
157
+ <!-- All screen page pills, rendered by JS -->
158
+ </div>
159
+ </footer>
160
+ </body>
161
+ </html>
162
+ ```
163
+
164
+ **Element labeling spec** (`data-el` attribute):
165
+ - Every interactive element or semantic block must have `data-el="[user-language label]"`
166
+ - Label language = Brief's primary language (Chinese project → Chinese labels, English project → English)
167
+ - Labels shown on hover via CSS `::before`, hidden by default
168
+ - When a parent is hovered, child labels auto-hide via `:has([data-el]:hover)::before { opacity:0 }`
169
+
170
+ **Interaction spec** (CSS + minimal JS, no external dependencies):
171
+ - Page switch: click PAGE pill → toggle `.wf-screen` display; JS syncs STATE pills
172
+ - State switch: click STATE pill → toggle `.wf-state` display within current screen
173
+ - Active style: `.pill.on-page` / `.pill.on-state` → `background:#444; color:#fff`
174
+ - Control bar must stay wireframe-style (grayscale, uppercase label, dashed border-top); no color
175
+
176
+ **UI Quality Standards** (CRITICAL):
177
+
178
+ | Dimension | Requirement |
179
+ |:---|:---|
180
+ | Positioning | Hi-fi interface, polished enough for developer handoff — not a wireframe |
181
+ | Card hierarchy | Use soft shadows for depth; do not substitute hard borders for shadows |
182
+ | Primary color usage | Only for CTAs and key status feedback; no more than 10% of total area |
183
+ | Global consistency | Border radius, icon sizes, spacing must be globally uniform |
184
+ | Typography | Ample whitespace, clear font size hierarchy (at least 3 levels of contrast) |
185
+ | Interaction states | All interactive elements must have hover / focus / disabled styles |
186
+ | Content fill | Use realistic content; no Lorem ipsum / "Title" / placeholder text |
187
+
188
+ **Content rules**:
189
+
190
+ | Element type | Rule |
191
+ |:---|:---|
192
+ | Headings / nav labels | Use real business names from roadmap task titles, e.g. "Dashboard", "Project List", "Settings" |
193
+ | Buttons | Write specific action text, e.g. "Create Project", "Sign In", "Save Changes" — never write "[Button]" |
194
+ | Inputs | Write placeholder text, e.g. "Search project name…", "Enter email address" |
195
+ | Lists / tables | Generate at least 3–4 rows of example data (realistic fake data in the project's domain: names, dates, statuses) |
196
+ | Chart / image areas | Use labeled rectangles, but label with the actual content type, e.g. "Line chart: visits last 7 days" not "[Chart]" |
197
+ | Empty state | Write specific empty state copy, e.g. "No projects yet — click 'Create Project' to get started" |
198
+ | Error state | Write specific error copy, e.g. "Connection failed. Please check your network and try again" |
199
+
200
+ **Aesthetic direction → design parameter mapping**:
201
+
202
+ Use `aestheticDirection.preset` to determine baseline values for design parameters (explicit Token values take priority; baselines fill empty Tokens):
203
+
204
+ | Preset | Background tone | Radius | Shadow | Font strategy | Layout traits | Reference products |
205
+ |:---|:---|:---|:---|:---|:---|:---|
206
+ | `saas-dark` | Dark (#0a-#15 range) | sm:4px md:8px | Near-zero, use borders for layering | Sans-serif, compact | High contrast, sharp edges, tight spacing | Linear, Vercel, Raycast |
207
+ | `saas-light` | White (#fafafa-#fff) | sm:6px md:12px | Soft (0 1px 3px rgba(0,0,0,0.08)) | System font or sans-serif | Breathing room, thin borders, whitespace | Notion, Stripe, GitHub |
208
+ | `dashboard` | Dark gray / dark blue | sm:8px md:12px | Card elevation (0 2px 8px) | Tabular nums + sans-serif | Card grids, info-dense, compact tables | Grafana, Datadog |
209
+ | `marketing` | Gradient / bold color blocks | lg:16px+ | Dramatic (0 8px 32px) | Large display font + refined body font | Big headings, full-width sections, visual narrative | Loom, Framer |
210
+ | `mobile-app` | Soft background | lg:16px xl:24px | Soft diffused (0 4px 16px) | System font -apple-system | Large touch targets, wide spacing, card-based | Telegram, Bear |
211
+ | `editorial` | Warm white / cream | Near-zero 0-4px | None or very faint | Serif display + sans-serif body | Narrow column, tall line-height, typography-driven | Medium, Substack |
212
+ | `brutalist` | Pure white or pure black | 0px | None | Monospace or system font | No decoration, dense, function-first | Craigslist, HN |
213
+
214
+ > `custom`: read `aestheticDirection.customDescription`, extract keywords, map to nearest preset, then layer custom adjustments on top.
215
+
216
+ **Anti-AI aesthetic blacklist** (CRITICAL — never violate during generation):
217
+
218
+ | Category | Forbidden | Use instead |
219
+ |:---|:---|:---|
220
+ | Typography | Inter, Roboto, Arial as heading font | Characterful fonts for headings (e.g. Cal Sans, General Sans, Satoshi, Outfit); body text may use system fonts |
221
+ | Colors | Purple gradient on white (signature AI default aesthetic) | Derive from `aestheticDirection`; palette must have hierarchy — one dominant color + sharp accent > evenly-distributed timid palette |
222
+ | Layout | Every screen uses the same centered card layout | Different screen types need layout variation: list vs detail vs form each have distinct character |
223
+ | Radius | Uniform rounded-lg on everything | Radius must have hierarchy: containers large, buttons medium, badges small (or uniformly 0/sm per aesthetic direction) |
224
+ | Shadow | Identical shadow-md everywhere | Shadow must match aesthetic direction: dark themes barely use shadow; light themes use layered shadow |
225
+ | Motion | Scattered transition-all everywhere | Focus on high-impact moments: orchestrated page load (staggered reveals via animation-delay) > scattered micro-interactions |
226
+ | Emoji | Using emoji as icons (🔔📁⚙️✅ etc.) → inconsistent cross-platform rendering, clashes with the overall design language | Use the icon library declared in `illustration.iconLibrary`, or plain text/symbols with `data-el` annotation |
227
+ | Overall | Every generation converges to the same look | Each project's design MUST differ by aesthetic direction — two different projects' ui_concept.html must be instantly distinguishable |
228
+
229
+ **Styling rules** (execute within aesthetic direction baseline + blacklist constraints):
230
+
231
+ | Styling dimension | Rule |
232
+ |:---|:---|
233
+ | Colors | Map with `semanticTokens.colors`; brand from `primitivePalette.brand`; empty tokens filled from aesthetic direction baseline |
234
+ | Typography | Use declared fonts from `semanticTokens.typography`; if empty, pick from aesthetic direction strategy (Google Fonts CDN), blacklisted fonts forbidden |
235
+ | Radius/Shadow | Per `layout.radius` / `layout.shadow`; empty values filled from aesthetic direction baseline |
236
+ | Motion | Apply CSS transition/animation per `motion.patterns`; prioritize orchestrated page-load staggered reveal (animation-delay) |
237
+ | Icons | `illustration.iconLibrary` set → import CDN; not set or style=none → self-drawn inline SVG (see spec below); **emoji as icons is forbidden** |
238
+ | Mode | If `mode.support` includes dark, add CSS `@media (prefers-color-scheme: dark)` + toggle button |
239
+ | Forbidden | Follow "Forbidden styles" from vision.md Visual Reference |
240
+ | Space | Create breathing room or controlled density (per aesthetic direction), avoid mechanical uniform spacing |
241
+ | Background | No flat solid-color fills — add subtle texture/gradient mesh/noise/geometric pattern per aesthetic direction |
242
+
243
+ **Self-drawn SVG spec** (use only when no `illustration.iconLibrary` is set):
244
+
245
+ ```html
246
+ <!-- Stroke style (saas-dark / saas-light / dashboard) -->
247
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
248
+ stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"
249
+ style="width:1em;height:1em;vertical-align:-0.125em">…</svg>
250
+
251
+ <!-- Fill style (mobile-app / marketing) -->
252
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
253
+ fill="currentColor" style="width:1em;height:1em;vertical-align:-0.125em">…</svg>
254
+ ```
255
+
256
+ Rules: ① Color 100% via `currentColor`, controlled by parent CSS `color`; ② Size follows font size (`1em`), no hardcoded px; ③ stroke-width: saas-dark/brutalist → `2`, all others → `1.5`; ④ When a complex icon is too hard to draw, use the simplest geometric substitute — emoji as fallback is forbidden.
257
+
258
+ ### Step 6 — Generate AI Index
259
+
260
+ Write `[[__DOCS_DIR__]]/global/ui_context.md`:
261
+
262
+ ```markdown
263
+ # UI Context
264
+ > Platform: [platform] | Generated by archi-ui-wireframe Skill
265
+ > Updated: YYYY-MM-DD | Do not edit manually
266
+
267
+ ## Screen Inventory
268
+ | ID | Name | Route | States |
269
+ |:---|:---|:---|:---|
270
+ | S-01 | [name] | [route] | default, loading, ... |
271
+
272
+ ## Navigation Graph
273
+ S-XX →([trigger])→ S-YY
274
+
275
+ ## Global Shared Components
276
+ | Component | Appears On |
277
+ |:---|:---|
278
+ | [component] | S-XX, S-YY |
279
+
280
+ ## Screen Structure Summary
281
+ > Extracted from ui_concept.html data-el. When writing ui.md Section 2, align with this section — do not invent layout that diverges from confirmed structure.
233
282
 
234
- 1. **Load visual spec**:
235
- - `design_tokens.json` read in full:
236
- - `aestheticDirection` preset + custom description
237
- - `primitivePalette` CSS variable definitions
238
- - `semanticTokens.colors` → semantic color mappings
239
- - `semanticTokens.typography` → font families / sizes
240
- - `mode` theme mode (light/dark)
241
- - `motion` → timing, easing, pattern names
242
- - `illustration` icon style, library
243
- - `layout` → radius / shadow / spacing
244
- - `vision.md` extract Visual Reference section (brand colors, competitor screenshot descriptions, forbidden styles)
245
-
246
- 2. **Aesthetic direction concrete design parameter mapping**:
247
-
248
- Use `aestheticDirection.preset` to determine baseline values for design parameters (explicit Token values take priority; baselines fill empty Tokens):
249
-
250
- | Preset | Background tone | Radius | Shadow | Font strategy | Layout traits | Reference products |
251
- |:---|:---|:---|:---|:---|:---|:---|
252
- | `saas-dark` | Dark (#0a-#15 range) | sm:4px md:8px | Near-zero, use borders for layering | Sans-serif, compact | High contrast, sharp edges, tight spacing | Linear, Vercel, Raycast |
253
- | `saas-light` | White (#fafafa-#fff) | sm:6px md:12px | Soft (0 1px 3px rgba(0,0,0,0.08)) | System font or sans-serif | Breathing room, thin borders, whitespace | Notion, Stripe, GitHub |
254
- | `dashboard` | Dark gray / dark blue | sm:8px md:12px | Card elevation (0 2px 8px) | Tabular nums + sans-serif | Card grids, info-dense, compact tables | Grafana, Datadog |
255
- | `marketing` | Gradient / bold color blocks | lg:16px+ | Dramatic (0 8px 32px) | Large display font + refined body font | Big headings, full-width sections, visual narrative | Loom, Framer |
256
- | `mobile-app` | Soft background | lg:16px xl:24px | Soft diffused (0 4px 16px) | System font -apple-system | Large touch targets, wide spacing, card-based | Telegram, Bear |
257
- | `editorial` | Warm white / cream | Near-zero 0-4px | None or very faint | Serif display + sans-serif body | Narrow column, tall line-height, typography-driven | Medium, Substack |
258
- | `brutalist` | Pure white or pure black | 0px | None | Monospace or system font | No decoration, dense, function-first | Craigslist, HN |
259
-
260
- > `custom`: read `aestheticDirection.customDescription`, extract keywords, map to nearest preset, then layer custom adjustments on top.
261
-
262
- 3. **Anti-AI aesthetic blacklist** (CRITICALnever violate during styling):
263
-
264
- | Category | Forbidden | Use instead |
265
- |:---|:---|:---|
266
- | Typography | Inter, Roboto, Arial as heading font | Characterful fonts for headings (e.g. Cal Sans, General Sans, Satoshi, Outfit); body text may use system fonts |
267
- | Colors | Purple gradient on white (signature AI default aesthetic) | Derive from `aestheticDirection`; palette must have hierarchy — one dominant color + sharp accent > evenly-distributed timid palette |
268
- | Layout | Every screen uses the same centered card layout | Different screen types need layout variation: list vs detail vs form each have distinct character |
269
- | Radius | Uniform rounded-lg on everything | Radius must have hierarchy: containers large, buttons medium, badges small (or uniformly 0/sm per aesthetic direction) |
270
- | Shadow | Identical shadow-md everywhere | Shadow must match aesthetic direction: dark themes barely use shadow; light themes use layered shadow |
271
- | Motion | Scattered transition-all everywhere | Focus on high-impact moments: orchestrated page load (staggered reveals via animation-delay) > scattered micro-interactions |
272
- | Overall | Every generation converges to the same look | Each project's styling MUST differ by aesthetic direction — two different projects' ui_concept.html must be instantly distinguishable |
273
-
274
- 4. **Styling rules** (execute within aesthetic direction baseline + blacklist constraints):
275
-
276
- | Styling dimension | Rule |
277
- |:---|:---|
278
- | Colors | Replace grayscale with `semanticTokens.colors`; brand from `primitivePalette.brand`; empty tokens filled from aesthetic direction baseline |
279
- | Typography | Use declared fonts from `semanticTokens.typography`; if empty, pick from aesthetic direction strategy (Google Fonts CDN), blacklisted fonts forbidden |
280
- | Radius/Shadow | Per `layout.radius` / `layout.shadow`; empty values filled from aesthetic direction baseline |
281
- | Motion | Apply CSS transition/animation per `motion.patterns`; prioritize orchestrated page-load staggered reveal (animation-delay) |
282
- | Icons | Import CDN per `illustration.iconLibrary`; if style=none, no illustrations |
283
- | Mode | If `mode.support` includes dark, add CSS `@media (prefers-color-scheme: dark)` + toggle button |
284
- | Forbidden | Strictly follow "Forbidden styles" from vision.md Visual Reference |
285
- | Space | Create breathing room or controlled density (per aesthetic direction), avoid mechanical uniform spacing |
286
- | Background | No flat solid-color fills — add subtle texture/gradient mesh/noise/geometric pattern per aesthetic direction |
287
-
288
- 5. **Post-styling checklist**:
289
- - [ ] All screen colors from semanticTokens or aesthetic direction baseline — no arbitrary hardcoded Hex
290
- - [ ] All motion durations from `motion.duration.*` — no magic numbers
291
- - [ ] Page/state control bar remains wireframe-style grayscale (no coloring — debug tool identity)
292
- - [ ] `data-el` labels fully preserved
293
- - [ ] Every state (default/loading/empty/error) of every screen visually implemented
294
- - [ ] **Anti-AI aesthetic check**: no blacklisted fonts, no purple-gradient-on-white, layout variety, radius hierarchy
295
- - [ ] **Identity check**: opening the HTML, one can instantly tell which aesthetic direction this follows — not a generic template
296
-
297
- 6. **Output**:
298
- - Update `[[__DOCS_DIR__]]/global/ui_concept.html` (colored version overwrites wireframe)
299
- - **Sync `ui_context.md` Screen Structure Summary**:
300
- - Update phase label from `Phase 1 Wireframe` to `Phase 2 Visual Styling`
301
- - Re-extract Layout and Key regions for each screen based on final HTML structure, ensuring summary matches the colored `ui_concept.html`
302
- - Screen Inventory / Navigation Graph / Global Shared Components: leave unchanged unless structure changed
303
- - Output summary:
304
- ```
305
- ### ui_concept.html updated (Phase 2 Visual Styling)
306
- ### ui_context.md synced (Screen Structure Summary refreshed to Phase 2)
307
-
308
- **Aesthetic direction**: [preset value] — [reference products]
309
- **Applied visual spec**:
310
- - Primary color: [Primary token value]
311
- - Font: [display font + body font]
312
- - Radius: [sm/md/lg values]
313
- - Motion: [preference value]
314
- - Icons: [iconLibrary] / style: [style]
315
- - Theme: [default + support list]
316
- - Background treatment: [texture/gradient/solid description]
317
-
318
- > Open `[[__DOCS_DIR__]]/global/ui_concept.html` in a browser to review visual output.
319
- > `/archi.plan <ID>` will read `ui_context.md` to determine each task's UI scope.
320
- ```
283
+ ### S-XX · [Screen name]
284
+ **Layout**: [e.g. "centered single-column max-w-400px" or "240px left sidebar + right content area"]
285
+ **States**: default ([core entry points]) | loading (skeleton) | empty / error (if applicable)
286
+ **Key regions**: [semantic blocks + interactive elements from data-el, e.g.: top nav bar, main form area, submit button, error message area]
287
+ ```
288
+
289
+ > `ui_context.md` is the sole entry point for all AI commands reading UI structure; `ui_concept.html` is for human browser preview only.
290
+
291
+ ### Step 7 Verification Checklist
292
+
293
+ - [ ] All screen colors from semanticTokens or aesthetic direction baseline no arbitrary hardcoded Hex
294
+ - [ ] All motion durations from `motion.duration.*` — no magic numbers
295
+ - [ ] Page/state control bar remains wireframe-style grayscale (no coloring — debug tool identity)
296
+ - [ ] `data-el` labels fully preserved
297
+ - [ ] Every state (default/loading/empty/error) of every screen visually implemented
298
+ - [ ] **Icon check**: icon library set → CDN used; no icon library → self-drawn SVG used; **zero emoji**
299
+ - [ ] **Anti-AI aesthetic check**: no blacklisted fonts, no purple-gradient-on-white, layout variety, radius hierarchy
300
+ - [ ] **Identity check**: opening the HTML, one can instantly tell which aesthetic direction this follows — not a generic template
301
+ - [ ] **UI quality check**: no pure black text, layered backgrounds, soft card shadows, primary color ≤10%, interaction states complete, realistic content fill
302
+
303
+ ### Step 8 Output Gate
304
+
305
+ Output coverage summary:
306
+
307
+ ```
308
+ ### ui_concept.html generated
309
+ ### ui_context.md generated (AI screen index)
310
+
311
+ **Aesthetic direction**: [preset value][reference products]
312
+ **Screen coverage** (N screens total):
313
+ | Screen | Name | States |
314
+ |:---|:---|:---|
315
+ | S-01 | [name] | N |
316
+ | ... | | |
317
+
318
+ **Applied visual spec**:
319
+ - Primary color: [Primary token value]
320
+ - Font: [display font + body font]
321
+ - Radius: [sm/md/lg values]
322
+ - Motion: [preference value]
323
+ - Theme: [default + support list]
324
+
325
+ **Navigation structure**: [e.g. "Left sidebar + top breadcrumb"]
326
+ **Platform**: [Web Desktop 1280px / Mobile 390px / ...]
327
+
328
+ > Open `[[__DOCS_DIR__]]/global/ui_concept.html` in a browser to review layout and visual output.
329
+ > Reply **OK** to confirm; or describe screen/layout/visual adjustments needed.
330
+ ```
331
+
332
+ **Gate**: Complete after user replies **OK**; otherwise enter Refinement.
321
333
 
322
334
  ---
323
335
 
324
- ### Phase 2.5 Incremental Re-coloring
336
+ ### RefinementIterative Polish (optional)
325
337
 
326
- **Trigger**: After Phase 2 is complete, a screen is updated by Plan Refinement / Edit / Revise and its new content needs to be styled to match the hi-fi standard.
338
+ **Trigger**: User reply is not OK contains layout adjustments, screen additions/removals, navigation changes, visual modifications.
339
+ **Action**: Incorporate feedback, update only the affected parts of `ui_concept.html` (no full rewrite), sync `ui_context.md` (keep screen index consistent with `ui_concept.html`), re-display summary, await confirmation.
327
340
 
328
- **Role**: Visual Designer
341
+ ---
342
+
343
+ ### Incremental Update
344
+
345
+ **Trigger**: A screen is updated by Plan Refinement / Edit / Revise and new content needs to match the current visual spec.
329
346
 
330
347
  **Action**:
331
348
 
332
- 1. Receive the list of screen IDs to re-color from the caller (e.g., `S-03`, `S-07`).
349
+ 1. Receive the list of screen IDs to update from the caller (e.g., `S-03`, `S-07`).
333
350
  2. Process only the specified screens:
334
- - Locate new wireframe-style additions within `.wf-screen#S-XX`
335
- - Apply Phase 2 styling rules (`semanticTokens` / `motion` / `illustration`) to the new additions only
351
+ - Preserve existing content within `.wf-screen#S-XX`
352
+ - Generate new additions per current visual spec (`semanticTokens` / `motion` / `illustration`)
336
353
  - Leave all other screen content untouched
337
- 3. [?new states] If new states are added in this re-color → sync `ui_context.md` to update the states column for the affected screen(s).
354
+ 3. If new states added → sync `ui_context.md` to update the states column for the affected screen(s).
338
355
  4. Output change summary:
339
- - `MODIFIED: ui_concept.html S-XX (incremental re-color, [N] new states/regions)`
356
+ - `MODIFIED: ui_concept.html S-XX (incremental update, [N] new states/regions)`
340
357
  - `MODIFIED: ui_context.md S-XX (updated states list)` (only if new states were added)
341
358
 
342
- > **Forbidden**: Never re-run the full Phase 2 for incremental re-coloring. Never touch screens not in the specified list.
359
+ > **Forbidden**: Never do a full rewrite for incremental updates. Never touch screens not in the specified list.
360
+
361
+ ---
362
+
363
+ ### Adopt — Reverse Adoption (Legacy UI Capture)
364
+
365
+ **Trigger**: After `/archi.inherit` completes, invoked for UI projects.
366
+ **Input**: Existing code (route definitions, page components, layout files) + design_tokens.json (may be incomplete)
367
+
368
+ **Action**:
369
+
370
+ 1. **Scan UI structure**:
371
+ - Extract page list from route definitions (React Router / Vue Router / Next.js pages / SvelteKit routes etc.)
372
+ - Identify navigation structure from layout components (sidebar / navbar / tabbar)
373
+ - Identify core regions and states from page components
374
+
375
+ 2. **Plan screen inventory**: Same as standard flow Step 2 (assign S-XX IDs, map to LEG-xx tasks)
376
+
377
+ 3. **Tokens check + guidance**: Same as standard flow Step 4
378
+ - Prioritize extracting CSS variables / Tailwind config / theme files from existing code
379
+ - Run guidance question flow for insufficient fields
380
+
381
+ 4. **Generate HTML**: Same as standard flow Step 5 (hi-fi quality standards)
382
+ - Use existing code UI structure as layout reference (restore, not invent from scratch)
383
+ - Details and states may be supplemented (e.g. original code lacks empty/error states)
384
+
385
+ 5. **Generate ui_context.md**: Same as standard flow Step 6
386
+
387
+ 6. **Output**: Same as standard flow Step 8