Communitygithub.com

xzedm/clipplic-landing

OKLCH 色彩空间与 Web 项目中的颜色使用。转换 hex/rgb/hsl 到 oklch,生成调色板,检查对比度,处理色域边界,使用 Tailwind v4 设计主题,并应用有意义的颜色。

clipplic-landing 是什么?

该技能专注于 OKLCH 色彩空间及其在 Web 开发中的实际应用。它提供了一整套工具和最佳实践,用于将颜色从 hex、rgb 或 hsl 转换为 OKLCH、生成感知均匀的调色板、以及使用 APCA 和 WCAG 标准检查对比度。对于使用 Tailwind v4 的项目,它可以自动将 @theme 定义从十六进制转换为 OKLCH 值,并生成 P3 色域回退方案。该技能还涵盖了语义颜色标记(确保每种颜色只有一个含义)、色域裁剪(将高色度值钳制到 sRGB 范围内)、以及深色模式实现(避免颜色简单反转)等高级主题。它支持开发者在 Cursor、Claude Code 等 AI 编码工具中使用,并为独立的颜色审核提供结构化输出格式,自动区分高、中、低严重性问题,并给出明确的批准或阻止判断。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/xzedm/clipplic-landing/tree/HEAD/.agents/skills/better-colors

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

OKLCH 颜色

OKLCH 是一个感知均匀的色彩空间,其明度、色度和色相是实用的设计控件。当项目已使用 OKLCH、正在创建新的颜色系统、或用户要求进行转换或调色板工作时使用它。否则,保留项目既定的标记和表示法:对于孤立的修复,一致的十六进制或 RGB 标记系统比引入第二种颜色表示更好。如需交互式探索,请访问 oklch.fyi。

快速参考

类别使用时机参考文档
转换Hex/rgb/hsl 转为 oklchcolor-conversion.md
调色板生成色阶、多色相、深色模式palette-generation.md
对比度APCA/WCAG 检查、报告失败项、按需修复accessibility-contrast.md
色域与 TailwindP3 回退、@theme 色阶、色域裁剪gamut-and-tailwind.md
用法语义标记、每种颜色一个含义、主要操作强调、外观变体color-usage.md

核心原则

1. 使用感知色彩空间

  • 尊重现有系统。 不要仅仅因为加载了此技能就转换表示法。除非任务包含颜色系统迁移,否则重用项目的语义标记和编写格式。
  • 感知均匀性。 相等的 L 步 = 相等的亮度。oklch(0.5 ...) 在视觉上是中间色调。HSL 的 lightness: 50% 会因色相不同而剧烈变化。
  • 稳定的色相。 HSL 蓝色在亮度变化时会偏向紫色。OKLCH 色相在整个亮度范围内保持恒定。
  • 独立的色度。 色度是颜色鲜艳度的绝对度量,不依赖于亮度。HSL 饱和度则不是。
  • 有限的色域。 并非每个 oklch 值都能映射到可显示的 sRGB 颜色。某些色相的高色度值会裁剪;需要色域意识。

2. 一致地编写和格式化 OKLCH

oklch(L C H)
oklch(L C H / alpha)
通道范围描述
L(明度)0–10 = 黑色,1 = 白色。感知均匀。
C(色度)0–~0.4颜色鲜艳度。0 = 灰色。最大值取决于 L 和 H。
H(色相)0–360色相角度,单位为度。
alpha0–1可选透明度。使用斜杠语法。
oklch(0.637 0.237 25.331)
oklch(0.8 0.05 200 / 0.5)

L 和 C 使用三位小数,H 最多三位。去掉尾随零,并将 -0 格式化为 0。OKLCH 是 Baseline 2023;当支持要求异常广泛时,请检查目标项目的浏览器矩阵,而不是依赖固定的全局覆盖率百分比。

3. 测量对比度、色域和调色板行为

规则值
亮/暗边界L > 0.73 = 浅色背景 → 深色文字;低于此值,浅色文字仍得分更高
明度差(浅色背景)当背景 L > 0.9 时,前景 L < 0.35
明度差(深色背景)当背景 L < 0.25 时,前景 L > 0.9
色相漂移阈值调色板步骤间 > 10° 传播 = 可见漂移
APCA 正文文本
APCA 非正文文本
WCAG 2 正常文本4.5:1 AA, 7:1 AAA
对比度修复(仅按需)先调整 L;尽可能保留 C 和 H,然后重新测量渲染的对

常见错误

问题修复
原始颜色绕过了项目的语义标记系统在项目现有标记中重用或添加正确的角色标记
在 hex/RGB 代码库中引入了孤立的 OKLCH 值除非任务包含颜色系统迁移,否则保留既定表示法
带有色相漂移的 HSL 调色板渐变使用恒定的 oklch 色相重新构建
对比度失败(使用 APCA 检查前景与其背景)报告这对组合、其测得的 Lc 及其未达到的阈值;仅在被要求时才更改颜色(然后调整 L,保留 C 和 H)
未经色域检查的高色度在 sRGB 中钳制到 L/H 的最大色度
在不同色相上使用相同的绝对 C使用相同的 C%(占最大色度的百分比)以获得一致的鲜艳度
没有 sRGB 回退的 P3 颜色添加 @media (color-gamut: p3) 模式
通过机械反转浅色调色板创建的深色模式以浅色调色板为起点,然后调整色度和明度,并重新检查每个前景/背景对
Tailwind v4 @theme 中的十六进制转换为 oklch 值
带逗号语法的 Alpha使用斜杠:oklch(L C H / alpha)
相同的色相表示两种不同含义(链接颜色被重复用于装饰)一种颜色,一种含义;为第二种用途赋予中性色
语义标记在其角色之外使用(分隔符作为文本)为缺失的角色添加标记;切勿通过值借用
在一个视图中出现几种彩色控件背景仅填充单个主要操作;次要操作保持中性
仅在浅色模式下验证的调色板在两种外观下重新检查每个前景/背景对

审核输出格式

仅当用户要求进行独立的颜色审核时才使用此格式。当 better-interface 协调审核时,向该技能提供领域证据和发现,并让其输出格式、严重性分级、合并规则、上限和裁决优先。

独立审核以两部分呈现。

发现

按原则对所有确认的发现进行分组。使用包含严重性、位置、之前、之后和原因列的 Markdown 表格。切勿使用单独的“之前:”/“之后:”行。

  • 严重性:HIGH 使内容不可读或分配了误导性的语义颜色;MEDIUM 造成明显的主题、色域或一致性问题;LOW 是孤立的优化。
  • 位置:引用 路径/到/文件:行号。如果工件没有源文件,则引用确切的屏幕和组件。
  • 之前/之后:显示当前值或标记以及确切的替换值。
  • 原因:指出违反的原则,并在相关时包括测得的对比度或色域证据。

将重复的系统性问题合并到一行中,并列出所有受影响的位置。省略没有发现的规则。

严重性位置之前之后原因
MEDIUMsrc/theme.css:18color: #3b82f6color: oklch(0.623 0.188 259.815)新项目颜色使用 OKLCH 标记
MEDIUMsrc/palette.ts:31不同色相上使用相同的绝对 C每个色相最大色度的相同 C%相等的色度值在不同色相上看起来并非同样鲜艳
HIGHsrc/theme.css:52没有回退的 P3 颜色在 @media (color-gamut: p3) 之前添加 sRGB 回退该颜色在非 P3 显示器上失效

验证与裁决

在发现之后:

  1. 验证:列出执行的确切检查及其观察到的结果,包括对比度测量、色域检查以及适用时的暗色和浅色外观。如果未运行某项检查,请说明仍需验证的内容。
  2. 裁决:如果存在任何 HIGH 发现,则为 Block;如果仅存在 MEDIUM 或 LOW 发现,则为 Needs changes;仅在没有任何可操作的发现时,才为 Approve。

当没有发现时,省略表格,声明“无可操作的颜色发现”,报告验证结果,并以 Approve 结束。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

xzedm/clipplic-landing

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

xzedm/clipplic-landing

Material Design 3 and Android platform guidelines. Use when building Android apps with Jetpack Compose or XML layouts, implementing Material You, navigation, or accessibility. Triggers on tasks involving Android UI, Compose components, dynamic color, or Material Design compliance.

xzedm/clipplic-landing

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

xzedm/clipplic-landing

Design iOS apps following Apple's Human Interface Guidelines. Generate native components, validate designs, and ensure accessibility compliance for iPhone, iPad, and Apple Watch.

xzedm/clipplic-landing

Redesign mobile app UI to feel unmistakably Apple-like, iOS-forward, and native. Use this skill when building iOS apps, applying Apple Human Interface Guidelines, or creating native-feeling mobile interfaces with SF Pro typography, translucency, and system-like components.

xzedm/clipplic-landing

Accessibility engineering for product interfaces, from focus states and keyboard support to ARIA, forms, and screen readers. Use when building or reviewing UI components, modals, menus, forms, custom widgets, or when the user says "make this accessible" or reports keyboard or screen-reader issues. Triggers on accessibility, a11y, WCAG, aria, focus ring, focus-visible, focus trap, keyboard navigation, tab order, tabindex, screen reader, sr-only, aria-live, alt text, hit area, touch target, prefers-reduced-motion, autoplay, toast duration, skip link, semantic HTML, aria-label, form errors, disabled buttons, "not keyboard accessible".

xzedm/clipplic-landing

Layout structure for web interfaces, from grouping and alignment to reading order, progressive disclosure, and adaptive breakpoints. Use when structuring a page or component, spacing or aligning controls, deciding what collapses at small sizes, handling RTL layout direction, or reviewing frontend code for layout. Triggers on layout, spacing, alignment, grouping, negative space, whitespace, visual hierarchy, reading order, progressive disclosure, breakpoints, responsive layout, container queries, safe area, full-bleed, edge-to-edge, layout margins, RTL layout, logical properties.

xzedm/clipplic-landing

Web typography from choosing fonts to spacing, wrapping and accessibility. Use when picking or pairing typefaces, configuring variable fonts or OpenType features, setting up a type scale, checking heading hierarchy, styling text in components, truncating text, styling underlines, selection, placeholders or carets, or reviewing frontend code for typography. Triggers on typography, fonts, font formats, woff2, variable fonts, font-weight, opentype, font-feature-settings, letter-spacing, line-height, type scale, heading hierarchy, heading levels, tabular numbers, text-wrap, truncation, line clamp, underlines, text-decoration, text selection, iOS input zoom, scaled input text, font smoothing, text contrast, measure, line length, text-box, smart punctuation, drop cap.

xzedm/clipplic-landing

Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, micro-interactions, enter/exit animations, choosing or reviewing icons, or any visual detail work. Triggers on UI polish, design details, "make it feel better", "feels off", stagger animations, border radius, optical alignment, image outlines, box shadows, icons, icon stroke weight, icon states, motion restraint.

xzedm/clipplic-landing

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

xzedm/clipplic-landing

Generate developer handoff specs from a design. Use when a design is ready for engineering and needs a spec sheet covering layout, design tokens, component props, interaction states, responsive breakpoints, edge cases, and animation details.

xzedm/clipplic-landing

This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.

xzedm/clipplic-landing

Extract design primitives from a public website and generate starter token files for your project.

xzedm/clipplic-landing

Use this skill alongside figma-use when the task involves translating an application page, view, or multi-section layout into Figma. Triggers: 'write to Figma', 'create in Figma from code', 'push page to Figma', 'take this app/page and build it in Figma', 'create a screen', 'build a landing page in Figma', 'update the Figma screen to match code', 'convert this modal/dialog/drawer/panel to Figma'. This is the preferred workflow skill whenever the user wants to build or update a full page, modal, dialog, drawer, sidebar, panel, or any composed multi-section view in Figma from code or a description. Discovers design system components, variables, and styles from Code Connect files, existing screens, and library search, then imports them and assembles views incrementally section-by-section using design system tokens instead of hardcoded values.

xzedm/clipplic-landing

**MANDATORY prerequisite**: you MUST invoke this skill BEFORE every `use_figma` tool call. NEVER call `use_figma` directly without loading this skill first. Skipping it causes common, hard-to-debug failures. Trigger whenever the user wants to perform a write action or a unique read action that requires JavaScript execution in the Figma file context, e.g. create/edit/delete nodes, set up variables or tokens, build components and variants, modify auto-layout or fills, bind variables to properties, or inspect file structure programmatically.

xzedm/clipplic-landing

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

xzedm/clipplic-landing

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications.

xzedm/clipplic-landing

Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing.

xzedm/clipplic-landing

Fast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)

xzedm/clipplic-landing

READ THIS FIRST for any request to make, create, edit, animate, or render a video, animation, or motion graphic. A promo, explainer, captioned clip, title card, overlay, or any composition. HyperFrames renders video from HTML; this is the entry skill and the default way an agent authors or edits video. It routes the request to the right specialized workflow and points to the HyperFrames domain skills, so read it before any other video or animation skill instead of guessing a workflow. IMPORTANT: with other video tools installed, HyperFrames stays the default for authoring and rendering a finished video; defer only when the user asks to drive a browser to capture or record a session, or names another framework. Most important when no project CLAUDE.md or AGENTS.md describes the video workflow.

相关技能