contrast-checker

Check color contrast ratios for WCAG compliance

509 stars

Best use case

contrast-checker is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Check color contrast ratios for WCAG compliance

Teams using contrast-checker should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/contrast-checker/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/ux-ui-design/skills/contrast-checker/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/contrast-checker/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How contrast-checker Compares

Feature / Agentcontrast-checkerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Check color contrast ratios for WCAG compliance

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Contrast Checker Skill

## Purpose

Calculate and validate color contrast ratios according to WCAG 2.1 guidelines, ensuring text readability and accessibility compliance.

## Capabilities

- Calculate WCAG contrast ratios
- Validate normal text (4.5:1) and large text (3:1) requirements
- Check AA and AAA compliance levels
- Suggest passing color alternatives
- Batch check multiple color pairs
- Analyze color palettes for contrast issues

## Target Processes

- accessibility-audit.js (colorContrastVisualAnalysisTask)
- component-library.js (colorSystemDesignTask)
- design-system.js

## Integration Points

- color-contrast-checker library
- polished.js
- chroma.js

## Input Schema

```json
{
  "type": "object",
  "properties": {
    "colorPairs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "foreground": { "type": "string" },
          "background": { "type": "string" },
          "textSize": { "type": "string", "enum": ["normal", "large"] }
        }
      }
    },
    "targetLevel": {
      "type": "string",
      "enum": ["AA", "AAA"],
      "default": "AA"
    },
    "suggestAlternatives": {
      "type": "boolean",
      "default": true
    },
    "palette": {
      "type": "object",
      "description": "Color palette to analyze for contrast"
    }
  },
  "required": ["colorPairs"]
}
```

## Output Schema

```json
{
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "foreground": { "type": "string" },
          "background": { "type": "string" },
          "ratio": { "type": "number" },
          "passesAA": { "type": "boolean" },
          "passesAAA": { "type": "boolean" },
          "passesAALarge": { "type": "boolean" },
          "alternatives": { "type": "array" }
        }
      }
    },
    "summary": {
      "type": "object",
      "properties": {
        "totalPairs": { "type": "number" },
        "passingAA": { "type": "number" },
        "passingAAA": { "type": "number" },
        "failing": { "type": "number" }
      }
    },
    "paletteAnalysis": {
      "type": "object",
      "description": "Full palette contrast matrix"
    }
  }
}
```

## Usage Example

```javascript
const result = await skill.execute({
  colorPairs: [
    { foreground: '#333333', background: '#ffffff', textSize: 'normal' },
    { foreground: '#666666', background: '#f0f0f0', textSize: 'large' }
  ],
  targetLevel: 'AA',
  suggestAlternatives: true
});
```

Related Skills

compliance-checker

509
from a5c-ai/babysitter

Check compliance with SOC 2, GDPR, HIPAA, and PCI-DSS standards

jupyter-reproducibility-checker

509
from a5c-ai/babysitter

Skill for checking and ensuring Jupyter notebook reproducibility

iso-nanotechnology-compliance-checker

509
from a5c-ai/babysitter

Regulatory compliance skill for ISO nanotechnology standards verification and documentation

model-checker-interface

509
from a5c-ai/babysitter

Interface with multiple model checking tools for formal verification

linearizability-checker

509
from a5c-ai/babysitter

Check linearizability of concurrent data structure implementations

building-code-checker

509
from a5c-ai/babysitter

Building code compliance checking skill for IBC occupancy, construction type, and area requirements

ada-compliance-checker

509
from a5c-ai/babysitter

ADA accessibility compliance checking skill for routes, slopes, and pedestrian facilities

iso-standards-compliance-checker

509
from a5c-ai/babysitter

Medical device standards compliance verification skill for ISO 13485, ISO 14971, IEC 62304, IEC 60601, and related standards

background-checker

509
from a5c-ai/babysitter

Integrates with background check services, social media analysis, reference verification

incoterms-compliance-checker

509
from a5c-ai/babysitter

International shipping terms validation and documentation skill ensuring trade compliance

gaap-ifrs-compliance-checker

509
from a5c-ai/babysitter

Automated compliance validation skill for GAAP and IFRS accounting standards with codification references

license-compliance-checker

509
from a5c-ai/babysitter

Automated license compliance verification for dependencies to ensure legal compliance during migration