create-specfuse 0.3.2 → 0.4.0
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/dist/design-md/templates/_schema.yaml +75 -10
- package/dist/design-md/templates/consumer-media.yaml +33 -24
- package/dist/design-md/templates/consumer-social.yaml +37 -28
- package/dist/design-md/templates/content-blog.yaml +35 -26
- package/dist/design-md/templates/content-docs.yaml +34 -24
- package/dist/design-md/templates/dashboard-analytics.yaml +33 -24
- package/dist/design-md/templates/dashboard-monitoring.yaml +33 -24
- package/dist/design-md/templates/developer-portal.yaml +37 -26
- package/dist/design-md/templates/e-commerce.yaml +38 -28
- package/dist/design-md/templates/enterprise-admin.yaml +44 -0
- package/dist/design-md/templates/form-heavy.yaml +36 -26
- package/dist/design-md/templates/internal-tool.yaml +33 -24
- package/dist/design-md/templates/marketing-corporate.yaml +36 -27
- package/dist/design-md/templates/marketing-creative.yaml +34 -25
- package/dist/design-md/templates/mobile-lifestyle.yaml +35 -26
- package/dist/design-md/templates/mobile-utility.yaml +36 -26
- package/dist/design-md/templates/saas-dashboard.yaml +33 -24
- package/dist/templates/design-md-skill.d.ts.map +1 -1
- package/dist/templates/design-md-skill.js +225 -14
- package/dist/templates/design-md-skill.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,29 +4,240 @@ name: design-md
|
|
|
4
4
|
description: Generate a DESIGN.md file for the current project via interactive questionnaire and archetype matching. Use for brownfield projects that need design tokens.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# DESIGN.md Generation Skill
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Generate a comprehensive \`DESIGN.md\` design token document for the current project.
|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
**Trigger:** User invokes \`/design-md\` manually, or auto-triggered after \`specfuse init\` for frontend projects.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
5.
|
|
18
|
-
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## §1 Questionnaire
|
|
16
|
+
|
|
17
|
+
Ask the user exactly 5 questions, one at a time. Each answer maps to one or more dimension axes (colorTemp, lightness, density, borderRadius, tone) on a 1-5 scale.
|
|
18
|
+
|
|
19
|
+
### Q1: Product Category
|
|
20
|
+
|
|
21
|
+
"What type of product is this?"
|
|
22
|
+
|
|
23
|
+
Options:
|
|
24
|
+
- A) Internal tool / Admin panel → category: internal-tool, density +2
|
|
25
|
+
- B) Dashboard / Analytics → category: dashboard, density +1, lightness -1
|
|
26
|
+
- C) Consumer app (social/media) → category: consumer, tone +2
|
|
27
|
+
- D) Developer tool / API portal → category: developer, colorTemp -1
|
|
28
|
+
- E) Mobile app → category: mobile, borderRadius +1
|
|
29
|
+
- F) E-commerce / Marketplace → category: e-commerce, tone +1
|
|
30
|
+
- G) Marketing / Landing page → category: marketing, density -2, lightness +1
|
|
31
|
+
- H) Form-heavy / Workflow → category: form-heavy, density +1
|
|
32
|
+
- I) Content / Blog / Docs → category: content, lightness +1, density -1
|
|
33
|
+
|
|
34
|
+
Mapping: Sets the \`category\` field and adjusts relevant dimensions from baseline 3.
|
|
35
|
+
|
|
36
|
+
### Q2: Visual Temperature
|
|
37
|
+
|
|
38
|
+
"How warm or cool should the palette feel?"
|
|
39
|
+
|
|
40
|
+
Options:
|
|
41
|
+
- A) Very cool (blues, blue-greys) → colorTemp: 1
|
|
42
|
+
- B) Cool-neutral → colorTemp: 2
|
|
43
|
+
- C) Balanced / Neutral → colorTemp: 3
|
|
44
|
+
- D) Warm-neutral → colorTemp: 4
|
|
45
|
+
- E) Very warm (ambers, warm greys) → colorTemp: 5
|
|
46
|
+
|
|
47
|
+
Mapping: Directly sets \`colorTemp\` dimension.
|
|
48
|
+
|
|
49
|
+
### Q3: Interface Density
|
|
50
|
+
|
|
51
|
+
"How information-dense should the interface be?"
|
|
52
|
+
|
|
53
|
+
Options:
|
|
54
|
+
- A) Maximum density (monitoring dashboards, trading) → density: 1
|
|
55
|
+
- B) High density (admin panels, data tables) → density: 2
|
|
56
|
+
- C) Balanced (standard SaaS) → density: 3
|
|
57
|
+
- D) Spacious (consumer apps, marketing) → density: 4
|
|
58
|
+
- E) Very spacious (luxury, editorial) → density: 5
|
|
59
|
+
|
|
60
|
+
Mapping: Directly sets \`density\` dimension.
|
|
61
|
+
|
|
62
|
+
### Q4: Shape Language
|
|
63
|
+
|
|
64
|
+
"What shape personality fits your brand?"
|
|
19
65
|
|
|
20
|
-
|
|
66
|
+
Options:
|
|
67
|
+
- A) Sharp / Angular (technical, serious) → borderRadius: 1
|
|
68
|
+
- B) Slightly rounded (professional) → borderRadius: 2
|
|
69
|
+
- C) Moderately rounded (friendly-professional) → borderRadius: 3
|
|
70
|
+
- D) Well-rounded (approachable, consumer) → borderRadius: 4
|
|
71
|
+
- E) Very rounded / Pill-shaped (playful) → borderRadius: 5
|
|
72
|
+
|
|
73
|
+
Mapping: Directly sets \`borderRadius\` dimension.
|
|
74
|
+
|
|
75
|
+
### Q5: Brand Personality
|
|
76
|
+
|
|
77
|
+
"What tone should the design communicate?"
|
|
78
|
+
|
|
79
|
+
Options:
|
|
80
|
+
- A) Strictly functional (no personality) → tone: 1
|
|
81
|
+
- B) Professional and restrained → tone: 2
|
|
82
|
+
- C) Confident and polished → tone: 3
|
|
83
|
+
- D) Friendly and approachable → tone: 4
|
|
84
|
+
- E) Playful and expressive → tone: 5
|
|
85
|
+
|
|
86
|
+
Mapping: Directly sets \`tone\` dimension. Also influences \`lightness\`: tone 1-2 → lightness -1, tone 4-5 → lightness +1.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## §2 Matching Algorithm
|
|
91
|
+
|
|
92
|
+
After collecting answers, compute a 5-dimensional vector: \`[colorTemp, lightness, density, borderRadius, tone]\`.
|
|
93
|
+
|
|
94
|
+
**Weighted Euclidean distance** against all 16 archetype seed files:
|
|
21
95
|
|
|
22
96
|
\`\`\`
|
|
23
|
-
|
|
24
|
-
|
|
97
|
+
distance(user, archetype) = sqrt(
|
|
98
|
+
w_colorTemp * (u.colorTemp - a.colorTemp)² +
|
|
99
|
+
w_lightness * (u.lightness - a.lightness)² +
|
|
100
|
+
w_density * (u.density - a.density)² +
|
|
101
|
+
w_borderRadius * (u.borderRadius - a.borderRadius)² +
|
|
102
|
+
w_tone * (u.tone - a.tone)²
|
|
103
|
+
)
|
|
25
104
|
\`\`\`
|
|
26
105
|
|
|
27
|
-
|
|
106
|
+
Weights: \`colorTemp=1.0, lightness=1.0, density=1.5, borderRadius=0.8, tone=1.2\`
|
|
107
|
+
|
|
108
|
+
**Category bonus:** If the archetype's \`category\` matches the user's Q1 answer, subtract 1.5 from its distance score (floor at 0). This ensures category-appropriate archetypes rank higher.
|
|
109
|
+
|
|
110
|
+
Select the archetype with the lowest adjusted distance. Present it to the user for confirmation. Allow fine-tuning individual dimensions before final generation.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## §3 Token Derivation Rules
|
|
115
|
+
|
|
116
|
+
From the matched archetype's \`anchors\`, derive a complete design token system:
|
|
117
|
+
|
|
118
|
+
### Colors (15+ semantic colors)
|
|
119
|
+
|
|
120
|
+
Starting from \`anchors.colors.primary\` and \`anchors.colors.auxiliary\`:
|
|
121
|
+
1. Generate primary scale: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900 (10 shades)
|
|
122
|
+
2. Generate 2-3 auxiliary/accent scales (5 shades each from auxiliary anchors)
|
|
123
|
+
3. Derive semantic colors: success, warning, error, info (from primary hue-shift)
|
|
124
|
+
4. Neutral scale: 11 steps (white → black) calibrated to lightness dimension
|
|
125
|
+
5. Surface colors: background, surface, elevated, overlay
|
|
126
|
+
|
|
127
|
+
Total: minimum 15+ semantic color tokens with named purposes.
|
|
128
|
+
|
|
129
|
+
### Typography Scale
|
|
130
|
+
|
|
131
|
+
From \`anchors.typography.baseSize\` and \`anchors.typography.scale\`:
|
|
132
|
+
- Generate type scale using the modular ratio: xs, sm, base, md, lg, xl, 2xl, 3xl, 4xl
|
|
133
|
+
- Each step = previous × scale ratio
|
|
134
|
+
- Define font weights: regular (400), medium (500), semibold (600), bold (700)
|
|
135
|
+
- Define line heights: tight (1.2), normal (1.5), relaxed (1.75)
|
|
136
|
+
|
|
137
|
+
### Spacing (6-level system)
|
|
138
|
+
|
|
139
|
+
From \`anchors.spacing.unit\`:
|
|
140
|
+
- Generate 6 named levels: xs, sm, md, lg, xl, 2xl
|
|
141
|
+
- Each level = unit × multiplier: 1×, 2×, 3×, 4×, 6×, 8×
|
|
142
|
+
- Example with 4px unit: 4, 8, 12, 16, 24, 32
|
|
143
|
+
|
|
144
|
+
### Radius (6-level system)
|
|
145
|
+
|
|
146
|
+
From \`anchors.radius.base\`:
|
|
147
|
+
- Generate 6 named levels: none, sm, md, lg, xl, full
|
|
148
|
+
- Values: 0, base÷2, base, base×1.5, base×2, 9999px
|
|
149
|
+
- Example with 8px base: 0, 4, 8, 12, 16, 9999
|
|
150
|
+
|
|
151
|
+
### Elevation
|
|
152
|
+
|
|
153
|
+
Derive 5 elevation levels based on density dimension:
|
|
154
|
+
- Level 0: none (flat)
|
|
155
|
+
- Level 1: subtle (small shadow for cards)
|
|
156
|
+
- Level 2: medium (dropdowns, popovers)
|
|
157
|
+
- Level 3: high (modals, dialogs)
|
|
158
|
+
- Level 4: highest (notifications, toasts)
|
|
159
|
+
|
|
160
|
+
Shadow intensity scales with density: high-density UIs use subtler shadows.
|
|
161
|
+
|
|
162
|
+
### Component Tokens (8-10 groups)
|
|
163
|
+
|
|
164
|
+
From \`structure.componentTokens\`, define tokens for each component using cross-reference syntax:
|
|
165
|
+
|
|
166
|
+
\`\`\`yaml
|
|
167
|
+
button:
|
|
168
|
+
padding: "{spacing.sm} {spacing.md}"
|
|
169
|
+
borderRadius: "{radius.md}"
|
|
170
|
+
fontSize: "{typography.sm}"
|
|
171
|
+
primary:
|
|
172
|
+
background: "{colors.primary.500}"
|
|
173
|
+
text: "{colors.white}"
|
|
174
|
+
secondary:
|
|
175
|
+
background: "{colors.neutral.100}"
|
|
176
|
+
text: "{colors.neutral.800}"
|
|
177
|
+
\`\`\`
|
|
178
|
+
|
|
179
|
+
Cross-reference format: \`"{category.token}"\` where category is one of colors, typography, spacing, radius, elevation.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## §4 Output Format
|
|
184
|
+
|
|
185
|
+
Generate \`DESIGN.md\` with two parts:
|
|
186
|
+
|
|
187
|
+
### YAML Front Matter
|
|
188
|
+
|
|
189
|
+
\`\`\`markdown
|
|
190
|
+
---
|
|
191
|
+
designSystem:
|
|
192
|
+
name: "<project name> Design System"
|
|
193
|
+
version: "1.0.0"
|
|
194
|
+
archetype: "<matched archetype id>"
|
|
195
|
+
generatedAt: "<ISO date>"
|
|
196
|
+
tokens:
|
|
197
|
+
colors:
|
|
198
|
+
primary: { ... full scale ... }
|
|
199
|
+
auxiliary: { ... }
|
|
200
|
+
semantic: { success, warning, error, info }
|
|
201
|
+
neutral: { ... 11 steps ... }
|
|
202
|
+
typography:
|
|
203
|
+
scale: { xs, sm, base, md, lg, xl, 2xl, 3xl, 4xl }
|
|
204
|
+
weights: { regular, medium, semibold, bold }
|
|
205
|
+
lineHeights: { tight, normal, relaxed }
|
|
206
|
+
spacing: { xs, sm, md, lg, xl, 2xl }
|
|
207
|
+
radius: { none, sm, md, lg, xl, full }
|
|
208
|
+
elevation: { 0, 1, 2, 3, 4 }
|
|
209
|
+
components: { ... 8-10 component token groups ... }
|
|
210
|
+
---
|
|
211
|
+
\`\`\`
|
|
212
|
+
|
|
213
|
+
### Markdown Body structure
|
|
214
|
+
|
|
215
|
+
The Markdown body follows this structure:
|
|
216
|
+
|
|
217
|
+
1. **Overview** — archetype name, philosophy, key decisions
|
|
218
|
+
2. **Color Palette** — visual swatches (using HTML/unicode), semantic meanings
|
|
219
|
+
3. **Typography** — scale table, font stack recommendations
|
|
220
|
+
4. **Spacing & Layout** — grid system, spacing scale visualization
|
|
221
|
+
5. **Border Radius** — shape language explanation
|
|
222
|
+
6. **Elevation & Shadows** — usage guidelines per level
|
|
223
|
+
7. **Component Tokens** — per-component token table with cross-references
|
|
224
|
+
8. **Responsive Breakpoints** — from \`structure.requiredSections\`
|
|
225
|
+
9. **Usage Guidelines** — do/don't patterns for applying tokens
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## §5 Backup & Overwrite Protection
|
|
230
|
+
|
|
231
|
+
Before writing \`DESIGN.md\`:
|
|
232
|
+
|
|
233
|
+
1. Check if \`DESIGN.md\` already exists in the target directory
|
|
234
|
+
2. If it exists:
|
|
235
|
+
- Ask for overwrite confirmation: "DESIGN.md already exists. Overwrite? (A .bak backup will be created)"
|
|
236
|
+
- On confirmation: copy existing file to \`DESIGN.md.bak\`
|
|
237
|
+
- On rejection: abort without changes
|
|
238
|
+
3. If it does not exist: proceed directly
|
|
28
239
|
|
|
29
|
-
|
|
240
|
+
Never silently overwrite an existing DESIGN.md file.
|
|
30
241
|
`;
|
|
31
242
|
}
|
|
32
243
|
//# sourceMappingURL=design-md-skill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-md-skill.js","sourceRoot":"","sources":["../../src/templates/design-md-skill.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB;IAClC,OAAO
|
|
1
|
+
{"version":3,"file":"design-md-skill.js","sourceRoot":"","sources":["../../src/templates/design-md-skill.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB;IAClC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+OR,CAAC;AACF,CAAC"}
|