klayout_gds_import

Import GDS files into a running KLayout session with flatten and merge options.

32|6|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/caidish/KlayoutClaw --skill klayout-gds-import
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: klayout_gds_import
Source: https://github.com/caidish/KlayoutClaw/tree/main/skills/klayout_gds_import
Command: npx skills add https://github.com/caidish/KlayoutClaw --skill klayout-gds-import

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Import a GDS file into the running KLayout session in a way that avoids the well-known Layout.read pitfalls documented in CLAUDE.md: cell-name collisions between the destination layout and the imported GDS, orphaned cell index slots, and dangling CellView.cell pointers, as well as confusing multi-top-cell states.

Core Features & Use Cases

  • Reads a GDS file into the current layout and binds to a stable top cell
  • Flattens hierarchy to ensure a single top cell and consistent cell indexing
  • Merges or isolates content with options to merge into current layout or open a new tab
  • Rebinds the active CellView to the canonical top and refreshes the view for immediate use

Quick Start

Run the GDS import script with an absolute --filepath and optional --flatten and --merge-into-current flags to load the GDS into the current KLayout session or a new tab.

Frequently Asked Questions about klayout_gds_import

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely import a GDS file into KLayout without cell-name collisions?

Safe GDS import into KLayout avoids Layout.read pitfalls by reading the file with an absolute filepath, flattening the hierarchy to a single top cell, and rebinding the active CellView to prevent cell-name collisions, orphaned cell index slots, and dangling pointers.

Why does KLayout show multiple top cells after importing a GDS file?

Multiple top cells appear in KLayout because the imported GDS hierarchy retains its original structure. Flattening the hierarchy during import collapses multiple top cells into one canonical top cell, resolving the confusing multi-top-cell state and ensuring consistent cell indexing.

Can I merge an imported GDS into the current KLayout layout or open it in a new tab?

Yes, you can control GDS import behavior using boolean flags. Set the merge-into-current option to merge the imported content into the existing layout, or disable it to isolate the content by opening the GDS file in a new tab within the KLayout session.

What is the best way to flatten a GDS hierarchy to a single top cell in KLayout?

The best way to flatten a GDS hierarchy to a single top cell is to run an import script with the flatten flag enabled. This collapses the entire layout structure into one canonical top cell and refreshes the active CellView for immediate use.

What are common limitations or pitfalls when using KLayout Layout.read for GDS import?

Common KLayout Layout.read pitfalls include cell-name collisions between the destination layout and the imported GDS, orphaned cell index slots, and dangling CellView cell pointers. These issues are avoided by using a controlled import script that rebinds the active view.