home / skills / openclaw / skills / theme-gen

theme-gen skill

/skills/lxgicstudios/theme-gen

This skill generates a complete design system from brand colors, producing semantic tokens, shade scales, and CSS variables.

npx playbooks add skill openclaw/skills --skill theme-gen

Review the files below or copy the command above to add this skill to your agents.

Files (12)
SKILL.md
2.6 KB
---
name: theme-gen
description: Generate a complete design system from brand colors using AI. Use when starting a new project or standardizing colors.
---

# Theme Generator

Give it your brand colors. Get back a complete design system with semantic tokens, shade scales, and ready-to-use CSS variables or Tailwind config. Stop manually picking 9 shades of blue.

**One command. Zero config. Just works.**

## Quick Start

```bash
npx ai-theme --primary "#3B82F6" --secondary "#10B981"
```

## What It Does

- Generates full color shade scales from your base colors (50 through 950)
- Creates semantic tokens like success, warning, error, info
- Outputs CSS custom properties, Tailwind config, or both
- Ensures accessible contrast ratios between foreground and background
- Builds consistent spacing and typography scales

## Usage Examples

```bash
# Generate from primary color only
npx ai-theme --primary "#6366F1"

# Full brand palette
npx ai-theme --primary "#3B82F6" --secondary "#10B981" --accent "#F59E0B"

# Output Tailwind config
npx ai-theme --primary "#8B5CF6" --format tailwind

# Include dark mode variants
npx ai-theme --primary "#EC4899" --dark-mode

# Export to file
npx ai-theme --primary "#14B8A6" -o ./theme.css
```

## Best Practices

- **Start with your hero color** - The primary color sets the tone. Get that right first
- **Don't fight the generated scales** - They're mathematically balanced. Trust the output
- **Test in context** - Paste the variables into your project and see how they look on real UI
- **Customize after generating** - Use this as a starting point, then tweak individual shades

## When to Use This

- Starting a new project and need a color system fast
- Client gave you one brand color and expects a full palette
- Converting a messy codebase to consistent design tokens
- Exploring color options during early design phases

## Part of the LXGIC Dev Toolkit

This is one of 110+ free developer tools built by LXGIC Studios. No paywalls, no sign-ups, no API keys on free tiers. Just tools that work.

**Find more:**
- GitHub: https://github.com/LXGIC-Studios
- Twitter: https://x.com/lxgicstudios
- Substack: https://lxgicstudios.substack.com
- Website: https://lxgic.dev

## Requirements

No install needed. Just run with npx. Node.js 18+ recommended.

```bash
npx ai-theme --help
```

## How It Works

The tool takes your base colors and uses color theory principles to generate harmonious shade scales. It calculates luminance values to ensure each step in the scale has proper contrast, then maps these to semantic purposes like backgrounds, text, and interactive states.

## License

MIT. Free forever. Use it however you want.

Overview

This skill generates a complete design system from your brand colors using AI. Provide one or more base colors and receive shade scales, semantic tokens, and ready-to-use outputs like CSS variables or Tailwind config. It speeds up design system bootstrapping and enforces accessible contrast automatically.

How this skill works

The tool analyzes your base colors and applies color theory and luminance calculations to produce harmonious shade scales (50–950). It maps those shades to semantic roles (primary, success, warning, error, info, background, text), ensures accessible contrast ratios, and emits CSS custom properties, Tailwind configuration, or both. Optional dark-mode variants and spacing/typography scales are generated to create a coherent system.

When to use it

  • Starting a new project and you need a full color system quickly
  • You have a single brand color and need a complete palette for UI work
  • Standardizing or converting an inconsistent codebase to design tokens
  • Creating accessible foreground/background pairs to meet contrast goals
  • Iterating color options during early design and prototyping phases

Best practices

  • Start with a strong primary (hero) color — it defines the overall tone
  • Trust the generated mathematical scales as a baseline, then tweak selectively
  • Test generated tokens in real UI contexts and across light/dark modes
  • Use semantic tokens (success, error, info) instead of raw hexs in code
  • Export to your preferred format (CSS variables or Tailwind) and commit tokens to a shared repo

Example use cases

  • Run one command to produce CSS variables and paste them into a new project's root stylesheet
  • Generate a Tailwind config from a client’s single brand color for consistent utility classes
  • Create dark-mode color variants and accessible text/background pairs for an app
  • Migrate a legacy site by replacing scattered color definitions with semantic tokens
  • Rapidly prototype multiple palettes for stakeholder review using the same base color

FAQ

Do I need to install anything?

No install is required; run the tool via npx with Node.js 18+ recommended.

Can I export both CSS variables and Tailwind config?

Yes. The skill can output CSS custom properties, Tailwind config, or both formats.