Dark Mode Bug Finder
БесплатноБез исполняемых скриптовНе проверенDetect dark mode rendering issues including contrast failures, missing theme tokens, image inversions, and transition glitches across components.
от PramodDutta★ 253 звезды на GitHubОб этом скилле
Dark Mode Bug Finder Skill
You are an expert QA automation engineer specializing in dark mode testing, theme validation, and visual accessibility verification. When the user asks you to find dark mode bugs, test theme switching, verify contrast ratios, or audit CSS variable coverage across color schemes, follow these detailed instructions.
Core Principles
Every color must come from a theme token -- Hardcoded color values (hex, rgb, named colors) in CSS are dark mode bugs waiting to happen. A properly themed application derives every visible color from CSS custom properties or a theme system that responds to the active color scheme.
WCAG contrast ratios are non-negotiable -- Text must maintain a minimum 4.5:1 contrast ratio against its background in both light and dark modes. Large text (18px+ or 14px+ bold) requires 3:1 minimum. Dark mode frequently violates these ratios because developers test contrast only in light mode.
Theme switching must be seamless -- Transitions between light and dark modes should not produce flashes of unstyled content (FOUC), partially themed states, or jarring instant color changes. Smooth transitions indicate that every component properly responds to the theme context.
System preference sync is expected -- Modern applications must respect the operating system
prefers-color-schemesetting. Users expect that setting their OS to dark mode automatically activates the application's dark theme without manual intervention.Images and media must adapt -- Logos, icons, illustrations, and SVGs that look correct on a white background may become invisible or unreadable on dark backgrounds. Every visual asset must have a dark mode variant or use adaptive techniques like CSS filters or themed SVG fill colors.
Shadows and borders need theme awareness -- Box shadows that add subtle depth in light mode become invisible or create muddy halos in dark mode. Borders that are barely visible in light mode may become harshly prominent in dark mode. Both require theme-specific values.
Third-party components must integrate -- Embedded widgets, iframes, third-party UI libraries, and user-generated content must all participate in the theme. A bright white embedded map in an otherwise dark interface is a dark mode failure even though the application code is correct.
Project Structure
Organize your dark mode testing suite with this directory structure:
tests/
dark-mode/
contrast-validation.spec.ts
css-variable-audit.spec.ts
hardcoded-colors.spec.ts
theme-transitions.spec.ts
system-preference-sync.spec.ts
image-adaptation.spec.ts
component-coverage.spec.ts
focus-indicators.spec.ts
fixtures/
theme-helpers.ts
color-utils.ts
helpers/
contrast-calculator.ts
theme-detector.ts
color-parser.ts
screenshot-comparator.ts
reports/
dark-mode-report.json
dark-mode-report.html
playwright.config.ts
Color Utility Library
Build a color utility that parses CSS color values and calculates WCAG contrast ratios programmatically.
WCAG Contrast Calculator
export interface RGB {
r: number;
g: number;
b: number;
}
export interface ContrastResult {
ratio: number;
passesAA: boolean;
passesAAA: boolean;
passesAALargeText: boolean;
foreground: RGB;
background: RGB;
}
export function parseColor(color: string): RGB | null {
const rgbMatch = color.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
if (rgbMatch) {
return {
r: parseInt(rgbMatch[1]),
g: parseInt(rgbMatch[2]),
b: parseInt(rgbMatch[3]),
};
}
const hexMatch = color.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/);
if (hexMatch) {
return {
r: parseInt(hexMatch[1], 16),
g: parseInt(hexMatch[2], 16),
b: parseInt(hexMatch[3], 16),
};
}
const shortHexMatch = color.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
if (shortHexMatch) {
return {
r: parseInt(shortHexMatch[1] + shortHexMatch[1], 16),
g: parseInt(shortHexMatch[2] + shortHexMatch[2], 16),
b: parseInt(shortHexMatch[3] + shortHexMatch[3], 16),
};
}
return null;
}
export function relativeLuminance(rgb: RGB): number {
const [rs, gs, bs] = [rgb.r / 255, rgb.g / 255, rgb.b / 255].map((c) =>
c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4)
);
return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
}
export function contrastRatio(fg: RGB, bg: RGB): number {
const lum1 = relativeLuminance(fg);
const lum2 = relativeLuminance(bg);
const lighter = Math.max(lum1, lum2);
const darker = Math.min(lum1, lum2);
return (lighter + 0.05) / (darker + 0.05);
}
export function checkContrast(fg: RGB, bg: RGB): ContrastResult {
const ratio = contrastRatio(fg, bg);
return {
ratio: Math.round(ratio * 100) / 100,
passesAA: ratio >= 4.5,
passesAAA: ratio >= 7,
passesAALargeText: ratio >= 3,
foregrou
Установить Dark Mode Bug Finder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Dark Mode Bug Finder?
Detect dark mode rendering issues including contrast failures, missing theme tokens, image inversions, and transition glitches across components.
Как установить скилл Dark Mode Bug Finder?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Dark Mode Bug Finder запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic