docs-creating-accessible-diagrams
WCAG-compliant Mermaid diagrams using verified accessible color palette. Use when creating diagrams, flowcharts, or any color-dependent visualizations requiring accessibility compliance for color blindness.
Best use case
docs-creating-accessible-diagrams is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
WCAG-compliant Mermaid diagrams using verified accessible color palette. Use when creating diagrams, flowcharts, or any color-dependent visualizations requiring accessibility compliance for color blindness.
Teams using docs-creating-accessible-diagrams 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
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/docs-creating-accessible-diagrams/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How docs-creating-accessible-diagrams Compares
| Feature / Agent | docs-creating-accessible-diagrams | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
WCAG-compliant Mermaid diagrams using verified accessible color palette. Use when creating diagrams, flowcharts, or any color-dependent visualizations requiring accessibility compliance for color blindness.
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
# Color Accessibility for Diagrams
This Skill provides guidance on creating accessible Mermaid diagrams using a verified color-blind friendly palette that meets WCAG AA standards. Use this when creating visual diagrams to ensure accessibility for all users, including those with color blindness (~300 million people worldwide).
## Purpose
Use this Skill when:
- Creating Mermaid diagrams, flowcharts, or visualizations
- Working with color-dependent visual content
- Need to ensure WCAG compliance for diagrams
- Supporting users with color blindness (protanopia, deuteranopia, tritanopia)
- Choosing colors for documentation, diagrams, or UI components
## Verified Accessible Color Palette
**CRITICAL**: Use ONLY these colors in all diagrams. This palette is scientifically verified to work for all color blindness types and meets WCAG AA standards.
| Color | Hex Code | Use Cases | WCAG AA (Light) | WCAG AA (Dark) |
| ------ | -------- | ------------------------------ | ---------------- | ---------------- |
| Blue | #0173B2 | Primary elements, main flow | ✅ 8.59:1 (AAA) | ✅ 6.93:1 (AAA) |
| Orange | #DE8F05 | Warnings, decisions, secondary | ✅ 6.48:1 (AAA) | ✅ 5.24:1 (AAA) |
| Teal | #029E73 | Success, validation, tertiary | ✅ 8.33:1 (AAA) | ✅ 6.74:1 (AAA) |
| Purple | #CC78BC | Special states, implementors | ✅ 4.51:1 (AA) | ✅ 3.65:1 (AA) |
| Brown | #CA9161 | Neutral elements, secondary | ✅ 5.23:1 (AAA) | ✅ 4.23:1 (AAA) |
| Black | #000000 | Text on light, borders | ✅ 21.00:1 (AAA) | N/A |
| White | #FFFFFF | Text on dark, backgrounds | N/A | ✅ 21.00:1 (AAA) |
| Gray | #808080 | Disabled, secondary elements | ✅ 7.00:1 (AAA) | ✅ 4.00:1 (AA) |
**Quick copy-paste hex codes:**
```
#0173B2 - Blue
#DE8F05 - Orange
#029E73 - Teal
#CC78BC - Purple
#CA9161 - Brown
#000000 - Black
#FFFFFF - White
#808080 - Gray
```
## Colors to NEVER Use
**CRITICAL**: Never use these colors where color conveys information:
- ❌ **Red** (#FF0000, #E74C3C) - Invisible to protanopia/deuteranopia (~8% of males)
- ❌ **Green** (#00FF00, #27AE60) - Invisible to protanopia/deuteranopia
- ❌ **Yellow** (#FFFF00, #F1C40F) - Invisible to tritanopia (rare but severe)
- ❌ **Light Pink** (#FF69B4, #FFC0CB) - Severely compromised for tritanopia
- ❌ **Bright Magenta** (#FF00FF, #FF1493) - Problematic for all types
- ❌ **Red-Green combinations** - Creates impossible contrast for ~8% of males
**Exception**: Emoji indicators (🔴🟠🟡🟢) can use standard colors when ALWAYS paired with text labels (color is supplementary, not primary identifier).
## Core Accessibility Principles
### 1. Never Rely on Color Alone
Always combine color with:
- ✅ **Text labels** - Clear descriptions
- ✅ **Shape differentiation** - Different node shapes (rectangles, diamonds, circles)
- ✅ **Line styles** - Solid, dashed, dotted
- ✅ **Position** - Spatial organization
- ✅ **Icons** - Additional visual markers
**Example:**
- ❌ Bad: Red node means "error" (color only)
- ✅ Good: Orange diamond labeled "Error State" with error icon
### 2. Use Color as Enhancement
Color should enhance information already conveyed through other means. A grayscale version should remain understandable.
### 3. Maintain WCAG AA Contrast
All text and UI components must meet minimum contrast:
- Normal text: 4.5:1 minimum
- Large text (18pt+ or 14pt+ bold): 3:1 minimum
- UI components/graphics: 3:1 minimum
### 4. Test for Color Blindness
Before publishing diagrams:
1. Create using accessible palette
2. Test in color blindness simulator (protanopia, deuteranopia, tritanopia)
3. Verify contrast ratios with WebAIM checker
4. Confirm shape differentiation sufficient
5. Test in both light and dark modes
## Mermaid Diagram Best Practices
### Standard Mermaid Template with Accessibility
Use this as a starting point for all Mermaid diagrams:
```mermaid
%% Color Palette: Blue #0173B2, Orange #DE8F05, Teal #029E73, Purple #CC78BC, Brown #CA9161, Gray #808080
%% All colors are color-blind friendly and meet WCAG AA contrast standards
graph TD
A["Start Process<br/>Primary"]:::blue
B{"Decision Point<br/>Evaluate"}:::orange
C["Success Path<br/>Complete"]:::teal
D["Alternate Path<br/>Optional"]:::gray
A --> B
B -->|Yes| C
B -->|No| D
classDef blue fill:#0173B2,stroke:#000000,color:#FFFFFF,stroke-width:2px
classDef orange fill:#DE8F05,stroke:#000000,color:#FFFFFF,stroke-width:2px
classDef teal fill:#029E73,stroke:#000000,color:#FFFFFF,stroke-width:2px
classDef gray fill:#808080,stroke:#000000,color:#FFFFFF,stroke-width:2px
```
### Essential Mermaid Rules
1. **Always include palette comment** - First line documents colors used
2. **Use classDef with accessible hex codes** - REQUIRED for accessibility
3. **Include black borders** - `stroke:#000000` for shape definition
4. **Use white text on dark fills** - `color:#FFFFFF` for readability
5. **Use black text on light fills** - `color:#000000` when needed
6. **2px stroke width** - `stroke-width:2px` for visibility
7. **Provide descriptive labels** - Never use color-only identification
8. **Prefer vertical orientation** - `graph TD` (top-down) for mobile viewing
9. **Use different shapes** - Rectangles, diamonds, circles for differentiation
10. **Escape special characters** - Parentheses, brackets, braces in node text
### Mermaid Comment Syntax (CRITICAL)
**CORRECT** - Use double-percent for comments:
```mermaid
%% This is a comment
%% Color palette: Blue #0173B2, Orange #DE8F05
```
**WRONG** - Do NOT use this syntax (causes syntax errors):
```mermaid
%%{ This breaks rendering }%%
```
### Escaping Special Characters in Mermaid
**CRITICAL**: Escape special characters in node text AND edge labels to prevent syntax errors:
| Character | Entity Code | Example Usage |
| --------- | ----------- | -------------------------- |
| `(` | `#40;` | `A[Function#40;param#41;]` |
| `)` | `#41;` | Same as above |
| `[` | `#91;` | `B[Array#91;index#93;]` |
| `]` | `#93;` | Same as above |
| `{` | `#123;` | `C[Object#123;key#125;]` |
| `}` | `#125;` | Same as above |
| `<` | `#60;` | `D[Generic#60;T#62;]` |
| `>` | `#62;` | Same as above |
**Edge labels also need escaping:**
```mermaid
A -->|Function#40;param#41;| B
```
**Avoid literal quotes** - Remove or use descriptive text instead:
- ❌ `F[let x = "hello"]` - Breaks rendering
- ✅ `F[let x = hello]` - Works correctly
- ✅ `F[Variable Assignment]` - Descriptive alternative
## Common Mistakes to Avoid
### Mistake 1: Using Red-Green Combinations
❌ **Problem**: ~8% of males cannot distinguish red/green
✅ **Solution**: Use Orange and Teal from verified palette
### Mistake 2: Relying on Color Alone
❌ **Problem**: Color-blind users can't distinguish elements
✅ **Solution**: Add text labels, use different shapes, provide context
### Mistake 3: Using Yellow for Important Info
❌ **Problem**: Yellow invisible to tritanopia (blue-yellow blindness)
✅ **Solution**: Use Orange or Teal instead
### Mistake 4: No Contrast Verification
❌ **Problem**: Insufficient contrast causes readability issues
✅ **Solution**: Use verified palette (all colors tested for WCAG AA)
### Mistake 5: Using CSS Color Names
❌ **Problem**: Inconsistent across platforms
```css
fill: red; /* WRONG */
```
✅ **Solution**: Always use hex codes
```css
fill: #de8f05; /* CORRECT */
```
### Mistake 6: Not Testing Dark Mode
❌ **Problem**: Colors may not work in dark backgrounds
✅ **Solution**: Verified palette works in both light and dark modes
## Testing Tools
### Color Blindness Simulators
- **Coblis Simulator**: <https://www.color-blindness.com/coblis-color-blindness-simulator/>
- Upload diagram, view with protanopia/deuteranopia/tritanopia
- Free, web-based
- **Figma Color Blind Plugin**: <https://www.figma.com/community/plugin/733159460536249875/Color%20Blind>
- Requires Figma account
- All color blindness types
### Contrast Checkers
- **WebAIM Contrast Checker**: <https://webaim.org/resources/contrastchecker/>
- Enter foreground/background colors
- Get WCAG compliance status
- Free, web-based
## Integration with Repository Conventions
This Skill integrates with:
- **[Color Accessibility Convention](../../../repo-governance/conventions/formatting/color-accessibility.md)** - Complete color accessibility standards
- **[Diagrams Convention](../../../repo-governance/conventions/formatting/diagrams.md)** - Mermaid diagram standards, comment syntax, special character escaping
- **[Content Quality Principles](../../../repo-governance/conventions/writing/quality.md)** - Quality standards for all content including diagrams
## Quick Reference
**Verified Palette (Copy-Paste):**
```
Blue: #0173B2 - Primary flow
Orange: #DE8F05 - Decisions, warnings
Teal: #029E73 - Success, validation
Purple: #CC78BC - Special states
Brown: #CA9161 - Neutral
Gray: #808080 - Secondary, disabled
Black: #000000 - Borders, text
White: #FFFFFF - Text on dark
```
**Mermaid classDef Template:**
```
classDef blue fill:#0173B2,stroke:#000000,color:#FFFFFF,stroke-width:2px
classDef orange fill:#DE8F05,stroke:#000000,color:#FFFFFF,stroke-width:2px
classDef teal fill:#029E73,stroke:#000000,color:#FFFFFF,stroke-width:2px
classDef purple fill:#CC78BC,stroke:#000000,color:#FFFFFF,stroke-width:2px
classDef brown fill:#CA9161,stroke:#000000,color:#FFFFFF,stroke-width:2px
classDef gray fill:#808080,stroke:#000000,color:#FFFFFF,stroke-width:2px
```
**Pre-commit Checklist:**
- [ ] Uses only verified palette colors
- [ ] Black borders on all elements
- [ ] White text on dark fills
- [ ] Text labels on all nodes
- [ ] Shape differentiation used
- [ ] Palette comment included
- [ ] Tested in color blindness simulator
- [ ] Contrast ratios verified
- [ ] Works in light and dark modes
## Examples
See `examples.md` in this Skill directory for complete working examples:
- Accessible flowchart
- Sequence diagram with colors
- Architecture diagram
- Common mistakes and corrections
## References
- **[Color Accessibility Convention](../../../repo-governance/conventions/formatting/color-accessibility.md)** - Complete standards, research citations, WCAG compliance
- **[Diagrams Convention](../../../repo-governance/conventions/formatting/diagrams.md)** - Mermaid syntax, comment rules, special character escaping
- **[Accessibility First Principle](../../../repo-governance/principles/content/accessibility-first.md)** - Foundational accessibility principle
## Related Skills
- `repository-architecture` - Understanding how accessibility fits into governance layers
- `apps-ayokoding-web-developing-content` - ayokoding-web diagram requirements
- `factual-validation-methodology` (Phase 2) - Verifying color accessibility claims
---
**Note**: This Skill provides action-oriented guidance for creating accessible diagrams. The authoritative Color Accessibility Convention contains complete scientific research, WCAG standards, and detailed testing procedures.Related Skills
plan-creating-project-plans
Comprehensive project planning standards for plans/ directory including folder structure (ideas.md, backlog/, in-progress/, done/), stage-aware naming convention (backlog/done use YYYY-MM-DD__identifier/, in-progress uses identifier/ with no date prefix), five-document file organization (README.md, brd.md, prd.md, tech-docs.md, delivery.md for multi-file default; single README.md for trivially-small single-file exception), BRD/PRD content-placement rules, Gherkin acceptance criteria, and the mandatory structured multiple-choice grilling gates (pre-write and post-write) for resolving design decisions with the user. Essential for creating structured, executable project plans.
docs-validating-factual-accuracy
Universal methodology for verifying factual correctness in documentation using WebSearch and WebFetch tools. Covers command syntax verification, version checking, code example validation, API correctness, confidence classification system ([Verified], [Error], [Outdated], [Unverified]), source prioritization, and update frequency rules. Essential for maintaining factual accuracy in technical documentation and educational content
docs-creating-in-the-field-tutorials
Comprehensive guide for creating in-the-field production implementation guides - production-ready code with 20-40 guides following standard library first principle, framework integration, and enterprise patterns. Essential for creating production tutorials for programming languages on educational platforms
docs-creating-by-example-tutorials
Comprehensive guide for creating by-example tutorials - code-first learning path with 75-85 heavily annotated examples achieving 95% language coverage. Covers five-part example structure, annotation density standards (1.0-2.25 comments per code line PER EXAMPLE), self-containment rules, and multiple code blocks for comparisons. Essential for creating by-example tutorials for programming languages on educational platforms
docs-applying-diataxis-framework
Diátaxis documentation framework for organizing content into four categories - tutorials (learning-oriented), how-to guides (problem-solving), reference (technical specifications), and explanation (conceptual understanding). Essential for creating and organizing documentation in docs/ directory.
docs-applying-content-quality
Universal markdown content quality standards for active voice, heading hierarchy, accessibility compliance (alt text, WCAG AA contrast, screen reader support), and professional formatting. Essential for all markdown content creation across docs/, web sites, plans/, and repository files. Auto-loads when creating or editing markdown content.
nx-workspace
Explore and understand Nx workspaces. USE WHEN answering questions about the workspace, projects, or tasks. ALSO USE WHEN an nx command fails or you need to check available targets/configuration before running a task. EXAMPLES: 'What projects are in this workspace?', 'How is project X configured?', 'What depends on library Y?', 'What targets can I run?', 'Cannot find configuration for task', 'debug nx task failure'.
nx-run-tasks
Helps with running tasks in an Nx workspace. USE WHEN the user wants to execute build, test, lint, serve, or run any other tasks defined in the workspace.
nx-plugins
Find and add Nx plugins. USE WHEN user wants to discover available plugins, install a new plugin, or add support for a specific framework or technology to the workspace.
nx-import
Import, merge, or combine repositories into an Nx workspace using nx import. USE WHEN the user asks to adopt Nx across repos, move projects into a monorepo, or bring code/history from another repository.
nx-generate
Generate code using nx generators. INVOKE IMMEDIATELY when user mentions scaffolding, setup, structure, creating apps/libs, or setting up project structure. Trigger words - scaffold, setup, create a ... app, create a ... lib, project structure, generate, add a new project. ALWAYS use this BEFORE calling nx_docs or exploring - this skill handles discovery internally.
monitor-ci
Monitor Nx Cloud CI pipeline and handle self-healing fixes. USE WHEN user says "monitor ci", "watch ci", "ci monitor", "watch ci for this branch", "track ci", "check ci status", wants to track CI status, or needs help with self-healing CI fixes. Prefer this skill over native CI provider tools (gh, glab, etc.) for CI monitoring — it integrates with Nx Cloud self-healing which those tools cannot access.