validate_component_code
Validates agent-generated web component code using 19 anti-hallucination sub-validators for HTML attributes, accessibility, CSS, and more. Returns anti-pattern examples and fix suggestions to ensure code quality before submission.
Instructions
ALL-IN-ONE validator — runs 19 anti-hallucination sub-validators on agent-generated code in a single call. Validates HTML attributes, slot children, attribute conflicts, a11y patterns, Shadow DOM CSS, custom properties, token fallbacks, theme compatibility, CSS specificity, layout patterns, inline styles, event bindings, method calls, composition patterns, component imports, color contrast, CSS scope, shorthand safety, and transition/animation patterns. Returns antiPatterns (component-specific negative examples) and auto-generated fix suggestions on issues. Use this as the FINAL check before submitting any code that uses web components.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| libraryId | No | Optional library ID to target a specific loaded library instead of the default. | |
| html | Yes | The HTML markup to validate. | |
| css | No | Optional CSS code to validate for Shadow DOM and custom property issues. | |
| code | No | Optional JS/JSX/template code to validate event bindings. | |
| tagName | Yes | The primary custom element tag name to validate against. | |
| framework | No | Optional framework hint for event validation. |