Validate Design Craft & Contrast Compliance
ink_validate_designEvaluate HTML and CSS for anti-AI-slop design, WCAG AAA contrast, and RTL/LTR compliance. Get a letter grade, score, and prioritized remediation advice to improve web layout quality before committing.
Instructions
PURPOSE: Evaluate HTML and CSS code against anti-AI-slop design heuristics (detecting generic AI purple gradients, hardcoded pixel font sizes, missing semantic tags), verify WCAG AAA color contrast ratios, and audit Arabic RTL/LTR logical properties.
BEHAVIOR: Executes in-memory static AST and regex analysis on the supplied code strings. Completely read-only with zero filesystem writes, no network requests, and deterministic score computation. Emits a letter grade (S, A, B, C, F), numerical score (0-100), and specific remediation diff advice.
USAGE GUIDELINES:
When to use: Call after creating or modifying web layouts, components, or stylesheets to verify craft quality, contrast compliance, and bidi readiness before committing.
When NOT to use: Do NOT use for JavaScript security vulnerability scanning (use ink_audit_security instead) or for capturing real-browser screenshots (use ink_capture_viewport instead).
Alternatives: Use ink_audit_security for security/XSS checks; use ink_capture_viewport for visual multi-viewport screenshot verification.
RETURNS: ResultEnvelope containing 'craftScore', 'craftGrade', 'isHighCraft' boolean, 'antiSlopChecks' results, computed 'contrast' analysis, 'bidiAndAlignment' report, and prioritized 'remediationAdvice'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | HTML and CSS code string to evaluate for anti-slop rules, typography scaling, and alignment | |
| checkBidi | No | When true, audits CSS logical property compliance (e.g. flagging margin-left instead of margin-inline-start) | |
| backgroundHex | No | Surface background color in 6-digit hex (#RRGGBB) to verify contrast ratio against text | #0b0f19 |
| foregroundHex | No | Primary foreground text color in 6-digit hex (#RRGGBB) to verify against surface | #f8fafc |
| checkCentering | No | When true, verifies optical centering balance and checks for horizontal overflow risks (e.g. 100vw, fixed large widths) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Domain-specific typed payload returned by the tool | |
| status | Yes | Execution outcome status | |
| summary | Yes | Concise, human-readable executive summary of the tool outcome | |
| evidence | No | Audit trail, source references, and generated artifact locations | |
| warnings | Yes | Operational cautions, craft advice, or non-blocking warnings | |
| nextActions | No | Actionable sequential recommendations or subsequent tool suggestions |