# Arranging Simulink Layouts

Arranges and tidies Simulink block diagram layouts with the model_edit layout engine.

- Repository: https://github.com/matlab/simulink-agentic-toolkit (1305 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-10-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add matlab/simulink-agentic-toolkit --skill arranging-simulink-layouts -g -a claude-code -y`
Codex: `npx skills add matlab/simulink-agentic-toolkit --skill arranging-simulink-layouts -g -a codex -y`
Cursor: `npx skills add matlab/simulink-agentic-toolkit --skill arranging-simulink-layouts -g -a cursor -y`
Gemini CLI: `npx skills add matlab/simulink-agentic-toolkit --skill arranging-simulink-layouts -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add matlab/simulink-agentic-toolkit`

## Description

Arranges and tidies Simulink block diagram layouts with the model_edit layout engine. Use when the user asks to fix, clean up, tidy, straighten, or rearrange a layout, when blocks overlap or lines cross, when specific blocks need re-placing, or when grouping blocks into or expanding a subsystem.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Arranging Simulink Layouts

Re-place blocks with the SATK layout engine in `model_edit`. Move as little of the user's diagram as the request allows.

## When to Use

- "Fix / clean up / tidy / straighten / rearrange the layout", "make it readable"
- Blocks overlap, lines cross or run through blocks, a few blocks landed in odd places
- "Move these blocks", "line these up", "sort out the blocks I just added"
- Grouping blocks into a subsystem, or expanding a subsystem into its parent

## When NOT to Use

- Adding, connecting, deleting, or configuring blocks: use `building-simulink-models`. Layout already runs automatically after every `model_edit` call.
- Stateflow chart layout: the `layout` op is Simulink-only. A chart scope accepts only a full re-layout (`operations` `[]`, `layout_mode` `"full"`), which moves every element, so ask first.

## Set Expectations

- You drive an automatic layout engine. You don't place blocks pixel by pixel. Say so if the user expects hand-tuned placement.
- **Ctrl+Z is not reliable for agent edits, including layout.** Don't offer undo. Before any layout that moves many blocks, recommend that the user saves the model (or a copy) first.
- The first layout in a MATLAB session can take about 20 s while the engine starts. Later calls take 1, 2 s.

## Choose the Method

Selective layout is the default. A full layout of a diagram the user has arranged by hand discards their arrangement, so ask before running one.

| Situation | Method |
|---|---|
| A few blocks are messy, overlapping, or just added | `{"op":"layout","targets":[...]}` with `layout_mode` `"incremental"` |
| The whole scope is a mess and the user agrees that everything moves | `operations` `[]` with `layout_mode` `"full"` |
| The user explicitly asks for Simulink's own tidy-up | **Format > Auto Arrange** / `Simulink.BlockDiagram.arrangeSystem`, and only on request |
| The user wants an exact placement | `configure` with `Position` through `model_edit` |

The rest: https://github.com/matlab/simulink-agentic-toolkit/blob/HEAD/skills-catalog/model-based-design-core/arranging-simulink-layouts/SKILL.md
