@harness-engineering/cli 1.6.1 → 1.7.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/agents/personas/planner.yaml +27 -0
- package/dist/agents/personas/verifier.yaml +30 -0
- package/dist/agents/skills/claude-code/enforce-architecture/SKILL.md +19 -0
- package/dist/agents/skills/claude-code/harness-accessibility/SKILL.md +274 -0
- package/dist/agents/skills/claude-code/harness-accessibility/skill.yaml +51 -0
- package/dist/agents/skills/claude-code/harness-autopilot/SKILL.md +111 -72
- package/dist/agents/skills/claude-code/harness-autopilot/skill.yaml +4 -2
- package/dist/agents/skills/claude-code/harness-dependency-health/skill.yaml +1 -1
- package/dist/agents/skills/claude-code/harness-design/SKILL.md +265 -0
- package/dist/agents/skills/claude-code/harness-design/skill.yaml +53 -0
- package/dist/agents/skills/claude-code/harness-design-mobile/SKILL.md +336 -0
- package/dist/agents/skills/claude-code/harness-design-mobile/skill.yaml +49 -0
- package/dist/agents/skills/claude-code/harness-design-system/SKILL.md +282 -0
- package/dist/agents/skills/claude-code/harness-design-system/skill.yaml +50 -0
- package/dist/agents/skills/claude-code/harness-design-web/SKILL.md +360 -0
- package/dist/agents/skills/claude-code/harness-design-web/skill.yaml +52 -0
- package/dist/agents/skills/claude-code/harness-hotspot-detector/skill.yaml +1 -1
- package/dist/agents/skills/claude-code/harness-impact-analysis/SKILL.md +16 -0
- package/dist/agents/skills/claude-code/harness-integrity/SKILL.md +19 -1
- package/dist/agents/skills/claude-code/harness-knowledge-mapper/skill.yaml +1 -1
- package/dist/agents/skills/claude-code/harness-onboarding/SKILL.md +19 -1
- package/dist/agents/skills/claude-code/harness-release-readiness/SKILL.md +13 -9
- package/dist/agents/skills/claude-code/harness-security-scan/skill.yaml +1 -1
- package/dist/agents/skills/claude-code/harness-verify/SKILL.md +26 -0
- package/dist/agents/skills/gemini-cli/harness-accessibility/SKILL.md +274 -0
- package/dist/agents/skills/gemini-cli/harness-accessibility/skill.yaml +51 -0
- package/dist/agents/skills/gemini-cli/harness-autopilot/SKILL.md +111 -72
- package/dist/agents/skills/gemini-cli/harness-autopilot/skill.yaml +4 -2
- package/dist/agents/skills/gemini-cli/harness-dependency-health/skill.yaml +1 -1
- package/dist/agents/skills/gemini-cli/harness-design/SKILL.md +265 -0
- package/dist/agents/skills/gemini-cli/harness-design/skill.yaml +53 -0
- package/dist/agents/skills/gemini-cli/harness-design-mobile/SKILL.md +336 -0
- package/dist/agents/skills/gemini-cli/harness-design-mobile/skill.yaml +49 -0
- package/dist/agents/skills/gemini-cli/harness-design-system/SKILL.md +282 -0
- package/dist/agents/skills/gemini-cli/harness-design-system/skill.yaml +50 -0
- package/dist/agents/skills/gemini-cli/harness-design-web/SKILL.md +360 -0
- package/dist/agents/skills/gemini-cli/harness-design-web/skill.yaml +52 -0
- package/dist/agents/skills/gemini-cli/harness-hotspot-detector/skill.yaml +1 -1
- package/dist/agents/skills/gemini-cli/harness-impact-analysis/SKILL.md +16 -0
- package/dist/agents/skills/gemini-cli/harness-knowledge-mapper/skill.yaml +1 -1
- package/dist/agents/skills/gemini-cli/harness-release-readiness/SKILL.md +13 -9
- package/dist/agents/skills/gemini-cli/harness-security-scan/skill.yaml +1 -1
- package/dist/agents/skills/node_modules/.bin/vitest +2 -2
- package/dist/agents/skills/shared/design-knowledge/anti-patterns/color.yaml +106 -0
- package/dist/agents/skills/shared/design-knowledge/anti-patterns/layout.yaml +109 -0
- package/dist/agents/skills/shared/design-knowledge/anti-patterns/motion.yaml +109 -0
- package/dist/agents/skills/shared/design-knowledge/anti-patterns/typography.yaml +112 -0
- package/dist/agents/skills/shared/design-knowledge/industries/creative.yaml +80 -0
- package/dist/agents/skills/shared/design-knowledge/industries/ecommerce.yaml +80 -0
- package/dist/agents/skills/shared/design-knowledge/industries/emerging-tech.yaml +83 -0
- package/dist/agents/skills/shared/design-knowledge/industries/fintech.yaml +80 -0
- package/dist/agents/skills/shared/design-knowledge/industries/healthcare.yaml +80 -0
- package/dist/agents/skills/shared/design-knowledge/industries/lifestyle.yaml +80 -0
- package/dist/agents/skills/shared/design-knowledge/industries/saas.yaml +80 -0
- package/dist/agents/skills/shared/design-knowledge/industries/services.yaml +80 -0
- package/dist/agents/skills/shared/design-knowledge/palettes/curated.yaml +234 -0
- package/dist/agents/skills/shared/design-knowledge/platform-rules/android.yaml +125 -0
- package/dist/agents/skills/shared/design-knowledge/platform-rules/flutter.yaml +144 -0
- package/dist/agents/skills/shared/design-knowledge/platform-rules/ios.yaml +106 -0
- package/dist/agents/skills/shared/design-knowledge/platform-rules/web.yaml +102 -0
- package/dist/agents/skills/shared/design-knowledge/typography/pairings.yaml +274 -0
- package/dist/bin/harness.js +3 -2
- package/dist/{chunk-3U5VZYR7.js → chunk-4WUGOJQ7.js} +6 -3
- package/dist/{chunk-O6NEKDYP.js → chunk-FFIX3QVG.js} +697 -349
- package/dist/chunk-GA6GN5J2.js +6150 -0
- package/dist/dist-C4J67MPP.js +242 -0
- package/dist/dist-N4D4QWFV.js +2809 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +3 -2
- package/dist/validate-cross-check-WGXQ7K62.js +7 -0
- package/package.json +12 -8
- package/dist/validate-cross-check-LNIZ7KGZ.js +0 -6
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# Harness Design System
|
|
2
|
+
|
|
3
|
+
> Token-first design management. Discover existing design patterns, define intent through curated palettes and typography, generate W3C DTCG tokens, and validate every color pair for WCAG compliance.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Starting a new project that needs design tokens (colors, typography, spacing)
|
|
8
|
+
- Adding design consistency to an existing project that lacks a token system
|
|
9
|
+
- When `on_project_init` triggers fire and the project has no `design-system/tokens.json`
|
|
10
|
+
- When `on_new_feature` triggers fire with design scope (new theme, new component library, rebrand)
|
|
11
|
+
- Regenerating tokens after stakeholder feedback on palette or typography choices
|
|
12
|
+
- NOT for accessibility auditing of existing components (use harness-accessibility)
|
|
13
|
+
- NOT for aesthetic direction, mood boards, or brand strategy (use harness-design, Phase 4)
|
|
14
|
+
- NOT for platform-specific implementation of tokens into CSS/Tailwind/etc. (use harness-design-web/mobile, Phase 5)
|
|
15
|
+
- NOT for fixing individual contrast failures in code (use harness-accessibility fix phase)
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
|
|
19
|
+
### Phase 1: DISCOVER -- Detect Existing Design System
|
|
20
|
+
|
|
21
|
+
1. **Read existing design files.** Search for:
|
|
22
|
+
- `design-system/tokens.json` -- existing W3C DTCG tokens
|
|
23
|
+
- `design-system/DESIGN.md` -- existing design intent documentation
|
|
24
|
+
- `tailwind.config.*` -- Tailwind CSS configuration with theme overrides
|
|
25
|
+
- CSS files with custom properties (`--color-*`, `--font-*`, `--space-*`)
|
|
26
|
+
- `theme.ts`, `theme.js`, `styles/variables.*` -- CSS-in-JS or preprocessor variables
|
|
27
|
+
|
|
28
|
+
2. **Check harness configuration.** Read `harness.config.json` for:
|
|
29
|
+
- `design.strictness` -- enforcement level (`strict`, `standard`, `permissive`)
|
|
30
|
+
- `design.platforms` -- which platforms are enabled (web, mobile)
|
|
31
|
+
- `design.tokenPath` -- path to tokens file (default: `design-system/tokens.json`)
|
|
32
|
+
- `design.aestheticIntent` -- path to design intent doc (default: `design-system/DESIGN.md`)
|
|
33
|
+
|
|
34
|
+
3. **Detect framework.** Identify the CSS strategy in use:
|
|
35
|
+
- Tailwind CSS (presence of `tailwind.config.*`)
|
|
36
|
+
- CSS-in-JS (styled-components, Emotion, Stitches imports)
|
|
37
|
+
- CSS Modules (`.module.css` or `.module.scss` files)
|
|
38
|
+
- Vanilla CSS/SCSS (global stylesheets)
|
|
39
|
+
- None detected (greenfield)
|
|
40
|
+
|
|
41
|
+
4. **Identify existing patterns.** Use Grep to find:
|
|
42
|
+
- Color values: hex codes (`#[0-9a-fA-F]{3,8}`), rgb/hsl functions
|
|
43
|
+
- Font declarations: `font-family` properties, `@font-face` rules
|
|
44
|
+
- Spacing patterns: margin/padding values, gap values
|
|
45
|
+
- Count unique values to estimate design debt (many unique colors = high debt)
|
|
46
|
+
|
|
47
|
+
5. **Load industry recommendations.** If an industry is specified (via CLI arg or config), read the industry profile from `agents/skills/shared/design-knowledge/industries/{industry}.yaml`. This provides sector-specific guidance on color psychology, typography conventions, and regulatory considerations.
|
|
48
|
+
|
|
49
|
+
6. **Report findings before proceeding.** Present a summary:
|
|
50
|
+
- Existing token file: yes/no
|
|
51
|
+
- Framework detected: [name]
|
|
52
|
+
- Unique colors found: [count]
|
|
53
|
+
- Unique fonts found: [count]
|
|
54
|
+
- Industry profile loaded: yes/no
|
|
55
|
+
- Design debt assessment: low/medium/high
|
|
56
|
+
|
|
57
|
+
### Phase 2: DEFINE -- Select Palette, Typography, and Spacing
|
|
58
|
+
|
|
59
|
+
1. **Present palette options.** Load curated palettes from `agents/skills/shared/design-knowledge/palettes/curated.yaml`. Filter by industry tags if an industry is specified. Present 3-5 palette options with:
|
|
60
|
+
- Palette name and description
|
|
61
|
+
- Primary, secondary, accent, neutral color ramps
|
|
62
|
+
- Semantic colors (success, warning, error, info)
|
|
63
|
+
- Pre-computed contrast ratios for common pairs (text-on-background)
|
|
64
|
+
|
|
65
|
+
2. **Present typography pairings.** Load pairings from `agents/skills/shared/design-knowledge/typography/pairings.yaml`. Present 3-5 options with:
|
|
66
|
+
- Heading font + body font combination
|
|
67
|
+
- Fallback stacks for each font
|
|
68
|
+
- Recommended size scale (base size, scale ratio)
|
|
69
|
+
- Line height and letter spacing recommendations
|
|
70
|
+
|
|
71
|
+
3. **Define spacing scale.** Default: 4px base with multipliers [0.25, 0.5, 1, 1.5, 2, 3, 4, 6, 8, 12, 16]. Allow customization of:
|
|
72
|
+
- Base unit (4px, 8px)
|
|
73
|
+
- Scale multipliers
|
|
74
|
+
- Named aliases (xs, sm, md, lg, xl, 2xl, etc.)
|
|
75
|
+
|
|
76
|
+
4. **Capture design intent.** Ask the user to define:
|
|
77
|
+
- Style: minimal, expressive, corporate, playful, editorial
|
|
78
|
+
- Tone: warm, cool, neutral, bold, muted
|
|
79
|
+
- Key differentiator: what makes this product's visual identity unique
|
|
80
|
+
- Anti-patterns: specific design choices to avoid
|
|
81
|
+
|
|
82
|
+
5. **Confirm all choices.** Present a complete summary of palette, typography, spacing, and intent. Wait for user confirmation before generating. This is a hard gate -- no generation without confirmation.
|
|
83
|
+
|
|
84
|
+
### Phase 3: GENERATE -- Create Tokens and Documentation
|
|
85
|
+
|
|
86
|
+
1. **Generate `design-system/tokens.json`** in W3C Design Token Community Group (DTCG) format. Structure:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"color": {
|
|
91
|
+
"primary": {
|
|
92
|
+
"50": { "$value": "#eff6ff", "$type": "color", "$description": "Lightest primary" },
|
|
93
|
+
"500": { "$value": "#3b82f6", "$type": "color", "$description": "Base primary" },
|
|
94
|
+
"900": { "$value": "#1e3a5f", "$type": "color", "$description": "Darkest primary" }
|
|
95
|
+
},
|
|
96
|
+
"semantic": {
|
|
97
|
+
"success": {
|
|
98
|
+
"$value": "{color.green.500}",
|
|
99
|
+
"$type": "color",
|
|
100
|
+
"$description": "Success state"
|
|
101
|
+
},
|
|
102
|
+
"error": { "$value": "{color.red.500}", "$type": "color", "$description": "Error state" }
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"typography": {
|
|
106
|
+
"heading": {
|
|
107
|
+
"fontFamily": { "$value": "Inter, system-ui, sans-serif", "$type": "fontFamily" },
|
|
108
|
+
"fontWeight": { "$value": 600, "$type": "fontWeight" }
|
|
109
|
+
},
|
|
110
|
+
"body": {
|
|
111
|
+
"fontFamily": { "$value": "Source Sans 3, system-ui, sans-serif", "$type": "fontFamily" },
|
|
112
|
+
"fontSize": { "$value": "1rem", "$type": "dimension" }
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"spacing": {
|
|
116
|
+
"xs": { "$value": "4px", "$type": "dimension", "$description": "Extra small spacing" },
|
|
117
|
+
"sm": { "$value": "8px", "$type": "dimension", "$description": "Small spacing" },
|
|
118
|
+
"md": { "$value": "16px", "$type": "dimension", "$description": "Medium spacing" },
|
|
119
|
+
"lg": { "$value": "24px", "$type": "dimension", "$description": "Large spacing" },
|
|
120
|
+
"xl": { "$value": "32px", "$type": "dimension", "$description": "Extra large spacing" }
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
2. **Generate `design-system/DESIGN.md`** with:
|
|
126
|
+
- Aesthetic direction (style, tone, differentiator)
|
|
127
|
+
- Color usage guidelines (when to use primary vs. secondary vs. accent)
|
|
128
|
+
- Typography hierarchy (h1-h6 sizing, body text, captions)
|
|
129
|
+
- Spacing conventions (component padding, layout gaps, section margins)
|
|
130
|
+
- Anti-patterns (explicitly forbidden design choices)
|
|
131
|
+
- Platform-specific notes (Tailwind class mappings, CSS variable names)
|
|
132
|
+
- Strictness override instructions (how to change `design.strictness`)
|
|
133
|
+
|
|
134
|
+
3. **Populate the knowledge graph.** If a graph exists at `.harness/graph/`, run `DesignIngestor` from `packages/graph/src/ingest/DesignIngestor.ts` to create graph nodes for:
|
|
135
|
+
- Each color token (type: `design_token`, subtype: `color`)
|
|
136
|
+
- Each typography token (type: `design_token`, subtype: `typography`)
|
|
137
|
+
- Each spacing token (type: `design_token`, subtype: `spacing`)
|
|
138
|
+
- The aesthetic intent (type: `aesthetic_intent`) with style, tone, differentiator, and strictness properties
|
|
139
|
+
- `declares_intent` edges from the project to the aesthetic intent node
|
|
140
|
+
|
|
141
|
+
### Phase 4: VALIDATE -- Verify Tokens and Compliance
|
|
142
|
+
|
|
143
|
+
1. **Parse `tokens.json` against W3C DTCG structure.** Verify:
|
|
144
|
+
- Every token has `$value` and `$type` fields
|
|
145
|
+
- Token references (e.g., `{color.primary.500}`) resolve to existing tokens
|
|
146
|
+
- No orphan tokens (defined but never referenced in DESIGN.md or usage guidelines)
|
|
147
|
+
|
|
148
|
+
2. **Check color contrast compliance.** For every declared contrast pair:
|
|
149
|
+
- Calculate the contrast ratio using the WCAG 2.1 relative luminance formula
|
|
150
|
+
- Normal text (< 18px): require >= 4.5:1 ratio (WCAG AA)
|
|
151
|
+
- Large text (>= 18px or >= 14px bold): require >= 3:1 ratio (WCAG AA)
|
|
152
|
+
- Report each pair with its ratio and pass/fail status
|
|
153
|
+
|
|
154
|
+
3. **Verify typography completeness.** Check that:
|
|
155
|
+
- Every font family declaration includes a fallback stack (at least `system-ui` or `sans-serif`/`serif`/`monospace`)
|
|
156
|
+
- Heading and body fonts are different (unless intentional single-font system)
|
|
157
|
+
- Font weights are specified as numbers, not names
|
|
158
|
+
|
|
159
|
+
4. **Verify spacing scale.** Check that:
|
|
160
|
+
- Spacing values are monotonically increasing
|
|
161
|
+
- No gaps in the scale (e.g., jumping from 8px to 48px with nothing between)
|
|
162
|
+
- Base unit is consistent across all values
|
|
163
|
+
|
|
164
|
+
5. **Run project health check.** Execute `harness validate` to ensure the new files do not break any existing constraints.
|
|
165
|
+
|
|
166
|
+
6. **Report validation results.** Present a summary:
|
|
167
|
+
- DTCG structure: pass/fail with details
|
|
168
|
+
- Contrast pairs: N passed, M failed (list failures)
|
|
169
|
+
- Typography: pass/fail with details
|
|
170
|
+
- Spacing: pass/fail with details
|
|
171
|
+
- Harness validate: pass/fail
|
|
172
|
+
|
|
173
|
+
## Harness Integration
|
|
174
|
+
|
|
175
|
+
- **`harness validate`** -- Run after generating tokens to verify project health. Token generation must not break existing constraints.
|
|
176
|
+
- **`harness scan`** -- Run after token changes to refresh the knowledge graph. Updated graph enables impact analysis when tokens are modified later.
|
|
177
|
+
- **`DesignIngestor`** (`packages/graph/src/ingest/DesignIngestor.ts`) -- Parses `tokens.json` and `DESIGN.md` to create graph nodes representing the design system. Called during the GENERATE phase.
|
|
178
|
+
- **`DesignConstraintAdapter`** (`packages/graph/src/constraints/DesignConstraintAdapter.ts`) -- Enforces design constraints by checking for `VIOLATES` edges in the graph. Used during validation to detect constraint violations.
|
|
179
|
+
- **`harness-impact-analysis`** -- When tokens change, impact analysis traces which components consume affected tokens, enabling targeted re-validation.
|
|
180
|
+
|
|
181
|
+
## Success Criteria
|
|
182
|
+
|
|
183
|
+
- `design-system/tokens.json` exists and is valid W3C DTCG format (every token has `$value` and `$type`)
|
|
184
|
+
- `design-system/DESIGN.md` exists with aesthetic direction, usage guidelines, anti-patterns, and platform notes
|
|
185
|
+
- All declared color contrast pairs pass WCAG AA thresholds (4.5:1 normal text, 3:1 large text)
|
|
186
|
+
- Every font family has a fallback stack
|
|
187
|
+
- Spacing scale is monotonically increasing with no gaps
|
|
188
|
+
- Graph nodes created for each token (if graph exists at `.harness/graph/`)
|
|
189
|
+
- `harness validate` passes after token generation
|
|
190
|
+
- User confirmed palette and typography choices before generation
|
|
191
|
+
|
|
192
|
+
## Examples
|
|
193
|
+
|
|
194
|
+
### Example: SaaS Dashboard Project
|
|
195
|
+
|
|
196
|
+
**Context:** New SaaS analytics dashboard. Industry: `saas`. No existing design system.
|
|
197
|
+
|
|
198
|
+
**DISCOVER output:**
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
Design System Discovery Report
|
|
202
|
+
-------------------------------
|
|
203
|
+
Existing token file: No
|
|
204
|
+
Framework detected: Tailwind CSS (tailwind.config.ts)
|
|
205
|
+
Unique colors found: 23 (high debt -- colors scattered across components)
|
|
206
|
+
Unique fonts found: 4 (medium debt -- inconsistent font usage)
|
|
207
|
+
Industry profile: Loaded (saas) -- recommends professional blues, clean sans-serif
|
|
208
|
+
Design debt assessment: High -- no centralized design system, ad-hoc color usage
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**DEFINE choices:**
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
Selected palette: "Ocean Professional" (blue primary, slate neutral, emerald accent)
|
|
215
|
+
Selected typography: Inter (headings, 600 weight) + Source Sans 3 (body, 400 weight)
|
|
216
|
+
Spacing base: 4px with standard multipliers
|
|
217
|
+
Style: Minimal, data-focused
|
|
218
|
+
Tone: Cool, professional
|
|
219
|
+
Differentiator: Dense information display with generous whitespace between sections
|
|
220
|
+
Anti-patterns: No gradients on data elements, no decorative borders on cards
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**GENERATE output (tokens.json snippet):**
|
|
224
|
+
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"color": {
|
|
228
|
+
"primary": {
|
|
229
|
+
"50": { "$value": "#eff6ff", "$type": "color", "$description": "Background tint" },
|
|
230
|
+
"100": { "$value": "#dbeafe", "$type": "color", "$description": "Hover state" },
|
|
231
|
+
"500": { "$value": "#3b82f6", "$type": "color", "$description": "Primary action" },
|
|
232
|
+
"700": { "$value": "#1d4ed8", "$type": "color", "$description": "Primary text on light" },
|
|
233
|
+
"900": { "$value": "#1e3a5f", "$type": "color", "$description": "Darkest primary" }
|
|
234
|
+
},
|
|
235
|
+
"neutral": {
|
|
236
|
+
"50": { "$value": "#f8fafc", "$type": "color", "$description": "Page background" },
|
|
237
|
+
"900": { "$value": "#0f172a", "$type": "color", "$description": "Primary text" }
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"typography": {
|
|
241
|
+
"heading": {
|
|
242
|
+
"fontFamily": { "$value": "Inter, system-ui, sans-serif", "$type": "fontFamily" }
|
|
243
|
+
},
|
|
244
|
+
"body": {
|
|
245
|
+
"fontFamily": { "$value": "Source Sans 3, system-ui, sans-serif", "$type": "fontFamily" }
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**VALIDATE output:**
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
Validation Results
|
|
255
|
+
------------------
|
|
256
|
+
DTCG structure: PASS (42 tokens, all have $value and $type)
|
|
257
|
+
Contrast pairs: PASS (12/12 pairs meet WCAG AA)
|
|
258
|
+
- primary-700 on neutral-50: 8.1:1 PASS (normal text)
|
|
259
|
+
- neutral-900 on neutral-50: 15.4:1 PASS (normal text)
|
|
260
|
+
- neutral-50 on primary-500: 4.7:1 PASS (normal text)
|
|
261
|
+
Typography: PASS (all fonts have fallback stacks)
|
|
262
|
+
Spacing: PASS (monotonically increasing, no gaps)
|
|
263
|
+
Harness validate: PASS
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Gates
|
|
267
|
+
|
|
268
|
+
These are hard stops. Violating any gate means the process has broken down.
|
|
269
|
+
|
|
270
|
+
- **No tokens generated without user confirming palette and typography choices.** The DEFINE phase must end with explicit user confirmation. Do not auto-select and generate.
|
|
271
|
+
- **No `tokens.json` written without passing DTCG schema validation.** Every token must have `$value` and `$type`. Malformed tokens are rejected before writing to disk.
|
|
272
|
+
- **No contrast pair allowed below 4.5:1 for normal text.** If a selected palette produces a failing contrast pair, flag it and ask the user to choose an alternative. Do not silently accept.
|
|
273
|
+
- **No fonts without fallback stacks.** Every `fontFamily` token must include at least one generic fallback (`sans-serif`, `serif`, `monospace`, or `system-ui`).
|
|
274
|
+
- **No spacing scale with non-monotonic values.** If a user customizes spacing, validate that values increase. Reject scales where `md` is larger than `lg`.
|
|
275
|
+
|
|
276
|
+
## Escalation
|
|
277
|
+
|
|
278
|
+
- **After 3 failed contrast validations on the same palette:** Suggest an alternative palette from the curated set that has pre-verified contrast ratios. Present the alternative with a comparison showing which pairs now pass.
|
|
279
|
+
- **When user rejects all curated palettes:** Accept custom colors but warn: "Custom colors have not been pre-validated for contrast compliance. Running full contrast check now." Run validation and report results before generating.
|
|
280
|
+
- **When existing project has conflicting design patterns:** Surface the specific conflicts (e.g., "Found 5 different blue values across 12 components"). Ask the user to choose: consolidate to the new palette, or map each existing value to the nearest token. Do not silently override existing colors.
|
|
281
|
+
- **When `design.strictness` is set to `permissive` but contrast fails:** Still report the failure as a warning. Permissive mode does not suppress contrast checks -- it only changes the severity from error to warning.
|
|
282
|
+
- **When the graph is unavailable:** Skip the graph population step in GENERATE. Log: "Graph not available at .harness/graph/ -- skipping token graph population. Run `harness scan` later to populate." Continue with file generation.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: harness-design-system
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: Design token generation, palette selection, typography, spacing, and design intent management
|
|
4
|
+
cognitive_mode: constructive-architect
|
|
5
|
+
triggers:
|
|
6
|
+
- manual
|
|
7
|
+
- on_new_feature
|
|
8
|
+
- on_project_init
|
|
9
|
+
platforms:
|
|
10
|
+
- claude-code
|
|
11
|
+
- gemini-cli
|
|
12
|
+
tools:
|
|
13
|
+
- Bash
|
|
14
|
+
- Read
|
|
15
|
+
- Write
|
|
16
|
+
- Edit
|
|
17
|
+
- Glob
|
|
18
|
+
- Grep
|
|
19
|
+
cli:
|
|
20
|
+
command: harness skill run harness-design-system
|
|
21
|
+
args:
|
|
22
|
+
- name: path
|
|
23
|
+
description: Project root path
|
|
24
|
+
required: false
|
|
25
|
+
- name: industry
|
|
26
|
+
description: Industry vertical for recommendations (e.g., saas, fintech, healthcare)
|
|
27
|
+
required: false
|
|
28
|
+
mcp:
|
|
29
|
+
tool: run_skill
|
|
30
|
+
input:
|
|
31
|
+
skill: harness-design-system
|
|
32
|
+
path: string
|
|
33
|
+
type: rigid
|
|
34
|
+
phases:
|
|
35
|
+
- name: discover
|
|
36
|
+
description: Detect existing design system, tokens, frameworks, and project context
|
|
37
|
+
required: true
|
|
38
|
+
- name: define
|
|
39
|
+
description: Define design intent, select palette, typography, spacing scale
|
|
40
|
+
required: true
|
|
41
|
+
- name: generate
|
|
42
|
+
description: Generate W3C DTCG tokens.json and DESIGN.md
|
|
43
|
+
required: true
|
|
44
|
+
- name: validate
|
|
45
|
+
description: Validate tokens against schema, check contrast pairs, verify completeness
|
|
46
|
+
required: true
|
|
47
|
+
state:
|
|
48
|
+
persistent: false
|
|
49
|
+
files: []
|
|
50
|
+
depends_on: []
|