From klayoutclaw
Creates geometry in KLayout — rectangles, polygons, paths, cells, and cell instances via MCP scripts. Use for layout/chip/mask design tasks triggered by phrases like 'draw a rectangle' or 'add a polygon'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/klayoutclaw:geometryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
CLI scripts for creating geometry in KLayout via the MCP server's `execute_script` tool.
CLI scripts for creating geometry in KLayout via the MCP server's execute_script tool.
Each script connects to KLayout at 127.0.0.1:8765 and runs pya code to create shapes.
create_layout tool first)All scripts live in scripts/ relative to this skill. Coordinates are in microns.
python scripts/add_rect.py <cell> <layer> <datatype> <x1> <y1> <x2> <y2>
Example: python scripts/add_rect.py TOP 1 0 -50 -12.5 50 12.5
python scripts/add_polygon.py <cell> <layer> <datatype> <x1,y1> <x2,y2> ...
Example: python scripts/add_polygon.py TOP 1 0 0,0 10,0 10,10 0,10
python scripts/add_path.py <cell> <layer> <datatype> <width> <x1,y1> <x2,y2> ...
Example: python scripts/add_path.py TOP 1 0 5 0,0 50,0 50,50
python scripts/create_cell.py <cell_name>
Example: python scripts/create_cell.py CONTACT_PAD
python scripts/add_instance.py <parent> <child> [x] [y]
Example: python scripts/add_instance.py TOP CONTACT_PAD 100 200
For simple shapes, call scripts directly. For complex designs with many shapes, prefer calling execute_script via MCP with a single Python block — this avoids per-shape HTTP round trips and is much faster.
# Example: batch geometry via execute_script
tool_call("execute_script", code="""
dbu = _layout.dbu
li = _layout.layer(1, 0)
for x in range(0, 100, 10):
_top_cell.shapes(li).insert(pya.Box(int(x/dbu), 0, int((x+5)/dbu), int(5/dbu)))
""")
npx claudepluginhub caidish/klayoutclaw --plugin klayoutclawToggles KLayout layer visibility on/off via scripts. Hides, shows, or isolates layers by number for inspection during design review.
Routes 17 KiCad MCP tools for schematic creation, PCB layout, autorouting, DRC, and Gerber export. Enforces serialized PCB ops and library-first lookup.
Generates professional circuit diagrams via schemdraw Python. Outputs SVG/PDF/PNG from natural language. Use when user requests schematics, needs publication-quality diagrams, or mentions schemdraw.