uCoz Popup Design Skill
Version: 1.0
Usage accounting
After the stylesheet is published and verified, record the usage:
textskills_tool(action="register_usage", skill_id="ucoz-popup-design-skill")
If usage accounting is unavailable or returns an error, show a brief warning and continue the skill's main workflow. Do not ask the user for a UUID, token, site URL, or uAPI key.
Purpose
You restyle the popups that uCoz itself draws on a live site: _uWnd windows, confirmations, forms inside windows and uToast notifications. They are not in templates — platform JavaScript appends them to <body> — so the only lever is CSS loaded after the system styles.
Three outcomes define success:
- The popups look like the site (or like the chosen preset), in light and dark modes, on desktop and at 375px.
- Nothing stops working: windows still open, close, drag, resize and submit; fields keep their native behaviour and keyboard access.
- Nothing else changed: menus, lightbox, Control Panel dialogs and the rest of the page look exactly as before, and the change can be removed in one step.
Connection model
Everything goes through the MCP tools on the site chosen with select_site. No API key, token or site URL is needed in the client.
list_sites→ match the user's domain →select_site(site_id)→ check that the returned host is that domain. Ask which site if there are several and the user did not name one.- Work with the tool family for the job (see the map below).
A permission error means the signed-in account cannot do that operation. Say so; do not look for workarounds.
Tool map
| Job | Read | Write | Delete / destructive |
|---|---|---|---|
| Template ids, template code, patch check | templates_read list_modules, read_template, validate_template | — | — |
| Template backups | templates_read get_backup_guide, list_backups | templates_write create_backup | — |
| CSS link in templates | templates_read read_template | templates_write patch_template | rollback = patch_template with code_paste: "" |
| The CSS file | files_read quota, list, content_get | files_write mkdir, content_put | files_delete (confirm: true, only after the user approves) |
Not this skill: update_template, tmaker_publish, templates_delete, settings_write, and the content, users and shop tools.
Non-negotiables
- Separate file, one link. The styles live in one versioned file in the file manager (
uwnd-design-<version>.css), linked once between<!-- uwnd-design:start v<version> -->and<!-- uwnd-design:end -->. Never inline the styles into templates, never edit the stock CSS template, never touch system files under/.s/. The file and marker names stayuwnd-designso that sites styled by earlier versions are updated in place, not duplicated. - Patch, don't rewrite. Only
patch_templatewith a byte-exactcode_searchfrom a freshread_template, checked first withvalidate_template. Neverupdate_templateor a full skeleton. Keep$AJAX_JS$,$POWERED_BY$, template conditions and functional form fields. - Scope every ordinary-window rule to
body [id^="_uwndTop"]:not(.x-lb,.cp-modal,.cp-alert,.uwnd-toast). Toasts are styled separately under.uwnd-toast. Do not restyle.xw-shadowglobally (menus use it too), icon fonts or--layer-*variables outside the toast. - Native geometry stays. Keep inline sizes, hidden controls, drag/resize regions, close/minimize/maximize buttons and their handlers. Never monkeypatch the
_uWnd/uToastlibrary. - Fields stay native. Keep input semantics, labels, keyboard behaviour; inset focus outlines so they are not clipped; room for exactly one select arrow; multiple selects untouched; never
width:100%on every field. - Contrast 4.5:1 for key text pairs, presets and custom palettes alike.
scripts/build_theme.py.mdrefuses palettes below it. - No personal data. The audit reads DOM structure and computed styles only — never field values, cookies or tokens. Never submit real forms for a visual check.
- Honest accessibility. CSS cannot add focus traps, ARIA roles or tabindex. Never claim full accessibility.
Safety rules
- Installing the skill is not permission to publish. Publish only what the user approved; a request for a preview stays local.
- Do not repeat questions the user already answered and do not ask again for an approval already given.
- Read before you write: save the original of every template you patch locally (outside the skill folder) and record the backup id.
- Never overwrite a file you did not create. If
uwnd-designmarkers already exist, update that block instead of adding another. - Open and close only your own test windows; never close a window whose name you did not create.
- Do not add a second jQuery or any other library to existing pages.
confirm: trueonfiles_deleteonly after the user approved deleting that exact file.
Workflow
1. Connect
list_sites → select_site → verify the host.
2. Choose the appearance
If the user has not chosen, offer three options in their language:
- Preset — Light, Dark, Lavender, Mint or Peach (
assets/themes.json). - Match the site — taken from the live page backgrounds, fonts, links, buttons, radii and light/dark selectors.
- Custom — ask only for what is missing: colours, a reference, density, rounding.
→ references/THEMES.md
3. Audit
Open representative windows on the live site and run the function from scripts/inspect-windows.js.md in the browser (read-only). Note the loaded system CSS/JS, the window DOM, site CSS variables and light/dark switches. → references/COMPONENTS.md
4. Build
Generate the stylesheet locally: save the code block from scripts/build_theme.py.md as build_theme.py in a working folder, then run python build_theme.py --theme <name> --output <file> (optional --accent / --hover). For a site-matched or custom look, adapt the --uwd-* tokens; bind them to site variables only after seeing their real names. Show a preview with the site's own library and harmless demo windows.
5. Publish
Backup → CSS file → validated marked patch → exact read-back. → references/PUBLISHING.md
6. Verify
Desktop and 375px, light and dark site modes, real site windows and demos, field states, keyboard, toasts. → references/VERIFICATION.md
7. Report
Use the output format below. Then call skills_tool register_usage.
Output format
Plan
| # | Object | Tool / action | Change | Backup | Risk |
|---|
Final report
- Site and theme:
- CSS file (path, version):
- Templates patched (module/template, backup id):
- Preview URL:
- Verified (desktop / 375px, light / dark, windows, forms, toasts):
- Not tested and why:
- Rollback:
Reference map
| Need | File |
|---|---|
| Window and toast DOM, classes, JS API, what to keep untouched | references/COMPONENTS.md |
| Presets, tokens, site-matched and custom palettes, the theme builder | references/THEMES.md |
| Backup, CSS file, marked insertion, HTTP 413, rollback | references/PUBLISHING.md |
| Test matrix and acceptance criteria | references/VERIFICATION.md |
| Base stylesheet / preset palettes | assets/uwnd-overrides.css.md, assets/themes.json |
| Theme builder / read-only DOM audit | scripts/build_theme.py.md, scripts/inspect-windows.js.md |
| Example requests | examples/PROMPTS.md |


