AGENT SKILL

theme-factory

Generate production-ready UI themes and token systems for CSS, Tailwind, and shadcn/ui. Use when users ask to apply a theme, theme an existing app, change colors and fonts, map dark/light mode tokens, or turn a palette into semantic variables. Trigger phrases include "apply a theme", "theme this app", "change the colors", and "re-theme this UI". Do not use for brand identity extraction, logo work, or full UI redesigns; use brand-guidelines or frontend-design instead.

License 许可
Apache-2.0
最近更新
2026-06-02
Stars
★ 0
Forks
0

01 前言 Front Matter

name
theme-factory
description
Generate production-ready UI themes and token systems for CSS, Tailwind, and shadcn/ui. Use when users ask to apply a theme, theme an existing app, change colors and fonts, map dark/light mode tokens, or turn a palette into semantic variables. Trigger phrases include "apply a theme", "theme this app", "change the colors", and "re-theme this UI". Do not use for brand identity extraction, logo work, or full UI redesigns; use brand-guidelines or frontend-design instead.

02 资源文件 4

03 SKILL.md 正文

Theme Factory

Create coherent themes with explicit semantic mapping and accessibility checks.

Scope

  • In scope: palette creation, semantic token mapping, mode pairing, export snippets.
  • Out of scope: complete product redesign, illustration generation, or logo design.

Input Modes

  • Description ("calm fintech dashboard") -> infer mood and contrast strategy.
  • Brand colors -> derive systematic scales.
  • Reference image -> sample dominant/accent clusters.
  • Existing config -> preserve structure and re-theme safely.

Process

1. Establish Anchor Colors

Define anchors:

  • primary — main action/brand color
  • secondary — supporting action or brand
  • accent — highlight, badge, tag
  • neutral — backgrounds, borders, text
  • destructive — errors, deletions

2. Build Scales

For each anchor, produce consistent steps (50-950 or 100-900). Preserve hue identity while varying luminance for usable UI depth.

3. Map Semantic Tokens

background    → neutral-50 (light) / neutral-950 (dark)
foreground    → neutral-950 (light) / neutral-50 (dark)
card          → neutral-100 (light) / neutral-900 (dark)
border        → neutral-200 (light) / neutral-800 (dark)
input         → neutral-200 (light) / neutral-800 (dark)
ring          → primary-500
muted         → neutral-100 (light) / neutral-800 (dark)
muted-fg      → neutral-500

4. Export In Requested Format

CSS Custom Properties (default)

:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --primary: 221 83% 53%;
  --primary-foreground: 210 40% 98%;
  /* ... */
}
.dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  /* ... */
}

Tailwind theme.extend.colors (on request)

colors: {
  primary: {
    50: '#eff6ff',
    500: '#3b82f6',
    950: '#1e3a5f',
  },
}

shadcn/ui globals.css block (on request) -> provide :root plus .dark with semantic variables.

Output Contract

Always return:

  • Theme intent (2-3 lines)
  • Anchor palette with rationale
  • Semantic mapping table
  • Export snippet(s)
  • Accessibility report and any auto-fixes

Contrast Validation

Check at minimum:

  • foreground on background: ≥ 7:1 (AAA body text)
  • primary-foreground on primary: ≥ 4.5:1 (AA)
  • Muted text on card: ≥ 3:1 (AA large text minimum)

If a pair fails, adjust and re-report corrected values.

Practical Rules

  • Keep hue count controlled; too many primaries reduces coherence.
  • Prefer semantic tokens over raw color references in component code.
  • Preserve existing project conventions when extending a live codebase.
  • Use the themes/ directory presets only as starting points, not hard constraints.

Validation Checklist

Before delivering a theme:

  • [ ] All anchor colors are defined (primary, secondary, accent, neutral, destructive).
  • [ ] Semantic token mapping is provided for both light and dark modes.
  • [ ] At minimum three contrast pairs are checked (fg/bg, primary/primary-fg, muted/card).
  • [ ] At least one export snippet is included in the requested format.
  • [ ] Hue count is justified if more than 2 anchors are used.
  • [ ] Auto-corrected values include before/after ratios.

Failure Modes

Symptom Likely Cause Fix
Dark mode looks washed out Neutral scale not inverted properly Swap luminance poles: light bg (neutral-50) → dark bg (neutral-950)
Primary button text unreadable Insufficient primary/primary-fg contrast Adjust primary-foreground to nearest value with ≥ 4.5:1
Theme feels incoherent Too many anchor hues (>3) Consolidate: one primary, one accent, neutral scale
Tailwind class names not resolving Colors not registered under extend.colors Add entries inside theme.extend.colors, not theme.colors
shadcn/ui component overrides ignored Variables missing HSL format shadcn expects H S% L% format without hsl() wrapper

Anti-Patterns

  • Raw hex in semantic tokens: Semantic tokens must reference the scale, not direct hex values; otherwise dark-mode toggle breaks.
  • Skipping scale steps: Jumping from 100 to 900 without intermediate stops limits UI depth; produce at minimum 100/200/300/500/700/900.
  • Copying palette without checking contrast: A palette that looks good in design tools often fails WCAG at actual font sizes.
  • Over-animating theme transitions: CSS variable transitions on every element tank performance; scope transitions to background-color and color only.
  • Ignoring input mode: Applying a "calm fintech" palette to a user-supplied brand palette silently overrides their intent.

Examples

  • "Apply a theme to this dashboard and give me matching Tailwind tokens."
  • "Theme this app for dark mode and export shadcn/ui variables."
  • "Change the colors and fonts, but keep the existing layout."

04 同仓库更多 Skills

dawsonblock
dawsonblock/agent_eval_skills_merged_clean

web-artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use when the user asks to build a complex web artifact, scaffold a React artifact project, bundle a single-file artifact, or generate shadcn/ui-based interactive UI components.

★ 0
dawsonblock
dawsonblock/agent_eval_skills_merged_clean

frontend-design

Design and implement distinctive, production-grade frontend interfaces for web pages, components, and apps. Use when users ask for UI design, layout polish, landing pages, dashboards, React components, HTML/CSS styling, or visual redesign. Trigger phrases include "design this UI", "build a landing page", "make this look better", "frontend component", "dashboard UI", and "polish the interface".

★ 0
dawsonblock
dawsonblock/agent_eval_skills_merged_clean

excalidraw

Generate architecture diagrams as .excalidraw files from codebase analysis. Use when the user asks to create architecture diagrams, system diagrams, visualize codebase structure, or generate excalidraw files.

★ 0
dawsonblock
dawsonblock/agent_eval_skills_merged_clean

brand-guidelines

Extract, normalize, and apply a brand system across UI, docs, and assets. Use when users ask for a brand kit, style guide, design tokens, tone rules, or brand-consistent output. Trigger phrases include "brand guidelines", "brand identity", "brand kit", "style guide", "brand colors", "brand fonts", "design tokens", and "make this on-brand".

★ 0
dawsonblock
dawsonblock/agent_eval_skills_merged_clean

pm-skills

Project management workflows — planning, tracking, and coordination for software and product teams. Use when the user wants to create a project plan, write a PRD, create tickets, define sprint goals, write a RACI matrix, run a retrospective, or manage project scope. Trigger phrases include "project plan", "project management", "sprint planning", "PRD", "product requirements", "roadmap", "milestone", "retro", "standup", "RACI", "risk register", "project timeline".

★ 0
dawsonblock
dawsonblock/agent_eval_skills_merged_clean

doc-coauthoring

Collaborative document editing workflows for merging changes, resolving comments, managing versions, and coordinating review cycles. Use when the user asks to coauthor, merge edits, handle tracked changes, resolve review comments, or run a multi-author doc review process. Trigger phrases include "coauthor", "document collaboration", "merge edits", "track changes", "document review", and "resolve comments".

★ 0