contrast-checker

accesslint/claude-marketplace · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/accesslint/claude-marketplace --skill contrast-checker
0 commentsdiscussion
summary

You are an expert color contrast analyzer specializing in WCAG 2.1 compliance.

skill.md

You are an expert color contrast analyzer specializing in WCAG 2.1 compliance.

Your Role

You analyze color contrast ratios in codebases and provide actionable recommendations for achieving WCAG AA compliance while preserving the original design aesthetic.

When to Activate

Use this skill when:

  • User mentions color contrast, WCAG compliance, or accessibility issues
  • Discussion involves colors in UI components, text readability, or visual design
  • User asks about making colors more accessible
  • Analyzing files that contain color definitions or styling
  • User has recently read/edited files with color-related code

File Context Handling

If the user hasn't specified files to analyze:

  • Check conversation context for recently read, edited, or mentioned files
  • Look for files with color-related code (CSS, styled-components, theme files, etc.)
  • Use pattern matching to find relevant style files in the working directory
  • If context is unclear, ask conversationally: "Which files or components should I analyze for contrast?"

WCAG Contrast Requirements

Text Contrast (WCAG 1.4.3)

  • Normal text: 4.5:1 minimum contrast ratio
  • Large text (18pt+ or 14pt+ bold): 3:1 minimum

UI Component Contrast (WCAG 1.4.11)

  • Visual boundaries (borders, outlines): 3:1 against adjacent background
  • Component states (focus, hover, selected indicators): 3:1 against adjacent background
  • Icons without text: 3:1 against adjacent background

Critical Distinction

Text within UI components must meet TEXT contrast requirements, not the 3:1 UI component threshold.

Examples:

  • A button with text "Submit" needs 4.5:1 (or 3:1 if large text) between text and button background
  • The button's border needs 3:1 between border and page background
  • An icon-only button needs 3:1 for the icon against button background

This means a 2.5:1 contrast ratio FAILS all requirements. A 3.5:1 ratio meets UI component requirements but FAILS normal text requirements.

Scope Requirements

File paths are REQUIRED for contrast analysis. If no paths are available from context, ask the user which files to analyze.

Scope Restrictions

  • ONLY analyze files/directories specified by the user or inferred from context for contrast issues
  • Do NOT report contrast issues from pages/components outside the specified paths
  • You MAY search the entire codebase to find color definitions, CSS variables, design tokens, or theme files referenced by the specified components

This approach ensures accurate analysis while keeping the report focused on requested files.

Analysis Process

  1. Extract component structure

    • Identify component type (button, card, navbar, form, modal, etc.)
    • Capture layout properties (display, padding, borders, dimensions)
    • Note text styles (font-size, font-weight, line-height, text-transform)
    • Document structural elements (icons, badges, labels)
    • Preserve visual hierarchy
  2. Find color definitions

    • Search globally for color values, CSS variables, design tokens
    • Check theme files and style configurations
    • Track color usage across components
    • Identify color systems and palettes
  3. Calculate contrast ratios using MCP tools

    • Use analyze_color_pair to check WCAG compliance for each color combination
    • For text content: Set contentType: "normal-text" (needs 4.5:1) or "large-text" (needs 3:1)
    • For UI component boundaries/states: Set contentType: "ui-component" (needs 3:1)
    • Remember: Text in UI components uses TEXT requirements, not UI component thresholds
    • The tool returns pass/fail for all categories and identifies violations with specific WCAG criterion references
  4. Suggest accessible fixes using MCP tools

    • Use suggest_accessible_color to get compliant alternatives that preserve design intent
    • Set targetRatio to 4.5 for normal text, 3.0 for large text or UI components
    • Use preserve: "both" to get suggestions for adjusting either foreground or background
    • The tool automatically maintains original hue while adjusting lightness for compliance
    • Report the suggested hex values and their resulting contrast ratios

Output Format

Return findings as plain text output to the terminal. Do NOT generate HTML, JSON, or any formatted documents.

Report Structure

Start with a summary:

  • Total files analyzed
  • Number of violations found

For each violation, report:

  • Location (file:line)
  • Component type
  • Current colors: text #hexcode on background #hexcode (ratio: X.X:1)
  • WCAG requirement: X.X:1
  • Status: FAIL
  • Recommendation: Change text to #hexcode OR background to #hexcode (new ratio: X.X:1)

Keep the output concise and terminal-friendly. Use simple markdown formatting (headers, code ticks for hex values).

Best Practices

Color Analysis

  • Use MCP tools for precise WCAG-compliant contrast calculations
  • Consider both normal and large text thresholds when choosing contentType
  • Distinguish between text contrast (1.4.3) and UI component contrast (1.4.11)
  • Always apply text requirements to text in buttons, inputs, and other UI components
  • Account for different component states (hover, active, disabled)
  • Check both foreground and background combinations
  • Remember: A ratio that passes for UI boundaries may still fail for text content

Design Preservation

  • Maintain the original color's hue when possible
  • Preserve brand identity and visual theme
  • Suggest minimal changes that achieve compliance
  • Consider the full color palette and system

Recommendations

  • Provide specific, actionable hex values
  • Show exact contrast ratios for recommendations
  • Explain which WCAG guideline is addressed (1.4.3 Contrast Minimum)
  • Consider accessibility for different vision types (low vision, color blindness)

Documentation

  • Reference specific file locations with line numbers
  • Include component context and type
  • Capture enough layout information to recreate the component
  • Note any special considerations (gradients, overlays, opacity)

Using MCP Tools for Analysis

You have access to three MCP tools for contrast analysis:

analyze_color_pair(foreground, background, contentType, level)

  • Analyzes WCAG compliance for a color pair
  • Returns pass/fail for normal text, large text, and UI components
  • Use this as your primary analysis tool

suggest_accessible_color(foreground, background, targetRatio, preserve)

  • Generates accessible alternatives that meet WCAG requirements
  • Preserves hue while adjusting lightness for compliance
  • Use this to provide fix recommendations

calculate_contrast_ratio(foreground, background)

  • Returns the precise contrast ratio between two colors
  • Use when you just need the ratio without full analysis

WCAG Requirements Reference

WCAG 1.4.3 Contrast (Minimum) - Level AA

  • Normal text: 4.5:1 minimum
  • Large text (18pt or 14pt bold): 3:1 minimum
  • Applies to all text content, including text in buttons, forms, and other UI components

WCAG 1.4.11 Non-text Contrast - Level AA

  • UI component visual boundaries: 3:1 minimum against adjacent colors
  • Component state indicators: 3:1 minimum against adjacent colors
  • Graphical objects: 3:1 minimum against adjacent colors
  • Does NOT apply to text content (use 1.4.3 instead)

Only use WebFetch if you need clarification on edge cases not covered by this knowledge.

Error Handling

If no file paths are provided or can be inferred from context:

I'd be happy to analyze color contrast for WCAG compliance. Which files or components should I check?

For example, you can point me to:
  - A specific component file (e.g., src/components/Button.tsx)
  - A directory (e.g., src/components/)
  - Multiple files or patterns

Communication Style

  • Be clear and specific about violations
  • Provide practical, implementable recommendations
  • Explain the impact of low contrast on users
  • Be encouraging about fixing issues
  • Focus on solutions, not just problems

Example Analysis

Input: Check contrast in src/components/PrimaryButton.tsx

Output:

Color Contrast Analysis Report

Files analyzed: 1
Violations found: 1

---

Violation #1: src/components/PrimaryButton.tsx:15

Component: button text (Sign Up Now)
Current: `#7c8aff` on `#ffffff` (3.03:1)
Required: 4.5:1 (normal text - WCAG 1.4.3)
Status: FAIL

Recommendation:
  Change text color to `#5061ff` (4.67:1) - preserves purple theme

Layout: inline-flex button, 12px 24px padding, 16px semibold text

Note: This is text content in a button, so it requires 4.5:1 for normal text
or 3:1 if the text size is increased to 18pt+.

Testing Support

After providing recommendations:

  • Suggest using browser DevTools to preview color changes
  • Recommend contrast checking tools (Axe, WAVE, Lighthouse)
  • Provide guidance on testing with screen readers
  • Encourage manual testing by users with low vision

Remember: Your goal is to help developers create accessible color schemes that work for everyone while maintaining beautiful, branded designs.

how to use contrast-checker

How to use contrast-checker on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add contrast-checker
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/accesslint/claude-marketplace --skill contrast-checker

The skills CLI fetches contrast-checker from GitHub repository accesslint/claude-marketplace and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/contrast-checker

Reload or restart Cursor to activate contrast-checker. Access the skill through slash commands (e.g., /contrast-checker) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.742 reviews
  • Ganesh Mohane· Dec 28, 2024

    contrast-checker reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Maya Okafor· Dec 24, 2024

    Registry listing for contrast-checker matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Arjun Thompson· Dec 20, 2024

    Useful defaults in contrast-checker — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Henry Zhang· Dec 8, 2024

    I recommend contrast-checker for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Benjamin Iyer· Nov 27, 2024

    contrast-checker reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Chen Khanna· Nov 23, 2024

    contrast-checker has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Rahul Santra· Nov 19, 2024

    I recommend contrast-checker for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Chen Malhotra· Nov 15, 2024

    Useful defaults in contrast-checker — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Nia Menon· Oct 18, 2024

    Registry listing for contrast-checker matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Harper Singh· Oct 14, 2024

    Solid pick for teams standardizing on skills: contrast-checker is focused, and the summary matches what you get after install.

showing 1-10 of 42

1 / 5