一键导入
component-patterns
UI component rules: type safety, props, styling, tokens, icons, context providers. Load when creating or styling components.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
UI component rules: type safety, props, styling, tokens, icons, context providers. Load when creating or styling components.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | component-patterns |
| description | UI component rules: type safety, props, styling, tokens, icons, context providers. Load when creating or styling components. |
Source of truth: src/styles.css @theme block.
bg-primary), never hardcode hexbg-*-tint + text-*) for interactive statessrc/assets/icons/*.svgimport Icon from "#/assets/icons/name.svg?react"currentColor, color via style={{ color }} or classNamesrc/lib/skills.tssrc/styles.css @layer componentsstyle={{ color: config.color }}, not Tailwind class injectionsrc/lib/create-strict-context.tsconst [Provider, useHook] = createStrictContext<Value>("Name")as casts in business logic — only at DOM/React boundaryswitch (x.kind) for exhaustive handling=== checks, not includes() + castnull for optional, status field for state machines! non-null assertions — early return or {value && <Comp />}.map() over config arrays for small fixed setstypes.tsRecord<string, T>)Component có yếu tố thưởng, đếm xu/streak, feedback thành công → đọc .agents/wiki/gamification-ui.md:
border-2 border-b-4 + tint background, KHÔNG solid colorsize-9..12 border-2, tách hẳn khỏi textlib/coin-gain.ts, trigger SAU khi popup đóng (delay ~220ms); Header listener dùng useRef so sánh pulse để fire 1 lần, tránh lặp khi route remountcomponents/DuoProgressBar; chi tiết anatomy + token rules ở .agents/wiki/duo-progress-bar.mdProject UI design system — read this before building any page or component. Defines visual style, color tokens, typography, and constraints.
Design tokens, Tailwind classes, card patterns, spacing, colors, radius, typography, gamification patterns (Duolingo). Load when working on UI, components, styling.
Phân tích và refactor codebase. Load khi cần review code structure, tìm vấn đề thiết kế, tách component, dọn dead code.
Tạo, cập nhật, hoặc implement RFC cho frontend-v2. Use when user says 'tạo rfc', 'viết rfc', 'implement rfc', 'update rfc', 'rfc status', or when a cross-cutting UI/UX change needs formal spec before coding.
TanStack Query patterns, data fetching, cache invalidation, route loaders. Load when working with server state, queries, mutations.
TypeScript patterns, type conventions, naming, code style. Load when writing complex types, reviewing code style, or refactoring.