lint_design: flag theme copies (light/dark artboards duplicated instead of using modes) #25

Closed
opened 2026-10-27 19:32:43 +00:00 by masi · 1 comment
Owner

What happened

While redesigning an app with a dark and a light theme, an agent built separate side-by-side artboards for each theme ("Screen / Moldura" + "Screen / Papel") with hard-coded colours, instead of one artboard bound to variables with a value per mode and set_variable_mode. Another agent avoided switching modes because the switch is document-wide and would flip the canvas for other agents working in parallel, and rendered "light" previews by rebuilding with different hex values.

The copies drift apart, double the maintenance and make the mode switch meaningless. The skills already said "Add a second mode", but nothing said don't copy, and nothing catches it.

Done already

  • skills/papercraft/SKILL.md and skills/papercraft-design/SKILL.md: explicit rule "Themes are modes, never copies" + troubleshooting row (uncommitted in the working tree).

Proposal

  1. New lint_design rule theme-copy (warning): flag artboards whose names differ only by a theme word (light/dark, claro/escuro, day/night, or the names of the project's variable modes) or whose layer trees match structurally while their colours differ. Message: "Use one artboard and set_variable_mode."
  2. hard-coded-color as error (not info) on any artboard when the project has a collection with 2+ modes: a raw colour there cannot follow the theme. Include strokes, which today need update_styles after a switch.
  3. Preview a mode without switching the document: get_screenshot { mode: "Light" } (and maybe a per-page/per-artboard mode override, like Figma's). This removes the reason agents duplicate: they can screenshot each theme without flipping the canvas for others.
  4. Optional: bind_variable visible to a boolean is the documented way to show theme-only ornaments; mention it in the lint message.

Acceptance

  • Duplicating an artboard and recolouring it for another theme produces a theme-copy warning.
  • An agent can screenshot both modes of an artboard while the document stays in its current mode.
## What happened While redesigning an app with a dark and a light theme, an agent built **separate side-by-side artboards for each theme** ("Screen / Moldura" + "Screen / Papel") with hard-coded colours, instead of one artboard bound to variables with a value per mode and `set_variable_mode`. Another agent avoided switching modes because the switch is document-wide and would flip the canvas for other agents working in parallel, and rendered "light" previews by rebuilding with different hex values. The copies drift apart, double the maintenance and make the mode switch meaningless. The skills already said "Add a second mode", but nothing said *don't copy*, and nothing catches it. ## Done already - `skills/papercraft/SKILL.md` and `skills/papercraft-design/SKILL.md`: explicit rule "Themes are modes, never copies" + troubleshooting row (uncommitted in the working tree). ## Proposal 1. **New `lint_design` rule `theme-copy` (warning):** flag artboards whose names differ only by a theme word (light/dark, claro/escuro, day/night, or the names of the project's variable modes) or whose layer trees match structurally while their colours differ. Message: "Use one artboard and `set_variable_mode`." 2. **`hard-coded-color` as error** (not info) on any artboard when the project has a collection with 2+ modes: a raw colour there cannot follow the theme. Include strokes, which today need `update_styles` after a switch. 3. **Preview a mode without switching the document:** `get_screenshot { mode: "Light" }` (and maybe a per-page/per-artboard mode override, like Figma's). This removes the reason agents duplicate: they can screenshot each theme without flipping the canvas for others. 4. Optional: `bind_variable visible` to a boolean is the documented way to show theme-only ornaments; mention it in the lint message. ## Acceptance - Duplicating an artboard and recolouring it for another theme produces a `theme-copy` warning. - An agent can screenshot both modes of an artboard while the document stays in its current mode.
masi closed this issue 2026-10-27 21:02:27 +00:00
Author
Owner

Fixed in 75faf3e on branch debrand.

Fixed in 75faf3e on branch debrand.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: masi/papercraft#25