suggest_fix
Generates copy-pasteable code fixes for validation issues like shadow-dom or token-fallback. Provide issue type, kind, and original code to receive a corrected snippet with explanation.
Instructions
Generates concrete, copy-pasteable code fixes for validation issues. Pass the issue type (shadow-dom, token-fallback, theme-compat, method-call, event-usage, specificity, layout), the specific issue kind, and the original code — returns a corrected code snippet with an explanation. NOTE: styling_preflight and validate_css_file now embed fixes inline in each issue — only call suggest_fix directly for issues from other validators or when you need a fix for code not already validated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | The category of validation issue. | |
| issue | Yes | The specific issue kind (e.g. "descendant-piercing", "missing-fallback", "hardcoded-color", "property-as-method", "react-custom-event"). | |
| original | Yes | The original problematic code. | |
| tagName | No | Optional tag name of the component. | |
| partNames | No | Optional list of CSS part names exposed by the component. | |
| property | No | Optional CSS property name for token/theme fixes. | |
| memberName | No | Optional method/property name for method call fixes. | |
| suggestedName | No | Optional corrected name for typo fixes. | |
| eventName | No | Optional event name for event usage fixes. | |
| tokenPrefix | No | Optional token prefix from the component library (e.g. "--hx-", "--fast-", "--md-"). When provided, suggested replacement tokens use this prefix. Get this from diagnose_styling. |