Validates SAP Analytics Cloud custom widget JSON metadata and JavaScript structure for schema compliance, required fields, lifecycle functions, data bindings, and security best practices. Outputs a report with status, critical issues, and warnings.
How this command is triggered — by the user, by Claude, or both
Slash command
/sap-sac-custom-widget:widget-validate file_pathThis command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# SAC Custom Widget Validation Command Validate SAP Analytics Cloud custom widget files (widget.json and widget.js) for schema compliance, required fields, and best practices. ## Usage ## Validation Categories ### 1. widget.json Schema Validation **Required Root Fields**: - `id` - Unique identifier (reverse domain notation: com.company.widget) - `version` - Semantic version (1.0.0) - `name` - Display name - `vendor` - Company/author name - `webcomponents` - Array of component definitions **Required webcomponents Fields**: - `kind` - Component type (main, styling, builder) - `tag` - ...
Validate SAP Analytics Cloud custom widget files (widget.json and widget.js) for schema compliance, required fields, and best practices.
/widget-validate [file_path]
/widget-validate widget.json
/widget-validate src/widget.js
/widget-validate --all
Required Root Fields:
id - Unique identifier (reverse domain notation: com.company.widget)version - Semantic version (1.0.0)name - Display namevendor - Company/author namewebcomponents - Array of component definitionsRequired webcomponents Fields:
kind - Component type (main, styling, builder)tag - HTML custom element tag (lowercase with hyphens)url - JavaScript file URLOptional but Recommended:
description - Widget descriptionlicense - License typeicon - Widget icon pathintegrity - SHA256 hash for productionproperties - Property definitionsmethods - Script-callable methodsevents - Custom eventsdataBindings - Data binding configurationRequired Elements:
customElements.define() call matching tag in JSONattachShadow({ mode: "open" }) for Shadow DOMRequired Lifecycle Functions:
onCustomWidgetBeforeUpdate(changedProperties)onCustomWidgetAfterUpdate(changedProperties)Recommended Lifecycle Functions:
onCustomWidgetResize()onCustomWidgetDestroy()Property Patterns:
propertiesChanged event dispatch on setIf dataBindings is defined:
feeds arrayid, description, typedimension, mainStructureMember, measureProduction Readiness:
ignoreIntegrity should be false for productionintegrity hash should be present and validWarning-Level:
ignoreIntegrity: true (development only)## SAC Widget Validation Report
**File**: [filename]
**Type**: [widget.json / widget.js]
**Status**: [PASS / FAIL / WARNINGS]
### Critical Issues (X found)
1. [Line X]: [Issue description]
**Current**: `[problematic code]`
**Required**: `[correct pattern]`
### Warnings (X found)
1. [Line X]: [Issue description]
**Recommendation**: [How to fix]
### Suggestions (X found)
1. [Issue description]
**Best Practice**: [Recommendation]
### Summary
- Critical: X (must fix)
- Warnings: X (should fix)
- Suggestions: X (consider)
### Cross-Validation
[Results of JSON ↔ JS consistency check if applicable]
/widget-validate widget.json
/widget-validate widget.js
/widget-validate --all
// GOOD: lowercase with hyphens
"tag": "my-custom-widget"
// BAD: uppercase or underscores
"tag": "MyCustomWidget"
"tag": "my_custom_widget"
// Valid types
"type": "string"
"type": "integer"
"type": "number"
"type": "boolean"
"type": "array"
"type": "object"
"type": "Color" // SAC special type
"type": "Selection" // SAC special type
// REQUIRED - will fail validation if missing
onCustomWidgetBeforeUpdate(changedProperties) { }
onCustomWidgetAfterUpdate(changedProperties) { }
// RECOMMENDED - warning if missing
onCustomWidgetResize() { }
onCustomWidgetDestroy() { }
// Tag in widget.json
"tag": "my-widget"
// Must match in widget.js
customElements.define("my-widget", MyWidget);
When this command is invoked:
--all, find all widget.json and widget.js files in the projectnpx claudepluginhub andreafusar/https-github.com-secondsky-sap-skills --plugin sap-sac-custom-widget/widget-validateValidates SAP Analytics Cloud custom widget JSON metadata and JavaScript structure for schema compliance, required fields, lifecycle functions, data bindings, and security best practices. Outputs a report with status, critical issues, and warnings.
/sac-debugGuides debugging of SAC script issues via info gathering, common error analysis (e.g., undefined functions, null checks), code fixes, and console logging tips. Optional error arg.
/auditAudits the current codebase for SvelteKit and Svelte 5 best practice violations, reporting file/line locations, explanations, correct patterns, and severity ratings (critical/warning/info).
/json-validatorValidates JSON against schemas (draft-07, 2019-09, 2020-12), formats and minifies JSON, runs JSONPath queries, compares JSON diffs, and reports detailed syntax and type errors.
/release-checkRuns pre-release validation pipeline on a component, auditing design alignment, accessibility, tokens, docs, guidelines, and changes. Produces release package, sign-off checklist, and gate decisions.
/devkit-validateValidates manifest.json, directory structure, and content (agents, commands, skills) of AIWG addons, frameworks, or extensions at <path>. Reports pass/fail with issues; supports --fix, --verbose.