Otgw design package

From rvdbreemen/OTGW-firmware · View interactive version

Otgw design package is an AI agent skill from the GitHub repository rvdbreemen/OTGW-firmware. Generate a complete, self-contained design-system package for an embedded device's on-device web UI — one tokens file, one component library, a /design.html reference page, page-templates with sentinel-marked patch blocks, a Windows installer script (PS1 + .bat wrapper), and a handoff.md aimed at Cl

How to use this skill

Skill file

Firmware design-system handoff (skill)

Use this skill when a user has an existing firmware repo with a

hand-rolled web UI (LittleFS / SPIFFS / similar partition, no build

step on the device) and wants the design layer rebuilt as a real,

token-driven design system that:

Inputs to gather (questions_v2 first)

Always ask these before writing anything:

  1. Repo + screen list. Which firmware (path / repo URL), and which

pages/screens does the UI have? Need: home, settings, log/monitor,

one or more device-specific control panels, file explorer, etc.

  1. Existing CSS state. Are there hand-rolled stylesheets per page,

or one global CSS, and is there a dark-mode variant? Get the file

names — they show up in the apply script's plan.

  1. Theme toggle mechanism. body.dark class? [data-theme] attr?

localStorage key? Match the existing convention so the toggle keeps

working.

  1. Chart library. ECharts? Chart.js? None? CDN or self-host? If

CDN: which version is pinned. The skill emits a chart-theme

helper that reads CSS vars regardless of library.

  1. Fonts. Self-hosted WOFF2 (preferred for offline devices) or

system stack? File-size budget if relevant — embedded partitions

are usually 1-2 MB.

  1. Variations to expose as Tweaks. Optional — usually no, this is

production output, not a design exploration.

  1. Scope. Just the design layer, or also a list of bugs/issues

that need to be fixed alongside (e.g. "the X panel is broken").

  1. Branding constraints. Which colors are "the brand"? What can

be changed and what is sacred?

  1. Iconography. Self-host PNG/SVG, icon font, or no icons?
  2. Apply target. Windows / macOS / Linux for the script. Default

to Windows since most firmware-flashing flows are Windows.

Package structure to emit

<project_name>_design_package/
├── README.md
├── handoff.md
├── SKILL.md            <-- this file, for next time
├── apply.ps1
├── apply.bat
├── data/               <-- mirrors firmware data/ structure
│   ├── ds-tokens.css
│   ├── components.css
│   ├── theme-toggle.js
│   ├── <chart>-theme.js
│   ├── design.html
│   └── fonts/
└── templates/
    ├── index.html.template
    └── <each-page>.html.template

Hard rules

Light + dark via the existing convention (body.dark AND

[data-theme="dark"] for safety). No second source of truth.

ds-tokens.css. Search for #[0-9a-f] after writing — should match

zero lines.

legacy CSS without markup changes for as many components as

possible. The user removes the legacy CSS in the final patch, not

the first.

is wrapped in <!-- DS:NAME:BEGIN --> … <!-- DS:NAME:END -->

comments so the receiver knows exactly what to paste.

bound element so re-running on a re-rendered DOM doesn't double-bind.

Listen for a project-specific <page>:rendered event for re-binding.

getComputedStyle(document.body).getPropertyValue('--…') so theme

swap is one chart.setOption(theme(), true) call.

unless -NoBackup. Default mode is interactive (y/n/q per file);

-Force skips prompts; -WhatIf is a dry run.

documents what's left for the receiver (Claude Code).

light and dark side-by-side. Hosting it from the firmware means

visual regression after each flash is one URL away.

Output discipline

convention and the apply order.

scope (full replace vs. block replace vs. append).

messages. The receiver should be able to land each as a separate

PR if they want.

"What the script does/doesn't do" — in that order.

-WhatIf works without extra code.

Anti-patterns to avoid

with the user — it bloats the partition and is rarely worth it.

Default to CDN, document the fallback.

or text labels. Don't invent SVG icons.

layer is files-only; routes are out of scope.

it. The receiver should be able to land the package without

rewriting partials.

When NOT to use this skill

design skill; this skill is for retrofitting an existing repo).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.