Skip to content
Skills Library
Other · Building & coding

klayoutclaw:geometry

/klayoutclaw:geometry

Create geometry in KLayout via MCP — rectangles, polygons, paths, cells, and cell instances. Use this skill whenever the user wants to draw, add, or create shapes/geometry/structures in KLayout, even if they don't say "geometry" explicitly. Trigger on phrases like "draw a rectangle", "add a polygon", "create a cell", "place an instance", "make a shape", or any layout/chip/mask design geometry task.

Repository
klayoutclaw ↗
Licence
MIT
Last repository change
02.08.2026

Assessment and security

85/ 100Class: good
Format15 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content30 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
5
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.08.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 5 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/add_instance.py, scripts/add_path.py, scripts/add_polygon.py, scripts/add_rect.py, scripts/create_cell.py

What it does and when to use it

Create geometry in KLayout via MCP — rectangles, polygons, paths, cells, and cell instances. Use this skill whenever the user wants to draw, add, or create shapes/geometry/structures in KLayout, even if they don't say "geometry" explicitly. Trigger on phrases like "draw a rectangle", "add a polygon", "create a cell", "place an instance", "make a shape", or any layout/chip/mask design geometry task.

Triggers from the description

t sayexplicitly. Trigger on phrases likeadd a polygoncreate a cellplace an instancemake a shape
Original author description

Create geometry in KLayout via MCP — rectangles, polygons, paths, cells, and cell instances. Use this skill whenever the user wants to draw, add, or create shapes/geometry/structures in KLayout, even if they don't say "geometry" explicitly. Trigger on phrases like "draw a rectangle", "add a polygon", "create a cell", "place an instance", "make a shape", or any layout/chip/mask design geometry task.

How it works

  1. Prerequisites
  2. Scripts
  3. Workflow
Original SKILL.md headings · 70 lines, 248 words
SKILL.md preview
---
name: klayoutclaw:geometry
description: Create geometry in KLayout via MCP — rectangles, polygons, paths, cells, and cell instances. Use this skill whenever the user wants to draw, add, or create shapes/geometry/structures in KLayout, even if they don't say "geometry" explicitly. Trigger on phrases like "draw a rectangle", "add a polygon", "create a cell", "place an instance", "make a shape", or any layout/chip/mask design geometry task.
---

# KLayout Geometry Skills

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.

## Prerequisites

- KLayout running with KlayoutClaw plugin (v0.3+)
- A layout must be open (use `create_layout` tool first)

## Scripts

All scripts live in `scripts/` relative to this skill. Coordinates are in **microns**.

### add_rect.py — Add a rectangle

```bash
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`

### add_polygon.py — Add a polygon

```bash
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`

### add_path.py — Add a path with width

```bash
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`

### create_cell.py — Create a new cell

```bash
python scripts/create_cell.py <cell_name>
```

Example: `python scripts/create_cell.py CONTACT_PAD`

### add_instance.py — Place a cell instance

```bash
python scripts/add_instance.py <parent> <child> [x] [y]
```

Example: `python scripts/add_instance.py TOP CONTACT_PAD 100 200`

## Workflow

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.

```python
# 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)))
""")
```
Files in this package (6)
  • SKILL.md 2 KB
  • scripts/add_instance.py 1 KB
  • scripts/add_path.py 1 KB
  • scripts/add_polygon.py 1 KB
  • scripts/add_rect.py 1 KB
  • scripts/create_cell.py 1 KB

Versions

The database has no other skills named klayoutclaw:geometry.

Database snapshot: 13.11.2026 · package version b1d55ead4d7a (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90klayoutclaw:visual
    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…
  • 90klayoutclaw:display
    Toggle KLayout layer visibility on and off for better visualization. Use this skill when the user wants to show/hide layers, toggle layer display, change layer visibility, or focus on specific layers in KLayout. Also trigger when the user says things like "hide the metal layer",…
  • 100close-layout-incrementally
    Close analog, mixed-signal, custom-digital, or top-level IC layout through small visually reviewed increments with fresh DRC, LVS, extraction, and performance evidence. Use when editing or debugging GDS, OASIS, Magic, KLayout, or custom-cell layout; placing matched or…
  • 100geometry-and-math
    Use this skill when using Phaser 4 math and geometry utilities. Covers vectors, rectangles, circles, triangles, polygons, random number generation, angles, distance, interpolation, and snapping. Triggers on: Vector2, Rectangle, Circle, math, distance, angle, random, lerp.
  • 100graphics-and-shapes
    Use this skill when drawing shapes and graphics in Phaser 4. Covers the Graphics game object, lines, rectangles, circles, arcs, polygons, gradients, fill, stroke, and generated textures. Triggers on: Graphics, draw shape, fillRect, lineStyle, polygon, arc.
  • 100drc-fix
    Diagnose and fix Design Rule Check (DRC) violations in a layout or GDS. Use when the user says "fix DRC", "DRC clean", "resolve spacing errors", "my layout fails DRC", or shares a DRC report from Calibre, Klayout, or Magic.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.