Your AI assistant, now fluent in your design system.
A Claude Code skill that teaches Claude, Cursor, and Copilot the Softuq rules before they write a single line of UI. Typography, spacing, tokens, components — enforced, not suggested.
npx softuq skillWhy a skill
CLAUDE.md is a long doc. A skill is a checklist.
Same rules, different delivery. Agents read the skill before writing code — not in passing.
Pre-flight, not post-hoc
Agent runs a checklist before writing any UI — catches mistakes at source, not in review.
Enforces, doesn't suggest
7 hard rules + 9 red flags. Not guidelines — requirements.
Lazy-loaded context
Core SKILL.md is ~8KB. Deep references pulled on-demand. Agent's context stays lean.
Works with any AI
Standard skill format — Claude Code, Cursor rules, Copilot. Copy-paste, no runtime.
Install
Pick your scope.
Three ways to install. Skill activates automatically once it's in .claude/skills/.
npx softuq skillInstalls to .claude/skills/softuq/ in the current directory. Active only in this project. Recommended for Softuq-based apps.
What's inside
One checklist, seven reference files.
The agent reads SKILL.md first. Deep references load on demand.
SKILL.mdPre-flight checklist & red flags
The entry point Claude reads first. 9 rules, mobile-first patterns, 21 anti-patterns.
references/typography.mdTypography
Body scale, heading rules (H1/H2 text-balance), paragraph hierarchy, input 16px floor.
references/spacing.mdSpacing
4px grid, stack hierarchy, page rhythm, app vs web, decision tree.
references/tokens.mdTokens & colors
Three-layer architecture, semantic utilities, OKLCH, radius, shadows.
references/icons.mdIcons
Lucide vs Simple Icons split, sizing, currentColor rules.
references/components.mdComponents
Full CVA template, forwardRef pattern, composable APIs.
references/content-quality.mdContent quality
Realistic names and brands, messy numbers, avatar rules, copy tone, emoji policy.
references/layout-variance.mdLayout variance
Hero variants, feature-row patterns beyond 3-column cards, hierarchy via weight, accent discipline.
examples/component.tsxCanonical component
Working Badge component — copy-paste template for new components.
Preview
The skill, in full.
Nothing hidden. This is exactly what Claude reads.
--- name: softuq description: Use before writing or modifying ANY UI in a Softuq project. Enforces design-system rules for tokens, typography, spacing, radius, borders, elevation, motion, components, forms, icons, microcopy and accessibility. Triggers on landing pages, hero sections, blocks, templates, cards, forms, inputs, dialogs, any JSX/TSX file that renders visual UI, theming, dark/light mode, or discussions of styling, CSS, Tailwind classes and design decisions. --- # Softuq - rules for building UI with the design system Softuq is copy-paste: components live in your project (`components/ui/`), tokens arrive as CSS. You own the code, so the rules below are what keeps it one system. Details live in `references/`; read the matching file when a checklist item is unclear. ## Hard gates (before any markup) 1. **Reuse-first.** In order: (a) is there a Softuq component for this (`components/ui/`, `npx softuq list`)? (b) is there a block on softuq.com/blocks with this shape (navbar, hero, FAQ, pricing, footer, auth, dashboard)? (c) can an existing component take it through `className`? Only after three "no" may you compose something new. Hand-rolling a dialog, select, menu, tooltip or toast that Softuq ships is a bug, not a style choice. 2. **New-in-DS check.** The design needs a variant, token, size, icon set or component that is not listed in `references/components.md` or `references/tokens.md`? **Stop. Do not invent it silently.** Name the gap, propose the smallest addition (token in `semantic.css`, variant in the component's CVA), and decide with the user. 3. **Decision log (Softuq repo only).** Before questioning an established pattern, read `docs/decisions.md`. New significant decisions are appended there, never rewritten. ## Pre-flight checklist 1. [ ] **Tokens, never hex.** Semantic utilities only: `bg-surface-*`, `text-fg-*`, `border-edge-*`, `accent-*`, status families. `bg-bg-*` classes do not exist. Text on `bg-accent` = `text-on-accent`; on solid status fills `text-on-destructive|success|warning|info` (never `text-white`, never `text-fg-inverse`). 2. [ ] **Text by role.** Headings use `type-h1..h4` (or the canonical plain recipe in `references/typography.md`); H1/H2 get `text-balance`, paragraphs `text-pretty`. Every `<p>` has an explicit `text-*` or `type-*` class. No `text-[Npx]`; `text-xs` (12px) is the floor. Sentence case everywhere. 3. [ ] **Spacing by role** on the 4px grid: inset, gap, stack, section are different things. Density-dependent spacing (card padding, page padding, section rhythm, stacks) uses `--ds-space-*` tokens; intra-component pair/group gaps may use 4px-grid numerics (`gap-1.5`, `gap-2`). Layout provides spacing between blocks, components carry no outer margin. 4. [ ] **Hit areas.** Every pointer target at least 24x24px (extend with padding or `before:absolute before:-inset-2`), 8px between adjacent targets, primary actions 40-48px. Control heights: sm 32 / md 40 / lg 48 via `min-h-8/10/12`, never fixed `h-*` on text-bearing controls. 5. [ ] **Radius by role:** `rounded-[var(--ds-radius-control|field|surface|overlay|menu)]`. Menus sit one step below overlays. Nested = outer minus padding. Radius never changes across states. 6. [ ] **Borders:** 1px = structure, 2px = focus ring only. Fields use `border-edge-field`; dividers `border-edge-divider`. 7. [ ] **Elevation as a package:** bg + border + shadow + z chosen together (`references/elevation.md`). Z only via `z-dropdown|sticky|overlay|modal|popover|toast`. 8. [ ] **Motion by intent:** tokens only (`duration-fast|normal|slow`, `ease-soft|smooth|bounce`, `animate-*`). Transition specific properties (`transition-colors`, `transition-opacity`, `transition-transform`), never `transition-all`. Hover and press never move or scale. Exits faster than enters. Reduced motion is global, do not add guards. 9. [ ] **Every interactive element:** `cursor-pointer`, a hover state, the focus recipe (controls: `focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`; fields: `focus-visible:field-glow`), `disabled:pointer-events-none`, `type="button"` on buttons, `select-none` on chrome you act on, `aria-label` on icon-only buttons. 10. [ ] **States are tokens:** disabled filled controls use `bg-surface-disabled text-fg-disabled border-edge-disabled` (binary controls keep `disabled:opacity-50`); placeholders `placeholder:text-fg-placeholder`; status (success/warning/destructive/info) only for real state, always with icon or text. 11. [ ] **Components:** CVA + `cn()` + `React.forwardRef`, file order Imports -> CVA -> Interface -> Component -> Exports. Prop vocabulary `variant`, `size` (sm/md/lg), `disabled`, `value`/`defaultValue`/`on<X>Change`. No baked user-facing strings: every visible or aria string is a prop with an English default. 12. [ ] **Icons:** `lucide-react` (UI) and `@icons-pack/react-simple-icons` (brands), never inline `<svg>`. Size via `size-*`, color via `currentColor`. Selection checks `strokeWidth={3}`. Decorative icons `aria-hidden="true"`. 13. [ ] **UX baseline** (`references/accessibility.md`): max one primary button per view; destructive is never the default and its confirm pre-focuses Cancel; reversible actions run immediately with an Undo toast; never gate submit behind `disabled`; loading signal matches the wait; hover is never the only path; keyboard follows the APG models. 14. [ ] **Copy** (`references/microcopy.md`, `references/content-quality.md`): numerals, positive framing, plain verb labels ("Create project", not "Get started"), fix-first errors without "you", links name their destination, realistic names and numbers, `tabular-nums` on stats. If any box fails, stop and fix before continuing. ## Question -> reference | Question | Read | |---|---| | Which color, status, disabled or placeholder token? Is this pairing allowed? | `references/tokens.md` | | Which text role, size, casing, link style, wrap behavior? | `references/typography.md` | | Which spacing token? Rhythm between title, description, action? Touch targets? Content width? | `references/spacing.md` | | Radius role? Focus ring? Separators? Field border? | `references/radius-borders.md` | | Shadow and z for a card, popover, dialog, toast? | `references/elevation.md` | | Should this animate? Which animation? | `references/motion.md` | | Which component, variant, size, prop? Dialog or Sheet? Forms? New component contract? | `references/components.md`, `examples/component.tsx` | | Which icon library, size, stroke? | `references/icons.md` | | Button label, error, empty state, pricing copy? | `references/microcopy.md` | | Placeholder names, numbers, avatars, imagery? | `references/content-quality.md` | | Hero or feature-row composition, accent discipline? | `references/layout-variance.md` | | Primary actions, confirms, loading, keyboard, contrast, target size? | `references/accessibility.md` | | Dark/light, provider axes, SSR flicker, forced-theme islands? | `references/theming.md` | ## Validation loop After changing UI, run and fix until clean: ```bash pnpm lint # Biome (or the project's lint script) npx tsc --noEmit # types npx softuq doctor # setup: alias, CSS import order, provider, theme script, fonts npx softuq diff # local components drifted from upstream? ``` In the Softuq repo, `pnpm --filter @softuq/tokens contrast` checks token pairs. Contrast: any new text/surface pair must reach 4.5:1 (3:1 for large text and UI boundaries) in both themes. Check it, do not assume it; `text-fg-muted` is metadata-only and `text-fg-dimmed` is never readable text. Check every visual change in both themes and at 390px and 1280px widths. ## Red flags | Anti-pattern | Instead | |---|---| | `bg-bg-card`, `bg-bg-base`, `ring-offset-bg-base`, `--ds-radius-badge` | `bg-surface-card`, `bg-surface-base`, `ring-offset-surface-base`, `--ds-radius-control` (these old names do not exist) | | `bg-[#111]`, `text-gray-500`, `rgba(...)` | semantic utilities | | `text-white` / `text-fg-inverse` on an accent or status fill | `text-on-accent` / `text-on-{status}` | | `text-fg-dimmed` on readable text, `text-fg-muted` on essential text | `text-fg-secondary`; muted for metadata only | | `focus-visible:ring-accent`, focus color reused for hover/selection | the contract focus recipe; focus color is focus-only | | `focus:border-accent`, `ring-ring/20` on fields | `border-edge-field` + `focus-visible:field-glow` | | `transition-all`, `duration-200`, `ease-in-out`, inline `cubic-bezier` | `transition-colors duration-fast ease-soft` etc. | | `hover:scale-105`, `active:scale-95`, hover translate | background step for hover and press | | `disabled:opacity-50` on a filled control | `disabled:bg-surface-disabled disabled:text-fg-disabled` | | `h-10` on a Button/Input, `text-[16px]`, `text-[11px]` | `min-h-10`; `text-xs` floor; iOS zoom floor is global | | `rounded-md` or `rounded-[13px]` on a control | radius role var | | `border-2` for emphasis | 1px structure; 2px is the focus ring | | `z-50`, `z-[999]` | `z-dropdown`, `z-modal`, `z-toast` | | `text-6xl font-black` to force hierarchy, two H2 recipes on one page | the canonical heading set | | `font-mono` on stats | `tabular-nums` | | Two accent buttons in one view | one primary; the rest `secondary`/`ghost`/`outline` | | Destructive confirm with Delete focused, confirm on a reversible action | Cancel pre-focused; Undo toast for reversible | | Submit button `disabled` until the form is valid | keep enabled, validate on submit | | Inline `<svg>`, `w-4 h-4` on icons | Lucide import, `size-4` | | Baked English strings or aria text inside a component | props with English defaults | | "Get started", "Learn more", "Click here", "You forgot..." | concrete verb label, destination-named link, fix-first error | | Hand-rolled dropdown/dialog/theme toggle/pre-hydration script | Softuq component, `useSoftuq()`, `SoftuqThemeScript` | | Inventing a variant/token/pattern silently | New-in-DS check | ## Theming model (do not reinvent) `SoftuqProvider` owns six axes: palette, accent, radius, spacing, font, headingFont, plus theme (`dark` default, `light`, `system`). Per-component overrides go through `className`, not new props. Dark/light comes from `useSoftuq()` (`resolvedTheme`, `setTheme`) and `SoftuqThemeScript`; never hand-roll `localStorage` + `matchMedia`. `data-theme="dark"` on any element locks its subtree to dark (forced-theme island) - use the attribute, never hardcode dark-looking colors. Full rules: `references/theming.md`. Live reference: softuq.com/foundations and softuq.com/components.
Own the rules, like you own the code.
The skill is a markdown file. Fork it, edit it, add your team's conventions — or strip it down to just what matters to you.