Harness design system

From Intense-Visions/harness-engineering · View interactive version

Harness design system is an AI agent skill from the GitHub repository Intense-Visions/harness-engineering. > 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.

How to use this skill

Skill file

Harness Design System

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.

When to Use

Process

Phase 1: DISCOVER -- Detect Existing Design System

  1. Read existing design files. Search for:
  1. Check harness configuration. Read harness.config.json and apply the design.enabled short-circuit _before_ doing anything else in Phase 1:

After the gate, read the remaining design configuration fields:

  1. Detect framework. Identify the CSS strategy in use:
  1. Identify existing patterns. Use Grep to find:
  1. 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.
  1. Report findings before proceeding. Present a summary:

Phase 2: DEFINE -- Select Palette, Typography, and Spacing

  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:
  1. Present typography pairings. Load pairings from agents/skills/shared/design-knowledge/typography/pairings.yaml. Present 3-5 options with:
  1. 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:
  1. Capture design intent. Ask the user to define:
  1. 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.

Phase 3: GENERATE -- Create Tokens and Documentation

  1. Generate design-system/tokens.json in W3C Design Token Community Group (DTCG) format. Structure:

```json

{

"color": {

"primary": {

"50": { "$value": "#eff6ff", "$type": "color", "$description": "Lightest primary" },

"500": { "$value": "#3b82f6", "$type": "color", "$description": "Base primary" },

"900": { "$value": "#1e3a5f", "$type": "color", "$description": "Darkest primary" }

},

"semantic": {

"success": {

"$value": "{color.green.500}",

"$type": "color",

"$description": "Success state"

},

"error": { "$value": "{color.red.500}", "$type": "color", "$description": "Error state" }

}

},

"typography": {

"heading": {

"fontFamily": { "$value": "Inter, system-ui, sans-serif", "$type": "fontFamily" },

"fontWeight": { "$value": 600, "$type": "fontWeight" }

},

"body": {

"fontFamily": { "$value": "Source Sans 3, system-ui, sans-serif", "$type": "fontFamily" },

"fontSize": { "$value": "1rem", "$type": "dimension" }

}

},

"spacing": {

"xs": { "$value": "4px", "$type": "dimension", "$description": "Extra small spacing" },

"sm": { "$value": "8px", "$type": "dimension", "$description": "Small spacing" },

"md": { "$value": "16px", "$type": "dimension", "$description": "Medium spacing" },

"lg": { "$value": "24px", "$type": "dimension", "$description": "Large spacing" },

"xl": { "$value": "32px", "$type": "dimension", "$description": "Extra large spacing" }

}

}

```

  1. Generate design-system/DESIGN.md with:
  1. 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:

Phase 4: VALIDATE -- Verify Tokens and Compliance

  1. Parse tokens.json against W3C DTCG structure. Verify:
  1. Check color contrast compliance. For every declared contrast pair:
  1. Verify typography completeness. Check that:
  1. Verify spacing scale. Check that:
  1. Run project health check. Execute harness validate to ensure the new files do not break any existing constraints.
  1. Report validation results. Present a summary:

Harness Integration

Success Criteria

Examples

Example: SaaS Dashboard Project

Context: New SaaS analytics dashboard. Industry: saas. No existing design system.

DISCOVER output:

Design System Discovery Report
-------------------------------
Existing token file:    No
Framework detected:     Tailwind CSS (tailwind.config.ts)
Unique colors found:    23 (high debt -- colors scattered across components)
Unique fonts found:     4 (medium debt -- inconsistent font usage)
Industry profile:       Loaded (saas) -- recommends professional blues, clean sans-serif
Design debt assessment: High -- no centralized design system, ad-hoc color usage

DEFINE choices:

Selected palette:     "Ocean Professional" (blue primary, slate neutral, emerald accent)
Selected typography:  Inter (headings, 600 weight) + Source Sans 3 (body, 400 weight)
Spacing base:         4px with standard multipliers
Style:                Minimal, data-focused
Tone:                 Cool, professional
Differentiator:       Dense information display with generous whitespace between sections
Anti-patterns:        No gradients on data elements, no decorative borders on cards

GENERATE output (tokens.json snippet):

{
  "color": {
    "primary": {
      "50": { "$value": "#eff6ff", "$type": "color", "$description": "Background tint" },
      "100": { "$value": "#dbeafe", "$type": "color", "$description": "Hover state" },
      "500": { "$value": "#3b82f6", "$type": "color", "$description": "Primary action" },
      "700": { "$value": "#1d4ed8", "$type": "color", "$description": "Primary text on light" },
      "900": { "$value": "#1e3a5f", "$type": "color", "$description": "Darkest primary" }
    },
    "neutral": {
      "50": { "$value": "#f8fafc", "$type": "color", "$description": "Page background" },
      "900": { "$value": "#0f172a", "$type": "color", "$description": "Primary text" }
    }
  },
  "typography": {
    "heading": {
      "fontFamily": { "$value": "Inter, system-ui, sans-serif", "$type": "fontFamily" }
    },
    "body": {
      "fontFamily": { "$value": "Source Sans 3, system-ui, sans-serif", "$type": "fontFamily" }
    }
  }
}

VALIDATE output:

Validation Results
------------------
DTCG structure:  PASS (42 tokens, all have $value and $type)
Contrast pairs:  PASS (12/12 pairs meet WCAG AA)
  - primary-700 on neutral-50:  8.1:1  PASS (normal text)
  - neutral-900 on neutral-50: 15.4:1  PASS (normal text)
  - neutral-50 on primary-500:  4.7:1  PASS (normal text)
Typography:      PASS (all fonts have fallback stacks)
Spacing:         PASS (monotonically increasing, no gaps)
Harness validate: PASS

Rationalizations to Reject

| Rationalization | Reality |

| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| "The project already has a tailwind.config with colors — I can derive the token set from that and skip the DEFINE phase." | Existing Tailwind config represents design debt, not design intent. The DEFINE phase exists to make deliberate choices about palette and typography. Deriving tokens from scattered config perpetuates the inconsistency the skill is meant to resolve. |

| "One of the contrast pairs is 4.3:1 — close enough to 4.5:1 to pass. I'll mark it as passing." | 4.3:1 fails WCAG AA for normal text. There is no "close enough." Flag the failure and ask the user to choose an alternative. Silently accepting sub-threshold contrast is a compliance defect. |

| "The user confirmed the palette in our conversation, so I can skip the formal confirmation gate and generate immediately." | The confirmation gate exists as a structural checkpoint, not a courtesy. Generate only after presenting the full palette + typography + spacing summary and receiving explicit approval. Conversation context can drift. |

| "There are no existing design files, so I can skip the DISCOVER phase and go straight to defining." | The DISCOVER phase also detects the CSS framework and existing color/font usage. Skipping it means the generated tokens may not map to the actual CSS strategy and the design debt assessment is lost. |

| "Fonts without fallback stacks are probably fine — modern browsers handle missing fonts gracefully." | A missing fallback stack is a token validation failure regardless of browser behavior. Every fontFamily token must include at least one generic fallback. This is a VALIDATE phase gate, not a style preference. |

Gates

These are hard stops. Violating any gate means the process has broken down.

Escalation

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.