From harness-claude
Ensures WCAG 2.1 AA contrast ratios and adds non-color indicators (icons, patterns, labels) for accessibility. Use when choosing color combos, designing UI states, or building data visualizations.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-claude:a11y-color-contrastThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information
Ensure sufficient color contrast ratios and never use color as the sole means of conveying information
/* Good — #1a1a1a on #ffffff = 17.4:1 */
.body-text {
color: #1a1a1a;
background: #ffffff;
}
/* Bad — #999999 on #ffffff = 2.8:1 (fails AA) */
.muted-text {
color: #999999;
background: #ffffff;
}
/* Acceptable for large text — #767676 on #ffffff = 4.5:1 */
.large-heading {
color: #767676;
font-size: 24px;
font-weight: bold;
}
// Bad — only color distinguishes error from success
<span style={{ color: 'red' }}>Failed</span>
<span style={{ color: 'green' }}>Passed</span>
// Good — color + icon + text label
<span style={{ color: '#d32f2f' }}>
<ErrorIcon aria-hidden="true" /> Failed
</span>
<span style={{ color: '#2e7d32' }}>
<CheckIcon aria-hidden="true" /> Passed
</span>
/* Safe — underline present */
a {
color: #005fcc;
text-decoration: underline;
}
/* Also safe — 3:1 contrast between link color and body text color, plus underline on hover/focus */
a {
color: #005fcc;
text-decoration: none;
}
a:hover,
a:focus {
text-decoration: underline;
}
<div>
<label htmlFor="email">Email</label>
<input
id="email"
aria-invalid={!!error}
aria-describedby={error ? 'email-error' : undefined}
style={{ borderColor: error ? '#d32f2f' : '#ccc' }}
/>
{error && (
<p id="email-error" role="alert" style={{ color: '#d32f2f' }}>
<ErrorIcon aria-hidden="true" /> {error}
</p>
)}
</div>
Use patterns, shapes, or labels in data visualizations. Charts with color-coded series are unreadable for color-blind users. Add patterns, direct labels, or shape markers.
Check contrast for all interactive states. Hover, focus, active, disabled, and selected states all need to meet contrast requirements against their backgrounds.
Test with simulated color vision deficiency. Chrome DevTools > Rendering > Emulate vision deficiencies. Test with protanopia, deuteranopia, tritanopia, and achromatopsia.
Design high-contrast mode support. Windows High Contrast Mode overrides your colors. Use forced-colors media query to ensure readability.
@media (forced-colors: active) {
.custom-checkbox {
border: 2px solid ButtonText;
}
}
WCAG contrast levels:
Contrast ratio formula: Based on relative luminance of the two colors. Use tools to calculate — do not eyeball it.
Recommended tools:
Color-blind-safe palettes: Approximately 8% of males and 0.5% of females have color vision deficiency. Red-green is the most common. Avoid red/green as the only distinction. Blue/orange is generally safe across all types.
Common mistakes:
https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeEnsures text and UI components meet WCAG contrast ratios (AA/AAA) and avoids color-only information conveyance.
Designs colorblind-safe palettes, audits UI for WCAG 2.1 SC 1.4.1 compliance, and selects redundant encodings so color never carries information alone.
Prompts you to add non-colour encoding (text, icons, patterns) to UI elements so colour vision deficient users get the same information.