diff --git a/.opencode/command/changelog.md b/.opencode/commands/changelog.md similarity index 100% rename from .opencode/command/changelog.md rename to .opencode/commands/changelog.md diff --git a/.opencode/skills/theme-system/SKILL.md b/.opencode/skills/theme-system/SKILL.md new file mode 100644 index 00000000..9304a6ec --- /dev/null +++ b/.opencode/skills/theme-system/SKILL.md @@ -0,0 +1,205 @@ +--- +name: theme-system +description: Use when creating or modifying UI components, styling, or visual elements in OpenChamber. All UI colors must use theme tokens - never hardcoded values or Tailwind color classes. +license: MIT +compatibility: opencode +--- + +## Overview + +OpenChamber uses a JSON-based theme system. Themes are defined in `packages/ui/src/lib/theme/themes/`. Users can also add custom themes via `~/.config/openchamber/themes/`. + +**Core principle:** UI colors must use theme tokens - never hardcoded hex colors or Tailwind color classes. + +## When to Use + +- Creating or modifying UI components +- Working with colors, backgrounds, borders, or text + +## Quick Decision Tree + +1. **Code display?** → `syntax.*` +2. **Feedback/status?** → `status.*` +3. **Primary CTA?** → `primary.*` +4. **Interactive/clickable?** → `interactive.*` +5. **Background layer?** → `surface.*` +6. **Text?** → `surface.foreground` or `surface.mutedForeground` + +## Critical Rules + +- `surface.elevated` = inputs, cards, panels +- `interactive.hover` = **ONLY on clickable elements** +- `interactive.selection` = active/selected states (not primary!) +- Status colors = **ONLY for actual feedback** (errors, warnings, success) +- Input footers = `bg-transparent` on elevated background + +### Never Use + +- Hardcoded hex colors (`#FF0000`) +- Tailwind colors (`bg-white`, `text-blue-500`, `bg-gray-*`) +- Deprecated: `bg-secondary`, `bg-muted` + +## Usage + +### Via Hook +```tsx +import { useThemeSystem } from '@/contexts/useThemeSystem'; +const { currentTheme } = useThemeSystem(); + +
+``` + +### Via CSS Variables +```tsx +
+``` + +## Color Tokens + +### Surface Colors + +| Token | Usage | +|-------|-------| +| `surface.background` | Main app background | +| `surface.elevated` | Inputs, cards, panels, popovers | +| `surface.muted` | Secondary backgrounds, sidebars | +| `surface.foreground` | Primary text | +| `surface.mutedForeground` | Secondary text, hints | +| `surface.subtle` | Subtle dividers | + +### Interactive Colors + +| Token | Usage | +|-------|-------| +| `interactive.border` | Default borders | +| `interactive.hover` | Hover on **clickable elements only** | +| `interactive.selection` | Active/selected items | +| `interactive.selectionForeground` | Text on selection | +| `interactive.focusRing` | Focus indicators | + +### Status Colors + +| Token | Usage | +|-------|-------| +| `status.error` | Errors, validation failures | +| `status.warning` | Warnings, cautions | +| `status.success` | Success messages | +| `status.info` | Informational messages | + +Each has variants: `*`, `*Foreground`, `*Background`, `*Border`. + +### Primary Colors + +| Token | Usage | +|-------|-------| +| `primary.base` | Primary CTA buttons | +| `primary.hover` | Hover on primary elements | +| `primary.foreground` | Text on primary background | + +**Primary vs Selection:** Primary = "click me" (CTA), Selection = "currently active" (state). + +### Syntax Colors + +For code display only. Never use for UI elements. + +| Token | Usage | +|-------|-------| +| `syntax.base.background` | Code block background | +| `syntax.base.foreground` | Default code text | +| `syntax.base.keyword` | Keywords | +| `syntax.base.string` | Strings | +| `syntax.highlights.diffAdded` | Added lines | +| `syntax.highlights.diffRemoved` | Removed lines | + +## Examples + +### Input Area + +```tsx +const { currentTheme } = useThemeSystem(); + +
+