Fixes native HTML and SVG usage in UI5 XML views/fragments detected by the UI5 linter, replacing them with equivalent UI5 controls and icons.
Ships in ui5-modernization. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill fixes native HTML and SVG usage in XML views/fragments that the UI5 linter detects but cannot auto-fix because they require understanding the appropriate UI5 control replacements.
| Rule ID | Message Pattern | This Skill's Action |
|---|---|---|
no-deprecated-api | Usage of native HTML in XML Views/Fragments is deprecated | Replace with UI5 controls |
no-deprecated-api | Deprecated use of SVG in XML View or Fragment | Replace with UI5 icons or custom controls |
Apply this skill when you see linter output like:
MyView.view.xml:15:5 error Usage of native HTML in XML Views/Fragments is deprecated no-deprecated-api
MyView.view.xml:25:5 error Deprecated use of SVG in XML View or Fragment no-deprecated-api
Run npx @ui5/linter --details to get links to documentation about native HTML deprecation.
Native HTML in XML views was supported via the sap.ui.core.HTML control and the html namespace. However, this approach:
Problem: Using HTML elements via the html: namespace.
<!-- Before - native HTML usage -->
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
xmlns:html="http://www.w3.org/1999/xhtml">
<html:div class="myContainer">
<html:span>Some text</html:span>
<html:a href="https://example.com">Link</html:a>
<html:img src="image.png" alt="My Image" />
</html:div>
</mvc:View>
Fix Strategy: Replace with equivalent UI5 controls.
<!-- After - UI5 controls -->
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<VBox class="myContainer">
<Text text="Some text" />
<Link text="Link" href="https://example.com" />
<Image src="image.png" alt="My Image" />
</VBox>
</mvc:View>
| HTML Element | UI5 Control | Notes |
|---|---|---|
<html:div> | <VBox>, <HBox>, <FlexBox> | Use VBox for vertical, HBox for horizontal layout |
<html:span> | <Text>, <Label> | Text for display, Label for form labels |
<html:p> | <Text> | Use \n in text for paragraphs |
<html:a> | <Link> | Full link functionality with href |
<html:img> | <Image> | Supports src, alt, width, height |
<html:input> | <Input>, <SearchField> | Various input types available |
<html:button> | <Button> | Full button with icon support |
<html:ul> / <html:li> | <List> / <StandardListItem> | Or <VBox> with items |
<html:ol> | <List> with <ObjectListItem> | Use custom numbering |
<html:table> | <Table> (sap.m) | Or <sap.ui.table.Table> for large data |
<html:h1> - <html:h6> | <Title> | Use level property for heading level |
<html:br> | (none) | Use \n in Text or separate controls |
<html:hr> | <Toolbar> with <ToolbarSpacer> | Or custom styling |
<html:iframe> | <HTML> control | Only when absolutely necessary |
<html:form> | (form controls directly) | UI5 handles form submission differently |
<html:select> | <Select>, <ComboBox> | Full dropdown functionality |
<html:textarea> | <TextArea> | Multi-line input |
Problem: Nested HTML for layout.
<!-- Before - complex HTML layout -->
<html:div class="header">
<html:div class="logo">
<html:img src="logo.png" />
</html:div>
<html:div class="nav">
<html:a href="#home">Home</html:a>
<html:a href="#about">About</html:a>
</html:div>
</html:div>
Fix Strategy: Use UI5 layout controls.
<!-- After - UI5 layout -->
<HBox class="header" alignItems="Center" justifyContent="SpaceBetween">
<Image src="logo.png" class="logo" />
<HBox class="nav">
<Link text="Home" href="#home" class="sapUiSmallMarginEnd" />
<Link text="About" href="#about" />
</HBox>
</HBox>
Problem: Using SVG directly in XML views.
<!-- Before - SVG in XML view -->
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
xmlns:svg="http://www.w3.org/2000/svg">
<svg:svg width="100" height="100">
<svg:circle cx="50" cy="50" r="40" fill="blue" />
</svg:svg>
</mvc:View>
Fix Strategy A - For Icons: Use UI5 Icon control with icon fonts.
<!-- After - UI5 Icon -->
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
xmlns:core="sap.ui.core">
<core:Icon src="sap-icon://circle-task" size="2rem" color="blue" />
</mvc:View>
Fix Strategy B - For Complex Graphics: Create a custom control or use HTML control.
// CustomGraphic.js - for complex SVG that can't be replaced with icons
sap.ui.define([
"sap/ui/core/Control"
], function(Control) {
"use strict";
return Control.extend("my.app.control.CustomGraphic", {
metadata: {
properties: {
color: { type: "string", defaultValue: "blue" }
}
},
renderer: {
apiVersion: 2,
render: function(oRm, oControl) {
oRm.openStart("svg", oControl);
oRm.attr("width", "100");
oRm.attr("height", "100");
oRm.openEnd();
oRm.openStart("circle");
oRm.attr("cx", "50");
oRm.attr("cy", "50");
oRm.attr("r", "40");
oRm.attr("fill", oControl.getColor());
oRm.openEnd();
oRm.close("circle");
oRm.close("svg");
}
}
});
});
<!-- Usage in XML view -->
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
xmlns:custom="my.app.control">
<custom:CustomGraphic color="blue" />
</mvc:View>
When replacing SVG icons, use the SAP icon font:
| SVG Pattern | UI5 Icon |
|---|---|
| Checkmark/tick | sap-icon://accept |
| Cross/X | sap-icon://decline |
| Circle | sap-icon://circle-task |
| Arrow right | sap-icon://navigation-right-arrow |
| Arrow left | sap-icon://navigation-left-arrow |
| Plus/Add | sap-icon://add |
| Minus/Remove | sap-icon://less |
| Edit/Pencil | sap-icon://edit |
| Delete/Trash | sap-icon://delete |
| Search | sap-icon://search |
| Settings/Gear | sap-icon://settings |
| User/Person | sap-icon://person-placeholder |
| Calendar | sap-icon://calendar |
| Download | sap-icon://download |
| Upload | sap-icon://upload |
Browse all available icons: UI5 Icon Explorer
For cases where HTML is absolutely required (e.g., rendering external HTML content):
<!-- Use sap.ui.core.HTML control with sanitized content -->
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
xmlns:core="sap.ui.core">
<core:HTML content="{/sanitizedHtmlContent}" sanitizeContent="true" />
</mvc:View>
Warning: Only use this for content that:
When modernizing from HTML to UI5 controls:
CSS Classes: Apply custom classes via the class attribute
<VBox class="myCustomContainer">
Inline Styles: Use customData for CSS variables or the layoutData aggregation
<VBox>
<layoutData>
<FlexItemData growFactor="1" />
</layoutData>
</VBox>
Theming: UI5 controls automatically adapt to the selected theme (Horizon, Quartz, etc.)
Identify HTML/SVG usage in the linter output
Determine the purpose of each HTML element:
Check for custom CSS that may need updating
Replace elements with UI5 equivalents
Remove the xmlns:html namespace once all HTML elements are replaced
Test the layout to ensure visual parity
Given linter output:
MyView.view.xml:5:3 error Usage of native HTML in XML Views/Fragments is deprecated no-deprecated-api
MyView.view.xml:12:5 error Deprecated use of SVG in XML View or Fragment no-deprecated-api
Before:
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg">
<html:div class="card">
<html:div class="cardHeader">
<svg:svg width="24" height="24">
<svg:circle cx="12" cy="12" r="10" fill="green" />
</svg:svg>
<html:span class="title">Status: Active</html:span>
</html:div>
<html:p>This is the card content.</html:p>
<html:a href="https://example.com">Learn more</html:a>
</html:div>
</mvc:View>
After:
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
xmlns:core="sap.ui.core">
<VBox class="card">
<HBox class="cardHeader" alignItems="Center">
<core:Icon src="sap-icon://status-positive" color="green" class="sapUiSmallMarginEnd" />
<Text text="Status: Active" class="title" />
</HBox>
<Text text="This is the card content." />
<Link text="Learn more" href="https://example.com" />
</VBox>
</mvc:View>
html: namespace should be completely removed once modernization is donesap.ui.core.HTML control can be used as a last resort with sanitizeContent="true"sap.m.FormattedText for HTML-like rich text formattingno-globals), ambiguous event handlers (no-ambiguous-event-handler), and legacy template:require syntax, use fix-xml-globalsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
19 skills in this plugin
/fix-bootstrap-paramsFix HTML bootstrap parameter issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs these rules:
- `no-deprecated-api` - For missing/deprecated bootstrap parameters (async, compat-version, animation, binding-syntax, etc.)
- `no-deprecated-theme` - For deprecated theme values in data-sap-ui-theme
- `no-deprecated-library` - For deprecated libraries in data-sap-ui-libs
Trigger on error messages containing: "Missing bootstrap parameter", "Abandoned bootstrap parameter", "Redundant bootstrap parameter", "deprecated value", "bootstrap"
Automatically applies safe fixes to HTML files containing UI5 bootstrap script tags.
/fix-component-asyncFix Component.js async configuration issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs these rules:
- `async-component-flags` - For missing IAsyncContentCreation interface, missing manifest declaration, redundant async flags, async:false errors
- `no-removed-manifest-property` - For async flags in inline manifest v2
Trigger on Component.js files with errors about async loading, IAsyncContentCreation, manifest declaration.
Automatically adds the IAsyncContentCreation interface and configures manifest properly.
/fix-control-rendererFix Control renderer issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs these rules:
- `no-deprecated-control-renderer-declaration` - For missing renderer declaration, string-based renderer declaration, implicit renderer auto-discovery (removed in modern UI5)
- `no-deprecated-api` - For missing apiVersion:2 in renderer objects, missing IconPool import when using oRm.icon(), deprecated rerender() override. NOTE: For Library.init() apiVersion errors, use fix-library-init instead.
- `ui5-class-declaration` - For non-static renderer property in ES6 classes
Trigger on: "missing a renderer declaration", "Deprecated declaration of renderer", "deprecated renderer", "apiVersion" (in renderer context), "IconPool", "rerender", "renderer must be a static property"
Converts legacy renderer patterns to modern apiVersion: 2 format with proper module imports.
/fix-csp-complianceFix Content Security Policy (CSP) compliance issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs:
- `csp-unsafe-inline-script` with message "Use of unsafe inline script"
Trigger on: inline JavaScript in HTML files, script tags without src attribute, onclick/onload handlers in HTML.
Also use when user mentions 'security headers', 'inline script warning', 'CSP policy', 'unsafe-inline', or 'Content-Security-Policy'.
Provides guidance on moving inline scripts to external files for CSP compliance.
/fix-cyclic-depsDetect and resolve cyclic module dependencies introduced during UI5 modernization.
Trigger when user mentions: "cyclic dependency", "circular import", "undefined module at runtime",
"lazy require", "sap.ui.require sync", "import cycle", or when a module returns undefined despite
a correct import path. Classic symptom: a module is `undefined` at runtime despite a correct
sap.ui.define import path.
Auto-fixes 2-node cycles (A↔B) by converting the lesser-used edge to lazy sap.ui.require().
Auto-fixes longer chains (3+ nodes) via hub-based approach. Reports unfixable chains to
MODERNIZATION-ISSUES.md. Runs as Phase 3, Step 3.3 (final step) after all other Phase 3 steps.
/fix-deprecated-controlsFix deprecated control/class/interface/type issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs:
- `no-deprecated-api` with messages about deprecated class, interface, type, property, or property of class
- Messages like "Use of deprecated class '...'", "Use of deprecated interface '...'", "Use of deprecated property '...'"
Trigger on: deprecated control usage in JS `new` expressions, deprecated properties in constructor settings, deprecated interfaces/types in metadata, deprecated controls/properties in XML views, sap.m.MessagePage modernization to IllustratedMessage.
Use this skill whenever you see 'deprecated class', 'deprecated property', 'deprecated interface', or 'deprecated type' in linter output, even if the user doesn't explicitly mention deprecation.
Provides replacement guidance for deprecated UI5 controls and their properties.
/ui5-ui5-modernization-plugins-ui5-modernization:fix-xml-native-htmlfrom ui5-modernization
Generated from the plugin's indexed repository (ui5/plugins-coding-agents) — no native marketplace selected
npx claudepluginhub p/ui5-ui5-modernization-plugins-ui5-modernizationOther plugins' skills for the same job