---
name: "wcag-color-contrast-aa-checker"
description: "Calculate color contrast ratios and enforce WCAG 2.2 accessibility compliance."
metadata:
  author: "W3C WAI"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "calculate color contrast ratio"
  - "check wcag aa compliance"
  - "adjust color for contrast"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# WCAG 2.2 AA / AAA Color Contrast Engine

Evaluates relative luminance, calculates contrast ratios (4.5:1 for normal text, 3:1 for large text/UI components), and automatically adjusts palette lightness to pass accessibility audits.

## When to Invoke
Invoke this skill whenever you need to:
- calculate color contrast ratio
- check wcag aa compliance
- adjust color for contrast

## Execution SOP & Rules
1. Calculate relative luminance according to the official WCAG 2.2 sRGB formula.
2. Calculate contrast ratio as (L1 + 0.05) / (L2 + 0.05) where L1 is the lighter luminance.
3. Enforce minimum 4.5:1 for standard text (< 18pt or < 14pt bold) and 3.0:1 for large text and UI borders.
4. Flag any text pairings with contrast ratios below 3.0:1 as critical accessibility violations.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
