accessibility-hub 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EXAMPLES.md +53 -53
- package/README.md +306 -167
- package/USAGE.md +430 -195
- package/dist/server.js +599 -51
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/EXAMPLES.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Usage Examples - AI-ccesibility
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Concrete input and output examples for each MCP tool.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Table of Contents
|
|
6
6
|
|
|
7
7
|
- [analyze-with-axe](#analyze-with-axe)
|
|
8
8
|
- [analyze-with-pa11y](#analyze-with-pa11y)
|
|
@@ -13,7 +13,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
13
13
|
|
|
14
14
|
## analyze-with-axe
|
|
15
15
|
|
|
16
|
-
###
|
|
16
|
+
### Example 1: Basic URL analysis
|
|
17
17
|
|
|
18
18
|
**Input:**
|
|
19
19
|
```json
|
|
@@ -44,11 +44,11 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
44
44
|
"snippet": "<img src=\"logo.png\">"
|
|
45
45
|
},
|
|
46
46
|
"message": "Images must have alternate text",
|
|
47
|
-
"humanContext": "**
|
|
47
|
+
"humanContext": "**Non-text content (WCAG 1.1.1 - Level A)**\n\nAll non-text content must have a text alternative...",
|
|
48
48
|
"suggestedActions": [
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
49
|
+
"Add descriptive alt attribute to images",
|
|
50
|
+
"Use aria-label for decorative icons with function",
|
|
51
|
+
"Mark decorative images with empty alt=\"\""
|
|
52
52
|
],
|
|
53
53
|
"affectedUsers": ["screen-reader", "low-vision"],
|
|
54
54
|
"priority": "critical",
|
|
@@ -77,7 +77,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
77
77
|
|
|
78
78
|
---
|
|
79
79
|
|
|
80
|
-
###
|
|
80
|
+
### Example 2: Raw HTML analysis
|
|
81
81
|
|
|
82
82
|
**Input:**
|
|
83
83
|
```json
|
|
@@ -111,10 +111,10 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
111
111
|
"snippet": "<input type=\"text\" placeholder=\"Email\">"
|
|
112
112
|
},
|
|
113
113
|
"message": "Form elements must have labels",
|
|
114
|
-
"humanContext": "**
|
|
114
|
+
"humanContext": "**Info and Relationships (WCAG 1.3.1 - Level A)**...",
|
|
115
115
|
"suggestedActions": [
|
|
116
|
-
"
|
|
117
|
-
"
|
|
116
|
+
"Associate labels with inputs correctly",
|
|
117
|
+
"Use aria-label if visible label is not possible"
|
|
118
118
|
],
|
|
119
119
|
"affectedUsers": ["screen-reader", "cognitive"],
|
|
120
120
|
"priority": "high",
|
|
@@ -127,7 +127,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
127
127
|
|
|
128
128
|
---
|
|
129
129
|
|
|
130
|
-
###
|
|
130
|
+
### Example 3: With advanced options
|
|
131
131
|
|
|
132
132
|
**Input:**
|
|
133
133
|
```json
|
|
@@ -152,7 +152,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
152
152
|
|
|
153
153
|
## analyze-with-pa11y
|
|
154
154
|
|
|
155
|
-
###
|
|
155
|
+
### Example 1: Analysis with specific standard
|
|
156
156
|
|
|
157
157
|
**Input:**
|
|
158
158
|
```json
|
|
@@ -189,7 +189,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
189
189
|
"snippet": "<img src=\"banner.jpg\">"
|
|
190
190
|
},
|
|
191
191
|
"message": "Img element missing an alt attribute. Use the alt attribute to specify a short text alternative.",
|
|
192
|
-
"humanContext": "**
|
|
192
|
+
"humanContext": "**Non-text content (WCAG 1.1.1 - Level A)**...",
|
|
193
193
|
"affectedUsers": ["screen-reader", "low-vision"],
|
|
194
194
|
"priority": "critical",
|
|
195
195
|
"remediationEffort": "low",
|
|
@@ -217,7 +217,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
217
217
|
|
|
218
218
|
## analyze-contrast
|
|
219
219
|
|
|
220
|
-
###
|
|
220
|
+
### Example 1: Basic contrast analysis
|
|
221
221
|
|
|
222
222
|
**Input:**
|
|
223
223
|
```json
|
|
@@ -288,7 +288,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
288
288
|
|
|
289
289
|
---
|
|
290
290
|
|
|
291
|
-
###
|
|
291
|
+
### Example 2: Analysis with AAA level
|
|
292
292
|
|
|
293
293
|
**Input:**
|
|
294
294
|
```json
|
|
@@ -341,7 +341,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
341
341
|
|
|
342
342
|
---
|
|
343
343
|
|
|
344
|
-
###
|
|
344
|
+
### Example 3: Analysis with APCA (WCAG 3.0 Draft)
|
|
345
345
|
|
|
346
346
|
**Input:**
|
|
347
347
|
```json
|
|
@@ -412,14 +412,14 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
412
412
|
}
|
|
413
413
|
```
|
|
414
414
|
|
|
415
|
-
**
|
|
416
|
-
- `currentRatio`
|
|
417
|
-
-
|
|
418
|
-
- APCA
|
|
415
|
+
**Note about APCA:**
|
|
416
|
+
- `currentRatio` and `requiredRatio` use Lc (Lightness contrast) values instead of ratios
|
|
417
|
+
- Thresholds: body text (75Lc), large text (60Lc), non-text (45Lc)
|
|
418
|
+
- APCA is more perceptually accurate but still experimental
|
|
419
419
|
|
|
420
420
|
---
|
|
421
421
|
|
|
422
|
-
###
|
|
422
|
+
### Example 4: Specific section analysis
|
|
423
423
|
|
|
424
424
|
**Input:**
|
|
425
425
|
```json
|
|
@@ -434,7 +434,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
434
434
|
|
|
435
435
|
---
|
|
436
436
|
|
|
437
|
-
###
|
|
437
|
+
### Example 5: HTML with contrast analysis
|
|
438
438
|
|
|
439
439
|
**Input:**
|
|
440
440
|
```json
|
|
@@ -504,7 +504,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
504
504
|
|
|
505
505
|
## analyze-mixed
|
|
506
506
|
|
|
507
|
-
###
|
|
507
|
+
### Example 1: Basic combined analysis
|
|
508
508
|
|
|
509
509
|
**Input:**
|
|
510
510
|
```json
|
|
@@ -533,7 +533,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
533
533
|
"tool": "axe-core",
|
|
534
534
|
"severity": "critical",
|
|
535
535
|
"message": "Images must have alternate text",
|
|
536
|
-
"humanContext": "**
|
|
536
|
+
"humanContext": "**Non-text content (WCAG 1.1.1 - Level A)**...",
|
|
537
537
|
"affectedUsers": ["screen-reader", "low-vision"],
|
|
538
538
|
"priority": "critical",
|
|
539
539
|
"remediationEffort": "low"
|
|
@@ -602,7 +602,7 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
602
602
|
|
|
603
603
|
---
|
|
604
604
|
|
|
605
|
-
###
|
|
605
|
+
### Example 2: Without deduplication
|
|
606
606
|
|
|
607
607
|
**Input:**
|
|
608
608
|
```json
|
|
@@ -635,11 +635,11 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
635
635
|
}
|
|
636
636
|
```
|
|
637
637
|
|
|
638
|
-
**
|
|
638
|
+
**Note:** Both detected the same image without `alt`, but with different selectors.
|
|
639
639
|
|
|
640
640
|
---
|
|
641
641
|
|
|
642
|
-
###
|
|
642
|
+
### Example 3: With mobile viewport
|
|
643
643
|
|
|
644
644
|
**Input:**
|
|
645
645
|
```json
|
|
@@ -660,9 +660,9 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
660
660
|
|
|
661
661
|
---
|
|
662
662
|
|
|
663
|
-
##
|
|
663
|
+
## Output Comparison by Tool
|
|
664
664
|
|
|
665
|
-
###
|
|
665
|
+
### Same issue detected by different tools
|
|
666
666
|
|
|
667
667
|
**Axe-core:**
|
|
668
668
|
```json
|
|
@@ -692,50 +692,50 @@ Ejemplos concretos de inputs y outputs para cada herramienta MCP.
|
|
|
692
692
|
|
|
693
693
|
---
|
|
694
694
|
|
|
695
|
-
##
|
|
695
|
+
## Differences Summary
|
|
696
696
|
|
|
697
|
-
|
|
|
698
|
-
|
|
697
|
+
| Feature | axe-core | Pa11y | Contrast |
|
|
698
|
+
|---------|----------|-------|----------|
|
|
699
699
|
| **Target** | URL/HTML | URL/HTML | URL/HTML |
|
|
700
|
-
| **Selector** | CSS
|
|
701
|
-
| **
|
|
700
|
+
| **Selector** | Compact CSS | Full CSS | Compact CSS |
|
|
701
|
+
| **Severities** | 4 levels | 3 types | 4 levels |
|
|
702
702
|
| **Snippet** | ✅ | ✅ | ✅ |
|
|
703
|
-
| **Confidence** | ✅ | ✅ |
|
|
703
|
+
| **Confidence** | ✅ | ✅ | Always 1 |
|
|
704
704
|
| **Browser** | Puppeteer | Puppeteer | Puppeteer |
|
|
705
|
-
| **
|
|
706
|
-
| **
|
|
707
|
-
| **
|
|
705
|
+
| **Speed** | ~2-3s | ~2s | ~1-2s |
|
|
706
|
+
| **False positives** | Few | Moderate | Very few |
|
|
707
|
+
| **Fix suggestions** | - | - | ✅ Colors |
|
|
708
708
|
| **APCA (WCAG 3.0)** | - | - | ✅ Experimental |
|
|
709
709
|
|
|
710
710
|
---
|
|
711
711
|
|
|
712
|
-
## Tips
|
|
712
|
+
## Tips for Interpreting Results
|
|
713
713
|
|
|
714
|
-
### 1.
|
|
714
|
+
### 1. Prioritize by Matrix
|
|
715
715
|
|
|
716
716
|
```
|
|
717
|
-
Critical + Low effort = Fix
|
|
718
|
-
Critical + Medium/High effort =
|
|
717
|
+
Critical + Low effort = Fix TODAY
|
|
718
|
+
Critical + Medium/High effort = Plan for sprint
|
|
719
719
|
High + Low effort = Quick wins
|
|
720
720
|
Medium/Low + High effort = Backlog
|
|
721
721
|
```
|
|
722
722
|
|
|
723
|
-
### 2.
|
|
723
|
+
### 2. Validate Duplicates
|
|
724
724
|
|
|
725
|
-
|
|
725
|
+
If `deduplicatedCount` > `issueCount`, check `individualResults` to see which tool is more reliable for that type of issue.
|
|
726
726
|
|
|
727
|
-
### 3.
|
|
727
|
+
### 3. Review `affectedUsers`
|
|
728
728
|
|
|
729
|
-
|
|
729
|
+
Prioritize issues that affect screen reader and keyboard-only users (most common).
|
|
730
730
|
|
|
731
|
-
### 4.
|
|
731
|
+
### 4. Leverage `humanContext`
|
|
732
732
|
|
|
733
|
-
|
|
733
|
+
Read the real-world examples to understand the actual impact on users.
|
|
734
734
|
|
|
735
735
|
---
|
|
736
736
|
|
|
737
737
|
## Next Steps
|
|
738
738
|
|
|
739
|
-
-
|
|
740
|
-
-
|
|
741
|
-
-
|
|
739
|
+
- See [USAGE.md](./USAGE.md) for complete workflows
|
|
740
|
+
- See [README.md](./README.md) for configuration
|
|
741
|
+
- See `src/shared/data/README.md` to add more WCAG criteria
|