--- name: workbench-hmi-clients description: Migrates existing Workbench HTML clients to native Vue 3 + GridStack.js HMI widgets while preserving iTAC IMSAPI behavior, user customization, ios.css tokens and GlassFish dsCustNJTA persistence. --- # Workbench HMI – AI Implementation Skill Use this skill when the user asks to create a new HMI page, migrate legacy Workbench HTML, compose widgets, modify ios.css, or add a MES action. **Read the current repository first.** Do not hallucinate IMSAPI parameters. ## Source of truth - Existing Workbench HTML code: `backend/src/main/webapp/*.html`. - Existing business/REST endpoints: `backend/src/main/java/com/workbenchclassic`. - Shared MES action adapter: `hmi-frontend/src/widgets/mesClient.ts`. - Catalog and rendering: `hmi-frontend/src/widgets/catalog.ts`, `WidgetRenderer.vue`. - GridStack layouts: `hmi-frontend/src/widgets/presets.ts`. - Visual tokens: `backend/src/main/webapp/ios.css`, `hmi-frontend/src/ios-widget.css`, `hmi-frontend/src/mes-widget.css`. - Styles admin API: `HmiStyleResource.java`, GET `/backend/api/hmi/v1/styles/ios`. - CSS delivery: GET `/backend/hmi-theme/ios.css`. - Existing GlassFish datasource `dsCustNJTA`; server determines Oracle or SQL Server via JDBC metadata. **Never add a separate PostgreSQL database.** ## 1. Understand the old client before implementing 1. Read the original HTML and *all* script blocks, not only the UI. 2. Inventory every `fetch`, IMSAPI action, query parameters, `sessionStorage`, table key order, modal, failure state and station-specific rule. 3. Record user-visible workflows and the accepted/nonzero IMSAPI return codes. 4. Classify all functions as read, write, administrative or visual. For writes, retain exact serial-number positions, process layers and keys. 5. Create an operation mapping in `hmi-docs/CLIENT_MIGRATION_MATRIX.md`. ## 2. Convert to native Vue - Single File Component with `