simulink-layout-tidylisted
Install: claude install-skill calebzu/pmsm-control-claude-skills-for-matlab
# simulink-layout-tidy
Make an already-built Simulink model compact, readable, and overlap-free — and report line crossings **honestly**, never promising a zero that the graph's topology forbids.
## Safety invariants (read first)
In Simulink a block's `Position` and a line's `Points` are purely **cosmetic** and orthogonal to the port connections. That fact is the whole basis for this skill being safe.
- **L1 contract (default, zero-risk).** This skill MUST only modify block `Position` and line `Points`. It MUST NOT add or remove blocks and MUST NOT change any port connection. *Why:* the compiled model is then byte-for-byte identical, so simulation results cannot change and **no functional re-test is needed**.
- **L2 contract (opt-in, explicit only).** L2 additionally allows (a) replacing long-range / multi-consumer wires with `Goto`/`From` and (b) wrapping a functional cluster into a `Subsystem`. These are logically equivalent but **change the block set**, so after enabling L2 you MUST run one smoke simulation and confirm no `NaN`/`Inf` and unchanged behavior. See [references/l2_contract.md](references/l2_contract.md).
- **NEVER hard-gate "zero line crossings."** A non-planar graph (one containing a `K3,3` or `K5` minor) cannot be drawn crossing-free on a plane (Kuratowski). Forcing zero would reject mathematically-valid models. Use the tiered gates below instead.
## Quick start (L1)
```matlab
addpath('scripts');
load_system('my_model');
rpt = tidy_layout('my_model');