Fix design system finding

From lightspeedwp/.github · View interactive version

Fix design system finding is an AI agent skill from the GitHub repository lightspeedwp/.github. Fix a specific design-system integration finding in a Figma screen or component, including missing shared components, local overrides, and unbound tokens.

How to use this skill

Skill file

Fix One Design-System Finding

Use this skill after audit-design-system has already identified a concrete issue.

This skill is intentionally narrow:

Load these capabilities first:

Use apply-design-system instead when the task is a broader screen-wide reconnect, multiple sections need coordinated changes, or the user explicitly wants a full pass across the frame.

Expected Input

Prefer one of these:

If the finding came from audit-design-system, extract the target from:

Treat the review result as the scope contract. Do not silently widen from one finding into a full cleanup pass.

Scope Rule

Stay pinned to the selected finding until one of these is true:

If the user pastes multiple findings, either address the one they selected or pick the highest-priority finding and say that is the one being fixed now.

Required Workflow

1. Normalize the Finding

Extract and restate:

If the review output does not identify a specific node, stop and ask for either the raw finding JSON or a direct Figma node.

2. Run A Local Compatibility Check When Replacement Choice Is Ambiguous

Before backing anything up or editing the canvas, decide whether a clean fix is actually possible.

Run a local compatibility check when:

Do not continue into writes until the compatibility check returns one of:

The compatibility check should answer:

If the result is blocked, stop and report the blocker.

If the result is needs-human-choice, stop and ask the minimal clarifying question instead of guessing.

3. Gather Only the Evidence Needed

Before writing, inspect the target with the smallest useful set of reads:

  1. get_screenshot for the offending node or closest enclosing section
  2. get_metadata for structural context
  3. get_variable_defs when the finding mentions tokens, raw values, color, spacing, or typography
  4. get_code_connect_map when the finding suggests an existing mapped component
  5. search_design_system only if you still need to locate the replacement primitive

Do not re-review the whole board unless the finding clearly points to a repeated pattern and the repeated pattern is required to choose the fix.

4. Classify the Fix

Choose exactly one remediation mode:

If more than one mode seems plausible, prefer the smallest change that satisfies the original finding.

5. Back Up Only the Affected Area

Before destructive edits, duplicate only the offending node or the smallest enclosing local section.

Name the backup clearly, for example:

Make the backup in its own write call and return the created node ID.

6. Apply the Fix Incrementally

Do not rebuild the whole screen.

Work in small steps:

  1. inspect current node IDs and component linkage
  2. import or locate the needed library component or variable
  3. replace, compose, or retokenize only the targeted area
  4. return all created and mutated node IDs

Prefer swapComponent() when it preserves the node's position and valid overrides.

Prefer rebuilding beside the original when:

If the first validation pass shows that the recommended component regresses layout, text visibility, icon behavior, or width contract, stop. Report blocked or needs-follow-up instead of continuing to force the same primitive into place.

7. Validate the Finding, Not the Entire Screen

After the write:

  1. screenshot the changed node or its immediate section
  2. confirm the specific review complaint is no longer true
  3. confirm the result is library-backed or token-bound when that was the goal
  4. confirm spacing and text overrides still make sense

Only expand validation beyond the local section if the fix touched a global pattern such as navigation.

Decision Heuristics

Writing Rules

Deliverable Format

When closing the task, report:

Keep the report tied to the single finding. Avoid screen-wide summaries unless the user asks for them.

_Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team_

Org Profile

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.