--- name: generate-swimlane-swim-solution description: Generate Swimlane Lit Element Solution (CDN). Requires the use-swim-ui skill for component list, API, CDN, and design rules. disable-model-invocation: true --- # Generate Swimlane Lit Element Solution (CDN) **Prerequisite:** When executing this skill, you **must** apply the **use-swim-ui** skill: use it for the component list, CDN/base usage, design rules, and for property/event/slot API (use-swim-ui’s reference.md or component source). Do not generate the solution without that context. Generate a **standalone Lit-based solution** (custom widget or small app) that uses **SwimlaneElement** (wrapper for Lit) and **Swimlane custom Lit elements** (`swim-*`) from `@swimlane/swim-ui`, with all dependencies loaded from **CDN**. Use **lit-elements as-is** — do not add additional styling for the elements (no custom colors, borders, shadows, typography on components); **only layout styling** (flex, grid, spacing, positioning) is allowed. The solution must be professional, consistent, accessible (WCAG), and free of memory leaks. You may use **HTML**, **vanilla JavaScript**, and **Swimlane Lit custom elements** only. **Base library**: All custom elements must extend **SwimlaneElement** and use its exports (`css`, `html`, `svg`, `unsafeCSS`) — not raw LitElement. For **component list**, **CDN/base usage**, and **design rules** (layout-only styling, tokens), apply the **use-swim-ui** skill; for full property/event/slot API see **use-swim-ui**’s [reference.md](../use-swim-ui/reference.md). - **SwimlaneElement**: [npm @swimlane/swimlane-element](https://www.npmjs.com/package/@swimlane/swimlane-element) · [GitHub swimlane/swimlane-element](https://github.com/swimlane/swimlane-element) Example (solution file): ```js import { SwimlaneElement, css, html, svg, unsafeCSS } from '@swimlane/swimlane-element@2'; import 'https://cdn.jsdelivr.net/gh/surya-pabbineedi/swim-ui@gh-pages/swim-ui.js?v=1'; import { repeat } from 'lit-html@1/directives/repeat.js'; ``` ## Input - **Goal/solution required**: Use the user's description of the solution (e.g. "dashboard widget", "form with validation", "alert configurator"). **If the user does not provide a goal or solution to build, ask them:** e.g. *"What solution or widget would you like to build? (e.g. dashboard widget, form with validation, alert configurator)"* — and **do not generate any output** until they provide one. - **Updating an existing solution**: If the user refers to the **same solution again** or **points to a specific file** (e.g. an existing `.js` file in `projects/swimlane/swim-ui/demo/solutions`), **update that existing solution file** instead of creating a new one. Use the referenced file as the target to modify; preserve or refine behavior based on their new instructions. - If the user @-mentions a file or provides a spec, use that as the target (or as the file to update when applicable). - You may take **inspiration** from patterns at [Swimlane Platform Custom Widgets](https://swimlane.github.io/custom-widgets) (layout, UX, use cases), but **all UI elements must be Swimlane Lit custom elements** (`swim-*`) from `@swimlane/swim-ui` — do not copy non-Lit or framework-specific patterns from that site. ## Output Location and Structure - **Output is a single `.js` file** (ES module) under **`projects/swimlane/swim-ui/demo/solutions`** with a **unique name**. - **Naming**: Derive a unique filename from the solution purpose, e.g. `-solution.js` (e.g. `alert-configurator-solution.js`, `dashboard-widget-solution.js`). Ensure the name does not conflict with existing files in that directory. - **When updating**: If the user pointed to an existing file or the same solution, write to **that existing file** (e.g. the same `projects/swimlane/swim-ui/demo/solutions/.js`) instead of creating a new file. - The `.js` file is a **self-contained ES module** that imports from CDN (Lit and swim-ui), **exports a default class** extending `SwimlaneElement` (the main solution component), composes the UI with `swim-*` components, and can be loaded by the demo app or a minimal HTML page (e.g. `