@systemverification/styling-kit 2.0.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/CLAUDE.md +98 -0
- package/README.md +411 -0
- package/bin/sv-style.js +74 -0
- package/docs/BAD_EXAMPLES.md +145 -0
- package/docs/COMPONENTS/BUTTON.md +108 -0
- package/docs/COMPONENTS/CARD.md +68 -0
- package/docs/DESIGN_SYSTEM.md +614 -0
- package/package.json +22 -0
- package/src/assets.js +67 -0
- package/src/bundle.js +67 -0
- package/src/config.js +67 -0
- package/src/doctor.js +113 -0
- package/src/fs-utils.js +15 -0
- package/src/init.js +182 -0
- package/src/login.js +65 -0
- package/src/mcp.js +215 -0
- package/src/path-rewrite.js +48 -0
- package/src/shutdown.js +26 -0
- package/src/update.js +101 -0
- package/templates/AGENTS_SNIPPET.md +40 -0
- package/templates/CLAUDE_SNIPPET.md +14 -0
- package/tokens/tokens-core.css +51 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Claude Styling Instructions – System Verification
|
|
2
|
+
|
|
3
|
+
# System Verification — Styling Kit
|
|
4
|
+
|
|
5
|
+
This repo is the **canonical source** for the System Verification design system and brand assets. It is not an application — it is a portable kit that gets copied into new projects.
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Provides consistent System Verification branding for new projects bootstrapped with Claude:
|
|
10
|
+
|
|
11
|
+
- `docs/DESIGN_SYSTEM.md` — **single source of truth** for all visual decisions: brand colors, typography, component specs (Button, Card, Badges, Inputs, Toasts), layout conventions, animations, and common anti-patterns
|
|
12
|
+
- `docs/COMPONENTS/` — per-component specs extracted from DESIGN_SYSTEM.md
|
|
13
|
+
- `docs/BAD_EXAMPLES.md` — anti-pattern reference
|
|
14
|
+
- `tokens/tokens.css` — CSS custom properties (source of truth for the token file)
|
|
15
|
+
- `README.md` — instructions for consuming this kit in a new project, including ready-made Claude prompts
|
|
16
|
+
- `assets/` — static brand assets installed into target projects by the CLI
|
|
17
|
+
- `bin/sv-style.js` — CLI entry point (`init`, `update`, `mcp`)
|
|
18
|
+
- `src/` — CLI and MCP server implementation (Node.js ESM)
|
|
19
|
+
|
|
20
|
+
## Asset Inventory
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
assets/
|
|
24
|
+
├── favicon.png # "S" symbol, orange/gold, ~92 KB
|
|
25
|
+
├── logo/logo.svg # "System Verification" wordmark, white SVG (dark backgrounds only)
|
|
26
|
+
└── fonts/
|
|
27
|
+
├── body-font.woff2 # BodyFont regular
|
|
28
|
+
├── body-font-italic.woff2
|
|
29
|
+
└── heading-font.woff2 # HeadingFont
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Design System
|
|
33
|
+
|
|
34
|
+
Follow `docs/DESIGN_SYSTEM.md` for all visual decisions. Key constraints:
|
|
35
|
+
|
|
36
|
+
- **Never hardcode brand colors** — always use the `var(--color-*)` tokens
|
|
37
|
+
- **Dark mode only** — no light theme is defined
|
|
38
|
+
- **Yellow (`#F7F965`) is the only accent color** — do not introduce additional accent hues
|
|
39
|
+
- **Logo is white SVG** — only suitable for dark backgrounds
|
|
40
|
+
- **Fonts are self-hosted** — no external CDN dependencies
|
|
41
|
+
|
|
42
|
+
## Modifying This Kit
|
|
43
|
+
|
|
44
|
+
When updating this kit, keep changes consistent:
|
|
45
|
+
|
|
46
|
+
1. **`docs/DESIGN_SYSTEM.md`** — update token values, component patterns, visual rules, or anti-patterns
|
|
47
|
+
2. **`docs/COMPONENTS/`** — update component-specific spec files to match DESIGN_SYSTEM.md
|
|
48
|
+
3. **`docs/BAD_EXAMPLES.md`** — update anti-patterns section to match DESIGN_SYSTEM.md
|
|
49
|
+
4. **`tokens/tokens.css`** — update CSS custom properties when token values change
|
|
50
|
+
5. **`README.md`** — update the ready-made prompts and brand quick reference table if tokens change
|
|
51
|
+
6. **`assets/`** — update binary assets (fonts, logo, favicon) when the brand is refreshed
|
|
52
|
+
7. **`src/mcp.js`** — update `PALETTE_TUPLES` when palette values change
|
|
53
|
+
|
|
54
|
+
The CLI (`bin/sv-style.js`, `src/`) and MCP server (`src/mcp.js`) are core parts of this kit. Keep them working when updating the kit.
|
|
55
|
+
|
|
56
|
+
Do not add framework-specific application logic. The kit must remain stack-agnostic.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
# Additional Enforcement Rules
|
|
62
|
+
|
|
63
|
+
## 1. Token Enforcement
|
|
64
|
+
|
|
65
|
+
If a value exists in docs/DESIGN_SYSTEM.md:
|
|
66
|
+
→ MUST use it
|
|
67
|
+
→ MUST NOT recreate it
|
|
68
|
+
|
|
69
|
+
## 2. No Visual Guessing
|
|
70
|
+
|
|
71
|
+
If something is not defined:
|
|
72
|
+
- reuse closest existing pattern
|
|
73
|
+
- do not invent new style language
|
|
74
|
+
|
|
75
|
+
## 3. Component Consistency
|
|
76
|
+
|
|
77
|
+
If a Button, Card, Badge, Input, or Toast is generated:
|
|
78
|
+
→ it must match `docs/DESIGN_SYSTEM.md` exactly in structure, tokens, required states
|
|
79
|
+
→ do not add variants, rename tokens, or omit required states
|
|
80
|
+
|
|
81
|
+
## 4. Density Awareness
|
|
82
|
+
|
|
83
|
+
Default to **product UI density**, not marketing spacing.
|
|
84
|
+
|
|
85
|
+
## 5. Output Quality
|
|
86
|
+
|
|
87
|
+
Code must:
|
|
88
|
+
- be production-ready
|
|
89
|
+
- not contain magic numbers
|
|
90
|
+
- not depend on hidden context
|
|
91
|
+
|
|
92
|
+
## 6. Anti-Pattern Enforcement
|
|
93
|
+
|
|
94
|
+
Before generating any styled code, consult `docs/BAD_EXAMPLES.md` and the "Common Styling Anti-Patterns" section in `docs/DESIGN_SYSTEM.md`:
|
|
95
|
+
→ hardcoded colors are forbidden — always use `var(--color-*)` tokens
|
|
96
|
+
→ magic spacing values are forbidden — always use consistent spacing values
|
|
97
|
+
→ accent color (`--color-yellow`) must only be used for interactive/CTA elements
|
|
98
|
+
→ all interactive components must include hover, focus-visible, active, and disabled states
|
package/README.md
ADDED
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
# System Verification — Styling Kit
|
|
2
|
+
|
|
3
|
+
A portable design system for bootstrapping new System Verification projects with consistent branding using Claude.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What's Included
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
styling-kit/
|
|
11
|
+
├── bin/sv-style.js # CLI entry point
|
|
12
|
+
├── src/
|
|
13
|
+
│ ├── init.js # init command
|
|
14
|
+
│ ├── update.js # update command
|
|
15
|
+
│ └── mcp.js # MCP validation server
|
|
16
|
+
├── tokens/tokens.css # CSS custom properties (source)
|
|
17
|
+
├── assets/
|
|
18
|
+
│ ├── favicon.png # "S" symbol — orange/gold
|
|
19
|
+
│ ├── logo/logo.svg # Wordmark — white SVG
|
|
20
|
+
│ └── fonts/
|
|
21
|
+
│ ├── body-font.woff2
|
|
22
|
+
│ ├── body-font-italic.woff2
|
|
23
|
+
│ └── heading-font.woff2
|
|
24
|
+
├── docs/
|
|
25
|
+
│ ├── DESIGN_SYSTEM.md # Single source of truth
|
|
26
|
+
│ ├── COMPONENTS/
|
|
27
|
+
│ │ ├── BUTTON.md
|
|
28
|
+
│ │ └── CARD.md
|
|
29
|
+
│ └── BAD_EXAMPLES.md
|
|
30
|
+
└── templates/
|
|
31
|
+
└── CLAUDE_SNIPPET.md # Appended to target project CLAUDE.md
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Setup in a New Project
|
|
37
|
+
|
|
38
|
+
### 1. Install with the CLI
|
|
39
|
+
|
|
40
|
+
Run from the **root of your target project**:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
node /path/to/styling-kit/bin/sv-style.js init
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This will:
|
|
47
|
+
- Copy `tokens/tokens.css` → `src/styles/sv/tokens.css`
|
|
48
|
+
- Copy `assets/` → `public/sv-assets/`
|
|
49
|
+
- Copy `docs/` → `docs/sv-style/`
|
|
50
|
+
- Generate `sv-style.json` recording the installed paths
|
|
51
|
+
- Patch (or create) `CLAUDE.md` with an SV Style reference block
|
|
52
|
+
|
|
53
|
+
**Custom paths:**
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
node /path/to/styling-kit/bin/sv-style.js init \
|
|
57
|
+
--styles-dir src/styles/sv \
|
|
58
|
+
--assets-dir public/sv-assets \
|
|
59
|
+
--docs-dir docs/sv-style
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 2. Keep in sync
|
|
63
|
+
|
|
64
|
+
When the kit is updated, run from your project root:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
node /path/to/styling-kit/bin/sv-style.js update
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Reads paths from `sv-style.json` and overwrites all managed files.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## MCP Validation Server
|
|
75
|
+
|
|
76
|
+
The kit includes an MCP server for Claude to validate styling in your project.
|
|
77
|
+
|
|
78
|
+
### Start the server
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
node /path/to/styling-kit/bin/sv-style.js mcp
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Client configuration
|
|
85
|
+
|
|
86
|
+
**Claude Desktop** — `%APPDATA%\Claude\claude_desktop_config.json` (Windows) or `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"mcpServers": {
|
|
91
|
+
"sv-style": {
|
|
92
|
+
"command": "node",
|
|
93
|
+
"args": ["C:/path/to/styling-kit/bin/sv-style.js", "mcp"],
|
|
94
|
+
"cwd": "C:/your-target-project"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`cwd` sets the working directory for `validate_file` path resolution and `sv-style.json` lookup. Set it to your target project root.
|
|
101
|
+
|
|
102
|
+
**Claude Code** — `.claude/settings.json` in your project root:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"mcpServers": {
|
|
107
|
+
"sv-style": {
|
|
108
|
+
"command": "node",
|
|
109
|
+
"args": ["C:/path/to/styling-kit/bin/sv-style.js", "mcp"]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Claude Code uses the workspace root as `cwd` automatically.
|
|
116
|
+
|
|
117
|
+
**VS Code** — `.vscode/mcp.json` in your project root:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"servers": {
|
|
122
|
+
"sv-style": {
|
|
123
|
+
"type": "stdio",
|
|
124
|
+
"command": "node",
|
|
125
|
+
"args": ["C:/path/to/styling-kit/bin/sv-style.js", "mcp"]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Note the different key (`"servers"` not `"mcpServers"`) and the required `"type": "stdio"` field.
|
|
132
|
+
|
|
133
|
+
**VS Code — tool discovery:** VS Code proxies all `.vscode/mcp.json` servers through a `vscode-mcp-gateway` layer, so tools appear as `mcp__vscode-mcp-gateway__<tool_name>` regardless of server name. Keyword search in ToolSearch does not index them through this gateway — use the exact `select:` syntax:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
select:mcp__vscode-mcp-gateway__validate_file
|
|
137
|
+
select:mcp__vscode-mcp-gateway__get_tokens
|
|
138
|
+
select:mcp__vscode-mcp-gateway__get_component_spec
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
In Claude Code (`.claude/settings.json`), the server is registered directly under the `"sv-style"` key, so the prefix is `mcp__sv-style__`.
|
|
142
|
+
|
|
143
|
+
### Available MCP tools
|
|
144
|
+
|
|
145
|
+
| Tool | Description |
|
|
146
|
+
|---|---|
|
|
147
|
+
| `get_tokens()` | Returns the full CSS token definitions |
|
|
148
|
+
| `get_component_spec({ name })` | Returns the component spec markdown (e.g. `BUTTON`, `CARD`) |
|
|
149
|
+
| `validate_file({ path })` | Validates a CSS/HTML file for design system violations |
|
|
150
|
+
|
|
151
|
+
### Validation rules
|
|
152
|
+
|
|
153
|
+
- **Hardcoded hex colors** — any `#rrggbb` value in a CSS property (should use `var(--color-*)`)
|
|
154
|
+
- **Hardcoded px font sizes** — `font-size` set in `px` (should use `rem` scale)
|
|
155
|
+
- **Non-palette rgba values** — `rgba()` using RGB numbers not from the documented palette
|
|
156
|
+
|
|
157
|
+
### Validation output format
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
[
|
|
161
|
+
{
|
|
162
|
+
"type": "error",
|
|
163
|
+
"rule": "no-hardcoded-hex",
|
|
164
|
+
"message": "Hardcoded hex color: #123456 — use a var(--color-*) token instead",
|
|
165
|
+
"line": 14
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
An empty array means no violations found.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Styling an Existing App with AI
|
|
175
|
+
|
|
176
|
+
End-to-end workflow for applying SV branding to a web app using an AI coding assistant
|
|
177
|
+
(Claude Code, VS Code Copilot with Claude, or similar).
|
|
178
|
+
|
|
179
|
+
### Step 1 — Clone the kit (one-time)
|
|
180
|
+
|
|
181
|
+
The CLI and MCP server run directly from a local clone — no npm publish required.
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
git clone <this-repo-url> C:/tools/styling-kit
|
|
185
|
+
cd C:/tools/styling-kit
|
|
186
|
+
npm install
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Step 2 — Run init in your target project
|
|
190
|
+
|
|
191
|
+
From the root of your project:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
node C:/tools/styling-kit/bin/sv-style.js init
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
This installs tokens, assets, and docs and patches `CLAUDE.md`. See
|
|
198
|
+
[Setup in a New Project](#setup-in-a-new-project) for path options.
|
|
199
|
+
|
|
200
|
+
After running, your project will contain:
|
|
201
|
+
- `sv-style.json` — records installed paths
|
|
202
|
+
- `AGENTS.md` — design system context and workflow for any AI agent
|
|
203
|
+
- `CLAUDE.md` — Claude-specific MCP tool discovery (references AGENTS.md)
|
|
204
|
+
- `docs/sv-style/DESIGN_SYSTEM.md` — managed copy of the visual spec
|
|
205
|
+
- `src/styles/sv/tokens.css` (or your custom `--styles-dir`) — CSS custom properties
|
|
206
|
+
|
|
207
|
+
### Step 3 — Add MCP config to your project
|
|
208
|
+
|
|
209
|
+
Add the MCP server so your AI assistant can validate CSS and fetch component specs.
|
|
210
|
+
|
|
211
|
+
**VS Code (Copilot with Claude, agent mode)** — `.vscode/mcp.json`:
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"servers": {
|
|
216
|
+
"sv-style": {
|
|
217
|
+
"type": "stdio",
|
|
218
|
+
"command": "node",
|
|
219
|
+
"args": ["C:/tools/styling-kit/bin/sv-style.js", "mcp"]
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**Claude Code** — `.claude/settings.json`:
|
|
226
|
+
|
|
227
|
+
```json
|
|
228
|
+
{
|
|
229
|
+
"mcpServers": {
|
|
230
|
+
"sv-style": {
|
|
231
|
+
"command": "node",
|
|
232
|
+
"args": ["C:/tools/styling-kit/bin/sv-style.js", "mcp"]
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
See [MCP Validation Server](#mcp-validation-server) for all client options and available tools.
|
|
239
|
+
|
|
240
|
+
### Step 4 — Paste the styling prompt
|
|
241
|
+
|
|
242
|
+
Open an AI chat in your project workspace and paste the prompt below. The AI will read
|
|
243
|
+
the design system, apply consistent branding across your components, validate the output,
|
|
244
|
+
and fix any violations automatically.
|
|
245
|
+
|
|
246
|
+
### Agent prompt — style this app
|
|
247
|
+
|
|
248
|
+
Copy and paste this into your AI coding assistant after completing steps 1–3:
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
Style this app using the installed System Verification design system.
|
|
252
|
+
|
|
253
|
+
Context:
|
|
254
|
+
- sv-style.json, AGENTS.md, CLAUDE.md, docs/sv-style/, and the tokens CSS are already in this project
|
|
255
|
+
- Use AGENTS.md and docs/sv-style/DESIGN_SYSTEM.md as the source of truth for all decisions
|
|
256
|
+
- Use MCP tools if available. Load them first with ToolSearch select: syntax:
|
|
257
|
+
- VS Code: `select:mcp__vscode-mcp-gateway__get_tokens` / `get_component_spec` / `validate_file`
|
|
258
|
+
- Claude Code: `select:mcp__sv-style__get_tokens` / `get_component_spec` / `validate_file`
|
|
259
|
+
|
|
260
|
+
Before writing any CSS:
|
|
261
|
+
1. Load and call get_tokens, read the full output
|
|
262
|
+
2. Read docs/sv-style/DESIGN_SYSTEM.md
|
|
263
|
+
3. For each interactive component (button, input, card), call get_component_spec to check
|
|
264
|
+
whether a spec exists — only style to spec if one is found; otherwise follow the design
|
|
265
|
+
system conventions directly
|
|
266
|
+
|
|
267
|
+
Adding styles:
|
|
268
|
+
4. Identify the app entry point and main layout/component files
|
|
269
|
+
5. Import tokens.css before all other stylesheets in the entry point
|
|
270
|
+
6. Create a single app-level CSS file (e.g. app.css) for all layout and component styles
|
|
271
|
+
7. Add flat BEM-like class names to component markup — do not change behaviour or logic
|
|
272
|
+
Use names like: app-shell, app-header, app-brand, app-layout, app-sidebar, app-main,
|
|
273
|
+
app-footer, form-field, form-label, form-input, form-error, button-primary,
|
|
274
|
+
button-secondary, is-current, is-done, empty-state, content-block
|
|
275
|
+
8. Style all interactive controls used in the app:
|
|
276
|
+
- text inputs and textareas
|
|
277
|
+
- select dropdowns
|
|
278
|
+
- radio buttons and checkboxes
|
|
279
|
+
- buttons (primary, secondary, danger)
|
|
280
|
+
- pre / code blocks
|
|
281
|
+
9. Implement the standard app layout:
|
|
282
|
+
- full-height shell
|
|
283
|
+
- sticky header
|
|
284
|
+
- sidebar + main two-column layout on desktop
|
|
285
|
+
- single column at ≤900px
|
|
286
|
+
- footer anchored at bottom
|
|
287
|
+
|
|
288
|
+
Visual design requirements:
|
|
289
|
+
- Dark background using var(--color-dark-blue)
|
|
290
|
+
- Headings in HeadingFont, body text in BodyFont
|
|
291
|
+
- Sidebar: highlight current/active item with yellow treatment; mark completed items visibly
|
|
292
|
+
- Cards and panels: use documented translucent surfaces and borders
|
|
293
|
+
- Technical content blocks (code, output, pre): distinct styled areas
|
|
294
|
+
- Buttons: all five states — default, hover, active, focus-visible, disabled
|
|
295
|
+
- Inputs and selects: visible focus-visible yellow outline
|
|
296
|
+
- Error text: use error tokens/palette
|
|
297
|
+
- Muted/placeholder text: use documented muted palette values
|
|
298
|
+
|
|
299
|
+
Hard constraints:
|
|
300
|
+
- Do not hardcode colors — always use var(--color-*) tokens
|
|
301
|
+
- Do not use px for font-size — use rem
|
|
302
|
+
- Use only tokens and documented palette values for rgba()
|
|
303
|
+
- Dark mode only — no light theme
|
|
304
|
+
- Yellow (--color-yellow) is the only accent — use only on interactive/CTA elements
|
|
305
|
+
- Self-hosted fonts ("BodyFont", "HeadingFont") are already installed — add no external refs
|
|
306
|
+
- Do not change behaviour, flow logic, or existing content — only add classes and styles
|
|
307
|
+
|
|
308
|
+
After editing:
|
|
309
|
+
- Call validate_file on each CSS file you created or modified
|
|
310
|
+
- Fix all violations until every result is an empty array
|
|
311
|
+
- Provide: a short summary of changed files, the final validate_file result, and any
|
|
312
|
+
remaining assumptions or known limitations
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Ready-Made Claude Prompts
|
|
318
|
+
|
|
319
|
+
### Full scaffold — base CSS + HTML + layout shell
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
Read docs/sv-style/DESIGN_SYSTEM.md and src/styles/sv/tokens.css in this project,
|
|
323
|
+
then do the following:
|
|
324
|
+
|
|
325
|
+
1. Create a base CSS file that includes:
|
|
326
|
+
- @import or inline the tokens from src/styles/sv/tokens.css
|
|
327
|
+
- CSS reset (* { box-sizing: border-box; margin: 0; padding: 0; })
|
|
328
|
+
- Base body styles: BodyFont, dark-blue background, sand text, antialiased
|
|
329
|
+
- Base heading styles: HeadingFont, white, weight 600
|
|
330
|
+
- Sticky header with frosted-glass effect (backdrop-filter blur, dark-blue bg,
|
|
331
|
+
light-blue border-bottom)
|
|
332
|
+
- Button variants: .btn-primary, .btn-secondary, .btn-danger (pill radius)
|
|
333
|
+
- Badge variants: .badge with .badge-success, .badge-error, .badge-warning
|
|
334
|
+
- Input and select base styles (dark-blue bg, sand border, yellow focus ring)
|
|
335
|
+
- Card component (.card — translucent bg, hover lift)
|
|
336
|
+
- Toast component (.toast — pill radius, floating shadow)
|
|
337
|
+
|
|
338
|
+
2. Set up the HTML head with charset, viewport, favicon, title, and CSS link.
|
|
339
|
+
|
|
340
|
+
3. Create a base layout: sticky header (logo at 28px + project title),
|
|
341
|
+
<main> at max-width 1300px centered with 2rem/2.5rem padding, minimal footer.
|
|
342
|
+
|
|
343
|
+
Keep it minimal — only what DESIGN_SYSTEM.md specifies.
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### Minimal — CSS tokens only
|
|
347
|
+
|
|
348
|
+
```
|
|
349
|
+
Read docs/sv-style/DESIGN_SYSTEM.md and create only a base CSS file with the
|
|
350
|
+
@font-face declarations, :root tokens, CSS reset, and body/heading base styles.
|
|
351
|
+
Do not create any HTML or layout components.
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Tailwind — generate config from tokens
|
|
355
|
+
|
|
356
|
+
```
|
|
357
|
+
Read docs/sv-style/DESIGN_SYSTEM.md and create a tailwind.config.js that extends
|
|
358
|
+
the default theme with:
|
|
359
|
+
- colors: dark-blue, light-blue, sand, yellow, white, error, success
|
|
360
|
+
- borderRadius: sm (4px), md (8px), pill (100px)
|
|
361
|
+
- fontFamily: body (BodyFont, sans-serif), heading (HeadingFont, sans-serif)
|
|
362
|
+
- transitionDuration and timingFunction matching var(--transition)
|
|
363
|
+
|
|
364
|
+
Add @font-face declarations to the global CSS layer. Use exact values from
|
|
365
|
+
DESIGN_SYSTEM.md — do not approximate or rename tokens.
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### React — scaffold component library with CSS modules
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
Read docs/sv-style/DESIGN_SYSTEM.md and create a set of React components:
|
|
372
|
+
- Button (variants: primary, secondary, danger)
|
|
373
|
+
- Badge (variants: success, error, warning, info)
|
|
374
|
+
- Card (with hover lift)
|
|
375
|
+
- Input (yellow focus ring)
|
|
376
|
+
- AppHeader (sticky, frosted glass, logo + title)
|
|
377
|
+
- Toast (floating, default + error)
|
|
378
|
+
|
|
379
|
+
Use CSS modules (*.module.css). Import tokens from src/styles/sv/tokens.css.
|
|
380
|
+
Follow exact values from DESIGN_SYSTEM.md.
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## Brand Quick Reference
|
|
386
|
+
|
|
387
|
+
| Element | Value |
|
|
388
|
+
|---|---|
|
|
389
|
+
| Primary background | `var(--color-dark-blue)` — `#0B1B28` |
|
|
390
|
+
| Secondary background | `var(--color-light-blue)` — `#435364` |
|
|
391
|
+
| Primary text | `var(--color-sand)` — `#F2F2EA` |
|
|
392
|
+
| Accent / CTA | `var(--color-yellow)` — `#F7F965` |
|
|
393
|
+
| Headings | `var(--color-white)` — `#ffffff` |
|
|
394
|
+
| Error | `var(--color-error)` — `#ef4444` |
|
|
395
|
+
| Success | `var(--color-success)` — `#10b981` |
|
|
396
|
+
| Body font | `"BodyFont", sans-serif` |
|
|
397
|
+
| Heading font | `"HeadingFont", sans-serif` |
|
|
398
|
+
| Border radii | `var(--radius-sm)` 4px · `var(--radius-md)` 8px · `var(--radius-pill)` 100px |
|
|
399
|
+
| Logo | White SVG — dark backgrounds only |
|
|
400
|
+
| Favicon | PNG — orange/gold "S" symbol |
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## Notes
|
|
405
|
+
|
|
406
|
+
- **Fonts are self-hosted** `.woff2` files — no external CDN dependencies.
|
|
407
|
+
- **Dark-mode only.** No light theme is defined. If you need one, derive it from existing tokens.
|
|
408
|
+
- **Yellow is the only accent color.** Never introduce additional accent hues.
|
|
409
|
+
- **Logo is white SVG.** Only suitable for dark backgrounds.
|
|
410
|
+
- The CLI is a local Node.js script — no npm publishing required. Run it with `node`.
|
|
411
|
+
- `docs/sv-style/DESIGN_SYSTEM.md` in your project is a **managed copy** — edit the source (`docs/DESIGN_SYSTEM.md` in this kit) and run `update` to propagate changes.
|
package/bin/sv-style.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
3
|
+
import { dirname, join } from 'path';
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
const command = args[0];
|
|
9
|
+
|
|
10
|
+
function parseFlags(args) {
|
|
11
|
+
const flags = {};
|
|
12
|
+
for (let i = 1; i < args.length; i++) {
|
|
13
|
+
if (!args[i].startsWith('--')) continue;
|
|
14
|
+
const key = args[i].slice(2).replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
15
|
+
const next = args[i + 1];
|
|
16
|
+
if (next && !next.startsWith('--')) {
|
|
17
|
+
flags[key] = next;
|
|
18
|
+
i++;
|
|
19
|
+
} else {
|
|
20
|
+
flags[key] = true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return flags;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
switch (command) {
|
|
27
|
+
case 'init': {
|
|
28
|
+
const flags = parseFlags(args);
|
|
29
|
+
const { default: init } = await import(pathToFileURL(join(__dirname, '../src/init.js')));
|
|
30
|
+
await init(flags);
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
case 'update': {
|
|
34
|
+
const { default: update } = await import(pathToFileURL(join(__dirname, '../src/update.js')));
|
|
35
|
+
await update();
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
case 'mcp': {
|
|
39
|
+
await import(pathToFileURL(join(__dirname, '../src/mcp.js')));
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case 'login': {
|
|
43
|
+
const { default: login } = await import(pathToFileURL(join(__dirname, '../src/login.js')));
|
|
44
|
+
await login();
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case 'doctor': {
|
|
48
|
+
const { default: doctor } = await import(pathToFileURL(join(__dirname, '../src/doctor.js')));
|
|
49
|
+
await doctor();
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
default: {
|
|
53
|
+
console.log(`SV Style System CLI
|
|
54
|
+
|
|
55
|
+
Usage:
|
|
56
|
+
sv-style <command> [options]
|
|
57
|
+
|
|
58
|
+
Commands:
|
|
59
|
+
init Install SV Style into the current project
|
|
60
|
+
update Sync SV Style files and refresh private assets
|
|
61
|
+
login Check Azure Blob authentication status
|
|
62
|
+
doctor Diagnose installation health
|
|
63
|
+
mcp Start the MCP validation server (stdio)
|
|
64
|
+
|
|
65
|
+
Options for init:
|
|
66
|
+
--styles-dir <path> CSS tokens output dir (default: src/styles/sv)
|
|
67
|
+
--assets-dir <path> Assets output dir (default: public/sv-assets)
|
|
68
|
+
--docs-dir <path> Docs output dir (default: docs/sv-style)
|
|
69
|
+
--public-dir <path> Web root directory (default: public)
|
|
70
|
+
--require-assets Fail if private assets cannot be downloaded
|
|
71
|
+
`);
|
|
72
|
+
if (command) process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
}
|