Inspect

Ghost Heal

Detailed Ghost Heal guide: how SXL Studio repairs ghost modes, orphan collections, stale variable bindings, and duplicate collections.

What Ghost Heal is for

Ghost Heal repairs stale variable infrastructure in a Figma file when references become inconsistent.

Typical symptoms:

  • deleted modes or collections still appear in Apply variable mode;
  • bindings exist visually, but source variables cannot be resolved normally;
  • duplicated local collections with the same name;
  • stale references after copy/paste from other files or library migrations.

Ghost Heal scans, remaps, and cleans those references with controlled steps.

How to run it

  1. Open the target Figma file.
  2. Open SXL Studio -> Inspect.
  3. In the left tree footer, click Ghost Heal.
  4. Review options in the modal.
  5. Click Run Ghost Heal.
  6. Read the notification summary and warnings.

Default profile (safe baseline)

Default options from current plugin build:

  • Clean explicit mode overrides: ON
  • Rebind exact variable matches: ON
  • Remove orphan local collections: ON
  • Merge visible duplicate collections: OFF
  • Force-clean unresolved ghosts: ON

Final diagnostics are always executed at the end of the run.

Option reference

OptionWhat it doesRisk profile
Clean explicit mode overridesClears resolvable/stale explicit mode overrides on nodes/pages before and after heal stages.Low
Rebind exact variable matchesRebinds by exact triplet: collection name + variable name + variable type.Low
Remove orphan local collectionsRemoves orphan collections after safe rebind. Auto-coupled with exact-match rebind.Medium
Merge visible duplicate collectionsMerges same-name local collections into one repair target.Medium/High (structural change)
Force-clean unresolved ghostsDetaches unresolved ghost bindings from affected nodes and can recreate stubborn text nodes when required.High (may intentionally break stale binding links)

Execution model and scope

Ghost Heal dynamically chooses scope based on options:

  • If Remove orphan local collections + Rebind exact variable matches are both ON, it runs in document repair mode.
  • Otherwise, it focuses on the active page where possible.

Core stages:

  1. initial explicit mode cleanup;
  2. duplicate collection analysis and optional merge;
  3. orphan collection scan and exact variable remap plan;
  4. swap-stage rebind for variables/styles (page or document scope depending on repair type);
  5. orphan/duplicate collection removal when enabled;
  6. force-clean detach pass for unresolved ghosts when enabled;
  7. post-cleanup explicit mode pass;
  8. final diagnostics of resolved-mode ghost references.

Understanding the result

Ghost Heal returns structured counters in the notification/report, including:

  • mode override(s) cleaned
  • binding(s) rebound
  • collection(s) removed
  • ghost node(s) force-cleaned
  • text node(s) recreated
  • unresolved ghost reference counters

If unresolved items remain, the plugin reports them explicitly instead of silently mutating unrelated data.

  1. Start with defaults.
  2. If unresolved references remain, verify local variable availability (name/type alignment).
  3. Re-run after required fonts/libraries are available.
  4. Enable Merge visible duplicate collections only when you intentionally want consolidation.
  5. After Ghost Heal, run Swap if you still need library/local migration.

Important behavior guarantees

  • Ghost Heal does not randomly guess replacement variables.
  • Exact-match rebind is deterministic.
  • Destructive actions are tied to explicit options.
  • Under Figma dynamic-page API limits, some references may be detectable but not removable; these are reported as unresolved.