refactoring-the-assembled-uilisted
Install: claude install-skill AleksandarBisevac/claude-plugins
# Refactoring the assembled UI
`scripts/ui/` does not hold standalone files. It holds **ordered parts of one artifact**.
`_report_ui.py`, `_panel_ui.py` and `panel-server.py` read them at import and join them into a
single self-contained HTML page. Almost every surprise in this area comes from forgetting that.
## The assembly contract
- **One inline `<style>`, and one inline `<script>` *carrying code*.** The tags live in the Python
modules, never in the assets — selftests pin both, and pin that the `.js` files carry no
`<script>` tags of their own.
*Carrying code* is not hedging. The panel emits one of each; **the shipped report emits three
`<script>` tags** — `window.AUDIT_USAGE` (2.6 KB of data), `window.AUDIT_MD_B64` (the 6.9 KB
base64 Markdown twin), and the code (81 KB). Check the artifact, not this sentence:
`grep -c '<script' examples/acme-store/acme-store-audit.html` prints 3.
The pin that reads `SCRIPT.count("<script>") == 1` counts tags in a **Python string** — the code
block alone — not in the page. It has never contradicted the above, which is exactly why the
wrong version of this bullet survived: the pin that looked like it was guarding the claim was
guarding something else.
- **No external resources, ever.** CI asserts the rendered report contains no `<script src`,
`<img `, `<link `, `<iframe` or `url(http`. No CDN, no web font, no separate stylesheet.
- **A module script, but no cross-file `import`.** The report's code block is
`<sc