# Validation KodiDevKit validates your skin at two levels: the XML check on save, and a full report covering variables, includes, maps, labels, fonts, IDs, images, XML structure, file integrity and the Kodi repo rules. ## Severity levels | Level | Meaning | Examples | |-------|---------|----------| | **Error** | Must fix. Blocks Kodi repo submission or causes visible breakage. | Missing image, undefined include, BOM in file, empty action without `noop` | | **Warning** | Kodi handles it, but the code is wrong or sloppy. | Invalid tag (silently ignored by Kodi), a tag that repeats its `` | Unused variables and includes are errors, not warnings: the Kodi repo review process blocks PRs with dead definitions. ## On-save phantoms vs full reports KodiDevKit validates in two modes with different defaults: **On-save phantoms** appear inline after saving an XML file, controlled by [`auto_skin_check`](settings.md#validation) (default: `true`). They run the XML structure check against the saved file only, not the full-skin checks like unused variables or missing images. They are filtered: - `phantom_severity_level` controls the minimum severity shown (default: `warning`, showing both errors and warnings). - `hide_include_warnings` (default: `true`) suppresses warnings that originate from include content, since an include may be valid in other contexts. Errors from includes are always shown. This is a plugin-wide setting; it also applies to the results view and the HTML report. - Phantoms show navigation links (Next Issue, Dismiss) and group multiple issues per line. **Full reports** (Command Palette: "KodiDevKit: Generate Validation Report") run all 10 checks across the entire skin: Variables, Includes, Maps, Labels, Fonts, IDs, Images, XML Validation, File Integrity and Kodi Repo. The report is saved in the skin's folder, or in [`validation_report_directory`](settings.md#validation) when set, and opens in the browser as an interactive HTML page with: - Toggle buttons for errors, warnings, and include-originated warnings. Errors and warnings show by default; include warnings start hidden, following `hide_include_warnings`. - Category sections (Variables, Includes, Labels, etc.) with issue counts and descriptions. - Clickable file paths that open the file in Sublime Text at the correct line. - Export to text that mirrors the active toggles. **Individual checks** can also be run from the Command Palette: | Command | Check | |---------|-------| | KodiDevKit: Check Variables | Variables | | KodiDevKit: Check Includes | Includes | | KodiDevKit: Check Maps | Maps | | KodiDevKit: Check Labels | Labels | | KodiDevKit: Check Fonts | Fonts | | KodiDevKit: Check Images | Images | | KodiDevKit: Check Control / Window IDs | IDs | | KodiDevKit: Check for invalid Nodes / Attributes | XML structure | | KodiDevKit: Check File Integrity | File Integrity | | KodiDevKit: Check Kodi Repo Rules | Kodi Repo | Results open in a read-only results view grouped by file; double-click a line (or F4 / Shift+F4) to jump to the issue. Useful when you want to run one check without generating a full report. ## Kodi release Validation targets the release the skin declares in `addon.xml` via ``: gui 5.17.0 is Omega, 5.18.0 is Piers. The `kodi_release` setting overrides the detected value. The release picks the control schema, the window table, the builtin and boolean-condition completions, and the bundled `colors.xml` / `strings.po`, so anything Kodi added in a later release is an error on an older skin. Piers-only skinning so far: | Feature | Surface | |---------|---------| | Skin maps | `` / ``, `$MAP[]`, `$ESCMAP[]` | | FixedList movement and alignment | ``, ``, `` on `fixedlist` | | Image scaling filters | ``, `` on `image` (`linear` or `nearest`) | | EPG grid block size | `` on `epggrid` | | Player bookmarks | `Player.Bookmarks` infolabel, `Player.HasBookmarks` boolean | | Stream-select dialogs | `dialogselectvideo` (12300), `dialogselectaudio` (12301), `dialogselectsubtitle` (12302); `selectvideoversion` and `selectvideoextra` are gone | | PVR providers, game disc manager | `tvproviders` (10712), `radioproviders` (10713), `gamediscmanager` (10832) | | New boolean conditions | `Player.IsLive`, `RetroPlayer.AchievementsLoggedIn`, `RetroPlayer.DiscEjected`, `RetroPlayer.EmptyTray`, `RetroPlayer.SupportsEject` | ## Validators ### Variables Checks `$VAR[Name]` and `$ESCVAR[Name]` references against variable definitions. **Errors:** - Variable referenced but not defined in any `` block. - Variable defined but never referenced. A variable named in a `SetProperty()` value counts as referenced. - Variable defined twice. Kodi uses the first definition. **`$PARAM` resolution:** Variable names containing `$PARAM[...]` are resolved with nested bracket matching, so `$VAR[Label_Title_C$PARAM[id]3]` is read as one name. **SkinShortcuts awareness:** `$VAR[Name]` references in `shortcuts/templates.xml` (v3) or `shortcuts/template.xml` (v2) count as referenced. References containing `$SKINSHORTCUTS[...]` or `$PROPERTY[...]` are skipped as runtime placeholders. See also: [SkinShortcuts integration](skinshortcuts.md) ### Includes Checks `Name` and `` references against include definitions, and the files `` loads. **Errors:** - Include referenced but not defined. - Include defined but never referenced. - Include defined twice. Kodi uses the first definition. - Include with `` children but no ``. Kodi ignores it. - `` naming a file that is missing, differs only by case, or lies outside the skin folder. - An `Includes.xml` named with different case. Kodi looks for `Includes.xml` exactly. **Runtime names:** References to `skinshortcuts-*`, `skinvariables-*` and `script-*-includes` are never reported as undefined, and neither is a missing ``. Add-ons write these at runtime. **SkinShortcuts template scanning:** Static `` tags and `content`/`include` attributes in template files count as references. ### Maps Checks `$MAP[Name, InfoLabel]` and `$ESCMAP[...]` references against `` definitions. Skin maps arrived in Kodi 22 (Piers); a skin targeting an older release is told so once. **Errors:** - Map referenced but not defined. - Map defined but nothing reaches it, directly or through another map's `ref`. - `$MAP[]` with fewer than two arguments, or a blank map name or infolabel. Kodi needs both and renders nothing without them. - `$MAP[` with no closing `]`. Kodi discards the rest of the label. - A definition Kodi silently drops: `` with no `name`, `` with no `key` or no text, a map with neither entries nor a `ref`. - Duplicate map name (the last definition wins) or duplicate `` within one map (the first value wins). - `ref` naming a map that is not defined, or a `ref` chain that loops back on itself. - A `name` or `ref` padded with whitespace. `$MAP[]` trims the name it looks up, so a padded definition can never be reached. **Warnings:** a child of `` other than `` (reported by the XML structure check). Hovering the map name in a `$MAP[]` shows the definition; hovering the infolabel queries the running Kodi and shows the value and what the map turns it into. ### Labels Checks label references and text content in label-like tags (`