Visual

From caidish/KlayoutClaw · View interactive version

Visual is an AI agent skill from the GitHub repository caidish/KlayoutClaw. Capture the current KLayout layout as a PNG image for visual inspection. Use this skill whenever the user wants to see, view, screenshot, preview, or visually inspect the current layout. Also trigger when the user asks "what does it look like", "show me the layout", "take a screenshot", "capture the

How to use this skill

Skill file

KLayout Visual Capture

Save the current KLayout layout to a temporary GDS file, convert it to PNG, and return both file paths for visual inspection.

Prerequisites

Script

capture.py 鈥?Capture layout as PNG

python scripts/capture.py [--output path.png] [--gds path.gds] [--dpi 200]

Returns the paths to both the GDS and PNG files, printed to stdout.

Example:

python scripts/capture.py
# Output:
# GDS saved: /tmp/klayoutclaw_capture.gds
# PNG saved: /tmp/klayoutclaw_capture.png

How It Works

  1. Calls save_layout via MCP to write the current layout to a temp GDS file
  2. Runs tools/gds_to_image.py from the KlayoutClaw repo to convert GDS to PNG
  3. Prints both file paths

The GDS-to-PNG conversion uses gdstk to parse the GDS and matplotlib to render all layers with distinct colors and a legend.

After Capture

Use the Read tool on the PNG path to view the image directly in the conversation. This gives immediate visual feedback on layout geometry.

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.