| name | update-component |
| description | Update an existing component from a design reference and text description for a specific theme, defaulting to CSS-only changes unless markup changes are explicitly requested. |
Update Component
Use this skill when the component already exists and the task is to align it with new visual direction from a design reference plus text instructions.
Mandatory Execution Rules
- Read this file before acting.
- Execute all workflow steps in exact order.
- Execute all sub-bullets under each step.
- Do not skip, combine, or reorder steps.
- If blocked or required input is missing, ask and wait.
Trigger
Use this skill when the user asks in patterns like:
Update the <component> from this Figma node (tv2Oj)
Adjust existing <component> to match this new design
Refine <component> styling based on this spec and notes
Required Inputs
Collect these before coding:
- Existing component name/path to update
- Design reference (Figma node link or explicit visual/text specification)
- Text description of the requested changes
- Source theme:
tv2Oj, tv2Nord, tv2Syd, tv2Fyn, tv2East, or kosmopol
If any of these are missing, ask before implementation.
Hard Rules
- Do not change markup by default.
- Do not change component JS by default.
- Update only the component CSS unless the user explicitly asks for markup/JS changes.
- If markup changes are requested explicitly, keep them minimal and scoped to the existing component contract.
- Use existing tokens first (
--base-* primary, --core-* when needed); treat --md-*/--news-*/legacy aliases as compatibility-only.
- No page-level hacks or per-theme hardcoded forks in markup.
- Preserve or improve accessibility semantics while updating visuals.
- Prefer native semantic elements over ARIA retrofits; use ARIA only when native semantics are insufficient.
- Preserve existing BEM contract; add or adjust classes using BEM conventions only.
Workflow (Execute In Order)
- Parse update scope from design reference + text description.
- Extract exact visual/behavior deltas from the provided reference.
- Confirm the provided theme as the canonical source style.
- Locate existing component files in
assets/components/<component-name>/.
- Update CSS only to match requested visual changes:
- Layout/spacing
- Typography
- Colors and effects
- Responsive behavior
- Keep selectors scoped to the component and avoid global leakage.
- Run accessibility regression checks for the updated component:
- semantic structure and labels remain valid,
- keyboard access/focus behavior still works,
- contrast remains WCAG AA compliant for text and interactive UI.
- Run BEM consistency checks for the updated component:
- block/element/modifier naming remains consistent,
- no orphan element classes without their block context,
- no cross-component selector coupling.
- Validate in the specified source theme, then smoke-test remaining themes for regressions.
- Report:
- What changed
- Files changed
- Assumptions
- Remaining deltas (if exact parity is blocked)
Acceptance Criteria
- Existing component structure remains intact unless user explicitly requested markup changes.
- Visual changes match the provided reference and text description for the specified theme.
- No global CSS leakage.
- Theme switcher behavior remains intact.
- Other themes still render without obvious regressions.
- No accessibility regressions introduced in semantics, keyboard flow, or contrast.
- Updated selectors/classes follow the component's BEM structure.