All skills
secondsky avatar

/sap-sac-custom-widget

@4d87d99
by Eddiesecondsky/sap-skills456 stars
120

SAP Analytics Cloud (SAC) Custom Widget development. Use when building custom visualizations, extending SAC with Web Components, or creating Widget Add-Ons. Covers JSON metadata, JavaScript Web Components, lifecycle functions, data binding with feeds, styling/builder panels, property/event/method definitions, third-party library integration, hosting, security, performance, and debugging. Includes Widget Add-On feature (QRC Q4 2023+) and templates for widgets, charts, and KPI cards.

Use this Skill: https://skilld.dev/gh/secondsky/sap-skills/sap-sac-custom-widget

This session only. Nothing lands on disk.

referencesverification-and-artifacts.md

≈1.6k tokens on demand. Your agent reads this file only when SKILL.md points to it.

SAC Custom Widget Verification and Artifact Discipline

Use this reference before SAC import, after a build change, or when local preview and tenant behavior disagree.

Test the public seam

Drive the interface SAC will use, not only private helpers:

  • set properties through public setters or an SAC-shaped update path;
  • dispatch real DOM events and use element.click() where native disabled behavior matters;
  • inspect rendered text, attributes, events, and serialized output; and
  • test the final bundled widget.js, builder.js, and styling.js independently.

Test the delivered component

The unit under test is the component JavaScript that SAC will load, not only a source helper. For every build:

  1. Generate the manifest and component files from the same source state.
  2. Validate all outputs before writing any output file. A failure in the last bundle must not leave earlier bundles written from a different build.
  3. Rebuild the Resource-ZIP after every manifest or JavaScript change.
  4. Check syntax, permitted ZIP contents, root-relative URLs for ZIP mode, and exact integrity bytes.
  5. Mount the final widget.js, builder.js, and styling.js independently in preview tests.

If a validation tool is optional, distinguish "not installed" from "ran and passed". Every emitted probe must still be parsed before it is treated as upload evidence. An absent optional tool must produce a clear skip or blocked result, never a passing result.

Do not claim SAC importability from a Node suite, node --check, a valid ZIP, or a local preview. Those are useful gates, not tenant evidence.

High-value behavior checks

Prefer behavior checks over markup checks:

  • Set two properties in one update tick and assert the final merged state.
  • Assert every manifest property is read by runtime behavior, not only by a panel or serializer.
  • Test string-form numbers, boolean-like strings, blank values, localized objects, and legal zero.
  • Test that a builder text edit keeps focus, caret, selection, search, and collapse state.
  • Use element.click() when testing disabled controls. dispatchEvent() can bypass native disabled behavior.
  • Simulate touch pointer sequences and ensure hover-only behavior checks event.pointerType.
  • Check every button for a handler and accessible name. Check icon-only buttons for a rendered glyph.
  • Test both keyboard and pointer activation for controls and popovers.
  • Test that a full-cover pseudo-element cannot intercept clicks when it is decorative.
  • Test output/import round trips with gaps, reordered items, duplicate-like names, and data that is present only in a non-default language.
  • Test a property received before builder initialization, a structural edit after a text edit, and an open popover followed by rerender or focus departure.

Use a small control sweep for panels instead of one test per current button. Keep the sweep honest: record the handler or observe the public effect, and do not count a control as covered merely because it exists in the DOM.

Know the test environment's blind spots

DOM emulation generally has no real layout, focus movement, font metrics, or rendering lifecycle. Zero geometry can make a conditional assertion never run. A hidden preview iframe may also fail to fire ResizeObserver or requestAnimationFrame even when the DOM is correct.

Move the check to a real browser when it depends on:

  • getBoundingClientRect, overflow, clipping, or narrow viewport behavior;
  • focus, caret movement, blur, popover dismissal, or pointer coordinates;
  • font loading and post-font measurements; or
  • ResizeObserver, animation frames, scrolling, or visibility transitions.

Real-browser checks should state the behavioral rule, use asymmetric content at wide and narrow viewports, wait for fonts, and record measurements. Do not lower an expected count or threshold just to make a stale check pass. If a browser is unavailable, report the check as pending.

Mutation and failure evidence

Every new guard should be shown to fail when the guarded rule is removed or changed in a throwaway copy. Examples:

  • remove a runtime property read and confirm the property-use check fails;
  • change a legal-zero fallback to || and confirm the coercion test fails;
  • change one bundle after SRI generation and confirm the artifact check fails; and
  • replace a handler or CSS rule with a no-op and confirm the public behavior check fails.

Restore from the pre-test copy, not from a destructive checkout that could discard unrelated work. If a test cannot reach a platform API, instrument the observation seam and add a positive control so the assertion is not vacuous.

Upload failure triage

For an opaque CUSTOM_WIDGET_SERVICE_EXCEPTION or HTTP 500, first scan source and bundles for raw control or ambiguous code points, including BOM, zero-width characters, and line separators, and confirm the manifest and ZIP are a matching pair. Then create complete, uploadable probes that change one variable at a time. Keep probes disposable and use unique ids and versions. Record confirmed non-causes so later debugging does not repeat them.

If a failure is tenant-observed rather than documented by SAP, label it as such and verify it again before turning it into a universal rule.

Deterministic artifact chain

The final package should be reproducible from source. Pin these relationships:

  • manifest version and component versions;
  • manifest component tags and the tags registered by each bundle;
  • manifest integrity values and the exact bytes inside the final ZIP;
  • the source bundle and the delivered bundle; and
  • the ZIP file list and the SAC upload contract.

Do not let line-ending normalization change digest-pinned files. Keep byte-contract files outside automatic text normalization when their format requires a specific encoding or line ending.

Sources and evidence

Source: SKILL.md on GitHub

1 alert16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides a comprehensive environment and templates for developing SAP Analytics Cloud (SAC) Custom Widgets. It promotes robust security best practices, including subresource integrity (SRI), XSS prevention via input sanitization, and proper Shadow DOM encapsulation. It includes local tools for scaffold generation and iteration that operate on the user's machine without requiring external packages or services.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    3/16 files flagged

  • ZeroLeaks5mo

    2 findings · Score: 80/100

Signed by skilld at 4d87d99. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated last month
What it can do
Reads files Runs commands Network
All 3 allowed tools
ReadBashWebFetch
Other metadata
metadata
{
  "maintainer": "Eduard Jiglau",
  "maintainer_email": "hello@sap-ai-skills.com",
  "website": "https://sap-ai-skills.com",
  "version": "2.4.1",
  "last_verified": "2026-06-12",
  "sac_version": "2026.8",
  "errors_prevented": "40+",
  "official_docs": [
    "https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/0ac8c6754ff84605a4372468d002f2bf/75311f67527c41638ceb89af9cd8af3e.html",
    "https://help.sap.com/doc/c813a28922b54e50bd2a307b099787dc/release/en-US/CustomWidgetDevGuide_en.pdf"
  ],
  "samples_repo": "https://github.com/SAP-samples/analytics-cloud-datasphere-community-content/tree/main/SAC_Custom_Widgets",
  "keywords": [
    "sap analytics cloud",
    "sac custom widget",
    "web component sac",
    "json metadata widget",
    "widget lifecycle functions",
    "onCustomWidgetBeforeUpdate",
    "onCustomWidgetAfterUpdate",
    "onCustomWidgetResize",
    "onCustomWidgetDestroy",
    "sac data binding",
    "dataBindings feeds",
    "styling panel widget",
    "builder panel widget",
    "sac echarts integration",
    "sac d3js integration",
    "third party library sac",
    "widget hosting sac",
    "integrity hash widget",
    "sha256 integrity",
    "widget security cors",
    "sac widget debugging",
    "sac analytics designer widget",
    "optimized story experience widget",
    "sac widget api",
    "widget add-on",
    "sac script api widget",
    "shadow dom web component",
    "sac tooltip customization",
    "plot area addon",
    "sac resource zip upload",
    "root relative widget url",
    "resource file upload",
    "builder focus collapse state",
    "self contained component js",
    "resource zip artifact naming",
    "chat download artifacts"
  ]
}

README badge

README badge for secondsky/sap-skills/sap-sac-custom-widget