AgentSkillsCN

maintaining-design-system

启动并监控klabo.world开发服务器及其所有依赖项。当运行服务器、管理草稿、启动开发环境,或排查启动问题时,可使用此方法。务必始终保持服务器运行,并对任何错误及时响应。

SKILL.md
--- frontmatter
name: maintaining-design-system
description: Enforces consistent design tokens, patterns, and component styles. Use when building new components, reviewing UI consistency, or extracting patterns from existing code.
invocation: auto

Maintaining Design System

Ensure design consistency across all UI by following established patterns.

Contents

klabo.world System

Direction: Editorial/Industrial hybrid

  • Dark-first design
  • Technical/code content focus
  • Amber accent for highlights
  • Dense information display

Tokens

Colors

css
/* Background */
--bg-base: theme('colors.zinc.950');      /* Page background */
--bg-surface: theme('colors.zinc.900');    /* Cards, surfaces */
--bg-elevated: theme('colors.zinc.800');   /* Hover, focus */

/* Foreground */
--fg-base: theme('colors.zinc.100');       /* Primary text */
--fg-muted: theme('colors.zinc.400');      /* Secondary text */
--fg-subtle: theme('colors.zinc.500');     /* Tertiary text */

/* Accent */
--accent: theme('colors.amber.500');       /* Primary accent */
--accent-muted: theme('colors.amber.500/10'); /* Accent backgrounds */

Spacing

ScaleValueUse
xs4pxIcon padding
sm8pxTight gaps
md16pxDefault gap
lg24pxSection gap
xl32pxMajor sections
2xl48pxPage sections

Typography

ElementClasses
Heading 1text-4xl font-bold tracking-tight
Heading 2text-2xl font-semibold
Heading 3text-xl font-medium
Bodytext-base text-zinc-300
Smalltext-sm text-zinc-400
Codefont-mono text-sm

Component Patterns

Buttons

tsx
// Primary
<button className="px-4 py-2 bg-amber-500 text-zinc-900 font-medium rounded-md hover:bg-amber-400 focus-visible:ring-2 ring-amber-500 ring-offset-2 ring-offset-zinc-900">
  Action
</button>

// Secondary
<button className="px-4 py-2 border border-zinc-700 text-zinc-100 rounded-md hover:bg-zinc-800 focus-visible:ring-2 ring-zinc-500 ring-offset-2 ring-offset-zinc-900">
  Action
</button>

Cards

tsx
// Standard card
<div className="bg-zinc-900/50 border border-zinc-800 rounded-lg p-4">
  {content}
</div>

// Highlighted card
<div className="bg-zinc-900/50 border border-amber-500/30 rounded-lg p-4">
  {content}
</div>

Callouts

tsx
// Info (amber)
<div className="bg-amber-500/10 border-l-4 border-amber-500 rounded-r-lg p-4">

// Warning (red)
<div className="bg-red-500/10 border-l-4 border-red-500 rounded-r-lg p-4">

// Success (green)
<div className="bg-green-500/10 border-l-4 border-green-500 rounded-r-lg p-4">

Links

tsx
// Inline link
<a className="text-amber-500 hover:underline">Link</a>

// Nav link
<a className="text-zinc-400 hover:text-zinc-100">Link</a>

Code Blocks

tsx
<pre className="bg-zinc-900 border border-zinc-800 rounded-lg p-4 overflow-x-auto">
  <code className="text-sm font-mono text-zinc-300">{code}</code>
</pre>

Validation

Before Shipping

  1. Color check - Only using defined palette
  2. Spacing check - Only using scale values
  3. Pattern check - Components match established patterns
  4. Dark mode - Works in dark theme
  5. Consistency - Matches existing similar components

Violations to Fix

ViolationFix
text-gray-*Use text-zinc-*
Arbitrary colorsUse token
rounded-xlUse rounded-lg or rounded-md
shadow-lgUse shadow-sm or none
Non-standard spacingUse scale

Command

bash
# Check for violations
grep -r "text-gray\|bg-gray\|border-gray" src/
grep -r "rounded-xl\|rounded-2xl\|rounded-3xl" src/