Skip to content

Commit 8f78e9a

Browse files
authored
fix(ui5-modernization): Resolve skill spec conformance errors (#83)
- Shorten descriptions to ≤1024 chars for fix-linter-blind-spots, fix-control-renderer, modernize-test-starter, fix-js-globals, and fix-xml-globals - Remove 2-level-deep file reference in modernize-flp-sandbox (skills/modernize-flp-sandbox-qunit/SKILL.md link removed) Fixes validation errors reported in github/awesome-copilot#2114 (comment).
1 parent 1d4dedd commit 8f78e9a

6 files changed

Lines changed: 24 additions & 29 deletions

File tree

plugins/ui5-modernization/skills/fix-control-renderer/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
name: fix-control-renderer
33
description: |
44
Fix Control renderer issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs these rules:
5-
- `no-deprecated-control-renderer-declaration` - For missing renderer declaration, string-based renderer declaration, implicit renderer auto-discovery (UI5 1.x loads `<Control>Renderer` automatically — removed in modern UI5)
6-
- `no-deprecated-api` - For missing apiVersion:2 in control renderer objects, missing IconPool import when using oRm.icon(), deprecated rerender() override. NOTE: For Library.init() apiVersion errors, use fix-library-init instead.
5+
- `no-deprecated-control-renderer-declaration` - For missing renderer declaration, string-based renderer declaration, implicit renderer auto-discovery (removed in modern UI5)
6+
- `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.
77
- `ui5-class-declaration` - For non-static renderer property in ES6 classes
8-
Trigger on error messages about: "missing a renderer declaration", "Deprecated declaration of renderer", "deprecated renderer", "deprecated renderer detected", "apiVersion" (in renderer context, NOT "Deprecated call to ... Lib.init"), "IconPool", "rerender", "renderer must be a static property"
9-
Automatically converts legacy renderer patterns to modern apiVersion: 2 format with proper module imports. Handles implicit renderer auto-discovery where UI5 1.x automatically loaded a renderer from the default path (e.g., sap/m/ButtonRenderer for sap/m/Button) — in modern UI5 this must be explicit.
8+
Trigger on: "missing a renderer declaration", "Deprecated declaration of renderer", "deprecated renderer", "apiVersion" (in renderer context), "IconPool", "rerender", "renderer must be a static property"
9+
Converts legacy renderer patterns to modern apiVersion: 2 format with proper module imports.
1010
---
1111

1212
# Fix Control Renderer Issues

plugins/ui5-modernization/skills/fix-js-globals/SKILL.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@ name: fix-js-globals
33
description: |
44
Fix JavaScript `no-globals` errors that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs:
55
- `no-globals` rule with message "Access of global variable '...' (...)" in JS files
6-
Cases that require this skill (linter CANNOT auto-fix):
6+
Cases handled (linter CANNOT auto-fix):
77
- Assignments to global namespaces: `sap.myNamespace = {...}`
8-
- Global namespace assignment inside sap.ui.define: `my.app.utils.Module = {...}; return my.app.utils.Module;` — replace with local variable
9-
- Global namespace read-only reference inside sap.ui.define: `var x = com.example.app.utils.Helper` — replace with proper dependency import
8+
- Global namespace assignment/read inside sap.ui.define
109
- Delete expressions: `delete sap.something`
11-
- sap.ui.core.Core direct access (class vs singleton difference)
12-
- jQuery/$ global calls: add `sap/ui/thirdparty/jquery` dependency, replace `$` with dependency variable — do NOT replace jQuery API calls (including static methods like jQuery.each, jQuery.extend, jQuery.proxy)
13-
- jQuery.sap.* deprecated utilities (jQuery.sap.log, jQuery.sap.uid, etc.): replace with dedicated replacement modules
14-
- Conditional/probing global access: `if (sap.ui.something)`
10+
- sap.ui.core.Core direct access (class vs singleton)
11+
- jQuery/$ globals: add `sap/ui/thirdparty/jquery` — do NOT replace jQuery API calls
12+
- jQuery.sap.* utilities: replace with dedicated modules
13+
- Conditional/probing access: `if (sap.ui.something)`
1514
- Custom namespace definitions that aren't UI5 modules
16-
- Global access in binding type strings without imports
17-
- sap.ui.controller() factory: define controllers via deprecated global (two-argument form → Controller.extend). Covers legacy files with or without sap.ui.define. Does NOT handle Fiori Elements extensions (use fix-fiori-elements-extensions when manifest has sap.ui.controllerExtensions)
18-
- jQuery.sap.declare/require: legacy module definitions without sap.ui.define wrapper
19-
Trigger when user mentions: "fix no-globals", "global variable error", "sap.ui.getCore", "window.sap", "jQuery.sap", "global namespace"
20-
Automatically converts global namespace access to proper sap.ui.define module imports.
15+
- sap.ui.controller() factory → Controller.extend (NOT Fiori Elements extensions)
16+
- jQuery.sap.declare/require: legacy modules without sap.ui.define
17+
Trigger when: "fix no-globals", "global variable error", "sap.ui.getCore", "jQuery.sap"
18+
Converts global namespace access to proper sap.ui.define module imports.
2119
---
2220

2321
# Fix JavaScript Global Access (no-globals)

plugins/ui5-modernization/skills/fix-linter-blind-spots/SKILL.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ description: |
88
- User mentions "runtime errors after modernization", "test failures after modernization", "global namespace still used"
99
- After running fix-js-globals and fix-cyclic-deps, but tests STILL fail
1010
- User sees "X is not a constructor" or module loading errors in test output
11-
The linter only checks sap.* globals in JS. App-specific namespace patterns in JavaScript (e.g., com.example.app.utils.Module)
12-
are invisible to it. This skill detects and fixes those patterns across ALL JS files — app source AND test.
13-
NOTE: App-namespace globals in XML files ARE reported by the linter (`no-globals` rule) and are handled by
14-
`fix-xml-globals` in Phase 3 — NOT by this skill.
11+
The linter only checks sap.* globals in JS. App-specific namespace patterns (e.g., com.example.app.utils.Module)
12+
are invisible to it. This skill detects and fixes those across ALL JS files — app source AND test.
13+
NOTE: App-namespace globals in XML files are handled by `fix-xml-globals` — NOT by this skill.
1514
---
1615

1716
# Fix Linter Blind Spots

plugins/ui5-modernization/skills/fix-xml-globals/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
name: fix-xml-globals
33
description: |
44
Fix XML view/fragment issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs these rules:
5-
- `no-globals` - For ALL global variable access in XML views — sap.*, jQuery.*, AND app-namespace globals (e.g., com.example.app.utils.Handler.onPress, my.app.formatter.method, sap.ui.model.type.Currency)
5+
- `no-globals` - For ALL global variable access in XML views — sap.*, jQuery.*, AND app-namespace globals (e.g., com.example.app.utils.Handler.onPress, my.app.formatter.method)
66
- `no-ambiguous-event-handler` - For event handlers without dot prefix or local name
77
- `no-deprecated-api` - For legacy template:require syntax (space-separated)
88
Trigger on XML view/fragment files with errors about global variables, event handlers, formatters, type references in bindings, factory functions, or template:require.
99
Automatically adds core:require declarations, fixes event handler prefixes, and handles .bind($control) for functions that use 'this'.
10-
IMPORTANT: The linter reports app-namespace globals in XML under `no-globals` — these MUST be fixed by this skill in Phase 3, NOT deferred to fix-linter-blind-spots (Phase 3, Step 3.2).
10+
IMPORTANT: The linter reports app-namespace globals in XML under `no-globals` — these MUST be fixed by this skill, NOT deferred to fix-linter-blind-spots.
1111
For native HTML or SVG in XML views, use the fix-xml-native-html skill instead.
1212
---
1313

plugins/ui5-modernization/skills/modernize-flp-sandbox/SKILL.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,7 @@ default (report only).
453453
### 6i. QUnit 1.x → 2.x patterns in OPA test code (handoff)
454454

455455
**Layer:** advisory. The actual rewrite lives in the
456-
`modernize-flp-sandbox-qunit` sub-skill (under
457-
[`skills/modernize-flp-sandbox-qunit/`](skills/modernize-flp-sandbox-qunit/SKILL.md)).
456+
`modernize-flp-sandbox-qunit` sub-skill.
458457
The main skill detects, reports, and offers to invoke the sub-skill
459458
on consumer request.
460459

plugins/ui5-modernization/skills/modernize-test-starter/SKILL.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ description: |
88
- Test JS files use Core.ready(), Core.attachInit(), or jsUnitTestSuite instead of sap.ui.define
99
- OPA test HTML files exist with per-test Opa5.extendConfig and manual bootstrapping
1010
- An AllJourneys.js orchestrator loads OPA journeys dynamically
11-
- OPA journeys call `iStartMyUIComponent` (in-window component launcher) instead of `iStartMyAppInAFrame` — skill migrates to a bare-Component iframe in Phase 5b
11+
- OPA journeys call `iStartMyUIComponent` instead of `iStartMyAppInAFrame`
1212
- User asks to modernize tests, modernize test infrastructure, or adopt Test Starter
13-
Handles both unit tests (Core.ready removal, sap.ui.define wrapping) and OPA-specific challenges
14-
(page-object side-effect imports, Opa5 config, journey orchestration, QUnit 1.x assert modernization,
13+
Handles unit tests (Core.ready removal, sap.ui.define wrapping) and OPA challenges
14+
(page-object imports, Opa5 config, journey orchestration, QUnit 1.x assert modernization,
1515
in-window-to-iframe launcher migration).
16-
Trigger on: prefer-test-starter linter warnings, test modernization requests, "test runner" modernization,
17-
iStartMyUIComponent in-window OPA launchers.
16+
Trigger on: prefer-test-starter warnings, test modernization requests, iStartMyUIComponent.
1817
---
1918

2019
# Modernize to Test Starter

0 commit comments

Comments
 (0)